/* ═══════════════════════════════════════════════════
   OW ADVISOR — Dark Slate + Orange Accent Theme
   Palette:
     ow-darker:      #0F172A  (body bg — deep slate)
     ow-dark:        #1E293B  (header bg — slate-800)
     ow-card:        #003e8e  (card bg — dark blue-gray)
     ow-card-hover:  #0052a3  (hover)
     ow-accent:      #F99E1A  (orange accent)
     ow-orange:      #F99E1A  (CTA + links + highlights)
   Text hierarchy:
     primary:   #FFFFFF  (headings, bright text)
     secondary: #E8EDF4  (body text)
     tertiary:  #D0DCE8  (labels, captions)
     faint:     #B8CCE0  (muted info)
   ═══════════════════════════════════════════════════ */

/* ─── Sticky Footer ─── */
body {
    display: flex;
    flex-direction: column;
    background: radial-gradient(50% 252.84% at 50% 49.94%, #c0cce2 7.27%, #d7e4f5 100%);
}
#app {
    flex: 1 0 auto;
    width: 100%;
}

/* ─── Header ─── */
.ow-header {
    background: rgba(229, 235, 244, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ─── Navigation ─── */
.nav-link {
    color: #334155;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    position: relative;
}
.nav-link:hover {
    color: #0F172A;
    background: rgba(0, 0, 0, 0.05);
}
.nav-link.active {
    color: #0F172A;
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #F99E1A;
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(249, 158, 26, 0.4);
}

/* ─── Mobile Menu Overlay ─── */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 60, 130, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 40;
    overflow-y: auto;
    padding-top: 56px;
}
#mobile-menu .nav-link {
    width: 100%;
    padding: 12px 16px;
    border-radius: 0;
    font-size: 1.2rem;
    color: #E8EDF4;
}
#mobile-menu .nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}
#mobile-menu .nav-link.active::after {
    display: none;
}
#mobile-menu .nav-link.active {
    color: #FFFFFF;
    border-left: 3px solid #F99E1A;
    background: rgba(249, 158, 26, 0.08);
}

/* ─── OW Panels / Cards ─── */
.ow-panel {
    background: rgba(0, 62, 142, 0.85);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 12px;
    color: #E8EDF4;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(51, 65, 85, 0.15) inset;
}

.ow-card {
    background: #003e8e;
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 10px;
    color: #E8EDF4;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
/* Ensure text is readable inside dark-bg Tailwind utilities */
.bg-ow-card,
.bg-ow-dark,
.bg-ow-darker {
    color: #E8EDF4;
}
.ow-card:hover {
    background: #0052a3;
    border-color: rgba(51, 65, 85, 0.6);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

/* ─── Section Headers ─── */
.ow-section-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1E293B;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.2);
    position: relative;
}
.ow-section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: #F99E1A;
    box-shadow: 0 0 6px rgba(249, 158, 26, 0.4);
}

/* ─── Buttons ─── */
.ow-btn {
    background: #e65d0f;
    color: #FFFFFF;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(249, 158, 26, 0.25);
}
.ow-btn:hover {
    background: #FFB340;
    box-shadow: 0 4px 20px rgba(249, 158, 26, 0.35);
    transform: translateY(-1px);
}
.ow-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(249, 158, 26, 0.2);
}
.ow-btn:focus-visible {
    outline: 2px solid #F99E1A;
    outline-offset: 2px;
}

.ow-btn-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: #334155;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.ow-btn-secondary:hover {
    background: rgba(100, 116, 139, 0.2);
    color: #1E293B;
    border-color: rgba(100, 116, 139, 0.4);
}
.ow-btn-secondary.active {
    background: rgba(249, 158, 26, 0.12);
    color: #B45309;
    border-color: rgba(180, 83, 9, 0.5);
    box-shadow: 0 0 12px rgba(180, 83, 9, 0.08);
}
.ow-btn-secondary:focus-visible {
    outline: 2px solid rgba(180, 83, 9, 0.6);
    outline-offset: 1px;
}
/* Dark container override: restore orange text for ow-btn-secondary inside cards */
.bg-ow-card .ow-btn-secondary,
.ow-card .ow-btn-secondary {
    color: #E8EDF4;
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.06);
}
.bg-ow-card .ow-btn-secondary:hover,
.ow-card .ow-btn-secondary:hover {
    color: #FFFFFF;
    border-color: rgba(148, 163, 184, 0.5);
    background: rgba(255, 255, 255, 0.1);
}
.bg-ow-card .ow-btn-secondary.active,
.ow-card .ow-btn-secondary.active {
    color: #F99E1A;
    border-color: rgba(249, 158, 26, 0.5);
    background: rgba(249, 158, 26, 0.12);
}

/* ─── Role Filter Buttons (solid fill) ─── */
.role-filter-btn {
    cursor: pointer;
    transition: all 0.2s;
}
.role-filter-btn.active,
.ban-role-btn.active,
.rec-ban-role-btn.active,
.rec-enemy-role-btn.active {
    box-shadow: 0 0 0 2px rgba(249, 158, 26, 0.8);
}

/* ─── Map Buttons (thumbnail cards) ─── */
.map-btn {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #1E293B;
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    padding: 0;
}
.map-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
    pointer-events: none;
    transition: background 0.2s;
}
.map-btn:hover {
    border-color: rgba(148, 163, 184, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.map-btn:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.05) 60%, transparent 100%);
}
.map-btn:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: 2px;
}
.map-btn.active {
    border-color: #F99E1A;
    box-shadow: 0 0 16px rgba(249, 158, 26, 0.3), inset 0 0 0 1px rgba(249, 158, 26, 0.2);
}
.map-btn.active::before {
    background: linear-gradient(to top, rgba(180,83,9,0.5) 0%, rgba(0,0,0,0.05) 60%, transparent 100%);
}
.map-btn-label {
    position: relative;
    z-index: 1;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    padding: 6px 10px;
    line-height: 1.2;
}

/* ─── Hero Grid ─── */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
    overflow: hidden;
    min-width: 0;
}
@media (max-width: 374px) {
    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
        gap: 4px;
    }
}
@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}
.hero-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    font-size: 10px;
    text-align: center;
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.15);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    overflow: hidden;
    color: #334155;
}
.hero-portrait {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
    border: 2px solid rgba(100, 116, 139, 0.25);
    transition: border-color 0.15s, box-shadow 0.15s;
}
#ban-list .hero-portrait,
#rec-ban-list .hero-portrait,
#rec-enemy-hero-list .hero-portrait,
#rec-wild-list .hero-portrait {
    width: 20px;
    height: 20px;
    border-width: 1px;
}
.hero-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}
.hero-btn:hover {
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(100, 116, 139, 0.15);
    color: #1E293B;
}
/* Hero buttons inside dark containers (ow-card) need light text */
.bg-ow-card .hero-btn,
.ow-card .hero-btn {
    color: #E8EDF4;
    background: rgba(255, 255, 255, 0.06);
}
.bg-ow-card .hero-btn:hover,
.ow-card .hero-btn:hover {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.12);
    color: #FFFFFF;
}
.hero-btn:hover .hero-portrait {
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.2);
}
.hero-btn:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: 1px;
}
.hero-btn.selected {
    border-color: #F99E1A;
    background: rgba(249, 158, 26, 0.15);
    box-shadow: 0 0 16px rgba(249, 158, 26, 0.15);
    color: #92400E;
}
.bg-ow-card .hero-btn.selected,
.ow-card .hero-btn.selected {
    color: #FFFFFF;
}
.hero-btn.selected .hero-portrait {
    border-color: #F99E1A;
    box-shadow: 0 0 8px rgba(249, 158, 26, 0.2);
}
.hero-btn.banned {
    opacity: 0.3;
    text-decoration: line-through;
}

/* ─── Role Badges ─── */
.role-tank { color: #60A5FA; }
.role-damage { color: #F87171; }
.role-support { color: #4ADE80; }

/* ─── Record Submit Bar (sticky bottom) ─── */
.record-submit-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(229, 235, 244, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 0;
}

/* ─── Result Buttons ─── */
.result-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    color: #334155;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s;
}
.result-btn:hover {
    border-color: rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.08);
}
.result-btn:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: 1px;
}
.result-btn.active-W {
    border-color: #16A34A;
    background: rgba(34, 197, 94, 0.15);
    color: #15803D;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.15);
}
.result-btn.active-L {
    border-color: #DC2626;
    background: rgba(239, 68, 68, 0.15);
    color: #B91C1C;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
}
.result-btn.active-D {
    border-color: #475569;
    background: rgba(90, 131, 159, 0.12);
    color: #334155;
}

/* ─── Breakdown Bars ─── */
.breakdown-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); position: relative; overflow: hidden; }
.breakdown-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.breakdown-bar-baseline { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.3); }

/* ─── Score Confidence ─── */
.conf-low { color: #F87171; }
.conf-mid { color: #FBBF24; }
.conf-high { color: #4ADE80; }

/* ─── Side Tabs ─── */
.side-tab {
    padding: 6px 16px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-bottom: none;
    transition: all 0.2s;
}
.side-tab:hover {
    color: #1E293B;
    background: rgba(100, 116, 139, 0.15);
}
.side-tab.active {
    background: #003e8e;
    color: #FFFFFF;
    font-weight: 600;
    border-color: rgba(51, 65, 85, 0.4);
}
.side-tab:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: 1px;
}

/* ─── Stats Tab Container (scrollable on mobile) ─── */
.stats-tab-container {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
}

/* ─── Stats Tab Buttons ─── */
.stats-tab {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.25);
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.stats-tab:hover {
    color: #1E293B;
    border-color: rgba(100, 116, 139, 0.4);
    background: rgba(100, 116, 139, 0.1);
}
.stats-tab.active {
    background: rgba(249, 158, 26, 0.15);
    color: #B45309;
    border-color: rgba(180, 83, 9, 0.45);
    box-shadow: 0 0 10px rgba(180, 83, 9, 0.12);
}
.stats-tab:focus-visible {
    outline: 2px solid rgba(180, 83, 9, 0.6);
    outline-offset: 1px;
}

/* ─── Match Card (Dashboard) ─── */
.match-card {
    text-decoration: none;
    color: #E8EDF4;
    background: #003e8e;
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-left: 3px solid transparent;
    border-radius: 10px;
    transition: all 0.25s;
    cursor: pointer;
}
.match-card:hover {
    background: #0052a3;
    border-left-color: rgba(148, 163, 184, 0.35);
    transform: translateX(2px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.match-card:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: 1px;
}
.match-card-win { border-left-color: #22C55E; }
.match-card-win:hover { border-left-color: #4ADE80; }
.match-card-loss { border-left-color: #EF4444; }
.match-card-loss:hover { border-left-color: #F87171; }
.match-card-draw { border-left-color: #5A839F; }
.match-card-draw:hover { border-left-color: #7A9DBF; }

/* ─── Hero Display (Detail, Read-only) ─── */
.hero-display {
    display: flex;
    justify-content: safe center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
}
@media (min-width: 768px) {
    .hero-display {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        overflow-x: visible;
        padding-bottom: 0;
    }
}
.hero-display-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
    width: 90px;
    min-width: 90px;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .hero-display-item {
        width: auto;
        min-width: 0;
        flex-shrink: 1;
    }
}
.hero-display-item .hero-portrait {
    width: 48px;
    height: 48px;
}
@media (max-width: 767px) {
    .hero-display-item .hero-portrait {
        width: 40px;
        height: 40px;
    }
}
/* Prevent role badge text from wrapping on narrow screens */
.hero-display-item .rounded {
    white-space: nowrap;
}
/* Truncate hero name and player name on narrow items */
.hero-display-item > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}



/* ─── Toast Notifications ─── */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 100;
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.toast-success {
    background: rgba(22, 101, 52, 0.9);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.toast-error {
    background: rgba(127, 29, 29, 0.9);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

/* ─── Win/Loss Colors ─── */
.text-win { color: #4ADE80; }
.text-loss { color: #F87171; }
.text-draw { color: #D0DCE8; }

/* ─── Form Inputs ─── */
select, input[type="text"], input[type="password"], input[type="number"] {
    background: #1E293B;
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 8px;
    color: #E8EDF4;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
select:hover, input[type="text"]:hover, input[type="password"]:hover, input[type="number"]:hover {
    border-color: rgba(148, 163, 184, 0.35);
    background: #1a2e44;
}
select:focus, input:focus {
    border-color: rgba(249, 158, 26, 0.5);
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 158, 26, 0.15);
    background: #1a2e44;
}

/* ─── Checkbox Accent ─── */
input[type="checkbox"] {
    accent-color: #F99E1A;
}


/* ─── Progress Bar ─── */
.ow-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.ow-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.ow-progress-fill-green {
    background: linear-gradient(90deg, #22C55E, #4ADE80);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.25);
}
.ow-progress-fill-red {
    background: linear-gradient(90deg, #EF4444, #F87171);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

/* ─── Responsive Utilities ─── */
@media (min-width: 768px) {
    .ow-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .ow-grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
    }
}
@media (min-width: 1024px) {
    .ow-grid-2-lg {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* ─── Theory Document ─── */
.theory-doc {
    font-size: 0.875rem;
    line-height: 1.75;
    color: #E8EDF4;
}
.theory-doc h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.theory-doc h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}
.theory-doc h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #E8EDF4;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.theory-doc h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #D0DCE8;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.theory-doc p {
    margin-bottom: 0.75rem;
}
.theory-doc ul, .theory-doc ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}
.theory-doc li {
    margin-bottom: 0.25rem;
}
.theory-doc ul { list-style-type: disc; }
.theory-doc ol { list-style-type: decimal; }
.theory-doc strong {
    color: #FFFFFF;
    font-weight: 600;
}
.theory-doc code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
    color: #FFB84D;
}
.theory-doc table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.theory-doc th {
    background: rgba(0, 0, 0, 0.15);
    color: #FFFFFF;
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(51, 65, 85, 0.3);
}
.theory-doc td {
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(51, 65, 85, 0.2);
}
.theory-doc tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.08);
}
.theory-doc hr {
    border: none;
    border-top: 1px solid rgba(51, 65, 85, 0.3);
    margin: 1.5rem 0;
}
.theory-doc blockquote {
    border-left: 3px solid rgba(249, 158, 26, 0.5);
    padding-left: 1rem;
    color: #D0DCE8;
    margin: 1rem 0;
}
.theory-doc .katex-display {
    overflow-x: auto;
    padding: 0.5rem 0;
}
.theory-doc a {
    color: #F99E1A;
    text-decoration: underline;
    text-decoration-color: rgba(249, 158, 26, 0.3);
}

/* ─── Details / FAQ ─── */
details {
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}
details:hover {
    border-color: rgba(51, 65, 85, 0.5);
}
details[open] {
    border-color: rgba(51, 65, 85, 0.5);
    background: rgba(0, 0, 0, 0.08);
}
details[open].bg-ow-card {
    background: #003e8e;
}
details summary {
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s, background 0.2s;
    border-radius: 8px;
    user-select: none;
}
details summary::-webkit-details-marker {
    display: none;
}
details summary::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid rgba(184, 204, 224, 0.35);
    border-bottom: 2px solid rgba(184, 204, 224, 0.35);
    transform: rotate(-45deg);
    transition: transform 0.2s, border-color 0.2s;
    flex-shrink: 0;
    margin-top: -2px;
}
details[open] summary::before {
    transform: rotate(45deg);
    border-color: #F99E1A;
    margin-top: 0;
}
details summary:hover {
    background: rgba(184, 204, 224, 0.04);
}
details[open] summary {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 8px 8px 0 0;
}
details > :not(summary) {
    padding: 0 14px;
}
details > :last-child {
    padding-bottom: 12px;
}
details summary:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: -2px;
}

/* ─── Guide page details overrides (within .bg-ow-card context) ─── */
.bg-ow-card > details,
.space-y-4 details {
    border-color: transparent;
    background: transparent;
}
.bg-ow-card > details:hover,
.space-y-4 details:hover {
    border-color: transparent;
}
.bg-ow-card > details[open],
.space-y-4 details[open] {
    border-color: transparent;
    background: transparent;
}
.bg-ow-card > details summary,
.space-y-4 details summary {
    padding: 6px 0;
}
.bg-ow-card > details[open] summary,
.space-y-4 details[open] summary {
    border-bottom: none;
    border-radius: 0;
}
.bg-ow-card > details > :not(summary),
.space-y-4 details > :not(summary) {
    padding: 0;
}
.bg-ow-card > details > :last-child,
.space-y-4 details > :last-child {
    padding-bottom: 0;
}

/* ─── Link Styles ─── */
a:focus-visible {
    outline: 2px solid rgba(249, 158, 26, 0.6);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ─── Selection ─── */
::selection {
    background: rgba(249, 158, 26, 0.35);
    color: #fff;
}

/* ─── Team Section Distinction ─── */
.team-section {
    border-left: 4px solid transparent;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.team-section--ally {
    background: rgba(0, 77, 167, 0.08);
    border-left-color: #0076d1;
}
.team-section--enemy {
    background: rgba(239, 68, 68, 0.06);
    border-left-color: #EF4444;
}
.team-section__header {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.team-section--ally .team-section__header {
    color: #0076d1;
}
.team-section--enemy .team-section__header {
    color: #B91C1C;
}

/* ─── Auth Tab Buttons ─── */
.auth-tab-btn {
    color: #B8CCE0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab-btn:hover {
    color: #E8EDF4;
}
.auth-tab-btn.active {
    color: #F99E1A;
    border-bottom-color: #F99E1A;
}

/* ─── Landing Dark Section ─── */
.landing-dark-section {
    background: #004da7;
    color: #E8EDF4;
}

/* ─── Footer ─── */
.ow-footer {
    background: radial-gradient(50% 252.84% at 50% 49.94%, #242a42 7.27%, #121524 100%);
    color: #E8EDF4;
}

/* ─── Disabled / Loading States ─── */
button:disabled,
button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Recommend Fullscreen Loader ─── */
#recommend-loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(10, 20, 40, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
#recommend-loader .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(184, 204, 224, 0.15);
    border-top-color: #F99E1A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
#recommend-loader .loader-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    color: #E8EDF4;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Cookie Consent Banner ─── */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(249, 158, 26, 0.25);
    color: #E8EDF4;
    animation: fadeInUp 0.4s ease;
}

/* ─── Mobile Responsive Fixes (320px-375px) ─── */
@media (max-width: 480px) {
    /* 1. hero-grid: tighter columns on narrow screens so 4 columns fit at 320px */
    .hero-grid {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
        gap: 4px;
    }
    .hero-btn {
        padding: 4px 1px;
        font-size: 9px;
    }
    .hero-grid .hero-portrait {
        width: 36px;
        height: 36px;
    }

    /* 2. team-section: reduce padding on small screens */
    .team-section {
        padding: 0.75rem;
    }

    /* 3. ow-section-title: scale down heading */
    .ow-section-title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    /* 4. theory-doc tables: prevent overflow on narrow screens */
    .theory-doc table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 5. theory-doc: tighter internal spacing */
    .theory-doc h1 {
        font-size: 1.25rem;
    }
    .theory-doc h2 {
        font-size: 1.1rem;
    }

    /* 6. result-btn / side-tab: smaller touch targets that still fit */
    .result-btn {
        padding: 6px 12px;
        font-size: 1rem;
    }
    .side-tab {
        padding: 5px 12px;
        font-size: 0.9rem;
    }

    /* 7. map-btn: smaller label on mobile */
    .map-btn-label {
        font-size: 0.95rem;
        padding: 4px 8px;
    }
}
