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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #0b0b0f;
    color: #fff;
    overflow: hidden;
    position: relative;
    height: 100vh;
}

#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#ui-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    padding: 2.5rem;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
    transition: opacity 0.3s ease; /* Убрали transform отсюда! */
}

/* ===== ЛОКАЛЬНЫЙ ШРИФТ ===== */
@font-face {
    font-family: 'Press Start 2P';
    src: url('MinecraftTen-VGORe.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


#ui-container.hidden-ui {
    opacity: 0;
    pointer-events: none;
 
}


h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.85;
}

.buttons-container {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.big-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    padding: 1.75rem 2rem;
    border-radius: 18px;
    cursor: pointer;
    font-size: 1rem;
    color: #fff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.big-button:hover {
    transform: translateY(-4px) scale(1.03);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.09));
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.big-button:active {
    transform: translateY(-2px) scale(1.01);
}

.button-icon {
    font-size: 2.5rem;
    display: block;
}

.button-title {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.button-desc {
    font-size: 0.9rem;
    opacity: 0.75;
    font-weight: 500;
}

/* ===== КНОПКА ГЛАВНОГО МЕНЮ (СПРАВА) ===== */
.menu-button {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1003;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.25;
}

.menu-button:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.08);
    opacity: 1;
}

/* ===== КНОПКА НАСТРОЕК ИГРЫ (СЛЕВА, НИЖЕ СЧЕТА) ===== */
.game-menu-button {
    position: fixed;
    top: 60px;
    left: 14px;
    z-index: 1003;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.25;
}

.game-menu-button:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.08);
    opacity: 1;
}

/* ===== ПАНЕЛЬ НАСТРОЕК ИГРЫ (СЛЕВА) ===== */
.game-settings-panel {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(40, 40, 60, 0.98));
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    
    /* ========== АНИМАЦИЯ ========== */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Когда панель скрыта */
.game-settings-panel.hidden {
    transform: translate(-120%, -50%); /* Уехала влево */
    opacity: 0;
    pointer-events: none;
}


.game-settings-panel h2 {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.8rem;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.settings-section select {
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.95rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.settings-section select:focus {
    outline: none;
    border-color: rgba(100, 200, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(100, 200, 255, 0.1);
}


.author-section {
    text-align: center;
    padding: 0;
    background: none;
    border: none;
}

.author-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* QR код - кликабельная ссылка */
.qr-link {
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.qr-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(100, 150, 255, 0.4);
}

.qr-link:active {
    transform: scale(0.98);
}

.qr-image {
    width: 100px;
    height: 100px;
    display: block;
    border-radius: 8px;
}

.version-tag {
    display: inline-block;
    opacity: 0.9;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.85rem;
}

/* ===== ШКАЛА СТАМИНЫ ===== */
.stamina-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stamina-bar.visible {
    opacity: 1;
}

.stamina-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ffa6, #00d4ff);
    transition: width 0.1s ease;
    box-shadow: 0 0 12px rgba(0, 255, 166, 0.6);
}

/* ===== АНИМАЦИИ ===== */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95); /* Добавили translate */
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1); /* Добавили translate */
    }
}

#ui-container.pop-in {
    animation: popIn 280ms ease;
}


#ui-container.pop-in {
    animation: popIn 280ms ease;
}

/* Скроллбар для панели настроек */
.game-settings-panel::-webkit-scrollbar {
    width: 6px;
}

.game-settings-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.game-settings-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.game-settings-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== КНОПКИ СКАЧИВАНИЯ ISO ===== */
.download-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.download-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

.download-icon {
    font-size: 1.2rem;
}

.download-label {
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}


/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    p { font-size: 1rem; }
    .big-button { min-width: 140px; padding: 1.25rem 1.5rem; }
    .button-icon { font-size: 2rem; }
    
    .game-settings-panel {
        width: calc(100vw - 28px);
        left: 14px;
        right: 14px;
    }
}

/* ===== МОБИЛЬНАЯ ОПТИМИЗАЦИЯ ===== */

/* Планшеты и смартфоны */
@media (max-width: 768px) {
    body {
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
    }
    
    h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    p {
        font-size: 0.9rem;
        margin-bottom: 1.3rem;
    }
    
    #ui-container {
        padding: 1.5rem 1rem;
        max-width: 95%;
        width: calc(100% - 2rem);
    }
    
    .buttons-container {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }
    
    .big-button {
        width: 100%;
        min-width: auto;
        padding: 1.2rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .button-icon {
        font-size: 2rem;
    }
    
    .button-title {
        font-size: 1.05rem;
    }
    
    .button-desc {
        font-size: 0.8rem;
    }
    
    /* Кнопки скачивания */
    .download-buttons {
        flex-direction: column;
        gap: 0.6rem;
        width: 100%;
    }
    
    .download-btn {
        width: 100%;
        padding: 0.8rem 1rem;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    .download-icon {
        font-size: 1.2rem;
    }
    
    .download-label {
        font-size: 0.9rem;
    }
    
    /* Меню настроек */
    .game-settings-panel {
        top: 70px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 85px);
        padding: 1.2rem;
    }
    
    .game-settings-panel h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .settings-section {
        margin-bottom: 1.2rem;
    }
    
    .settings-section label {
        font-size: 0.9rem;
    }
    
    .settings-section select {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
    
    .author-name {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .qr-image {
        width: 85px;
        height: 85px;
    }
    
    .version-tag {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }
    
    /* Кнопки меню */
    .menu-button {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
        opacity: 0.6;
    }
    
    .game-menu-button {
        top: 58px;
        left: 12px;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
        opacity: 0.6;
    }
    
    /* Счёт */
    #score-hud {
        top: 12px;
        left: 12px;
        font-size: 0.9rem;
        padding: 5px 9px;
    }
    
    /* Шкала стамины */
    .stamina-bar {
        width: 150px;
        height: 12px;
        bottom: 15px;
    }
}

/* Маленькие смартфоны */
@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
    }
    
    p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    #ui-container {
        padding: 1.2rem 0.8rem;
        border-radius: 16px;
    }
    
    .big-button {
        padding: 1rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .button-icon {
        font-size: 1.8rem;
    }
    
    .button-title {
        font-size: 1rem;
    }
    
    .button-desc {
        font-size: 0.75rem;
    }
    
    .download-btn {
        padding: 0.7rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .menu-button,
    .game-menu-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .menu-button {
        top: 10px;
        right: 10px;
    }
    
    .game-menu-button {
        top: 55px;
        left: 10px;
    }
    
    #score-hud {
        top: 10px;
        left: 10px;
        font-size: 0.85rem;
        padding: 4px 8px;
    }
    
    .stamina-bar {
        width: 130px;
        height: 10px;
    }
}


@media (hover: none) and (pointer: coarse) {
    .big-button:hover,
    .download-btn:hover,
    .menu-button:hover,
    .game-menu-button:hover {
        transform: none;
        opacity: inherit;
    }
    
    .big-button:active {
        transform: scale(0.97);
    }
    
    .download-btn:active {
        transform: scale(0.97);
    }
    
    .menu-button:active,
    .game-menu-button:active {
        opacity: 1;
        transform: scale(0.92);
    }
}
#res-guard {
    z-index: 1002 !important;
}

#res-guard-badge {
    pointer-events: auto !important;
}

#gameCanvas {
    position: fixed;
    z-index: 0;
}
.easter-egg-gif {
    position: fixed !important;
    z-index: 1 !important;
    pointer-events: none;
}

/* ===== УЛЬТРА ГАДЭМ РЕЖИМ ===== */
@keyframes ultraRainbow {
    0% { filter: hue-rotate(0deg) saturate(3) brightness(1.2); }
    25% { filter: hue-rotate(90deg) saturate(4) brightness(1.4); }
    50% { filter: hue-rotate(180deg) saturate(5) brightness(1.6); }
    75% { filter: hue-rotate(270deg) saturate(4) brightness(1.4); }
    100% { filter: hue-rotate(360deg) saturate(3) brightness(1.2); }
}

body.ultra-mode {
    animation: ultraRainbow 3s infinite linear !important;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff) !important;
    background-size: 400% 400% !important;
}

body.ultra-mode #gameCanvas {
    filter: contrast(1.2) saturate(2);
    animation: ultraRainbow 2s infinite linear;
}

body.ultra-mode .settings-overlay {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(20px) hue-rotate(180deg);
}

body.ultra-mode #gameCanvas {
    box-shadow: 0 0 50px #ff00ff, 0 0 100px #00ffff !important;
}
/* ===== MINECRAFT СПЛЕШ ===== */

.minecraft-splash {
    position: absolute;
    top: 10px;
    right: -90px;
    color: #FFFF00;
    font-family: 'Minecraft', 'Press Start 2P', cursive;
    font-size: 40px;
    text-shadow: 3px 3px 0px #000000;
    transform: rotate(20deg);
    animation: minecraftBounce 1s ease-in-out infinite alternate;
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
}

@keyframes minecraftBounce {
    0% {
        transform: rotate(20deg) translateY(0px) scale(1);
    }
    100% {
        transform: rotate(20deg) translateY(-12px) scale(1.08);
    }
}

/* Адаптивность */
@media (max-width: 600px) {
    .minecraft-splash {
        font-size: 13px;
        right: 15px;
        top: 15px;
    }
}
/* ===== КНОПКА ИГРАТЬ ===== */
.play-button {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 18px 40px;
    margin: 20px auto 25px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: inherit;
    overflow: hidden;
    z-index: 1;
}

/* Градиентная обводка */
.play-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    padding: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.play-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.play-button:active {
    transform: translateY(0px) scale(0.98);
}

/* Адаптивность */
@media (max-width: 600px) {
    .play-button {
        font-size: 20px;
        padding: 15px 30px;
    }
}
/* ===== АНИМАЦИИ ПОЯВЛЕНИЯ И ИСЧЕЗНОВЕНИЯ ===== */

/* FADE */
@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeOutScale {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* SLIDE */
@keyframes slideInTop {
    0% { opacity: 0; transform: translateY(-50px); }
    100% { opacity: 1; transform: translateY(0); }
}

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

/* BOUNCE */
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes bounceOut {
    0% { transform: scale(1); }
    25% { transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* ZOOM */
@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes zoomOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}

/* ROTATE */
@keyframes rotateIn {
    0% { opacity: 0; transform: rotate(-200deg) scale(0); }
    100% { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes rotateOut {
    0% { opacity: 1; transform: rotate(0) scale(1); }
    100% { opacity: 0; transform: rotate(200deg) scale(0); }
}

/* SLIDE DIRECTIONS */
@keyframes slideInDown {
    0% { opacity: 0; transform: translateY(-100%); }
    100% { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes slideOutRight {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}

/* FLIP */
@keyframes flipInX {
    0% { opacity: 0; transform: perspective(400px) rotateX(90deg); }
    40% { transform: perspective(400px) rotateX(-10deg); }
    70% { transform: perspective(400px) rotateX(10deg); }
    100% { opacity: 1; transform: perspective(400px) rotateX(0); }
}

@keyframes flipOutX {
    0% { opacity: 1; transform: perspective(400px) rotateX(0); }
    100% { opacity: 0; transform: perspective(400px) rotateX(90deg); }
}

/* ROLL */
@keyframes rollIn {
    0% { opacity: 0; transform: translateX(-100%) rotate(-120deg); }
    100% { opacity: 1; transform: translateX(0) rotate(0); }
}

@keyframes rollOut {
    0% { opacity: 1; transform: translateX(0) rotate(0); }
    100% { opacity: 0; transform: translateX(100%) rotate(120deg); }
}

/* SPECIAL */
@keyframes tada {
    0%, 100% { transform: scale(1) rotate(0); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
}

@keyframes wobble {
    0% { transform: translateX(0) rotate(0); }
    15% { transform: translateX(-25px) rotate(-5deg); }
    30% { transform: translateX(20px) rotate(3deg); }
    45% { transform: translateX(-15px) rotate(-3deg); }
    60% { transform: translateX(10px) rotate(2deg); }
    75% { transform: translateX(-5px) rotate(-1deg); }
    100% { transform: translateX(0) rotate(0); }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
/* Никнейм в настройках */
.nickname-section {
    margin-bottom: 20px;
}

.nickname-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-top: 8px;
}

.nickname-input:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.nickname-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.nickname-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.nickname-input {
    flex: 1;
}

.save-nickname-btn,
.generate-nickname-btn {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.save-nickname-btn:hover,
.generate-nickname-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* ========== ЦВЕТНЫЕ ПЕРЕКЛЮЧАТЕЛИ ========== */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

input:checked + .slider:before {
    transform: translateX(28px);
}

.slider:hover {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
}

/* Анимация пульсации при клике */
input:active + .slider:before {
    width: 32px;
}
/* ========== КНОПКИ ========== */
.social-section {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.telegram-btn {
    background: linear-gradient(135deg, #0088cc, #0077b5);
    color: white;
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #0099dd, #0088cc);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.channel-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.channel-btn:hover {
    background: linear-gradient(135deg, #7b92f7, #8a5ab4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.social-icon {
    font-size: 20px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: row-reverse;
}

.settings-row .settings-label {
    flex: 1;
    text-align: left;
    margin-left: 15px;
}
@media (max-width: 768px) {
    .game-settings-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }
}
/* Затемнение фона при открытии */
.game-settings-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-settings-panel:not(.hidden)::before {
    opacity: 1;
}
.game-settings-panel:not(.hidden) .settings-section,
.game-settings-panel:not(.hidden) .settings-row {
    animation: slideInLeft 0.4s ease forwards;
    opacity: 0; /* ВАЖНО! Начальное состояние */
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Задержка для ВСЕХ элементов (до 10) */
.game-settings-panel:not(.hidden) .settings-section:nth-child(1),
.game-settings-panel:not(.hidden) .settings-row:nth-child(1) {
    animation-delay: 0.05s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(2),
.game-settings-panel:not(.hidden) .settings-row:nth-child(2) {
    animation-delay: 0.1s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(3),
.game-settings-panel:not(.hidden) .settings-row:nth-child(3) {
    animation-delay: 0.15s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(4),
.game-settings-panel:not(.hidden) .settings-row:nth-child(4) {
    animation-delay: 0.2s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(5),
.game-settings-panel:not(.hidden) .settings-row:nth-child(5) {
    animation-delay: 0.25s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(6),
.game-settings-panel:not(.hidden) .settings-row:nth-child(6) {
    animation-delay: 0.3s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(7),
.game-settings-panel:not(.hidden) .settings-row:nth-child(7) {
    animation-delay: 0.35s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(8),
.game-settings-panel:not(.hidden) .settings-row:nth-child(8) {
    animation-delay: 0.4s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(9),
.game-settings-panel:not(.hidden) .settings-row:nth-child(9) {
    animation-delay: 0.45s;
}

.game-settings-panel:not(.hidden) .settings-section:nth-child(10),
.game-settings-panel:not(.hidden) .settings-row:nth-child(10) {
    animation-delay: 0.5s;
}

/* ==================== LEADERBOARD ==================== */

/* Кнопка открытия таблицы */
.leaderboard-menu-button {
    position: fixed;
    top: 116px;
    left: 14px;
    z-index: 9999;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(240, 147, 251, 0.5);
    opacity: 0.85;
    animation: leaderboardPulse 2s ease-in-out infinite;
}

@keyframes leaderboardPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(240, 147, 251, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 24px rgba(240, 147, 251, 0.8);
    }
}

.leaderboard-menu-button:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    transform: scale(1.12) rotate(-5deg);
    opacity: 1;
    box-shadow: 0 8px 32px rgba(240, 147, 251, 0.8);
}

.leaderboard-menu-button:active {
    transform: scale(1.05) rotate(-5deg);
}

/* Панель таблицы лидеров */
.leaderboard-panel {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(40, 40, 60, 0.98));
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.leaderboard-panel.hidden {
    transform: translate(-120%, -50%);
    opacity: 0;
    pointer-events: none;
}

.leaderboard-panel h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 0.8rem;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.close-leaderboard {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.close-leaderboard:hover {
    background: rgba(255, 0, 0, 0.6);
    transform: rotate(90deg) scale(1.1);
}

.leaderboard-content {
    color: white;
}

.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.no-records {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Карточка игрока */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideInLeft 0.4s ease forwards;
    opacity: 0;
}

/* Анимация появления для каждого элемента */
.leaderboard-item:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.25s; }
.leaderboard-item:nth-child(6) { animation-delay: 0.3s; }
.leaderboard-item:nth-child(7) { animation-delay: 0.35s; }
.leaderboard-item:nth-child(8) { animation-delay: 0.4s; }
.leaderboard-item:nth-child(9) { animation-delay: 0.45s; }
.leaderboard-item:nth-child(10) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Стили для топ-3 */
.leaderboard-item.first-place {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.leaderboard-item.first-place:hover {
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.4);
}

.leaderboard-item.second-place {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(169, 169, 169, 0.1));
    border: 2px solid rgba(192, 192, 192, 0.4);
    box-shadow: 0 4px 20px rgba(192, 192, 192, 0.2);
}

.leaderboard-item.second-place:hover {
    box-shadow: 0 6px 30px rgba(192, 192, 192, 0.4);
}

.leaderboard-item.third-place {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(184, 115, 51, 0.1));
    border: 2px solid rgba(205, 127, 50, 0.4);
    box-shadow: 0 4px 20px rgba(205, 127, 50, 0.2);
}

.leaderboard-item.third-place:hover {
    box-shadow: 0 6px 30px rgba(205, 127, 50, 0.4);
}

.leaderboard-position {
    font-size: 24px;
    font-weight: 700;
    min-width: 70px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.position-number {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.leaderboard-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.leaderboard-nickname {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.leaderboard-score {
    font-size: 16px;
    font-weight: 700;
    color: #4CAF50;
    text-shadow: 0 1px 3px rgba(76, 175, 80, 0.5);
}

.score-label {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
}

/* Скроллбар для таблицы */
.leaderboard-panel::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.leaderboard-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.leaderboard-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .leaderboard-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        padding: 20px;
    }
    
    .leaderboard-panel h2 {
        font-size: 1.3rem;
    }
    
    .leaderboard-item {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .leaderboard-position {
        font-size: 20px;
        min-width: 55px;
    }
    
    .leaderboard-nickname {
        font-size: 16px;
    }
    
    .leaderboard-score {
        font-size: 14px;
    }
    
    .leaderboard-menu-button {
        top: 58px;
        left: 12px;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .leaderboard-panel {
        padding: 15px;
        border-radius: 16px;
    }
    
    .leaderboard-panel h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .leaderboard-item {
        padding: 10px 12px;
        border-radius: 12px;
    }
    
    .leaderboard-position {
        font-size: 18px;
        min-width: 50px;
    }
    
    .position-number {
        font-size: 14px;
    }
    
    .leaderboard-nickname {
        font-size: 15px;
    }
    
    .leaderboard-score {
        font-size: 13px;
    }
    
    .score-label {
        font-size: 12px;
    }
    
    .leaderboard-menu-button {
        top: 55px;
        left: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
