:root {
    --bg-dark: #07090e;
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.45);
    --crimson: #ef4444;
    --crimson-glow: rgba(239, 68, 68, 0.45);
    --blue: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.45);
    --green: #10b981;
    --purple: #8b5cf6;
    --panel-bg: rgba(15, 23, 42, 0.92);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Fullscreen Single-Panel Center Layout */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #0f172a 0%, #030712 100%);
    overflow: hidden;
}

/* Center Section: Playable Game Arena (Default 20:9 Ultra HD Screen Ratio) */
.center-game-section {
    flex: 1;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* In-Menu Active Battle Loadout Preview Widget */
.menu-loadout-preview-box {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 6px;
}

.menu-loadout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-loadout-title {
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 0.05em;
}

.edit-loadout-btn {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-loadout-btn:hover {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.menu-loadout-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.menu-slot-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    position: relative;
    cursor: pointer;
    min-width: 0;
    width: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-slot-card:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.menu-slot-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #2563eb;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
}

.menu-slot-icon {
    font-size: 1.5rem;
    margin-top: 6px;
}

.menu-slot-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.menu-slot-name {
    font-size: 0.76rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-slot-desc {
    font-size: 0.66rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-slot-edit-btn {
    display: none;
}

.loadout-btn {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(30, 58, 138, 0.3)) !important;
    border: 1px solid #3b82f6 !important;
    color: #93c5fd !important;
}

.loadout-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4) !important;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    overflow: hidden;
    background: #090d16;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    container-type: inline-size;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    image-rendering: auto;
    image-rendering: smooth;
}

/* Glass UI Box */
.glass-box {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    backdrop-filter: blur(16px);
}

/* Top In-Game HUD */
.hud-overlay, #hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: max(clamp(6px, 1.5cqw, 16px), env(safe-area-inset-top, 6px));
    padding-bottom: max(clamp(6px, 1.5cqw, 16px), env(safe-area-inset-bottom, 6px));
    padding-left: max(clamp(8px, 2cqw, 24px), env(safe-area-inset-left, 8px));
    padding-right: max(clamp(8px, 2cqw, 24px), env(safe-area-inset-right, 8px));
    z-index: 20;
}

.hud-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(6px, 1.5cqw, 20px);
    width: 100%;
}

/* Player Cards (P1 & P2) */
.player-hud {
    width: clamp(110px, 34cqw, 200px);
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: clamp(8px, 1.2cqw, 14px);
    padding: clamp(4px, 0.8cqw, 8px) clamp(6px, 1.2cqw, 10px);
    display: flex;
    flex-direction: column;
    gap: clamp(2px, 0.5cqw, 5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    pointer-events: auto;
}

.p1-hud {
    border-left: 4px solid var(--blue);
}

.p2-hud {
    border-right: 4px solid var(--crimson);
}

.player-hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-title {
    font-size: clamp(0.65rem, 1.1cqw, 0.9rem);
    font-weight: 800;
    letter-spacing: 1px;
}

.p1-title {
    color: #60a5fa;
}

.p2-title {
    color: #f87171;
}

.player-hp-num {
    font-size: clamp(0.65rem, 1cqw, 0.85rem);
    font-weight: 800;
    color: #ffffff;
}

.bar-shell {
    position: relative;
    width: 100%;
    height: clamp(8px, 1.2cqw, 14px);
    background: rgba(0, 0, 0, 0.65);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stamina-shell {
    height: clamp(5px, 0.8cqw, 8px);
    border-radius: 4px;
}

.bar-core {
    height: 100%;
    transition: width 0.12s ease-out;
    border-radius: 7px;
}

.p1-hp-core {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.p2-hp-core {
    background: linear-gradient(90deg, #dc2626, #f87171);
    box-shadow: 0 0 10px var(--crimson-glow);
}

.stamina-core {
    background: linear-gradient(90deg, #059669, #34d399);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

/* Castle Fortification Bar */
.castle-hud-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.castle-header {
    display: flex;
    justify-content: space-between;
    font-size: clamp(0.6rem, 0.9cqw, 0.75rem);
    font-weight: 800;
}

.castle-title {
    color: #fbbf24;
    letter-spacing: 0.8px;
}

.castle-val {
    color: #e2e8f0;
}

.castle-shell {
    height: clamp(6px, 1cqw, 10px);
    border-radius: 5px;
    border-color: rgba(245, 158, 11, 0.4);
}

.castle-core {
    background: linear-gradient(90deg, #d97706, #fbbf24);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* Center HUD Info */
.hud-center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1px, 0.4cqw, 4px);
    flex: 1;
    max-width: clamp(120px, 28cqw, 380px);
}

.wave-badge, .pvp-badge {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.35);
    padding: clamp(2px, 0.4cqw, 5px) clamp(6px, 1.2cqw, 16px);
    border-radius: clamp(4px, 0.8cqw, 10px);
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.6cqw, 8px);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.badge-label {
    font-size: clamp(0.55rem, 0.85cqw, 0.8rem);
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.badge-val {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.75rem, 1.3cqw, 1.3rem);
    font-weight: 900;
    color: #fbbf24;
}

.stats-row {
    display: flex;
    gap: clamp(3px, 0.8cqw, 10px);
}

.stat-pill {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: clamp(2px, 0.4cqw, 3px) clamp(6px, 1cqw, 12px);
    border-radius: 8px;
    font-size: clamp(0.65rem, 1cqw, 0.9rem);
    font-weight: 700;
}

.stat-pill strong {
    color: #fff;
}

/* Boss Bar */
.boss-bar-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(24, 10, 36, 0.9);
    border: 1px solid rgba(236, 72, 153, 0.4);
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.25);
}

.boss-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 800;
}

.boss-name {
    font-family: 'Cinzel', serif;
    color: #f472b6;
    letter-spacing: 2px;
}

.boss-val {
    color: #fff;
}

.boss-core {
    background: linear-gradient(90deg, #9333ea, #ec4899);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.7);
}

/* Bottom Arrow Dock */
.hud-bottom-bar {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 6px;
}

.mobile-jump-btn {
    display: none;
    position: absolute;
    bottom: clamp(10px, 2.5cqw, 24px);
    left: clamp(10px, 2.5cqw, 24px);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1.5px solid #60a5fa;
    border-radius: 12px;
    padding: clamp(8px, 1.5cqw, 12px) clamp(12px, 2cqw, 18px);
    color: #ffffff;
    font-size: clamp(0.78rem, 1.2cqw, 0.95rem);
    font-weight: 800;
    font-family: 'Rajdhani', sans-serif;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
    touch-action: manipulation;
    pointer-events: auto;
    z-index: 50;
    user-select: none;
    -webkit-user-select: none;
}

@media (hover: none), (max-width: 900px) {
    .mobile-jump-btn {
        display: inline-flex !important;
    }
}

.is-portrait .mobile-jump-btn {
    display: inline-flex !important;
}

.arrow-dock {
    position: absolute;
    bottom: clamp(10px, 2.5cqw, 24px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: clamp(10px, 2cqw, 18px);
    padding: clamp(6px, 1.2cqw, 10px) clamp(8px, 1.8cqw, 16px);
    display: flex;
    gap: clamp(6px, 1.5cqw, 14px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.7);
    pointer-events: auto;
    overflow: visible;
}

.arrow-slot {
    position: relative;
    width: clamp(42px, 10cqw, 60px);
    height: clamp(42px, 10cqw, 60px);
    background: rgba(30, 41, 59, 0.88);
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-radius: clamp(8px, 1.6cqw, 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.arrow-slot-emoji {
    font-size: clamp(1.4rem, 5cqw, 2rem);
    pointer-events: none;
    line-height: 1;
}

.arrow-slot:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--gold);
}

.arrow-slot.active {
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.28);
    box-shadow: 0 0 15px var(--gold-glow);
    transform: translateY(-3px) scale(1.08);
}

.arrow-key-hint {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: clamp(0.52rem, 0.85cqw, 0.68rem);
    font-weight: 800;
    color: var(--text-muted);
    pointer-events: none;
}

/* Controls Top Right */
.top-actions {
    position: absolute;
    top: clamp(6px, 1.5cqw, 16px);
    right: clamp(8px, 2cqw, 24px);
    display: flex;
    gap: clamp(4px, 0.8cqw, 8px);
    pointer-events: auto;
}

.ctrl-btn {
    width: clamp(28px, 4cqw, 40px);
    height: clamp(28px, 4cqw, 40px);
    border-radius: clamp(6px, 1cqw, 10px);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: clamp(0.8rem, 1.4cqw, 1.1rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Watermark */
.in-game-watermark {
    position: absolute;
    bottom: clamp(6px, 1.5cqw, 12px);
    left: clamp(8px, 2cqw, 20px);
    font-size: clamp(0.6rem, 0.9cqw, 0.82rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.in-game-watermark strong {
    color: rgba(251, 191, 36, 0.85);
}

.heart-pulse {
    color: #ef4444;
    display: inline-block;
    animation: heartPulse 1.4s ease-in-out infinite;
}

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

/* Modal Overlays */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 14, 0.82);
    backdrop-filter: blur(12px);
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.22s ease-out;
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.global-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    display: none !important;
    pointer-events: none !important;
}

.global-modal.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-overlay.hidden,
.modal-overlay:not(.active),
.global-modal:not(.active),
.hidden {
    display: none !important;
    pointer-events: none !important;
}

/* MAIN MENU CARD - DYNAMIC ADAPTIVE DASHBOARD (WIDESCREEN 16:9 & PORTRAIT 9:16) */
.menu-card {
    width: min(94vw, 1080px);
    max-width: 96%;
    max-height: 94vh;
    padding: clamp(14px, 2vw, 24px) clamp(16px, 2.5vw, 30px);
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: clamp(14px, 2vw, 24px);
    align-items: center;
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(245, 158, 11, 0.2);
    backdrop-filter: blur(16px);
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-left-col {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vw, 14px);
    text-align: left;
    justify-content: center;
    min-width: 0;
}

.menu-right-col {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.4vw, 16px);
    justify-content: center;
    min-width: 0;
}

.title-logo {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.4rem, 2.8vw, 2.3rem);
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

.gold-text {
    color: #f59e0b;
    text-shadow: 0 0 25px var(--gold-glow);
}

.tagline {
    font-size: clamp(0.68rem, 1vw, 0.82rem);
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 0;
}

/* 4 EXPANDED GAME MODE BUTTONS */
.mode-selection-grid, .mode-selection-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 1.2vw, 12px);
}

.mode-btn {
    position: relative;
    border: none;
    border-radius: 12px;
    padding: clamp(10px, 1.4vw, 16px) clamp(12px, 1.6vw, 18px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.2vw, 14px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    text-align: left;
    min-width: 0;
}

/* On Mobile Portrait Screens */
body.is-portrait .menu-card {
    width: clamp(280px, 94vw, 520px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    max-height: 96vh;
}

@media (max-width: 820px) {
    .menu-card {
        width: clamp(280px, 94vw, 520px);
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
        max-height: 96vh;
    }
    .title-logo {
        text-align: center;
        font-size: clamp(1.3rem, 5vw, 1.9rem);
    }
    .tagline {
        text-align: center;
    }
    .mode-selection-grid, .mode-selection-grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .mode-btn {
        padding: 8px 10px;
        gap: 8px;
    }
}

/* Pre-Game 3-Arrow Loadout Selection */
.loadout-selection-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.loadout-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.loadout-title {
    font-family: 'Cinzel', serif;
    font-size: 0.96rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 0.5px;
}

.loadout-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
}

.loadout-slots-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.loadout-slot-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.loadout-slot-card:hover {
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.loadout-slot-badge {
    font-size: 0.66rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.loadout-slot-icon {
    font-size: 1.5rem;
}

.loadout-slot-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    color: #f8fafc;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.loadout-slot-action {
    font-size: 0.66rem;
    font-weight: 800;
    color: #38bdf8;
}

.mode-btn-icon {
    font-size: clamp(1.4rem, 4cqw, 1.9rem);
    line-height: 1;
}

.mode-btn-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.mode-btn-title {
    font-size: clamp(0.85rem, 2.5cqw, 1.05rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mode-btn-desc {
    font-size: clamp(0.62rem, 1.6cqw, 0.72rem);
    font-weight: 600;
    opacity: 0.82;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mode-arrow-badge {
    display: none;
}

.btn-campaign {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border: 1px solid rgba(248, 113, 113, 0.4);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

.btn-campaign:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.6);
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-pvp {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-pvp:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6);
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* Secondary Buttons */
.menu-sub-row {
    display: flex;
    gap: clamp(6px, 1cqw, 12px);
}

.sub-btn {
    flex: 1;
    border: none;
    border-radius: clamp(6px, 1cqw, 10px);
    padding: clamp(8px, 1.2cqw, 12px) clamp(6px, 1cqw, 10px);
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(0.78rem, 1.2cqw, 0.98rem);
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 0.6cqw, 8px);
    color: #fff;
    transition: all 0.18s ease;
}

.shop-btn {
    background: linear-gradient(135deg, #d97706, #b45309);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    color: #ffffff;
}

.shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--gold-glow);
}

.leaderboard-btn {
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    border: 1px solid rgba(167, 139, 250, 0.45);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
    color: #ffffff;
}

.leaderboard-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #5b21b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.55);
}

.info-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.info-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    transform: translateY(-2px);
}

/* Menu Footer */
.menu-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: clamp(6px, 1cqw, 10px);
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.6cqw, 6px);
}

.stat-summary {
    display: flex;
    justify-content: space-between;
    font-size: clamp(0.72rem, 1cqw, 0.86rem);
    color: var(--text-muted);
}

.stat-summary strong {
    color: #fff;
}

.credits-badge {
    font-size: clamp(0.68rem, 0.95cqw, 0.82rem);
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.credits-badge strong {
    color: #fbbf24;
}

.game-version-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: clamp(0.64rem, 0.9cqw, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.6px;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.18);
    font-family: 'Rajdhani', sans-serif;
}

@container (max-width: 768px) {
    .menu-card {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 12px 14px !important;
        text-align: center;
        max-height: 92dvh !important;
    }
    .menu-left-col {
        text-align: center;
        gap: 6px;
    }
    .user-profile-bar {
        justify-content: center;
    }
    .credits-badge {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .menu-card {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 12px 14px !important;
        max-height: 92dvh !important;
    }
    .menu-left-col {
        text-align: center;
        gap: 6px;
    }
    .user-profile-bar {
        justify-content: center;
    }
    .credits-badge {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.is-portrait .menu-card {
    grid-template-columns: 1fr !important;
    max-height: 92dvh !important;
}

/* Modal Boxes & Forms */
.shop-card {
    width: clamp(300px, 94vw, 680px);
    max-width: 96%;
    max-height: 92dvh;
    padding: clamp(12px, 2.5vw, 22px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.controls-box, .gameover-card, .dialog-box, .perk-card-box, .leaderboard-card {
    width: clamp(280px, 92vw, 640px);
    max-width: 96%;
    max-height: 92dvh;
    padding: clamp(12px, 2.5vw, 22px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.modal-top h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #ffffff;
}

.close-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.close-icon-btn:hover {
    color: #fff;
}

.shop-tabs {
    display: flex;
    gap: 10px;
}

.tab-button {
    flex: 1;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.tab-button.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 800;
}

.shop-body {
    flex: 1;
    overflow-y: auto;
    max-height: 62vh;
    padding-right: 8px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.upgrades-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.upgrade-entry {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-icon {
    font-size: 1.8rem;
}

.dots-holder {
    display: flex;
    gap: 3px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
}

.dot.lit {
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold);
}

.entry-name {
    font-size: 1.1rem;
    font-weight: 800;
}

.entry-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    flex: 1;
}

/* Shop Level Banner */
.shop-level-banner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.level-banner-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.level-badge {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 1px;
}

.level-sub-desc {
    font-size: 0.84rem;
    color: #94a3b8;
    font-weight: 600;
}

.level-progress-shell {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    overflow: hidden;
}

.level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d97706, #fbbf24);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    transition: width 0.3s ease;
}

/* Defense and Level Badges */
.defense-badge {
    font-size: 0.76rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.badge-gray {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border-color: rgba(100, 116, 139, 0.3);
}

.active-gear {
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.unlocked-arrow-card {
    border-color: rgba(16, 185, 129, 0.35);
}

.locked-card {
    opacity: 0.7;
}

.gear-status-notice {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-align: center;
}

.gear-status-notice.locked {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.gear-status-notice.active {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.gear-status-notice.upgrade {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.gear-status-notice.destroyed {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.gear-status-notice.not-enough-gold {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
    font-size: 0.72rem;
    line-height: 1.25;
    font-style: italic;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

.armory-columns-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 768px) {
    .armory-columns-layout {
        grid-template-columns: 1fr;
    }
}

.armory-section-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.armory-section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    padding-bottom: 10px;
}

.armory-sec-title {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 0.5px;
}

.armory-section-hint {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 600;
}

.armory-items-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.arrows-50-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.gold-btn.disabled-btn,
.gold-btn:disabled,
button:disabled {
    opacity: 0.42 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.85) !important;
    background: #334155 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
    transform: none !important;
    color: #94a3b8 !important;
    pointer-events: none !important;
}

.stat-power-val {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: #38bdf8;
}

.stat-free-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.primary-btn, .secondary-btn, .gold-btn, .danger-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s ease;
    color: #ffffff;
}

.primary-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.gold-btn {
    background: linear-gradient(135deg, #d97706, #b45309);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.danger-btn {
    background: rgba(153, 27, 27, 0.8);
}

.dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Perks Row & 5-Rewards Choice System */
.perk-card-box {
    max-width: 980px;
    width: 94%;
}

.perk-counter-badge {
    color: #fbbf24;
    font-weight: 800;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 3px 10px;
    border-radius: 8px;
    letter-spacing: 1px;
}

.perks-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 14px;
}

@media (max-width: 900px) {
    .perks-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 580px) {
    .perks-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.perk-pick-card {
    background: rgba(30, 27, 75, 0.85);
    border: 2px solid rgba(139, 92, 246, 0.35);
    border-radius: 14px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.perk-pick-card:hover {
    transform: translateY(-6px) scale(1.04);
    border-color: #c084fc;
    box-shadow: 0 10px 30px rgba(192, 132, 252, 0.4);
}

.perk-pick-card.claimed {
    background: rgba(6, 78, 59, 0.92);
    border-color: #10b981;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
    pointer-events: none;
    transform: scale(0.96);
    opacity: 0.9;
}

.perk-pick-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.perk-pick-name {
    font-size: 1.02rem;
    font-weight: 800;
    color: #fff;
}

.perk-pick-desc {
    font-size: 0.78rem;
    color: #c4b5fd;
    line-height: 1.3;
    text-align: center;
    flex: 1;
}

.perk-select-hint {
    font-size: 0.72rem;
    font-weight: 800;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.perk-claimed-badge {
    font-size: 0.75rem;
    font-weight: 900;
    color: #ffffff;
    background: #10b981;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

/* Controls Guide Modal */
.controls-body {
    overflow-y: auto;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-item {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
}

.guide-item h3 {
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 6px;
}

.guide-item p, .guide-item li {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.guide-item ul {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

/* Combat Banner */
.banner-container {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.combat-banner {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    padding: 8px 26px;
    border-radius: 10px;
    animation: bannerPop 1.2s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.banner-headshot {
    color: #fee2e2;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.9), transparent);
    border-top: 2px solid #f87171;
    border-bottom: 2px solid #f87171;
}

.banner-wave {
    color: #fef08a;
    background: linear-gradient(90deg, transparent, rgba(202, 138, 4, 0.9), transparent);
    border-top: 2px solid #fbbf24;
    border-bottom: 2px solid #fbbf24;
}

@keyframes bannerPop {
    0% { opacity: 0; transform: scale(0.6) translateY(20px); }
    15% { opacity: 1; transform: scale(1.1) translateY(0); }
    30% { transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9) translateY(-20px); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .title-logo {
        font-size: 2rem;
    }
    .hud-top-bar {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    .player-hud {
        width: 100%;
        max-width: 320px;
    }
    .perks-row {
        grid-template-columns: 1fr;
    }
}

/* User Profile Header Bar */
.user-profile-bar {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: clamp(6px, 1cqw, 10px) clamp(8px, 1.4cqw, 14px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    gap: 8px;
}

.user-profile-info {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1cqw, 10px);
}

.user-avatar {
    font-size: clamp(1.2rem, 2cqw, 1.6rem);
}

.user-text-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fbbf24;
}

.user-status {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.green {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.status-dot.yellow {
    background: #f59e0b;
}

.auth-btn {
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-btn:hover {
    background: #2563eb;
    color: #fff;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

.logout-btn:hover {
    background: #dc2626;
    color: #fff;
}

/* Auth Modal */
.auth-card {
    width: 90%;
    max-width: 480px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
}

.auth-tab-btn {
    flex: 1;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.auth-tab-btn.active {
    background: var(--blue);
    color: #fff;
    border-color: #60a5fa;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.form-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.avatar-select-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.avatar-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.avatar-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.avatar-btn.selected {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 800;
}

.auth-banner {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.auth-banner.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
}

.auth-banner.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #f87171;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.auth-submit-btn {
    flex: 2;
}

/* Online Room Lobby */
.room-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.room-action-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.room-action-box h3 {
    font-size: 1.1rem;
    color: var(--gold);
}

.room-sub-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.room-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.room-divider::before, .room-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.room-divider span {
    padding: 0 10px;
}

.created-room-details {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.room-code-display-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 10px;
}

.room-code-display-wrap:hover .room-code-badge {
    transform: scale(1.04);
    background: rgba(245, 158, 11, 0.18);
    border-color: #fef08a;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
}

.room-code-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
}

.room-code-badge {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 15px var(--gold-glow);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.room-code-badge:active {
    transform: scale(0.96) !important;
}

.room-code-badge.copied {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6) !important;
}

.room-code-hint {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    margin-top: -4px;
    margin-bottom: 2px;
    transition: color 0.2s ease;
}

.room-share-btns {
    display: flex;
    gap: 8px;
    width: 100%;
}

.waiting-indicator {
    font-size: 0.88rem;
    font-weight: 700;
    color: #38bdf8;
    animation: waitingBlink 1.5s ease-in-out infinite;
}

@keyframes waitingBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =========================================================================
   GLOBAL LEADERBOARD MODAL STYLES
   ========================================================================= */
.leaderboard-card {
    width: 92%;
    max-width: 820px;
    max-height: 88vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(245, 158, 11, 0.2);
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-row .modal-icon {
    font-size: 1.8rem;
}

.modal-title-row h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 0.06em;
}

.leaderboard-subtitle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.6);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.refresh-btn {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #f59e0b;
    color: #000;
    box-shadow: 0 0 12px var(--gold-glow);
}

.leaderboard-table-wrap {
    overflow-y: auto;
    max-height: 52vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.7);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    background: rgba(30, 41, 59, 0.95);
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.95rem;
    font-weight: 700;
    vertical-align: middle;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.leaderboard-table tr.my-rank-row {
    background: rgba(245, 158, 11, 0.16);
    border-left: 4px solid #f59e0b;
}

.leaderboard-player-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar-icon {
    font-size: 1.3rem;
}

.player-name-text {
    font-weight: 800;
    color: #f8fafc;
}

.you-tag {
    font-size: 0.75rem;
    color: #fbbf24;
    font-weight: 900;
    background: rgba(245, 158, 11, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.rank-badge {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 0.95rem;
}

.rank-badge.rank-1 {
    color: #fbbf24;
    font-size: 1.15rem;
}

.rank-badge.rank-2 {
    color: #cbd5e1;
    font-size: 1.1rem;
}

.rank-badge.rank-3 {
    color: #d97706;
    font-size: 1.05rem;
}

.kills-val {
    color: #ef4444;
    font-size: 1.1rem;
    font-weight: 900;
}

.wave-val {
    color: #38bdf8;
    font-weight: 800;
}

.gold-val {
    color: #fbbf24;
    font-weight: 800;
}

.leaderboard-loading-state {
    padding: 30px;
    text-align: center;
    color: #38bdf8;
    font-weight: 800;
    font-size: 1.05rem;
}

/* =========================================================================
   RESPONSIVE DESIGN (Desktop, Tablets & Mobile Layouts)
   ========================================================================= */
/* =========================================================================
   GLOBAL MODALS (Fixed Screen Overlays)
   ========================================================================= */
.global-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(16px);
    pointer-events: none !important;
}

.global-modal.active {
    display: flex !important;
    pointer-events: auto !important;
}

.global-modal.hidden,
.global-modal:not(.active) {
    display: none !important;
    pointer-events: none !important;
}

/* =========================================================================
   TOP ACTIVE LOADOUT SUMMARY IN PICKER MODAL (Requirement 3)
   ========================================================================= */
.picker-card-expanded {
    width: 94%;
    max-width: 980px;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 20px;
}

.picker-top-summary-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.picker-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.picker-summary-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 0.05em;
}

.picker-summary-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
}

.picker-top-slots-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.picker-top-slot-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s ease;
}

.picker-top-slot-card.active-target-slot {
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.picker-top-slot-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.picker-top-slot-badge {
    font-size: 0.72rem;
    font-weight: 900;
    padding: 2px 6px;
    background: #3b82f6;
    border-radius: 4px;
    color: #fff;
    flex-shrink: 0;
}

.picker-top-slot-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.picker-top-slot-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.picker-top-slot-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-slot-edit {
    font-size: 0.72rem;
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.btn-slot-remove {
    font-size: 0.72rem;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.picker-arsenal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.arsenal-sub-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 900;
    color: #f8fafc;
}

.arsenal-sub-hint {
    font-size: 0.78rem;
    color: #38bdf8;
    font-weight: 700;
}

.picker-body-scroll {
    overflow-y: auto;
    max-height: 52vh;
    padding-right: 6px;
}

/* =========================================================================
   ARROW DETAIL & POWERS MODAL (Requirement 4)
   ========================================================================= */
.detail-card {
    width: 92%;
    max-width: 580px;
    max-height: 88vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 20px;
    border: 2px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 158, 11, 0.2);
    overflow-y: auto;
}

.detail-icon-big {
    font-size: 2.4rem;
}

.detail-name-big {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: #fbbf24;
    margin: 0;
}

.detail-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.6);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.detail-stat-label {
    color: #94a3b8;
    font-weight: 700;
}

.detail-stat-val {
    color: #f8fafc;
    font-weight: 900;
}

.detail-power-box {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-box-title {
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #fbbf24;
    text-transform: uppercase;
}

.detail-power-text, .detail-bonus-text, .detail-tactics-text {
    font-size: 0.88rem;
    line-height: 1.35;
    color: #e2e8f0;
    margin: 0;
}

.bonus-box {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(30, 58, 138, 0.25);
}

.bonus-box .detail-box-title {
    color: #60a5fa;
}

.tactics-box {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(6, 78, 59, 0.25);
}

.tactics-box .detail-box-title {
    color: #34d399;
}

.detail-actions-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.btn-detail-equip {
    padding: 10px;
    font-size: 0.82rem;
    font-weight: 900;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

/* =========================================================================
   ARSENAL & LOADOUT CARD COLOR CORRECTIONS
   ========================================================================= */
.btn-info-detail {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(15, 23, 42, 0.98)) !important;
    border: 1px solid rgba(96, 165, 250, 0.6) !important;
    color: #93c5fd !important;
    font-weight: 900 !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 6px 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.18s ease !important;
}

.btn-info-detail:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
    border-color: #93c5fd !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.6) !important;
    transform: translateY(-1px);
}

.tag-unlocked {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    color: #34d399 !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    letter-spacing: 0.5px !important;
}

.tag-locked {
    background: rgba(245, 158, 11, 0.18) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    letter-spacing: 0.5px !important;
}

.arrow-card-perk-pill {
    font-size: 0.74rem;
    color: #93c5fd;
    background: rgba(15, 23, 42, 0.85);
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.45);
    margin-top: 4px;
    line-height: 1.3;
    font-weight: 600;
}

button.disabled-btn,
button:disabled {
    opacity: 0.75 !important;
    cursor: not-allowed !important;
    filter: none !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #94a3b8 !important;
    font-weight: 800 !important;
}

button.primary-btn.disabled-btn {
    background: linear-gradient(135deg, #15803d, #166534) !important;
    border: 1px solid #22c55e !important;
    color: #dcfce7 !important;
    opacity: 1 !important;
    cursor: default !important;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.35) !important;
}

/* =========================================================================
   DESKTOP FLOATING HOVER TOOLTIP (Requirement 4)
   ========================================================================= */
.arrow-tooltip-box {
    position: fixed;
    z-index: 100000;
    pointer-events: none !important;
    max-width: min(260px, 85vw);
    background: rgba(15, 23, 42, 0.97);
    border: 1.5px solid #f59e0b;
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(245, 158, 11, 0.35);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: opacity 0.15s ease;
}

.tooltip-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.tooltip-icon {
    font-size: 1.4rem;
}

.tooltip-name {
    font-family: 'Cinzel', serif;
    font-size: 0.92rem;
    font-weight: 900;
    color: #fbbf24;
}

.tooltip-cat {
    font-size: 0.68rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 800;
}

.tooltip-power {
    font-size: 0.8rem;
    color: #e2e8f0;
    line-height: 1.25;
}

.tooltip-bonus {
    font-size: 0.75rem;
    color: #60a5fa;
    line-height: 1.25;
    background: rgba(30, 58, 138, 0.3);
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tooltip-tactics {
    font-size: 0.72rem;
    color: #34d399;
    font-style: italic;
}

/* =========================================================================
   RESPONSIVE DESIGN (Desktop, Tablets & 20:9 Mobile Screen Layouts)
/* =========================================================================
   RESPONSIVE DESIGN (Desktop, Tablets & Mobile Screen Layouts)
   ========================================================================= */
@media (max-width: 980px) {
    .modal-overlay, .global-modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 99999 !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 12px 8px !important;
        background: rgba(3, 7, 18, 0.94) !important;
    }

    .modal-overlay:not(.active),
    .global-modal:not(.active),
    .modal-overlay.hidden,
    .global-modal.hidden {
        display: none !important;
        pointer-events: none !important;
    }

    .modal-overlay.active,
    .global-modal.active {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .menu-card {
        grid-template-columns: 1fr !important;
        padding: 16px 12px !important;
        max-width: 96% !important;
        width: 96% !important;
        max-height: 94vh !important;
        height: auto !important;
        overflow-y: auto !important;
        gap: 12px !important;
    }

    .menu-right-col {
        order: 1 !important;
        gap: 10px !important;
    }

    .mode-btn {
        padding: 14px 16px !important;
        font-size: 1rem !important;
    }

    .mode-btn-title {
        font-size: 1.15rem !important;
    }

    .menu-left-col {
        order: 2 !important;
        text-align: center !important;
        gap: 8px !important;
    }

    .user-profile-bar {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .menu-sub-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .sub-btn {
        padding: 10px 6px !important;
        font-size: 0.78rem !important;
    }

    .mobile-jump-btn {
        display: inline-flex !important;
        bottom: 3px !important;
        left: 4px !important;
        padding: 4px 8px !important;
        font-size: 0.68rem !important;
        border-radius: 6px !important;
        gap: 3px !important;
    }

    /* Micro HUD for Mobile Screens */
    .hud-top-bar {
        padding: 3px 6px !important;
    }

    .player-hud {
        padding: 3px 6px !important;
        min-width: 0 !important;
        max-width: 125px !important;
        border-radius: 6px !important;
        background: rgba(15, 23, 42, 0.85) !important;
        gap: 1px !important;
    }

    .player-title {
        font-size: 0.58rem !important;
    }

    .player-hp-num {
        font-size: 0.58rem !important;
    }

    .bar-shell {
        height: 4px !important;
        border-radius: 3px !important;
    }

    .castle-hud-wrap {
        margin-top: 1px !important;
        padding-top: 1px !important;
    }

    .castle-header {
        font-size: 0.52rem !important;
    }

    .castle-val {
        font-size: 0.52rem !important;
    }

    .hud-center-info {
        gap: 1px !important;
        max-width: 110px !important;
    }

    .wave-badge, .pvp-badge {
        padding: 1px 6px !important;
        font-size: 0.65rem !important;
        border-radius: 4px !important;
    }

    .badge-label {
        font-size: 0.55rem !important;
    }

    .badge-val {
        font-size: 0.65rem !important;
    }

    .stats-row {
        gap: 3px !important;
    }

    .stat-pill {
        padding: 1px 4px !important;
        font-size: 0.6rem !important;
        border-radius: 4px !important;
    }

    .top-actions {
        top: 3px !important;
        right: 3px !important;
        gap: 3px !important;
    }

    .ctrl-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.72rem !important;
        border-radius: 6px !important;
    }

    .hud-bottom-bar {
        margin-bottom: 2px !important;
    }

    .arrow-dock {
        bottom: 3px !important;
        padding: 2px 5px !important;
        border-radius: 8px !important;
        gap: 4px !important;
    }

    .arrow-slot {
        width: 32px !important;
        height: 32px !important;
        border-radius: 6px !important;
        font-size: 1rem !important;
    }

    .arrow-slot-num {
        font-size: 0.5rem !important;
        top: 1px !important;
        left: 2px !important;
    }

    .in-game-watermark {
        display: none !important;
    }

    .picker-top-slots-row {
        grid-template-columns: 1fr !important;
    }

    .detail-actions-row {
        grid-template-columns: 1fr !important;
    }

    /* While Playing on Mobile: Hide Side Panels for 100% Focused Screen */
    body.is-playing .side-panel {
        display: none !important;
    }

    body.is-playing .app-layout {
        padding: 2px 2px !important;
        gap: 0 !important;
    }

    body.is-playing .center-game-section {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.is-playing #game-container {
        width: 100% !important;
        aspect-ratio: 20 / 9 !important;
        border-radius: 8px !important;
    }
}

@media (max-width: 600px) {
    .app-layout {
        padding: 4px !important;
        gap: 8px !important;
    }

    #game-container {
        width: 100% !important;
        aspect-ratio: 20 / 9 !important;
        border-radius: 8px !important;
    }

    #gameCanvas {
        aspect-ratio: 20 / 9 !important;
    }

    .side-panel {
        padding: 12px 10px !important;
    }

    .menu-card {
        padding: 14px 10px !important;
        max-width: 98% !important;
    }

    .title-logo {
        font-size: 1.35rem !important;
    }
}

/* Landscape Mode on 20:9 Mobile Phones */
@media (max-height: 600px) and (orientation: landscape) {
    body, html {
        overflow: hidden !important;
        height: 100vh !important;
        width: 100vw !important;
    }

    .app-layout {
        padding: 0 !important;
        gap: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
        flex-direction: row !important;
    }

    .side-panel {
        display: none !important; /* Fullscreen 20:9 immersion in landscape */
    }

    .center-game-section {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        padding: 0 !important;
    }

    #game-container {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        aspect-ratio: 20 / 9 !important;
        border-radius: 0 !important;
        border: none !important;
    }
}

/* ==========================================================================
   SUPREME GOD-MODE OWNER CONSOLE & ADMIN MANAGEMENT STYLING
   ========================================================================== */

.god-mode-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #0f172a !important;
    font-weight: 900 !important;
    border: 1.5px solid #fef08a !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.45) !important;
    animation: pulse-gold 2s infinite ease-in-out;
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 14px rgba(245, 158, 11, 0.35); }
    50% { box-shadow: 0 0 24px rgba(245, 158, 11, 0.75); }
}

.owner-tag {
    background: #f59e0b;
    color: #0f172a;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.status-dot.gold {
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
}

.owner-console-card {
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 2px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 40px rgba(245, 158, 11, 0.2);
    overflow: hidden;
}

.owner-title-badge {
    display: flex;
    align-items: center;
    gap: 14px;
}

.owner-crown-icon {
    font-size: 2.4rem;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.owner-title-text h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #fbbf24;
    letter-spacing: 0.05em;
    margin: 0;
}

.owner-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 700;
}

.god-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.god-tab-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.god-tab-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fff;
}

.god-tab-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    border-color: #fef08a;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.god-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.god-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.god-panel.hidden {
    display: none !important;
}

.god-panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.god-search-input {
    max-width: 320px;
    padding: 8px 12px;
}

.god-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 480px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.god-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    text-align: left;
}

.god-table th {
    background: rgba(15, 23, 42, 0.95);
    padding: 12px 14px;
    color: #fbbf24;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(245, 158, 11, 0.3);
    position: sticky;
    top: 0;
    z-index: 5;
}

.god-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.god-table tr:hover {
    background: rgba(30, 41, 59, 0.5);
}

.god-badge-status {
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.74rem;
    display: inline-block;
}

.god-badge-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #10b981;
}

.god-badge-status.banned {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border: 1px solid #ef4444;
}

.god-badge-status.owner {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border: 1px solid #f59e0b;
}

.god-actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.god-act-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.god-act-btn.ban {
    background: #ef4444;
    color: #fff;
}
.god-act-btn.unban {
    background: #10b981;
    color: #fff;
}
.god-act-btn.del {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #dc2626;
}
.god-act-btn.edit {
    background: #3b82f6;
    color: #fff;
}

.god-act-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
}

.god-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.god-metric-card {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.god-card-icon {
    font-size: 2rem;
}

.god-card-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fbbf24;
    font-family: 'Cinzel', serif;
}

.god-card-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.god-broadcast-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.god-textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.god-select {
    padding: 8px 12px;
}

.god-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.god-room-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.god-room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
}

.god-room-badge {
    background: #2563eb;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.76rem;
}

/* =========================================================================
   4 EXPANDED GAME MODES, WIND INDICATOR, EMOTES, MASTERIES & SCORECARD
   ========================================================================= */

.mode-selection-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.btn-survival {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.65), rgba(69, 10, 10, 0.85)) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.btn-survival:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.45) !important;
}

.btn-target {
    background: linear-gradient(135deg, rgba(161, 98, 7, 0.65), rgba(113, 63, 18, 0.85)) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

.btn-target:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.45) !important;
}

/* Wind Indicator Pill in HUD */
.wind-pill {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Emote Trigger & Popup */
.emote-trigger-btn {
    position: absolute;
    bottom: clamp(10px, 2.5cqw, 24px);
    right: clamp(10px, 2.5cqw, 24px);
    background: rgba(30, 41, 59, 0.88);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: clamp(8px, 1.5cqw, 12px) clamp(10px, 2cqw, 16px);
    border-radius: 12px;
    font-weight: 800;
    font-size: clamp(0.74rem, 1.1cqw, 0.88rem);
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    touch-action: manipulation;
    pointer-events: auto;
    z-index: 50;
    user-select: none;
    -webkit-user-select: none;
}

.emote-trigger-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #38bdf8;
}

.emote-popup {
    position: absolute;
    bottom: clamp(55px, 8cqw, 75px);
    right: clamp(10px, 2.5cqw, 24px);
    background: rgba(15, 23, 42, 0.96);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.emote-option-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.emote-option-btn:hover {
    background: #2563eb;
    color: #fff;
    border-color: #60a5fa;
}

/* Comprehensive Post-Match Scorecard */
.scorecard-box {
    max-width: 540px !important;
    text-align: center;
    padding: 24px 20px !important;
}

.scorecard-header {
    margin-bottom: 16px;
}

.scorecard-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    display: inline-block;
    margin-bottom: 6px;
}

.scorecard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0 22px 0;
}

.score-stat-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.score-stat-icon {
    font-size: 1.4rem;
}

.score-stat-lbl {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.score-stat-val {
    font-size: 1.4rem;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Cinzel', serif;
}

.scorecard-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Masteries Grid */
.masteries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 10px 0;
}

.mastery-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mastery-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mastery-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #fbbf24;
}

.mastery-level-badge {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

.mastery-desc {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.3;
}

/* Skins & Bows Grids */
.skins-bows-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skins-heading {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: #fbbf24;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.skins-grid, .bows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.cosmetic-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cosmetic-card:hover {
    border-color: #fbbf24;
    transform: translateY(-2px);
}

.cosmetic-card.equipped {
    border-color: #34d399;
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.35);
}

.cosmetic-icon {
    font-size: 2rem;
}

.cosmetic-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: #f8fafc;
}

.cosmetic-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.25;
}

/* Daily Bounties */
.bounties-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.bounty-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bounty-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bounty-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: #f8fafc;
}

.bounty-progress-text {
    font-size: 0.76rem;
    color: #94a3b8;
}

.bounty-reward {
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.85rem;
}

@media (max-width: 980px) {
    .mode-selection-grid-4 {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================================
   DEFENSE ARMORY (HELMETS & SHIELDS)
   ========================================================================= */
.defense-armory-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.defense-section {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 14px;
    padding: 16px;
}

.defense-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 1px;
    margin: 0 0 4px 0;
}

.defense-sub {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 12px 0;
}

.defense-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .defense-grid {
        grid-template-columns: 1fr;
    }
}

.defense-item-card {
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.defense-item-card:hover {
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.defense-item-card.equipped {
    border-color: #10b981;
    background: rgba(6, 78, 59, 0.35);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.defense-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.defense-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.defense-meta {
    display: flex;
    flex-direction: column;
}

.defense-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f8fafc;
}

.defense-tier-badge {
    font-size: 0.7rem;
    font-weight: 900;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    margin-top: 2px;
}

.defense-desc {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.35;
    flex: 1;
}

.defense-stat-row {
    background: rgba(15, 23, 42, 0.75);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}


