* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #fffaf0 70%, #ffe4b5 100%);
    color: #333;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><polygon points="20,5 25,15 35,15 27,22 30,32 20,27 10,32 13,22 5,15 15,15" fill="%23f1c27d" opacity="0.1"/></svg>') repeat;
    pointer-events: none;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 800px; /* Ограничение ширины для десктопа */
    margin: 0 auto;
}

.logo {
    display: block;
    margin: 10px auto;
    max-width: 350px;
    max-height: 187px;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

.event-info {
    width: 100%;
    margin: 0 auto 0.8rem auto;
    background: linear-gradient(135deg, rgba(255, 250, 240, 0.95), rgba(241, 194, 125, 0.5));
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffd700;
    text-align: center;
    animation: slideUp 1s ease-out;
}

.event-info h1 {
    font-size: 1.2rem;
    color: #744d26;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    margin: 0;
    animation: pulse 2s infinite;
}

.event-description {
    width: 100%;
    margin: 0 auto 1rem auto;
    text-align: center;
}

.event-description h2 {
    font-size: 0.9rem;
    color: #744d26;
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.event-description h3 {
    font-size: 0.8rem;
    color: #744d26;
    margin: 0.5rem 0 0.2rem 0;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.event-description p {
    font-size: 0.7rem;
    color: #333;
    margin: 0.3rem 0;
}

.event-description ul.team-rewards,
.event-description ul.winner-rewards {
    list-style: none;
    padding: 0 10px;
    margin: 0.3rem 0;
}

.event-description li {
    font-size: 0.7rem;
    margin: 0.2rem 0;
    color: #333;
    overflow-wrap: break-word;
}

.event-description li strong {
    color: #e07a5f;
}

.event-description a {
    color: #e07a5f;
    text-decoration: none;
    transition: color 0.3s;
}

.event-description a:hover {
    color: #ffd700;
}

.puzzle-container {
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #f1c27d;
    transition: transform 0.3s ease;
}

.puzzle-container:hover {
    transform: translateY(-2px);
}

.puzzle {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 4px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.puzzle-number {
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 30px;
    text-align: left;
    color: #744d26;
}

.input-field {
    width: 20px;
    height: 20px;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.8rem;
    border: 2px solid #f1c27d;
    border-radius: 5px;
    transition: border-color 0.3s, background-color 0.3s, transform 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.input-field:focus {
    outline: none;
    border-color: #e07a5f;
    box-shadow: 0 0 5px rgba(224, 122, 95, 0.3);
    transform: scale(1.05);
}

.ip-field {
    width: 100px;
    height: 20px;
    text-align: center;
    font-size: 0.8rem;
    border: 2px solid #f1c27d;
    border-radius: 5px;
    transition: border-color 0.3s, background-color 0.3s, transform 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ip-field:focus {
    outline: none;
    border-color: #e07a5f;
    box-shadow: 0 0 5px rgba(224, 122, 95, 0.3);
    transform: scale(1.05);
}

.correct {
    background: linear-gradient(45deg, #d4edda, #a3d9b1);
    border-color: #28a745;
    animation: glow 1.5s infinite;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #28a745; }
    50% { box-shadow: 0 0 10px #28a745; }
    100% { box-shadow: 0 0 5px #28a745; }
}

.incorrect-input {
    background: linear-gradient(45deg, #f8d7da, #f1b0b7);
    border-color: #dc3545;
    animation: fadeOut 1s ease-in-out forwards;
}

@keyframes fadeOut {
    0% { background-color: #f8d7da; border-color: #dc3545; }
    100% { background-color: transparent; border-color: #f1c27d; }
}

.check-button {
    display: block;
    width: 100%;
    max-width: 150px;
    margin: 0.8rem auto;
    padding: 5px;
    background: linear-gradient(45deg, #f1c27d, #ffd700);
    color: #744d26;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: bounce 1.5s infinite;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(241, 194, 125, 0.5);
}

.reset-button {
    display: block;
    width: 100%;
    max-width: 80px;
    margin: 0.4rem auto;
    padding: 4px;
    background: linear-gradient(45deg, #a39171, #d4c4a8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(163, 145, 113, 0.5);
}

.tag-cloud {
    width: 100%;
    margin-top: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #f1c27d;
    animation: slideUp 1s ease-out;
}

.tag-cloud h2 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #744d26;
}

.tag {
    display: inline-block;
    padding: 4px 6px;
    margin: 2px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tag.correct {
    background: linear-gradient(45deg, #d4edda, #a3d9b1);
    color: #28a745;
}

.tag.correct:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.5);
}

.tag.incorrect {
    background: linear-gradient(45deg, #f8d7da, #f1b0b7);
    color: #dc3545;
}

.tag.incorrect:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.5);
}

.tag:hover {
    transform: scale(1.05);
}

.social-links {
    display: flex;
    gap: 6px;
}

.social-icon {
    max-width: 24px;
    max-height: 24px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.3s ease-in-out;
}

.social-icon:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.share-text {
    font-size: 0.8rem;
    padding: 3px 6px;
    border-radius: 5px;
    background: linear-gradient(45deg, #d4edda, #a3d9b1);
    color: #28a745;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-2px); }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 600px) {
    body { padding: 20px; }
    .container { max-width: 800px; }
    .logo { max-width: 520px; max-height: 260px; }
    .event-info h1 { font-size: 1.8rem; }
    .event-description h2 { font-size: 1.3rem; }
    .event-description h3 { font-size: 1.1rem; }
    .event-description p, .event-description li { font-size: 1rem; }
    .event-description ul.team-rewards, .event-description ul.winner-rewards { padding: 0; }
    .puzzle-container { padding: 20px; }
    .puzzle { margin-bottom: 0.8rem; gap: 6px; flex-wrap: nowrap; }
    .puzzle-number { font-size: 1rem; min-width: 45px; }
    .input-field { width: 35px; height: 35px; font-size: 1rem; }
    .ip-field { width: 160px; height: 35px; font-size: 1rem; }
    .check-button { padding: 8px; font-size: 0.9rem; max-width: 200px; margin: 1rem auto; }
    .reset-button { padding: 6px; font-size: 0.8rem; max-width: 120px; margin: 0.5rem auto; }
    .tag-cloud { padding: 12px; margin-top: 1.2rem; }
    .tag-cloud h2 { font-size: 1.1rem; }
    .tag { padding: 5px 8px; margin: 3px; font-size: 0.8rem; }
    .social-links { gap: 8px; }
    .social-icon { max-width: 28px; max-height: 28px; width: 28px; height: 28px; }
    .share-text { font-size: 0.9rem; padding: 4px 8px; }
}