* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e30613;
    --primary-dark: #b8050f;
    --white: #ffffff;
    --light-gray: #a0a0a0;
    --dark-bg: #0a0a0a;
    --dark-surface: #141414;
    --dark-border: #252525;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--dark-bg);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(227, 6, 19, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(227, 6, 19, 0.05) 0%, transparent 50%);
}

.racing-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.racing-lines .line {
    position: absolute;
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    animation: raceLine 8s ease-in-out infinite;
}

.racing-lines .line:nth-child(1) { top: 30%; animation-delay: 0s; }
.racing-lines .line:nth-child(2) { top: 50%; animation-delay: 2.5s; }
.racing-lines .line:nth-child(3) { top: 70%; animation-delay: 5s; }

@keyframes raceLine {
    0% { transform: translateX(-100%); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo-container {
    margin-bottom: 40px;
    animation: logoEntrance 1s ease-out;
}

@keyframes logoEntrance {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.logo-img {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: brightness(1.1);
}

.main-heading {
    margin-bottom: 25px;
}

.coming-soon {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    letter-spacing: 0.05em;
}

.coming-soon .word {
    display: inline-block;
    opacity: 0;
    animation: wordReveal 0.6s ease-out forwards;
    color: var(--white);
}

.coming-soon .word:nth-child(1) { animation-delay: 0.2s; }
.coming-soon .word:nth-child(2) { animation-delay: 0.35s; }
.coming-soon .word:nth-child(3) { animation-delay: 0.5s; }
.coming-soon .word:nth-child(4) { animation-delay: 0.65s; color: var(--primary); }

@keyframes wordReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.underline {
    width: 80px;
    height: 3px;
    background: var(--primary);
    margin: 0 auto;
    animation: underlineGrow 0.8s ease-out 0.8s forwards;
    transform: scaleX(0);
}

@keyframes underlineGrow {
    to { transform: scaleX(1); }
}

.description {
    margin-bottom: 30px;
}

.description p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--light-gray);
    margin-bottom: 8px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.75s; }
.delay-6 { animation-delay: 0.9s; }
.delay-7 { animation-delay: 1.05s; }

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* GAMES SECTION */
.games-section {
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.05), rgba(20, 20, 20, 0.8));
    border: 1px solid var(--dark-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: clamp(1.8rem, 4vw, 2.3rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.section-title p {
    color: var(--light-gray);
    font-size: 1rem;
    font-weight: 300;
}

/* GAME BUTTONS - PROMINENTLY AT TOP! */
.game-buttons-container {
    margin-bottom: 40px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.game-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 18px 35px;
    border: none;
    border-radius: 50px;
    color: var(--white);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-button.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.4);
}

.game-button.secondary {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-button:hover {
    transform: translateY(-5px) scale(1.05);
}

.game-button.primary:hover {
    box-shadow: 0 10px 30px rgba(227, 6, 19, 0.6);
}

.game-button.secondary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: var(--white);
}

.game-button:active {
    transform: translateY(-2px) scale(1.02);
}

.game-button svg {
    width: 26px;
    height: 26px;
}

.game-hint {
    width: 100%;
    margin-top: 10px;
    color: var(--light-gray);
    font-size: 0.9rem;
    font-weight: 300;
}

.status-container {
    margin-bottom: 40px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 50px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.status-text {
    font-size: 0.9rem;
    color: var(--light-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.services-title {
    margin-bottom: 35px;
}

.services-title h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.05em;
}

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
    width: 100%;
    max-width: 1100px;
}

.service-item {
    padding: 30px 20px;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--dark-surface), rgba(227, 6, 19, 0.05));
}

.service-icon {
    width: 45px;
    height: 45px;
    margin: 0 auto 18px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.service-item:hover .service-icon {
    transform: scale(1.1);
}

.service-item h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--white);
    font-weight: 600;
}

.service-item p {
    color: var(--light-gray);
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.4;
}

/* GAME MODAL - FULLSCREEN! */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: rgba(0, 0, 0, 0.98);
    z-index: 10000;
    overflow: hidden;
    box-sizing: border-box;
}

.game-modal.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
}

.game-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(227, 6, 19, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.sound-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background: rgba(50, 50, 50, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.sound-toggle:hover {
    background: rgba(70, 70, 70, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}

.sound-toggle svg {
    width: 20px;
    height: 20px;
}

.game-close:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.game-close svg {
    width: 20px;
    height: 20px;
}

.game-header {
    text-align: center;
    margin-bottom: 5px;
    z-index: 10;
    flex-shrink: 0;
    width: 100%;
    max-width: 600px;
}

.game-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--light-gray);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

.stat-unit {
    font-size: 0.75rem;
    color: var(--light-gray);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #0d0d0d;
    border: 3px solid var(--primary);
    border-radius: 15px;
    box-shadow: 0 0 40px rgba(227, 6, 19, 0.4);
}

.game-controls {
    display: none;
    margin-top: 8px;
    margin-bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 10;
    flex-shrink: 0;
}

.game-controls.show {
    display: block;
}

.arrow-keys {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 5px 0;
}

.arrow-center {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.arrow-key {
    width: 55px;
    height: 55px;
    background: var(--dark-surface);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Большие кнопки влево/вправо */
.arrow-key.arrow-left,
.arrow-key.arrow-right {
    width: 80px;
    height: 115px;
    font-size: 2.5rem;
    border-radius: 15px;
}

/* Маленькие кнопки вверх/вниз */
.arrow-key.arrow-small {
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
}

.arrow-key:hover {
    border-color: var(--primary);
    background: rgba(227, 6, 19, 0.1);
    transform: scale(1.05);
}

.arrow-key:active {
    transform: scale(0.95);
    background: rgba(227, 6, 19, 0.3);
    box-shadow: 0 0 15px rgba(227, 6, 19, 0.5);
}

.easter-egg-hint {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--light-gray);
    opacity: 0.8;
}

/* START SCREEN */
.start-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    z-index: 10001;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
    padding-top: 50px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.start-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    background: var(--dark-surface);
    border-radius: 30px;
    padding: 5px;
    border: 1px solid var(--dark-border);
    flex-shrink: 0;
}

.start-tab {
    padding: 12px 35px;
    background: transparent;
    border: none;
    border-radius: 25px;
    color: var(--light-gray);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.start-tab:hover {
    color: var(--white);
}

.start-tab.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.4);
}

.start-tab-content {
    display: none;
    width: 100%;
    max-width: 500px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.start-tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.start-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(227, 6, 19, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.start-close-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.start-close-btn svg {
    width: 20px;
    height: 20px;
}

.start-content {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.1), rgba(20, 20, 20, 0.9));
    border: 2px solid var(--primary);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
}

.start-content h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--white);
    font-weight: 700;
}

.start-content p {
    font-size: 1rem;
    color: var(--light-gray);
    margin-bottom: 10px;
    line-height: 1.5;
}

.start-content #startInstructions {
    margin-bottom: 25px;
}

.start-content input[type="text"] {
    width: 100%;
    max-width: 280px;
    padding: 14px 20px;
    background: var(--dark-surface);
    border: 2px solid var(--dark-border);
    border-radius: 12px;
    color: var(--white);
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s ease;
}

.start-content input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.start-content input[type="text"].error {
    border-color: #ff4444;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.start-content input[type="text"]::placeholder {
    color: var(--light-gray);
}

/* Leaderboard */
.leaderboard-container {
    width: 100%;
    max-width: 450px;
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.05), rgba(20, 20, 20, 0.9));
    border: 2px solid var(--dark-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.leaderboard-container h4 {
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
    flex-shrink: 0;
}

.leaders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    min-height: 0;
}

.leader-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.leader-row:hover {
    background: rgba(255,255,255,0.06);
}

.leader-row.top3 {
    background: rgba(227, 6, 19, 0.1);
    border: 1px solid rgba(227, 6, 19, 0.3);
}

.leader-row .rank {
    width: 35px;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.leader-row.top3:nth-child(1) .rank { color: #ffd700; }
.leader-row.top3:nth-child(2) .rank { color: #c0c0c0; }
.leader-row.top3:nth-child(3) .rank { color: #cd7f32; }

.leader-row .name {
    flex: 1;
    color: var(--white);
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leader-row .datetime {
    font-size: 0.75rem;
    color: var(--light-gray);
    opacity: 0.7;
    margin: 0 10px;
    white-space: nowrap;
}

.leader-row .score {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.no-leaders {
    text-align: center;
    color: var(--light-gray);
    padding: 40px 20px;
    font-size: 1.1rem;
}

.start-button {
    padding: 18px 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50px;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(227, 6, 19, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.start-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 35px rgba(227, 6, 19, 0.7);
}

.start-button:active {
    transform: translateY(-2px) scale(1.02);
}

.game-over {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.95);
    border: 3px solid var(--primary);
    border-radius: 20px;
    padding: 50px 70px;
    text-align: center;
    z-index: 10002;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 50px rgba(227, 6, 19, 0.6);
}

.game-over.show {
    display: block;
}

.game-over h2 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(227, 6, 19, 0.6);
}

.final-score {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--white);
}

.final-score span {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
}

.restart-button {
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50px;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(227, 6, 19, 0.4);
}

.restart-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(227, 6, 19, 0.6);
}

.contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--light-gray);
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item:hover {
    color: var(--white);
}

.contact-item:hover svg {
    color: var(--primary);
}

.contact-item svg {
    width: 20px;
    height: 20px;
    color: var(--light-gray);
    transition: color 0.3s ease;
}

/* Contacts Grid */
.contacts-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    max-width: 900px;
    width: 100%;
}

@media (max-width: 768px) {
    .contacts-grid {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .contacts-grid {
        gap: 12px;
    }
}

.contact-card {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    flex: 0 0 calc(33.333% - 14px);
    min-width: 200px;
    max-width: 280px;
}

@media (max-width: 768px) {
    .contact-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .contact-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.contact-card h4 {
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-card a {
    display: block;
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: var(--primary);
}

.contact-card a:last-child {
    margin-bottom: 0;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 50%;
    color: var(--light-gray);
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.social-link svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.social-link svg path,
.social-link svg circle,
.social-link svg line,
.social-link svg polyline,
.social-link svg polygon,
.social-link svg rect {
    vector-effect: non-scaling-stroke;
}

.current-site {
    margin-bottom: 40px;
}

.current-site-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--light-gray);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 12px 24px;
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.current-site-link:hover {
    color: var(--white);
    border-color: var(--primary);
    background: rgba(227, 6, 19, 0.1);
}

.current-site-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.current-site-link:hover svg {
    transform: translate(3px, -3px);
}

.footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
}

.footer .copyright {
    font-size: 0.9rem;
    color: var(--light-gray);
    font-weight: 400;
    margin-bottom: 4px;
}

.footer .rights {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    margin-bottom: 16px;
}

.footer .developer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.footer .developer .heart {
    color: #e74c3c;
    display: inline-block;
    margin: 0 4px;
    font-style: normal;
    animation: heartPulse 1.2s ease-in-out infinite;
}

.footer .developer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer .developer a:hover {
    color: var(--accent);
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    15% { transform: scale(1.25); opacity: 1; }
    30% { transform: scale(1); opacity: 0.9; }
    45% { transform: scale(1.2); opacity: 1; }
    60% { transform: scale(1); opacity: 0.9; }
}

@media (max-width: 768px) {
    .container {
        padding: 40px 25px;
    }

    .logo-img {
        max-width: 220px;
    }

    .coming-soon {
        gap: 8px;
    }

    .game-buttons-container {
        flex-direction: column;
        gap: 15px;
    }

    .game-button {
        width: 100%;
        max-width: 350px;
    }

    .services {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }

    .contact-info {
        flex-direction: column;
        gap: 15px;
    }

    .social-links {
        gap: 15px;
    }

    .social-link {
        width: 44px;
        height: 44px;
    }

    .game-canvas {
        width: 100%;
        max-width: none;
        flex: 1 1 auto;
        min-height: 150px;
        max-height: calc(100vh - 220px);
        max-height: calc(100dvh - 220px);
        overflow: visible;
    }
    
    /* Точность на мобильных - больше места */
    .game-canvas.game-target {
        max-height: calc(100vh - 140px);
        max-height: calc(100dvh - 140px);
    }

    .game-stats {
        gap: 12px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .arrow-key {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .game-over {
        padding: 25px 30px;
        width: 90vw;
    }

    .game-header h2 {
        font-size: 1rem;
    }

    .game-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
    }

    .start-close-btn {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .start-content {
        padding: 30px 20px;
        margin: 0 15px;
    }

    .start-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
    }

    .logo-img {
        max-width: 180px;
    }

    .service-item {
        padding: 25px 15px;
    }

    .services {
        grid-template-columns: 1fr;
    }

    .game-button {
        padding: 16px 28px;
        font-size: 0.95rem;
    }

    .game-canvas {
        flex: 1 1 auto;
        min-height: 120px;
        max-height: calc(100vh - 240px);
        max-height: calc(100dvh - 240px);
        overflow: visible;
    }
    
    /* Точность на маленьких экранах - больше места */
    .game-canvas.game-target {
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
    }

    .stat-value {
        font-size: 1rem;
    }

    .arrow-key {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .game-over h2 {
        font-size: 1.8rem;
    }

    .restart-button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

body {
    animation: pageLoad 0.5s ease-in;
}

@keyframes pageLoad {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Start Screen Styles */
#startInstructions input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    background: rgba(20, 20, 20, 0.8);
    border: 2px solid #252525;
    border-radius: 10px;
    color: white;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s;
}

#startInstructions input:focus {
    outline: none;
    border-color: var(--primary);
}

#startInstructions .hint {
    color: #a0a0a0;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

#startInstructions .goal {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Leaderboard */
.leaderboard-container {
    margin-top: 25px;
    padding: 20px;
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid #252525;
    border-radius: 12px;
    overflow-y: auto;
}

.leaderboard-container h4 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.leaderboard-container .no-leaders {
    text-align: center;
    color: #666;
    padding: 20px;
}

.leaders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leader-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid transparent;
}

.leader-row.top3 {
    background: rgba(227, 6, 19, 0.08);
    border-color: rgba(227, 6, 19, 0.3);
}

.leader-row .rank {
    width: 30px;
    font-weight: 700;
    color: var(--primary);
}

.leader-row .name {
    flex: 1;
    color: #ccc;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-row .datetime {
    font-size: 0.65rem;
    margin: 0 6px;
}

.leader-row .score {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Game Over Screen */
.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

#finalScore {
    text-align: center;
    margin-bottom: 30px;
}

#finalScore .player-name {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 10px;
}

#finalScore .final-points {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 15px;
}

#finalScore .final-rank {
    font-size: 1rem;
    color: #aaa;
}

#finalScore .final-level,
#finalScore .final-stats {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
}

/* Level Up Popup - subtle corner notification */
.level-popup {
    position: fixed;
    bottom: 100px;
    left: 20px;
    background: rgba(227, 6, 19, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    z-index: 100000;
    pointer-events: none;
    animation: levelSlide 1.5s ease-out forwards;
}

@keyframes levelSlide {
    0% { opacity: 0; transform: translateX(-50px); }
    15% { opacity: 1; transform: translateX(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Screen Flash */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #e30613;
    opacity: 0;
    z-index: 99999;
    pointer-events: none;
    animation: screenFlash 0.3s ease-out;
}

@keyframes screenFlash {
    0% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* Combo Popup for Target Game */
.combo-popup {
    position: fixed;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    z-index: 10000;
    pointer-events: none;
    animation: comboFloat 0.7s ease-out forwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.combo-popup div:first-child {
    font-size: 1rem;
    margin-bottom: 2px;
}

.combo-popup div:last-child {
    font-size: 1.3rem;
}

.combo-popup.orange {
    color: #ff9500;
    text-shadow: 0 0 10px rgba(255, 149, 0, 0.6);
}

.combo-popup.gold {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

@keyframes comboFloat {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
    30% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -130%) scale(0.9); }
}

/* Game Canvas Area */
.game-canvas {
    position: relative;
    width: calc(100vw - 20px);
    max-width: 600px;
    flex: 1 1 auto;
    min-height: 200px;
    max-height: calc(100dvh - 200px);
    margin: 0 auto;
    overflow: visible;
}

/* Гонки - уже для удобного управления */
.game-canvas.game-race {
    max-width: min(500px, calc(100vw - 20px));
}

/* Точность - может быть шире и выше (нет стрелок внизу) */
.game-canvas.game-target {
    max-width: min(900px, calc(100vw - 20px));
    max-height: calc(100dvh - 140px);
}
