* {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.game-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #0f0f1a;
    overflow: hidden;
}

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    background: #0a0a12;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 80px 80px 150px 80px;
}

.canvas-container::-webkit-scrollbar {
    display: none;
}

canvas {
    display: block;
    margin: 0 auto;
    cursor: pointer;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.top-menu {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    background: rgba(13, 13, 26, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    padding: 10px 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(45, 45, 85, 0.5);
    pointer-events: none;
}

.top-menu .counters-row {
    pointer-events: auto;
}

.counters-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 40px;
    background: rgba(26, 26, 42, 0.8);
}

.counter-color-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 50%;
}

.counter-value {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    min-width: 28px;
    text-align: center;
}

/* Виджет сезона */
.season-widget {
    position: fixed;
    top: 80px;
    right: 12px;
    background: rgba(13, 13, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 8px 12px;
    border: 1px solid rgba(45, 45, 85, 0.5);
    text-align: center;
    z-index: 100;
    min-width: 100px;
}

.season-number {
    color: #ffd966;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.season-timer {
    color: #6bcb77;
    font-size: 0.7rem;
    font-weight: 500;
}

.control-menu {
    position: fixed;
    bottom: 95px;
    left: 12px;
    right: 12px;
    background: rgba(22, 22, 42, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    padding: 8px 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(45, 45, 85, 0.5);
    pointer-events: none;
}

.control-menu .coins-counter,
.control-menu .selected-info {
    pointer-events: auto;
}

.occupy-btn {
    pointer-events: auto;
    position: relative;
    background: linear-gradient(135deg, #3a6ea5, #2a4a7a);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(58, 110, 165, 0.4);
    margin: -8px 0;
}

.occupy-btn::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: rgba(22, 22, 42, 0.9);
    z-index: -1;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.occupy-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(58, 110, 165, 0.3);
}

.dig-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.coins-counter {
    background: rgba(10, 10, 20, 0.8);
    padding: 8px 18px;
    border-radius: 40px;
    color: #ffd966;
    font-weight: 800;
    font-size: 1.3rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coin-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.selected-info {
    background: rgba(35, 35, 58, 0.8);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.8rem;
    flex: 1;
    text-align: center;
    color: #ffffff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 99;
    padding: 0;
    background: transparent;
}

.nav-btn {
    flex: 1;
    height: 65px;
    border-radius: 40px;
    background: rgba(22, 22, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 45, 85, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:active {
    transform: scale(0.97);
}

.nav-btn.center {
    flex: 1.2;
    height: 75px;
}

.nav-btn.active {
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
    background: rgba(22, 22, 42, 0.9);
}

.nav-btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-btn[data-page="wallet"] img,
.nav-btn[data-page="ref"] img,
.nav-btn[data-page="top"] img {
    width: 36px;
    height: 36px;
}

.nav-btn.center img {
    width: 38px;
    height: 38px;
}

.message-overlay {
    position: fixed;
    bottom: 170px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 8px 18px;
    border-radius: 40px;
    z-index: 101;
    pointer-events: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.message-text {
    font-size: 0.75rem;
    color: #ccddee;
    text-align: center;
    font-weight: 500;
}

/* Модальное окно окончания сезона */
.season-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.season-overlay.show {
    visibility: visible;
    opacity: 1;
}

.season-overlay-content {
    background: linear-gradient(135deg, #1a1a2e, #0d0d1a);
    border-radius: 24px;
    padding: 16px 20px;
    text-align: center;
    border: 2px solid #ffd966;
    box-shadow: 0 0 30px rgba(255, 217, 102, 0.3);
    max-width: 280px;
    width: calc(100% - 30px);
}

.season-overlay-title {
    color: #ffd966;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.season-overlay-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.season-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(26, 26, 42, 0.8);
    padding: 6px 8px;
    border-radius: 12px;
    min-width: 50px;
}

.season-stat-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.season-stat-value {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: bold;
}

.season-overlay-note {
    color: #aaaaff;
    font-size: 0.6rem;
    margin-top: 8px;
}

.season-overlay-close {
    background: linear-gradient(135deg, #3a6ea5, #2a4a7a);
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
}

/* Загрузочный экран */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hide {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    padding: 20px;
    animation: fadeInUp 0.6s ease;
}

.splash-logo {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    animation: pulse 1.5s infinite;
}

.splash-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    animation: float 2s ease-in-out infinite;
}

.splash-icon:nth-child(1) { animation-delay: 0s; }
.splash-icon:nth-child(2) { animation-delay: 0.3s; }
.splash-icon:nth-child(3) { animation-delay: 0.6s; }
.splash-icon:nth-child(4) { animation-delay: 0.9s; }

/* Основной логотип - УВЕЛИЧЕННЫЙ */
.splash-main-logo {
    width: 540px;
    max-width: 85vw;
    height: auto;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease;
}

.progress-container {
    width: 250px;
    height: 8px;
    background: rgba(26, 26, 42, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 10px;
    border: 1px solid rgba(58, 110, 165, 0.3);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3a6ea5, #6bcb77);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    color: #aaaaaa;
    font-size: 0.7rem;
    margin-bottom: 20px;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@media (max-width: 600px) {
    .canvas-container {
        padding: 60px 40px 180px 40px;
    }
    .top-menu {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 8px 12px;
    }
    .counter-item {
        padding: 4px 8px;
    }
    .counter-color-img {
        width: 16px;
        height: 16px;
    }
    .counter-value {
        font-size: 0.85rem;
        min-width: 22px;
    }
    .season-widget {
        top: 70px;
        right: 8px;
        padding: 6px 10px;
        min-width: 80px;
    }
    .season-number {
        font-size: 0.7rem;
    }
    .season-timer {
        font-size: 0.6rem;
    }
    .control-menu {
        bottom: 85px;
        left: 8px;
        right: 8px;
        padding: 6px 10px;
    }
    .coins-counter {
        padding: 5px 12px;
        font-size: 1.1rem;
        gap: 6px;
    }
    .coin-icon {
        width: 22px;
        height: 22px;
    }
    .selected-info {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
    .occupy-btn {
        width: 48px;
        height: 48px;
    }
    .occupy-btn::before {
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
    }
    .dig-icon {
        width: 26px;
        height: 26px;
    }
    .nav-btn {
        height: 50px;
    }
    .nav-btn.center {
        height: 58px;
    }
    .nav-btn img {
        width: 24px;
        height: 24px;
    }
    .nav-btn[data-page="wallet"] img,
    .nav-btn[data-page="ref"] img,
    .nav-btn[data-page="top"] img {
        width: 28px;
        height: 28px;
    }
    .nav-btn.center img {
        width: 28px;
        height: 28px;
    }
    .message-overlay {
        bottom: 155px;
    }
    .splash-icon {
        width: 40px;
        height: 40px;
    }
    .splash-main-logo {
        width: 85vw;
        max-width: 400px;
    }
    .progress-container {
        width: 200px;
    }
    .splash-logo {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .splash-icon {
        width: 35px;
        height: 35px;
    }
    .splash-main-logo {
        width: 85vw;
        max-width: 350px;
        margin-bottom: 25px;
    }
    .progress-container {
        width: 180px;
    }
    .splash-logo {
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .splash-icon {
        width: 30px;
        height: 30px;
    }
    .splash-main-logo {
        width: 90vw;
        max-width: 300px;
        margin-bottom: 20px;
    }
    .progress-container {
        width: 160px;
    }
    .splash-logo {
        gap: 8px;
    }
}