/* ========================================
   HUNTRIX: DEMON CARDS - STYLES
   ======================================== */

:root {
    /* Цвета персонажей */
    --rumi-color: #ff6b9d;
    --rumi-dark: #cc4477;
    --mira-color: #6bffff;
    --mira-dark: #44cccc;
    --zoey-color: #ffd76b;
    --zoey-dark: #ccaa44;
    
    /* Основные цвета */
    --bg-dark: #0a0a12;
    --bg-mid: #151525;
    --bg-card: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #aaaacc;
    --accent: #ff44aa;
    --danger: #ff4444;
    --success: #44ff88;
    --energy: #ffdd44;
    
    /* Эффекты */
    --glow-rumi: 0 0 20px rgba(255, 107, 157, 0.5);
    --glow-mira: 0 0 20px rgba(107, 255, 255, 0.5);
    --glow-zoey: 0 0 20px rgba(255, 215, 107, 0.5);
    --glow-honmun: 0 0 40px rgba(255, 68, 170, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */

#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0a0a12;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255, 68, 170, 0.2);
    border-top-color: #ff44aa;
    border-radius: 50%;
    animation: loadSpin 0.8s linear infinite;
}

@keyframes loadSpin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Russo One', 'Noto Sans', sans-serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    text-transform: uppercase;
}

html {
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Noto Sans', sans-serif;
    background: #000;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    width: 100%;
    height: 100%;
}

/* Блокировка выделения и контекстного меню на всех элементах */
*, *::before, *::after {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
}

#game-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
}

@media (pointer: fine) {
    #game-container {
        width: 1920px;
        height: 1080px;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: auto;
    }
}

/* ========================================
   SCREENS
   ======================================== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
    overflow: hidden;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 100;
}

/* ========================================
   MAIN MENU
   ======================================== */

.menu-container {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.game-title {
    margin-bottom: 40px;
}
}

.title-huntrix {
    display: block;
    font-family: 'Russo One', sans-serif;
    font-size: 48px;
    background: linear-gradient(135deg, var(--rumi-color), var(--mira-color), var(--zoey-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(255, 68, 170, 0.5));
    animation: titleGlow 3s ease-in-out infinite;
}

.title-sub {
    display: block;
    font-family: 'Russo One', sans-serif;
    font-size: 40px;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--rumi-color), var(--mira-color), var(--zoey-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 68, 170, 0.3));
    margin-top: 5px;
}

.menu-characters {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-shrink: 1;
}

.char-silhouette {
    width: 100px;
    height: 150px;
    border-radius: 10px;
    opacity: 0.8;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.char-silhouette.rumi {
    background-image: url('../images/rumi.png');
    background-color: var(--rumi-dark);
    box-shadow: var(--glow-rumi);
}

.char-silhouette.mira {
    background-image: url('../images/mira.png');
    background-color: var(--mira-dark);
    box-shadow: var(--glow-mira);
}

.char-silhouette.zoey {
    background-image: url('../images/zoia.png');
    background-color: var(--zoey-dark);
    box-shadow: var(--glow-zoey);
}

.char-silhouette:hover {
    transform: translateY(-10px) scale(1.05);
    opacity: 1;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary, .btn-secondary, .btn-danger {
    font-family: 'Russo One', sans-serif;
    font-size: 18px;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--rumi-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 68, 170, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 68, 170, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #ff6666;
}

.btn-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

.btn-menu-small {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-menu-small:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   BATTLE SCREEN
   ======================================== */

#battle-screen {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    background:
        /* Шёлковая текстура — диагональные нити */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.015) 2px,
            rgba(255, 255, 255, 0.015) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 2px,
            rgba(180, 140, 255, 0.012) 2px,
            rgba(180, 140, 255, 0.012) 4px
        ),
        /* Отблеск шёлка */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 60px,
            rgba(255, 255, 255, 0.02) 60px,
            rgba(255, 255, 255, 0.02) 61px
        ),
        /* Цветовые ореолы */
        radial-gradient(ellipse at 15% 10%, rgba(255, 80, 140, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 15%, rgba(80, 160, 255, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 0%, rgba(180, 100, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 60%, rgba(100, 60, 200, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 100% 60%, rgba(60, 120, 220, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 100%, rgba(40, 20, 80, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, #0d0b1e 0%, #161230 25%, #1a1640 50%, #161235 75%, #0e0b20 100%);
}

#battle-screen::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    /* Звёзды */
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 8%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 20%, rgba(255,220,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 5%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 18%, rgba(200,200,255,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 85% 10%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 25%, rgba(255,180,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 35%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 18% 42%, rgba(200,220,255,0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 32% 30%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 48% 38%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 62% 28%, rgba(220,200,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 35%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(2px 2px at 90% 42%, rgba(255,200,255,0.5) 0%, transparent 100%);
    animation: battleStarsTwinkle 4s ease-in-out infinite alternate;
}

/* Скользящий отблеск шёлка */
#battle-screen .silk-sheen {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        transparent 35%,
        rgba(255, 255, 255, 0.04) 45%,
        rgba(200, 180, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.04) 55%,
        transparent 65%,
        transparent 100%
    );
    animation: silkSheen 8s ease-in-out infinite;
}

@keyframes silkSheen {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes battleStarsTwinkle {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

#battle-screen::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(8, 6, 20, 0.3) 100%);
}

#battle-screen > * {
    position: relative;
    z-index: 1;
}

#battle-screen > .deck-info {
    position: fixed;
}

.battle-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    position: relative;
    z-index: 10;
}

.chapter-info {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 20px;
    top: 10px;
}

#chapter-name {
    font-family: 'Russo One', sans-serif;
    font-size: 16px;
    color: var(--accent);
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#battle-count {
    font-size: 13px;
    color: var(--text-secondary);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.player-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    border: 2px solid #8b2020;
    box-shadow:
        inset 0 0 10px rgba(139, 32, 32, 0.3),
        0 2px 10px rgba(0, 0, 0, 0.5);
}

.stat-hp {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-bar {
    width: 280px;
    height: 26px;
    background: #1a0a0a;
    border-radius: 11px;
    overflow: hidden;
    position: relative;
    border: 2px solid #8b2020;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.hp-fill {
    height: 100%;
    background: linear-gradient(180deg, #ff5555, #cc2222 50%, #aa1111);
    border-radius: 9px;
    transition: width 0.3s ease;
    width: 100%;
    box-shadow: 0 0 8px rgba(255, 50, 50, 0.4);
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    letter-spacing: 0.5px;
}

.stat-energy {
    font-family: 'Russo One', sans-serif;
    font-size: 20px;
    color: var(--energy);
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 221, 68, 0.3);
    text-shadow: 0 0 6px rgba(255, 221, 68, 0.5);
}

/* ========================================
   ENEMIES ZONE
   ======================================== */

.enemies-zone {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    padding: 30px 40px;
    min-height: 300px;
    flex: 1;
}

.enemy {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: enemySpawn 0.5s ease;
    cursor: pointer;
    touch-action: manipulation;
    background: rgba(10, 5, 15, 0.7);
    border: 3px solid #8b2020;
    border-radius: 16px;
    padding: 8px 10px 10px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 0 15px rgba(139, 32, 32, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.5);
}

.enemy:active {
    transform: scale(0.96);
    box-shadow:
        inset 0 0 20px rgba(255, 68, 68, 0.3),
        0 0 20px rgba(255, 68, 68, 0.5);
}

.enemy-intent {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    background: linear-gradient(135deg, #cc2222, #991111);
    border-radius: 12px;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 15px;
    border: 1px solid rgba(255, 100, 100, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.enemy-intent.block {
    background: linear-gradient(135deg, #2255cc, #113399);
    border-color: rgba(100, 150, 255, 0.4);
}

.enemy-intent.buff {
    background: linear-gradient(135deg, #cc8822, #995511);
    border-color: rgba(255, 200, 100, 0.4);
}

.enemy-body {
    width: 140px;
    height: 140px;
    background:
        radial-gradient(ellipse at center, rgba(100, 30, 50, 0.3) 0%, transparent 70%),
        linear-gradient(180deg, #3a1830, #1a0a15);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    position: relative;
    border: 2px solid rgba(139, 32, 32, 0.5);
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

.enemy-body.boss {
    width: 190px;
    height: 190px;
    font-size: 80px;
    border-color: #ff4444;
    box-shadow:
        inset 0 0 20px rgba(255, 68, 68, 0.2),
        0 0 30px rgba(255, 68, 68, 0.3);
}

.enemy-body.damaged {
    animation: shake 0.3s ease;
}

.enemy-hp-bar {
    width: 100%;
    height: 8px;
    background: #1a0a0a;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid rgba(139, 32, 32, 0.4);
}

.enemy-hp-fill {
    height: 100%;
    background: linear-gradient(180deg, #ff5544, #cc2211);
    transition: width 0.3s ease;
    border-radius: 3px;
    box-shadow: 0 0 4px rgba(255, 68, 68, 0.4);
}

.enemy-name {
    font-size: 14px;
    color: #dda;
    margin-top: 6px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    letter-spacing: 0.3px;
}

.enemy-block {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #4488ff, #2255cc);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid rgba(100, 170, 255, 0.5);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.enemy-icon-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    border-radius: 8px;
}

.enemy-body.boss .enemy-icon-img {
    width: 95%;
    height: 95%;
}

.enemy-status {
    position: absolute;
    bottom: -25px;
    display: flex;
    gap: 5px;
}

.status-icon {
    font-size: 14px;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ========================================
   HONMUN INDICATOR
   ======================================== */

.honmun-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 25px;
    margin: 5px 0;
    border: 2px solid rgba(255, 68, 170, 0.2);
}

.honmun-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    background: transparent;
    border: none;
    opacity: 0.5;
    transition: all 0.3s ease;
    overflow: visible;
}

.honmun-icon {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 0;
    filter: grayscale(0.6) brightness(0.7);
    transition: all 0.3s ease;
    pointer-events: none;
}

.honmun-slot.active .honmun-icon {
    filter: grayscale(0) brightness(1.2) drop-shadow(0 0 6px rgba(255,255,255,0.6));
}

.honmun-slot.active {
    opacity: 1;
    transform: scale(1.15);
}

.honmun-slot[data-char="rumi"].active {
    background: transparent;
    border: none;
    box-shadow: none;
}

.honmun-slot[data-char="mira"].active {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #000;
}

.honmun-slot[data-char="zoey"].active {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #000;
}

.honmun-label {
    font-family: 'Russo One', sans-serif;
    font-size: 13px;
    color: var(--accent);
    margin-left: 8px;
    text-shadow: 0 0 8px rgba(255, 68, 170, 0.5);
}

/* ========================================
   HUNTERS ZONE
   ======================================== */

.hunters-zone {
    display: flex;
    justify-content: center;
    gap: 50px;
    padding: 12px;
}

.hunter {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.hunter-portrait {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #444;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.5),
        0 4px 12px rgba(0,0,0,0.5);
}

.rumi-portrait {
    background-image: url('../images/rumi.png');
    background-color: var(--rumi-dark);
    border-color: var(--rumi-color);
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.5),
        0 0 15px rgba(255, 107, 157, 0.4),
        0 4px 12px rgba(0,0,0,0.5);
}

.mira-portrait {
    background-image: url('../images/mira.png');
    background-color: var(--mira-dark);
    border-color: var(--mira-color);
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.5),
        0 0 15px rgba(107, 255, 255, 0.4),
        0 4px 12px rgba(0,0,0,0.5);
}

.zoey-portrait {
    background-image: url('../images/zoia.png');
    background-color: var(--zoey-dark);
    border-color: var(--zoey-color);
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.5),
        0 0 15px rgba(255, 215, 107, 0.4),
        0 4px 12px rgba(0,0,0,0.5);
}

.hunter.buffed .hunter-portrait {
    transform: scale(1.08);
    animation: portraitPulse 2s ease-in-out infinite;
}

.hunter.buffed[data-char="rumi"] .hunter-portrait {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.5), 0 0 25px var(--rumi-color);
}

.hunter.buffed[data-char="mira"] .hunter-portrait {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.5), 0 0 25px var(--mira-color);
}

.hunter.buffed[data-char="zoey"] .hunter-portrait {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.5), 0 0 25px var(--zoey-color);
}

@keyframes portraitPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.hunter-name {
    font-size: 13px;
    margin-top: 6px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 10px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.hunter[data-char="rumi"] .hunter-name {
    color: var(--rumi-color);
    border: 1px solid rgba(255, 107, 157, 0.3);
}
.hunter[data-char="mira"] .hunter-name {
    color: var(--mira-color);
    border: 1px solid rgba(107, 255, 255, 0.3);
}
.hunter[data-char="zoey"] .hunter-name {
    color: var(--zoey-color);
    border: 1px solid rgba(255, 215, 107, 0.3);
}

.hunter-buff {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 11px;
    background: linear-gradient(135deg, #44ff88, #22cc55);
    color: #000;
    padding: 2px 7px;
    border-radius: 8px;
    display: none;
    border: 1px solid rgba(0,0,0,0.3);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    font-weight: bold;
}

.hunter-buff.visible {
    display: block;
    animation: popIn 0.3s ease;
}

/* ========================================
   HAND ZONE & CARDS
   ======================================== */

.hand-zone {
    width: 100%;
    padding: 10px 20px 16px;
    min-height: 240px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
}

.hand-cards {
    display: flex;
    justify-content: center;
    gap: 12px;
    perspective: 1000px;
}

.card {
    width: 160px;
    height: 220px;
    background: linear-gradient(180deg, #1e1e38 0%, #14142a 100%);
    border-radius: 14px;
    border: 3px solid #555;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.08),
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 6px 18px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Touch/Mobile: активные состояния */
.card:active {
    transform: translateY(-20px) scale(1.08);
    z-index: 10;
}

.card.rumi:active {
    box-shadow: 0 0 25px var(--rumi-color), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card.mira:active {
    box-shadow: 0 0 25px var(--mira-color), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card.zoey:active {
    box-shadow: 0 0 25px var(--zoey-color), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card.honmun:active {
    box-shadow: 0 0 35px var(--accent), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card:hover {
    transform: translateY(-30px) scale(1.1);
    z-index: 10;
}

.card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: saturate(0.4);
}

.card.disabled:hover {
    transform: none;
}

.card-selected {
    transform: translateY(-20px) scale(1.08) !important;
    z-index: 15 !important;
    filter: brightness(1.3) drop-shadow(0 0 20px currentColor);
    animation: cardPulse 0.8s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { filter: brightness(1.3) drop-shadow(0 0 20px currentColor); }
    50% { filter: brightness(1.5) drop-shadow(0 0 30px currentColor); }
}

/* --- Персонажные карты --- */
.card.rumi {
    border-color: var(--rumi-color);
    background: linear-gradient(180deg, rgba(255, 107, 157, 0.3) 0%, #2a1028 40%, #1a0a18 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 107, 157, 0.2),
        0 0 12px rgba(255, 107, 157, 0.2),
        0 6px 18px rgba(0,0,0,0.6);
}

.card.mira {
    border-color: var(--mira-color);
    background: linear-gradient(180deg, rgba(107, 255, 255, 0.3) 0%, #0a2028 40%, #081018 100%);
    box-shadow:
        inset 0 0 0 1px rgba(107, 255, 255, 0.2),
        0 0 12px rgba(107, 255, 255, 0.2),
        0 6px 18px rgba(0,0,0,0.6);
}

.card.zoey {
    border-color: var(--zoey-color);
    background: linear-gradient(180deg, rgba(255, 215, 107, 0.3) 0%, #201a10 40%, #181208 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 215, 107, 0.2),
        0 0 12px rgba(255, 215, 107, 0.2),
        0 6px 18px rgba(0,0,0,0.6);
}

.card.honmun {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(255, 68, 170, 0.4) 0%, #1e0a20 40%, #100810 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 68, 170, 0.25),
        0 0 20px rgba(255, 68, 170, 0.3),
        0 6px 18px rgba(0,0,0,0.6);
}

/* --- Элементы карты --- */
.card-cost {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 36px;
    height: 36px;
    background: radial-gradient(circle at 35% 35%, #fff59d, var(--energy) 50%, #b8960a);
    color: #1a0a00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 18px;
    border: 2px solid rgba(100, 80, 0, 0.5);
    box-shadow:
        0 2px 8px rgba(0,0,0,0.5),
        inset 0 1px 3px rgba(255,255,255,0.5);
    text-shadow: 0 1px 1px rgba(255,255,255,0.3);
    z-index: 2;
}

.card-character {
    position: absolute;
    top: 4px;
    right: 4px;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    z-index: 2;
    line-height: 1;
}

.card-char-crystal {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.card.rumi .card-character,
.card.mira .card-character,
.card.zoey .card-character,
.card.honmun .card-character { background: transparent; color: #fff; }

.card-art {
    height: 90px;
    margin: 42px 8px 4px 8px;
    background:
        radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 70%),
        rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 34px;
}

.card-icon-img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.card-name {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    padding: 3px 8px 2px;
    margin: 0 6px 2px;
    position: relative;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.card-desc {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 8px;
    flex: 1 1 auto;
    min-height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    overflow: hidden;
    word-break: break-word;
}

.card-type {
    text-align: center;
    font-size: 10px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(200, 200, 220, 0.8);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-radius: 0 0 11px 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card.rare {
    border-width: 3px;
    border-color: #c8a84e;
    box-shadow:
        inset 0 0 0 1px rgba(200, 168, 78, 0.3),
        0 0 18px rgba(200, 168, 78, 0.35),
        0 6px 18px rgba(0,0,0,0.6);
}

.card.rare::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    animation: cardShine 3s ease-in-out infinite;
    z-index: 1;
}

/* Card play animation */
.card.playing {
    animation: cardPlay 0.3s ease forwards;
}

@keyframes cardPlay {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-100px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-200px) scale(0.5); opacity: 0; }
}

/* ========================================
   CARD DRAG-AND-DROP
   ======================================== */

/* Оригинальная карта при перетаскивании */
.card.dragging {
    opacity: 0.3;
    transform: scale(0.95) !important;
}

/* Ghost — летящая копия карты */
.card-drag-ghost {
    pointer-events: none;
    opacity: 0.85;
    transform: scale(1.1) rotate(-3deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.3);
    transition: none !important;
}

/* Враги подсвечиваются как возможные цели */
.enemy.drop-target .enemy-body {
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
    animation: dropTargetPulse 1s ease-in-out infinite;
}

/* Враг под курсором — яркая подсветка */
.enemy.drop-hover .enemy-body {
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.9), 0 0 60px rgba(255, 68, 68, 0.4);
    border-color: #ff4444;
    transform: scale(1.08);
    animation: none;
}

@keyframes dropTargetPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 68, 68, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 68, 68, 0.6); }
}

/* ========================================
   END TURN BUTTON
   ======================================== */

.btn-end-turn {
    position: fixed;
    right: 30px;
    bottom: 250px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--rumi-dark));
    border: 3px solid rgba(255, 255, 255, 0.7);
    color: white;
    font-family: 'Russo One', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.3),
        0 4px 15px rgba(255, 68, 170, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.2);
    z-index: 50;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.btn-end-turn:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.3),
        0 6px 25px rgba(255, 68, 170, 0.6),
        inset 0 2px 4px rgba(255,255,255,0.2);
}

.btn-end-turn:active {
    transform: scale(0.95);
}

.btn-end-turn.enemy-turn {
    background: linear-gradient(135deg, #555, #333);
    border-color: #666;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ========================================
   DECK & DISCARD
   ======================================== */

.deck-info {
    position: fixed;
    left: 15px;
    bottom: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.deck-pile, .discard-pile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    background: rgba(10, 10, 20, 0.7);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.deck-pile:hover, .discard-pile:hover {
    background: rgba(20, 20, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.pile-icon {
    font-size: 34px;
}

.pile-count {
    font-weight: bold;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ========================================
   CARD VISUAL EFFECTS (Final Fantasy style)
   ======================================== */

.card-vfx {
    position: fixed;
    pointer-events: none;
    z-index: 100;
}

/* --- Духовный луч (Rumi Strike) — широкий луч справа налево --- */
.vfx-spirit-beam {
    background: linear-gradient(180deg,
        transparent,
        rgba(255,150,255,0.3),
        rgba(255,200,255,0.8),
        #fff,
        rgba(255,200,255,0.8),
        rgba(255,150,255,0.3),
        transparent);
    box-shadow: 0 0 40px rgba(255,150,255,0.6);
    transform-origin: right center;
    animation: vfxSpiritBeam 0.8s ease-out forwards;
}
.vfx-spirit-beam-glow {
    background: radial-gradient(ellipse at 50% 50%, rgba(255,180,255,0.4) 0%, transparent 70%);
    animation: vfxFlashFade 0.8s ease-out forwards;
}
@keyframes vfxSpiritBeam {
    0% { opacity: 0; transform: scaleX(0); }
    15% { opacity: 1; transform: scaleX(1); }
    60% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

/* --- Щит (Rumi Defend / Barrier) --- */
.vfx-shield {
    border-radius: 50%;
    border: 3px solid rgba(180,140,255,0.7);
    background: radial-gradient(circle, rgba(180,140,255,0.15), transparent 70%);
    box-shadow: 0 0 20px rgba(180,140,255,0.4), inset 0 0 20px rgba(180,140,255,0.2);
    animation: vfxShieldPulse 0.8s ease-out forwards;
}
@keyframes vfxShieldPulse {
    0% { transform: scale(0.3); opacity: 0; }
    30% { transform: scale(1.1); opacity: 1; }
    60% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
}

/* --- Медитация (символ + кольца) --- */
.vfx-zen-symbol {
    font-size: 60px;
    text-shadow: 0 0 20px rgba(180,140,255,0.8);
    animation: vfxZenSpin 1.2s ease-in-out forwards;
}
@keyframes vfxZenSpin {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    30% { transform: scale(1.2) rotate(180deg); opacity: 1; }
    70% { transform: scale(1) rotate(360deg); opacity: 1; }
    100% { transform: scale(0.8) rotate(540deg); opacity: 0; }
}
.vfx-zen-ring {
    border-radius: 50%;
    border: 2px solid rgba(180,140,255,0.6);
    animation: vfxRingExpand 1.2s ease-out forwards;
}
@keyframes vfxRingExpand {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

/* --- Призрак (Rumi Ancestors) --- */
.vfx-ghost {
    font-size: 40px;
    filter: blur(1px);
    animation: vfxGhostFly 1.2s ease-in forwards;
}
@keyframes vfxGhostFly {
    0% { opacity: 0; transform: translateX(-50px) scale(0.5); }
    30% { opacity: 0.8; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(100px) translateY(-30px) scale(0.3); }
}

/* --- Волна взрыва (Rumi Spirit Blast) --- */
.vfx-shockwave {
    border-radius: 50%;
    border: 3px solid rgba(200,100,255,0.8);
    box-shadow: 0 0 15px rgba(200,100,255,0.5);
    animation: vfxShockwave 1s ease-out forwards;
}
@keyframes vfxShockwave {
    0% { transform: scale(0); opacity: 1; }
    70% { opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

/* --- Столп света (Rumi Transcend) --- */
.vfx-pillar {
    background: linear-gradient(180deg, rgba(255,215,100,0.8), rgba(255,215,100,0) 100%);
    box-shadow: 0 0 30px rgba(255,215,100,0.4);
    animation: vfxPillar 1.5s ease-in-out forwards;
}
@keyframes vfxPillar {
    0% { opacity: 0; transform: scaleY(0); }
    20% { opacity: 1; transform: scaleY(1); }
    80% { opacity: 0.8; }
    100% { opacity: 0; }
}
.vfx-sparkle {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd76b;
    box-shadow: 0 0 8px #ffd76b;
    animation: vfxSparkleFloat 1.5s ease-out forwards;
}
@keyframes vfxSparkleFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0); }
}

/* --- Молния (Mira Lightning) --- */
.vfx-lightning {
    width: 4px;
    background: #6bffff;
    box-shadow: 0 0 10px #6bffff, 0 0 20px rgba(107,255,255,0.5);
    animation: vfxLightningFlash 0.15s ease-in-out;
}
@keyframes vfxLightningFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.vfx-lightning-flash {
    background: rgba(107,255,255,0.2);
    animation: vfxFlashFade 0.4s ease-out forwards;
}

/* --- Рывок (Mira Dash) --- */
.vfx-dash-trail {
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(107,255,255,0.8), transparent);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(107,255,255,0.5);
    animation: vfxDashTrail 0.5s ease-out forwards;
}
@keyframes vfxDashTrail {
    0% { opacity: 1; transform: scaleX(0); }
    40% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1.2); }
}

/* --- Музыкальные ноты (Mira Tempo) --- */
.vfx-note {
    font-size: 28px;
    animation: vfxNoteFloat 1s ease-out forwards;
}
@keyframes vfxNoteFloat {
    0% { opacity: 0; transform: translateY(0) rotate(0deg) scale(0.5); }
    30% { opacity: 1; transform: translateY(-20px) rotate(-15deg) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) rotate(15deg) scale(0.5); }
}

/* --- Общая вспышка --- */
@keyframes vfxFlashFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Кулак (Zoey Punch) --- */
.vfx-fist {
    font-size: 50px;
    animation: vfxFistSlam 0.5s ease-in forwards;
}
@keyframes vfxFistSlam {
    0% { opacity: 0; transform: translate(-80px, -80px) scale(2) rotate(-30deg); }
    50% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    70% { opacity: 1; transform: scale(1.3); }
    100% { opacity: 0; transform: scale(0.5); }
}
.vfx-impact-ring {
    border-radius: 50%;
    border: 3px solid rgba(255,215,107,0.8);
    animation: vfxImpactExpand 0.4s ease-out forwards;
}
@keyframes vfxImpactExpand {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* --- Землетрясение (Zoey Earthquake) --- */
.vfx-quake-crack {
    background: linear-gradient(0deg, rgba(255,100,50,0.6), transparent);
    animation: vfxCrackRise 1.5s ease-out forwards;
}
@keyframes vfxCrackRise {
    0% { opacity: 0; transform: scaleY(0); }
    20% { opacity: 1; transform: scaleY(1); }
    100% { opacity: 0; }
}
@keyframes vfxQuakeShake {
    0%, 100% { transform: translateX(0) translateY(0); }
    10% { transform: translateX(-8px) translateY(3px); }
    20% { transform: translateX(6px) translateY(-4px); }
    30% { transform: translateX(-10px) translateY(2px); }
    40% { transform: translateX(8px) translateY(-3px); }
    50% { transform: translateX(-5px) translateY(5px); }
    60% { transform: translateX(7px) translateY(-2px); }
    70% { transform: translateX(-6px) translateY(3px); }
    80% { transform: translateX(4px) translateY(-4px); }
    90% { transform: translateX(-3px) translateY(2px); }
}

/* --- Железная стена (Zoey Iron Wall) --- */
.vfx-iron-plate {
    background: linear-gradient(180deg, #888, #555, #888);
    border: 2px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(150,150,170,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
    animation: vfxIronSlam 0.8s ease-out forwards;
}
@keyframes vfxIronSlam {
    0% { opacity: 0; transform: translateY(-100px) scaleY(0.3); }
    40% { opacity: 1; transform: translateY(0) scaleY(1); }
    50% { transform: translateY(5px) scaleY(1.05); }
    60% { transform: translateY(0) scaleY(1); }
    100% { opacity: 0; }
}

/* --- Титанический удар (Zoey Titan) --- */
.vfx-titan-flash {
    background: rgba(255,255,255,0.6);
    animation: vfxTitanFlash 0.3s ease-out forwards;
}
@keyframes vfxTitanFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Ярость (Zoey Rage) --- */
.vfx-flame {
    width: 10px;
    height: 20px;
    background: linear-gradient(0deg, rgba(255,100,30,0.9), rgba(255,200,50,0.5), transparent);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: vfxFlameRise 1.2s ease-out forwards;
}
@keyframes vfxFlameRise {
    0% { opacity: 0; transform: translateY(0) scaleY(0.5); }
    20% { opacity: 1; transform: translateY(-10px) scaleY(1.2); }
    50% { opacity: 0.8; transform: translateY(-30px) scaleY(1); }
    100% { opacity: 0; transform: translateY(-60px) scaleY(0.3); }
}

/* --- Контрудар (Zoey Counter) --- */
.vfx-parry-flash {
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,215,107,0.3), transparent);
    animation: vfxParryFlash 0.3s ease-out forwards;
}
@keyframes vfxParryFlash {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* --- Фантом (Mira Phantom) --- */
.vfx-phantom-particle {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6bffff;
    box-shadow: 0 0 6px #6bffff;
    animation: vfxPhantomDissolve 1s ease-out forwards;
}
@keyframes vfxPhantomDissolve {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* --- Гармония (Honmun) --- */
.vfx-harmony-orb {
    border-radius: 50%;
    animation: vfxHarmonyOrb 1.2s ease-in-out forwards;
}
@keyframes vfxHarmonyOrb {
    0% { opacity: 0; transform: scale(0) translate(var(--startX), var(--startY)); }
    50% { opacity: 1; transform: scale(1) translate(0, 0); }
    100% { opacity: 0; transform: scale(1.5) translate(0, 0); }
}

/* --- Единство (Honmun Unity) --- */
.vfx-unity-beam {
    height: 3px;
    border-radius: 2px;
    transform-origin: 0 50%;
    animation: vfxUnityBeam 1s ease-in-out forwards;
}
@keyframes vfxUnityBeam {
    0% { opacity: 0; transform: scaleX(0); }
    40% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

/* ========================================
   REWARD SCREEN
   ======================================== */

.reward-container, .chapter-container, .gameover-container, 
.victory-container, .pause-container, .tutorial-container,
.deck-view-container, .relics-container {
    background: var(--bg-mid);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    animation: popIn 0.3s ease;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.reward-title, .chapter-title, .gameover-title, .victory-title {
    font-family: 'Russo One', sans-serif;
    font-size: 36px;
    margin-bottom: 20px;
}

.reward-title { color: var(--success); }
.gameover-title { color: var(--danger); }
.victory-title { 
    background: linear-gradient(135deg, var(--rumi-color), var(--mira-color), var(--zoey-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.reward-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.reward-option {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
    min-width: 150px;
}

.reward-option:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.reward-option-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.reward-option-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.reward-option-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Card reward option */
.reward-card {
    padding: 10px;
}

/* ========================================
   CHAPTER SCREEN
   ======================================== */

.chapter-container {
    background: linear-gradient(180deg, var(--bg-mid), var(--bg-dark));
}

.chapter-title {
    color: var(--accent);
    font-size: 48px;
}

.chapter-name {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.chapter-desc {
    max-width: 500px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.chapter-new-mechanic {
    background: rgba(255, 68, 170, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid var(--accent);
}

.chapter-new-mechanic h4 {
    color: var(--accent);
    margin-bottom: 10px;
}

/* ========================================
   VICTORY / GAMEOVER
   ======================================== */

.victory-stats, .gameover-stats {
    margin: 30px 0;
}

.victory-stats p, .gameover-stats p {
    font-size: 18px;
    margin: 10px 0;
}

.victory-score {
    font-size: 28px !important;
    font-family: 'Russo One', sans-serif;
    color: var(--energy);
    margin-top: 20px !important;
}

/* ========================================
   TUTORIAL
   ======================================== */

.tutorial-container {
    max-width: 600px;
}

.tutorial-content {
    min-height: 200px;
    margin: 30px 0;
}

.tutorial-page {
    display: none;
}

.tutorial-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tutorial-page h3 {
    color: var(--accent);
    margin-bottom: 20px;
}

.tutorial-page p {
    margin: 15px 0;
    line-height: 1.6;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-dots {
    display: flex;
    gap: 8px;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-card);
}

.tutorial-dot.active {
    background: var(--accent);
}

/* ========================================
   DECK VIEW
   ======================================== */

.deck-view-container {
    max-width: 800px;
    max-height: 80vh;
}

.deck-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.deck-cards-grid .card {
    transform: scale(0.9);
    margin: 0;
    touch-action: pan-y;
    pointer-events: none;
}

.deck-cards-grid .card:hover {
    transform: scale(0.9);
}

.deck-cards-grid .card:active {
    transform: scale(0.9);
}

/* ========================================
   RELICS
   ======================================== */

.relics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.relic {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    border: 3px solid var(--accent);
    position: relative;
}

.relic.locked {
    opacity: 0.3;
    border-color: #444;
}

/* ========================================
   HONMUN ANIMATION
   ======================================== */

.honmun-anim {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: none;
}

.honmun-anim.active {
    display: flex;
    animation: honmunFlash 1s ease forwards;
}

.honmun-burst {
    position: absolute;
    width: min(300px, 60vw);
    height: min(300px, 60vw);
    background: radial-gradient(circle, var(--accent), transparent);
    border-radius: 50%;
    animation: honmunBurst 1s ease forwards;
}

.honmun-text {
    font-family: 'Russo One', sans-serif;
    font-size: clamp(28px, 8vw, 72px);
    color: white;
    text-shadow: 0 0 30px var(--accent), 0 0 60px var(--accent);
    animation: honmunText 1s ease forwards;
    text-align: center;
    width: 100%;
}

/* ========================================
   FLOATING NUMBERS
   ======================================== */

#floating-numbers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.floating-number {
    position: absolute;
    font-family: 'Russo One', sans-serif;
    font-size: 28px;
    animation: floatUp 1s ease forwards;
    text-shadow: 2px 2px 4px black;
}

.floating-number.damage {
    color: var(--danger);
}

.floating-number.heal {
    color: var(--success);
}

.floating-number.block {
    color: #4488ff;
}

/* ========================================
   TOOLTIP
   ======================================== */

.tooltip {
    position: fixed;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    padding: 15px;
    border-radius: 10px;
    max-width: 250px;
    z-index: 300;
    display: none;
    font-size: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.tooltip.visible {
    display: block;
}

/* ========================================
   ENEMY TURN OVERLAY
   ======================================== */

.turn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    pointer-events: none;
}
.turn-overlay.enemy {
    animation: overlayPulse 1.2s ease forwards;
}
.turn-overlay.player {
    animation: playerOverlayPulse 1s ease forwards;
}

.enemy-turn-text {
    font-family: 'Russo One', sans-serif;
    font-size: 48px;
    color: #ff4444;
    text-shadow: 0 0 30px #ff0000, 0 0 60px #ff0000, 0 0 90px #ff0000;
    letter-spacing: 8px;
    animation: enemyTextAppear 1.2s ease forwards;
}

@keyframes overlayPulse {
    0% { background: rgba(0, 0, 0, 0); }
    30% { background: rgba(100, 0, 0, 0.4); }
    70% { background: rgba(100, 0, 0, 0.4); }
    100% { background: rgba(0, 0, 0, 0); }
}

@keyframes enemyTextAppear {
    0% { 
        opacity: 0; 
        transform: scale(0.5);
    }
    30% { 
        opacity: 1; 
        transform: scale(1.1);
    }
    50% { 
        transform: scale(1);
    }
    70% {
        opacity: 1;
        transform: scale(1);
    }
    100% { 
        opacity: 0; 
        transform: scale(1.2);
    }
}

/* --- Player Turn Overlay --- */
/* player-turn-overlay стили выше в .turn-overlay */

.player-turn-text {
    font-family: 'Russo One', sans-serif;
    font-size: 44px;
    color: #44bbff;
    text-shadow: 0 0 25px rgba(68,187,255,0.8), 0 0 50px rgba(68,187,255,0.4);
    letter-spacing: 8px;
    animation: playerTextAppear 1s ease forwards;
}

@keyframes playerOverlayPulse {
    0% { background: rgba(0, 0, 0, 0); }
    25% { background: rgba(0, 40, 80, 0.3); }
    65% { background: rgba(0, 40, 80, 0.3); }
    100% { background: rgba(0, 0, 0, 0); }
}

@keyframes playerTextAppear {
    0% { opacity: 0; transform: scale(0.5); }
    25% { opacity: 1; transform: scale(1.1); }
    45% { transform: scale(1); }
    65% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.2); }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@keyframes enemySpawn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(255, 68, 170, 0.5)); }
    50% { filter: drop-shadow(0 0 50px rgba(255, 68, 170, 0.8)); }
}

@keyframes cardShine {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(1.5);
    }
}

@keyframes honmunFlash {
    0% { background: transparent; }
    20% { background: rgba(255, 68, 170, 0.3); }
    100% { background: transparent; }
}

@keyframes honmunBurst {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(5); opacity: 0; }
}

@keyframes honmunText {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ========================================
   RESPONSIVE - МОБИЛЬНАЯ АДАПТАЦИЯ
   ======================================== */

/* Мобильные/планшеты — общие переопределения */
@media (pointer: coarse) {
    .screen {
        position: fixed;
        height: 100dvh;
        height: var(--vh-real, 100dvh);
    }

    .menu-container {
        max-height: 100%;
        max-height: 100dvh;
        max-height: var(--vh-real, 100dvh);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px 10px;
    }

    .game-title {
        flex-shrink: 1;
    }

    .menu-characters {
        flex-shrink: 1;
    }
}

/* Планшеты (ландшафт) */
@media (max-width: 1024px) and (pointer: coarse) {
    .hand-cards {
        gap: 5px;
    }
    
    .card {
        width: 110px;
        height: 155px;
    }
    
    .enemy-body {
        width: 90px;
        height: 110px;
    }
}

/* Мобильные (ландшафт/горизонталь) */
@media (max-width: 768px) and (orientation: landscape) and (pointer: coarse) {
    .title-huntrix {
        font-size: 24px;
    }
    
    .title-sub {
        font-size: 20px;
        letter-spacing: 2px;
    }
    
    .menu-buttons {
        flex-direction: row;
        gap: 10px;
    }
    
    .menu-buttons button {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    /* Верхняя панель */
    .battle-header {
        padding: 5px 10px;
        flex-wrap: nowrap;
    }
    
    .chapter-info {
        font-size: 10px;
    }
    
    .hp-bar {
        width: 100px;
        height: 16px;
    }
    
    .hp-text {
        font-size: 10px;
    }
    
    #energy-display {
        font-size: 12px;
    }
    
    /* Враги */
    .enemies-zone {
        padding: 5px 5px 10px;
        min-height: 100px;
    }
    
    .enemy {
        transform: scale(0.7);
        margin: 0 -10px 10px;
    }
    
    .enemy-body {
        width: 70px;
        height: 85px;
        font-size: 28px;
    }
    
    .enemy-body.boss {
        width: 70px;
        height: 85px;
        font-size: 28px;
    }
    
    .enemy-hp-bar {
        width: 60px;
        height: 6px;
    }
    
    .enemy-intent {
        font-size: 14px;
        padding: 2px 4px;
    }
    
    /* Хонмун индикатор */
    .honmun-indicator {
        top: 55px;
        transform: scale(0.7);
    }
    
    /* Охотницы */
    .hunters-zone {
        padding: 5px;
        gap: 10px;
    }
    
    .hunter {
        transform: scale(0.9);
    }
    
    /* Карты */
    .hand-zone {
        min-height: 120px;
        padding: 5px;
    }
    
    .hand-cards {
        gap: 0;
    }
    
    .card {
        width: 80px;
        height: 110px;
        margin: 0 -12px;
        font-size: 10px;
    }
    
    .card:hover {
        transform: translateY(-15px) scale(1.05);
    }
    
    .card:active {
        transform: translateY(-10px) scale(1.08);
        z-index: 65;
    }
    
    .card-cost {
        width: 22px;
        height: 22px;
        font-size: 12px;
        top: 4px;
        left: 4px;
    }
    
    .card-character {
        top: 4px;
        right: 4px;
    }

    .card-char-crystal {
        width: 20px;
        height: 20px;
    }
    
    .card-icon-img {
        width: 40px;
        height: 40px;
    }
    
    .card-name {
        font-size: 8px;
        padding: 1px 2px;
        margin-bottom: 0;
    }
    
    .card-desc {
        font-size: 7px;
        padding: 1px 3px;
        line-height: 1.1;
    }
    
    .card-type {
        font-size: 7px;
        padding: 1px 4px;
    }
    
    /* Кнопка завершения */
    .btn-end-turn {
        width: 60px;
        height: 60px;
        font-size: 8px;
        bottom: 130px;
        right: 10px;
    }
    
    /* Колода/сброс */
    .deck-info {
        bottom: 130px;
        left: 10px;
        gap: 5px;
    }
    
    .deck-pile, .discard-pile {
        width: 35px;
        height: 45px;
    }
    
    .pile-icon {
        font-size: 16px;
    }
    
    .pile-count {
        font-size: 10px;
    }
}

/* ========================================
   ПЛАНШЕТ - ПОРТРЕТ (вертикальная, 769–1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) and (pointer: coarse) {
    body {
        overflow: hidden;
    }

    .enemy-turn-text {
        font-size: 36px;
        letter-spacing: 6px;
    }

    /* Меню */
    .title-huntrix {
        font-size: 40px;
    }

    .title-sub {
        font-size: 32px;
        letter-spacing: 3px;
    }

    .menu-characters {
        transform: scale(0.9);
    }

    .menu-buttons button {
        font-size: 18px;
        padding: 16px 30px;
    }

    /* Экран боя */
    #battle-screen {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        height: var(--vh-real, 100dvh);
        overflow: hidden;
    }

    #battle-screen.active {
        display: flex;
    }

    /* Верхняя панель */
    .battle-header {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        padding: 6px 14px 4px;
        gap: 4px;
        flex-shrink: 0;
        position: relative;
        margin-top: 4px;
    }

    .chapter-info {
        position: static;
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: -1;
        margin-bottom: 2px;
    }

    #chapter-name {
        font-size: 22px;
    }

    #battle-count {
        font-size: 14px;
    }

    .player-stats {
        flex: 1;
        min-width: 0;
        width: 100%;
        justify-content: center;
        padding-right: 44px;
        height: 22px;
    }

    .stat-hp {
        flex: 1;
        min-width: 0;
    }

    .btn-menu-small {
        position: absolute;
        right: 10px;
        top: 6px;
        font-size: 22px;
        z-index: 10;
    }

    .btn-menu-small img {
        width: 28px;
        height: 28px;
    }

    /* Враги */
    .enemies-zone {
        flex: 1 1 0;
        min-height: 0;
        padding: 8px 16px;
        flex-wrap: wrap;
        align-items: center;
        align-content: center;
        justify-content: center;
        gap: 12px;
        overflow: hidden;
    }

    .enemy {
        transform: scale(1);
        margin: 0;
    }

    .enemy-body {
        width: 80px;
        height: 95px;
        font-size: 32px;
    }

    .enemy-hp-bar {
        width: 75px;
        height: 7px;
    }

    .enemy-name {
        font-size: 12px;
    }

    .enemy-intent {
        font-size: 14px;
        padding: 2px 5px;
    }

    /* Хонмун */
    .honmun-indicator {
        position: static;
        transform: none;
        flex-shrink: 1;
        margin: 2px auto;
        padding: 4px 14px;
        gap: 6px;
    }

    .honmun-slot {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .honmun-label {
        font-size: 11px;
    }

    /* Охотницы */
    .hunters-zone {
        position: static;
        flex-shrink: 1;
        padding: 4px 14px;
        gap: 20px;
        justify-content: center;
        background: transparent;
    }

    .hunter {
        transform: scale(1);
    }

    .hunter-portrait {
        width: 56px;
        height: 56px;
    }

    .hunter-name {
        font-size: 10px;
        margin-top: 2px;
    }

    /* Карты */
    .hand-zone {
        position: static;
        flex-shrink: 1;
        width: 100%;
        min-height: 0;
        max-height: none;
        padding: 4px 10px 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        background: linear-gradient(to top, var(--bg-dark) 80%, transparent);
        z-index: auto;
    }

    .hand-cards {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-end;
        gap: 6px;
        max-width: 100%;
        padding: 0 10px;
    }

    .card {
        width: 100px;
        height: 138px;
        margin: 0;
        flex-shrink: 0;
        font-size: 11px;
    }

    .card:hover {
        transform: translateY(-8px) scale(1.04);
        z-index: 60;
    }

    .card:active {
        transform: translateY(-6px) scale(1.06);
        z-index: 65;
    }

    .card-cost {
        width: 24px;
        height: 24px;
        font-size: 13px;
        top: 4px;
        left: 4px;
    }

    .card-character {
        font-size: 8px;
        padding: 2px 4px;
        top: 5px;
        right: 5px;
    }

    .card-art {
        font-size: 24px;
        margin: 24px 5px 3px;
        height: 46px;
    }

    .card-icon-img {
        width: 40px;
        height: 40px;
    }

    .card-name {
        font-size: 10px;
        padding: 2px;
    }

    .card-desc {
        font-size: 8px;
        padding: 2px 4px;
        line-height: 1.2;
    }

    .card-type {
        font-size: 7px;
        padding: 2px 5px;
    }

    /* Кнопка завершения хода */
    .btn-end-turn {
        position: fixed;
        bottom: 50%;
        right: 8px;
        width: 54px;
        height: 54px;
        font-size: 9px;
        z-index: 50;
    }

    /* Колода и сброс */
    .deck-info {
        position: fixed;
        left: 6px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        flex-direction: column;
        gap: 4px;
        z-index: 50;
        display: flex;
    }

    .deck-pile, .discard-pile {
        width: 36px;
        height: 44px;
        padding: 4px 6px;
        background: rgba(10, 10, 20, 0.85);
        border: 2px solid rgba(255, 255, 255, 0.15);
    }

    .pile-icon {
        font-size: 16px;
    }

    .pile-count {
        font-size: 11px;
    }

    /* Экраны наград/выбора */
    .reward-container,
    .deck-view-container,
    .relics-container {
        width: 90%;
        max-width: 500px;
        padding: 20px 16px;
    }

    .reward-title {
        font-size: 24px;
    }

    .reward-options {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
        justify-content: center;
        padding: 14px;
    }

    .reward-option {
        width: calc(50% - 14px);
        max-width: 200px;
        min-width: 150px;
    }

    /* Просмотр колоды */
    .deck-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .deck-cards-grid .card {
        width: 110px;
        height: 155px;
        touch-action: pan-y;
        pointer-events: none;
    }

    /* Туториал */
    .tutorial-container {
        width: 88%;
        max-width: 500px;
        padding: 20px 16px;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
    }

    .tutorial-content {
        font-size: 15px;
        line-height: 1.5;
    }

    .tutorial-nav button {
        font-size: 14px;
        padding: 10px 16px;
    }

    /* Пауза */
    .pause-container {
        width: 85%;
        max-width: 420px;
        padding: 24px 18px;
        position: relative;
    }

    .pause-container .btn-close {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .pause-container button:not(.btn-close):not(.btn-icon) {
        width: 100%;
        font-size: 16px;
    }

    /* Главы */
    .chapter-container {
        width: 90%;
        max-width: 480px;
        padding: 20px 14px;
    }

    .chapter-title {
        font-size: 26px;
    }

    /* Game Over / Victory */
    .gameover-container,
    .victory-container {
        width: 90%;
        max-width: 460px;
        padding: 20px 14px;
    }

    .victory-title,
    .gameover-title {
        font-size: 28px;
    }

    .victory-container p,
    .gameover-container p {
        font-size: 15px;
        line-height: 1.5;
    }
}

/* ========================================
   МОБИЛЬНЫЕ - ПОРТРЕТ (вертикальная)
   ======================================== */
@media (max-width: 768px) and (orientation: portrait) and (pointer: coarse) {
    /* Скрываем скролл */
    body {
        overflow: hidden;
    }
    
    /* Надпись "Ход противника" - компактнее */
    .enemy-turn-text {
        font-size: 28px;
        letter-spacing: 4px;
    }
    
    /* Меню */
    .title-huntrix {
        font-size: 30px;
    }
    
    .title-sub {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .menu-characters {
        transform: scale(0.8);
    }
    
    /* ========================================
       ЭКРАН БОЯ - ВЕРТИКАЛЬНАЯ РАСКЛАДКА (FLEX)
       ======================================== */
    #battle-screen {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        height: var(--vh-real, 100dvh);
        overflow: hidden;
    }
    
    #battle-screen.active {
        display: flex;
    }
    
    /* --- 1) ВЕРХНЯЯ ПАНЕЛЬ: глава по центру, кнопка справа, HP ниже --- */
    .battle-header {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        padding: 6px 10px 4px;
        gap: 4px;
        flex-shrink: 0;
        position: relative;
        margin-top: 4px;
    }
    
    .chapter-info {
        position: static;
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: -1;
        margin-bottom: 2px;
    }
    
    #chapter-name {
        font-size: 22px;
    }
    
    #battle-count {
        font-size: 14px;
    }
    
    .player-stats {
        flex: 1;
        min-width: 0;
        width: 100%;
        justify-content: center;
        padding-right: 44px;
    }
    
    .hp-bar {
        width: 100%;
        flex: 1;
        height: 22px;
    }
    
    .stat-hp {
        flex: 1;
        min-width: 0;
    }
    
    .btn-menu-small {
        position: absolute;
        right: 8px;
        top: 6px;
        font-size: 22px;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
    }
    
    .btn-menu-small img {
        width: 28px;
        height: 28px;
    }
    
    /* --- 2) ВРАГИ --- */
    .enemies-zone {
        flex: 1 1 auto;
        min-height: 0;
        padding: 8px 10px;
        flex-wrap: wrap;
        align-items: center;
        align-content: center;
        justify-content: center;
        gap: 10px;
    }
    
    .enemy {
        transform: scale(1);
        margin: 0;
    }
    
    .enemy-body {
        width: 70px;
        height: 85px;
        font-size: 28px;
    }
    
    .enemy-body.boss {
        width: 70px;
        height: 85px;
        font-size: 28px;
    }
    
    .enemy-hp-bar {
        width: 60px;
        height: 7px;
    }
    
    .enemy-intent {
        font-size: 13px;
        padding: 2px 5px;
    }
    
    /* --- 3) ХОНМУН --- */
    .honmun-indicator {
        position: static;
        transform: none;
        flex-shrink: 1;
        margin: 2px auto;
        padding: 4px 14px;
        gap: 6px;
    }

    .honmun-slot {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .honmun-label {
        font-size: 11px;
    }

    /* --- 4) ОХОТНИЦЫ --- */
    .hunters-zone {
        position: static;
        flex-shrink: 1;
        padding: 4px 10px;
        gap: 20px;
        justify-content: center;
        background: transparent;
    }

    .hunter {
        transform: scale(1);
    }

    .hunter-portrait {
        width: 58px;
        height: 58px;
    }

    .hunter-name {
        font-size: 9px;
        margin-top: 3px;
    }

    /* --- 5) КАРТЫ --- */
    .hand-zone {
        position: static;
        flex-shrink: 1;
        width: 100%;
        min-height: 0;
        max-height: none;
        padding: 4px 5px 8px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        background: linear-gradient(to top, var(--bg-dark) 80%, transparent);
        z-index: auto;
    }
    
    .hand-cards {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-end;
        gap: 5px;
        max-width: 100%;
        padding: 0 5px;
    }
    
    .card {
        width: 85px;
        height: 118px;
        margin: 0;
        flex-shrink: 0;
        font-size: 10px;
    }
    
    .card:hover {
        transform: translateY(-6px) scale(1.03);
        z-index: 60;
    }
    
    .card:active {
        transform: translateY(-4px) scale(1.05);
        z-index: 65;
    }
    
    .card-cost {
        width: 22px;
        height: 22px;
        font-size: 12px;
        top: 4px;
        left: 4px;
    }
    
    .card-character {
        top: 5px;
        right: 5px;
    }

    .card-char-crystal {
        width: 22px;
        height: 22px;
    }

    .card-art {
        font-size: 22px;
        margin: 20px 5px 2px;
        height: 44px;
    }
    
    .card-icon-img {
        width: 38px;
        height: 38px;
    }
    
    .card-name {
        font-size: 9px;
        padding: 1px 2px;
        margin-bottom: 0;
    }
    
    .card-desc {
        font-size: 7px;
        padding: 1px 3px;
        line-height: 1.1;
    }
    
    .card-type {
        font-size: 7px;
        padding: 1px 4px;
    }
    
    /* Кнопка завершения хода */
    .btn-end-turn {
        position: fixed;
        bottom: 50%;
        right: 8px;
        width: 50px;
        height: 50px;
        font-size: 8px;
        z-index: 50;
    }
    
    /* --- 6) КОЛОДА И СБРОС: слева, по центру экрана --- */
    .deck-info {
        position: fixed;
        left: 6px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        flex-direction: column;
        gap: 4px;
        z-index: 50;
        display: flex;
    }
    
    .deck-pile, .discard-pile {
        width: 34px;
        height: 42px;
        padding: 4px 6px;
        background: rgba(10, 10, 20, 0.85);
        border: 2px solid rgba(255, 255, 255, 0.15);
    }
    
    .pile-icon {
        font-size: 16px;
    }
    
    .pile-count {
        font-size: 10px;
    }
    
    /* Экраны наград/выбора */
    .reward-container,
    .deck-view-container,
    .relics-container {
        width: 95%;
        max-width: 380px;
        padding: 15px 10px;
    }
    
    .reward-title {
        font-size: 20px;
        line-height: 1.2;
        word-wrap: break-word;
        margin-bottom: 15px;
    }
    
    .reward-options {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        align-items: center;
        padding: 10px;
    }
    
    .reward-option {
        width: calc(50% - 10px);
        max-width: 160px;
        min-width: 130px;
    }
    
    .reward-option.reward-card {
        transform: scale(0.85);
        display: flex;
        justify-content: center;
    }
    
    /* Просмотр колоды */
    .deck-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .deck-cards-grid .card {
        width: 90px;
        height: 125px;
        touch-action: pan-y;
        pointer-events: none;
    }
    
    /* Туториал */
    .tutorial-container {
        width: 92%;
        max-width: 380px;
        padding: 15px 10px;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    .tutorial-content {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .tutorial-nav {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .tutorial-nav button {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* Пауза */
    .pause-container {
        width: 90%;
        max-width: 320px;
        padding: 20px 15px;
        position: relative;
    }
    
    .pause-container .btn-close {
        position: absolute;
        top: 10px;
        right: 10px;
        background: var(--bg-card);
        z-index: 5;
    }
    
    .pause-container button:not(.btn-close):not(.btn-icon) {
        width: 100%;
        font-size: 14px;
    }
    
    /* Главы */
    .chapter-container {
        width: 95%;
        max-width: 380px;
        padding: 15px 10px;
    }
    
    .chapter-title {
        font-size: 22px;
        line-height: 1.2;
        word-wrap: break-word;
        margin-bottom: 15px;
    }
    
    /* Game Over / Victory */
    .gameover-container,
    .victory-container {
        width: 95%;
        max-width: 360px;
        padding: 15px 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .victory-title,
    .gameover-title {
        font-size: 24px;
        line-height: 1.2;
        word-wrap: break-word;
    }
    
    .victory-container p,
    .gameover-container p {
        font-size: 13px;
        line-height: 1.4;
    }
}

/* Очень маленькие экраны (ширина < 380px) */
@media (max-width: 380px) and (orientation: portrait) and (pointer: coarse) {
    #battle-screen {
        height: 100vh;
        height: 100dvh;
        height: var(--vh-real, 100dvh);
    }
    
    .enemies-zone {
        padding: 6px 5px;
    }
    
    .enemy {
        transform: scale(0.9);
    }
    
    .hunter-portrait {
        width: 48px;
        height: 48px;
    }
    
    .hunter-name {
        font-size: 8px;
    }
    
    .hunters-zone {
        gap: 14px;
        padding: 2px 8px;
    }
    
    .honmun-slot {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .card {
        width: 75px;
        height: 105px;
    }
    
    .card-art {
        height: 40px;
        margin: 22px 4px 2px;
    }
    
    .card-icon-img {
        width: 32px;
        height: 32px;
    }
    
    .card-desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 6px;
        padding: 0 3px;
        line-height: 1.1;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 12px;
        flex: 0 0 auto;
    }
    
    .hand-zone {
        padding: 3px 4px 6px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }
    
    .deck-pile, .discard-pile {
        width: 30px;
        height: 38px;
    }
    
    /* Заголовки */
    .reward-title,
    .chapter-title {
        font-size: 18px;
    }
    
    .victory-title,
    .gameover-title {
        font-size: 20px;
    }
}

/* ========================================
   АДАПТАЦИЯ ПО ВЫСОТЕ VIEWPORT (мобильные)
   Когда высота экрана уменьшена из-за
   адресной строки, рекламы или других UI
   ======================================== */

/* Средне-сжатый viewport (≤700px высота, портрет, мобильные) */
@media (max-height: 700px) and (orientation: portrait) and (pointer: coarse) {
    /* --- МЕНЮ --- */
    .menu-container {
        padding: 10px 10px;
    }

    .game-title {
        margin-bottom: 15px;
    }

    .title-huntrix {
        font-size: 24px;
    }

    .title-sub {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .menu-characters {
        margin: 15px 0;
        gap: 15px;
    }

    .char-silhouette {
        width: 70px;
        height: 105px;
    }

    .menu-buttons {
        gap: 8px;
    }

    .menu-buttons button {
        padding: 10px 25px;
        font-size: 14px;
    }

    .audio-controls {
        margin: 8px 0;
    }

    .btn-icon {
        width: 42px;
        height: 42px;
    }

    /* --- БОЙ --- */
    .battle-header {
        padding: 3px 10px 2px;
        gap: 2px;
        margin-top: 2px;
    }

    .chapter-info {
        margin-bottom: 0;
    }

    #chapter-name {
        font-size: 16px;
    }

    #battle-count {
        font-size: 11px;
    }

    .hp-bar {
        height: 18px;
    }

    .hp-text {
        font-size: 10px;
    }

    .stat-energy {
        font-size: 16px;
    }

    .enemies-zone {
        padding: 4px 8px;
        gap: 8px;
    }

    .enemy {
        padding: 4px 6px 6px;
    }

    .enemy-body {
        width: 60px;
        height: 72px;
        font-size: 24px;
    }

    .enemy-body.boss {
        width: 75px;
        height: 88px;
        font-size: 32px;
    }

    .enemy-hp-bar {
        height: 5px;
        margin-top: 3px;
    }

    .enemy-name {
        font-size: 10px;
        margin-top: 3px;
    }

    .enemy-intent {
        font-size: 11px;
        padding: 1px 6px;
        margin-bottom: 3px;
    }

    .honmun-indicator {
        padding: 2px 10px;
        gap: 4px;
        margin: 1px auto;
    }

    .honmun-slot {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .honmun-label {
        font-size: 9px;
        margin-left: 4px;
    }

    .hunters-zone {
        padding: 2px 10px;
        gap: 16px;
    }

    .hunter-portrait {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }

    .hunter-name {
        font-size: 8px;
        margin-top: 2px;
        padding: 1px 6px;
    }

    .hand-zone {
        padding: 2px 5px 4px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }

    .card {
        width: 78px;
        height: 108px;
    }

    .card-art {
        height: 38px;
        margin: 20px 4px 2px;
    }

    .card-icon-img {
        width: 34px;
        height: 34px;
    }

    .card-name {
        font-size: 8px;
    }

    .card-desc {
        font-size: 6px;
        line-height: 1.1;
    }

    .btn-end-turn {
        width: 44px;
        height: 44px;
        font-size: 7px;
    }
}

/* Сильно сжатый viewport (≤580px высота, портрет, мобильные) */
@media (max-height: 580px) and (orientation: portrait) and (pointer: coarse) {
    /* --- МЕНЮ --- */
    .menu-container {
        padding: 6px 8px;
    }

    .game-title {
        margin-bottom: 8px;
    }

    .title-huntrix {
        font-size: 20px;
    }

    .title-sub {
        font-size: 16px;
        letter-spacing: 1px;
        margin-top: 2px;
    }

    .menu-characters {
        margin: 8px 0;
        gap: 10px;
    }

    .char-silhouette {
        width: 55px;
        height: 82px;
        border-radius: 6px;
    }

    .menu-buttons {
        gap: 6px;
    }

    .menu-buttons button {
        padding: 8px 20px;
        font-size: 12px;
    }

    .audio-controls {
        margin: 5px 0;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }

    /* --- БОЙ --- */
    .battle-header {
        padding: 2px 8px 1px;
        gap: 1px;
        margin-top: 0;
    }

    #chapter-name {
        font-size: 13px;
    }

    #battle-count {
        font-size: 10px;
    }

    .hp-bar {
        height: 14px;
    }

    .hp-text {
        font-size: 9px;
    }

    .stat-energy {
        font-size: 14px;
        padding: 1px 6px;
    }

    .player-stats {
        padding: 3px 8px;
        gap: 6px;
    }

    .enemies-zone {
        padding: 2px 6px;
        gap: 6px;
    }

    .enemy {
        padding: 3px 5px 5px;
        border-width: 2px;
        border-radius: 10px;
    }

    .enemy-body {
        width: 50px;
        height: 60px;
        font-size: 20px;
        border-radius: 8px;
    }

    .enemy-body.boss {
        width: 65px;
        height: 75px;
        font-size: 28px;
    }

    .enemy-hp-bar {
        height: 4px;
        margin-top: 2px;
    }

    .enemy-name {
        font-size: 9px;
        margin-top: 2px;
    }

    .enemy-intent {
        font-size: 10px;
        padding: 1px 4px;
        margin-bottom: 2px;
    }

    .honmun-indicator {
        padding: 1px 8px;
        gap: 3px;
        margin: 0 auto;
        border-width: 1px;
    }

    .honmun-slot {
        width: 22px;
        height: 22px;
        font-size: 9px;
        border-width: 1px;
    }

    .honmun-label {
        font-size: 8px;
    }

    .hunters-zone {
        padding: 1px 8px;
        gap: 12px;
    }

    .hunter-portrait {
        width: 36px;
        height: 36px;
        border-width: 2px;
    }

    .hunter-name {
        font-size: 7px;
        margin-top: 1px;
        padding: 0 4px;
    }

    .hand-zone {
        padding: 1px 4px 3px;
        padding-bottom: max(3px, env(safe-area-inset-bottom));
    }

    .hand-cards {
        gap: 3px;
    }

    .card {
        width: 68px;
        height: 94px;
    }

    .card-cost {
        width: 18px;
        height: 18px;
        font-size: 10px;
        top: 3px;
        left: 3px;
    }

    .card-character {
        top: 3px;
        right: 3px;
    }

    .card-char-crystal {
        width: 16px;
        height: 16px;
    }

    .card-art {
        height: 32px;
        margin: 16px 3px 1px;
    }

    .card-icon-img {
        width: 28px;
        height: 28px;
    }

    .card-name {
        font-size: 7px;
        padding: 1px 2px;
    }

    .card-desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 5px;
        padding: 0 2px;
        line-height: 1.1;
        min-height: 10px;
        flex: 0 0 auto;
    }

    .card-type {
        font-size: 6px;
        padding: 1px 3px;
    }

    .btn-end-turn {
        width: 38px;
        height: 38px;
        font-size: 6px;
        right: 5px;
    }

    .deck-pile, .discard-pile {
        width: 28px;
        height: 34px;
        padding: 2px 4px;
    }

    .pile-icon {
        font-size: 14px;
    }

    .pile-count {
        font-size: 8px;
    }
}

/* Критически сжатый viewport (≤480px высота, портрет, мобильные) */
@media (max-height: 480px) and (orientation: portrait) and (pointer: coarse) {
    /* --- МЕНЮ --- */
    .menu-container {
        padding: 4px 6px;
    }

    .game-title {
        margin-bottom: 4px;
    }

    .title-huntrix {
        font-size: 16px;
    }

    .title-sub {
        font-size: 13px;
        letter-spacing: 1px;
        margin-top: 1px;
    }

    .menu-characters {
        margin: 4px 0;
        gap: 8px;
    }

    .char-silhouette {
        width: 40px;
        height: 60px;
        border-radius: 4px;
    }

    .menu-buttons {
        gap: 4px;
    }

    .menu-buttons button {
        padding: 6px 15px;
        font-size: 10px;
    }

    .audio-controls {
        margin: 3px 0;
    }

    .btn-icon {
        width: 30px;
        height: 30px;
    }

    /* --- БОЙ --- */
    .battle-header {
        padding: 1px 6px 0;
    }

    .chapter-info {
        display: none;
    }

    .hp-bar {
        height: 12px;
    }

    .enemies-zone {
        padding: 2px 4px;
        gap: 4px;
    }

    .enemy-body {
        width: 44px;
        height: 52px;
        font-size: 18px;
    }

    .enemy-body.boss {
        width: 56px;
        height: 64px;
        font-size: 24px;
    }

    .enemy-name {
        display: none;
    }

    .honmun-indicator {
        padding: 0 6px;
    }

    .honmun-slot {
        width: 18px;
        height: 18px;
        font-size: 8px;
    }

    .honmun-label {
        display: none;
    }

    .hunters-zone {
        padding: 0 6px;
        gap: 10px;
    }

    .hunter-portrait {
        width: 28px;
        height: 28px;
    }

    .hunter-name {
        display: none;
    }

    .card {
        width: 60px;
        height: 82px;
    }

    .card-art {
        height: 26px;
        margin: 14px 2px 1px;
    }

    .card-icon-img {
        width: 22px;
        height: 22px;
    }

    .card-name {
        font-size: 6px;
    }

    .card-type {
        display: none;
    }
}

/* Адаптация по высоте для ландшафта на мобильных */
@media (max-height: 400px) and (orientation: landscape) and (pointer: coarse) {
    .enemies-zone {
        padding: 2px 5px;
        min-height: 60px;
    }

    .enemy {
        transform: scale(0.6);
        margin: 0 -15px;
    }

    .honmun-indicator {
        transform: scale(0.6);
        margin: 0;
    }

    .hunters-zone {
        padding: 2px;
        gap: 5px;
    }

    .hunter {
        transform: scale(0.7);
    }

    .hand-zone {
        min-height: 90px;
        padding: 2px;
    }

    .card {
        width: 65px;
        height: 90px;
        margin: 0 -14px;
    }

    .btn-end-turn {
        width: 45px;
        height: 45px;
        font-size: 7px;
        bottom: 100px;
        right: 5px;
    }
}

/* ========================================
   АУДИО КОНТРОЛИ
   ======================================== */

.audio-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.btn-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--primary);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.btn-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.btn-icon:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}
