/* ==========================================================================
   PRIPOVEDI — Design System & Theming
   Luxury Minimalist Interactive Fiction Platform
   ========================================================================== */

:root {
    /* DEFAULT THEME: CELESTIAL SAPPHIRE & ROYAL SLATE */
    --bg-base: #080c14;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #16213b;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(22, 33, 59, 0.92);
    --bg-glass: rgba(11, 18, 33, 0.88);
    --bg-glass-heavy: rgba(8, 12, 20, 0.96);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(59, 130, 246, 0.40);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #60a5fa;
    --text-inverse: #080c14;

    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-secondary: #38bdf8;
    --accent-glow: rgba(59, 130, 246, 0.22);
    --accent-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0.03) 100%);

    --hero-overlay-start: rgba(8, 12, 20, 0.95);
    --hero-overlay-mid: rgba(8, 12, 20, 0.75);
    --hero-overlay-end: rgba(8, 12, 20, 0.35);

    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #38bdf8;

    --header-height: 72px;
    --max-content-width: 1240px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --font-sans: 'Google Sans', 'Google Sans Text', 'Product Sans', 'Inter', 'Trebuchet MS', 'Segoe UI', sans-serif;
    --font-display: 'Google Sans', 'Google Sans Display', 'Product Sans', 'Inter', 'Franklin Gothic Medium', 'Trebuchet MS', sans-serif;
    --font-story: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    --font-story-read: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.55);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* THEME: ZINC MODERN (Shadcn Dark Minimalist) */
[data-theme="zinc"] {
    --bg-base: #09090b;
    --bg-surface: #121215;
    --bg-surface-elevated: #18181b;
    --bg-card: rgba(24, 24, 27, 0.75);
    --bg-card-hover: rgba(39, 39, 42, 0.90);
    --bg-glass: rgba(18, 18, 21, 0.90);
    --bg-glass-heavy: rgba(9, 9, 11, 0.97);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(250, 250, 250, 0.40);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-accent: #f4f4f5;
    --text-inverse: #09090b;
    --accent-primary: #fafafa;
    --accent-primary-hover: #e4e4e7;
    --accent-secondary: #a1a1aa;
    --accent-glow: rgba(250, 250, 250, 0.16);
    --accent-gradient: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(250, 250, 250, 0.12) 0%, rgba(250, 250, 250, 0.02) 100%);
    --hero-overlay-start: rgba(9, 9, 11, 0.96);
    --hero-overlay-mid: rgba(9, 9, 11, 0.78);
    --hero-overlay-end: rgba(9, 9, 11, 0.38);
}

/* THEME: OBSIDIAN ROSE (Žametna noč) */
[data-theme="rose"] {
    --bg-base: #0c0609;
    --bg-surface: #170b12;
    --bg-surface-elevated: #24111d;
    --bg-card: rgba(26, 14, 22, 0.70);
    --bg-card-hover: rgba(38, 20, 32, 0.90);
    --bg-glass: rgba(18, 9, 15, 0.88);
    --bg-glass-heavy: rgba(12, 6, 9, 0.97);
    --border-subtle: rgba(244, 63, 94, 0.12);
    --border-medium: rgba(244, 63, 94, 0.22);
    --border-accent: rgba(244, 63, 94, 0.45);
    --text-primary: #fff1f2;
    --text-secondary: #fecdd3;
    --text-muted: #fda4af;
    --text-accent: #fb7185;
    --text-inverse: #0c0609;
    --accent-primary: #f43f5e;
    --accent-primary-hover: #e11d48;
    --accent-secondary: #fb7185;
    --accent-glow: rgba(244, 63, 94, 0.22);
    --accent-gradient: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(244, 63, 94, 0.14) 0%, rgba(244, 63, 94, 0.03) 100%);
    --hero-overlay-start: rgba(12, 6, 9, 0.96);
    --hero-overlay-mid: rgba(12, 6, 9, 0.78);
    --hero-overlay-end: rgba(12, 6, 9, 0.38);
}

/* THEME 2: MIDNIGHT EMERALD */
[data-theme="emerald"] {
    --bg-base: #050b08;
    --bg-surface: #0a1410;
    --bg-surface-elevated: #101e18;
    --bg-card: rgba(12, 24, 18, 0.65);
    --bg-card-hover: rgba(18, 34, 26, 0.88);
    --bg-glass: rgba(8, 16, 12, 0.85);
    --border-accent: rgba(16, 185, 129, 0.35);
    --text-accent: #34d399;
    --accent-primary: #10b981;
    --accent-primary-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.18);
    --accent-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.03) 100%);
    --hero-overlay-start: rgba(5, 11, 8, 0.95);
    --hero-overlay-mid: rgba(5, 11, 8, 0.75);
    --hero-overlay-end: rgba(5, 11, 8, 0.35);
}

/* THEME 3: ROYAL AMETHYST */
[data-theme="amethyst"] {
    --bg-base: #090610;
    --bg-surface: #100b1d;
    --bg-surface-elevated: #181229;
    --bg-card: rgba(18, 13, 31, 0.65);
    --bg-card-hover: rgba(26, 19, 43, 0.88);
    --bg-glass: rgba(12, 8, 21, 0.85);
    --border-accent: rgba(168, 85, 247, 0.35);
    --text-accent: #c084fc;
    --accent-primary: #a855f7;
    --accent-primary-hover: #7e22ce;
    --accent-glow: rgba(168, 85, 247, 0.18);
    --accent-gradient: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(168, 85, 247, 0.03) 100%);
    --hero-overlay-start: rgba(9, 6, 16, 0.95);
    --hero-overlay-mid: rgba(9, 6, 16, 0.75);
    --hero-overlay-end: rgba(9, 6, 16, 0.35);
}

/* THEME 4: CYBER SLATE */
[data-theme="cyber"] {
    --bg-base: #080d16;
    --bg-surface: #0e1624;
    --bg-surface-elevated: #152033;
    --bg-card: rgba(16, 25, 41, 0.65);
    --bg-card-hover: rgba(23, 36, 58, 0.88);
    --bg-glass: rgba(11, 18, 30, 0.85);
    --border-accent: rgba(56, 189, 248, 0.35);
    --text-accent: #38bdf8;
    --accent-primary: #0284c7;
    --accent-primary-hover: #0369a1;
    --accent-glow: rgba(56, 189, 248, 0.18);
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0.03) 100%);
    --hero-overlay-start: rgba(8, 13, 22, 0.95);
    --hero-overlay-mid: rgba(8, 13, 22, 0.75);
    --hero-overlay-end: rgba(8, 13, 22, 0.35);
}

/* THEME 5: MONOCHROME DARK (Črno-bela) */
[data-theme="mono-dark"] {
    --bg-base: #000000;
    --bg-surface: #0a0a0a;
    --bg-surface-elevated: #141414;
    --bg-card: rgba(18, 18, 18, 0.85);
    --bg-card-hover: #1f1f1f;
    --bg-glass: rgba(10, 10, 10, 0.92);
    --bg-glass-heavy: rgba(0, 0, 0, 0.98);
    --border-subtle: rgba(255, 255, 255, 0.14);
    --border-medium: rgba(255, 255, 255, 0.25);
    --border-accent: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #d4d4d8;
    --text-muted: #a1a1aa;
    --text-accent: #ffffff;
    --text-inverse: #000000;
    --accent-primary: #ffffff;
    --accent-primary-hover: #e4e4e7;
    --accent-secondary: #d4d4d8;
    --accent-glow: rgba(255, 255, 255, 0.15);
    --accent-gradient: linear-gradient(135deg, #ffffff 0%, #d4d4d8 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    --hero-overlay-start: rgba(0, 0, 0, 0.96);
    --hero-overlay-mid: rgba(0, 0, 0, 0.78);
    --hero-overlay-end: rgba(0, 0, 0, 0.40);
}

/* THEME 6: MONOCHROME LIGHT (Belo-črna) */
[data-theme="mono-light"] {
    --bg-base: #ffffff;
    --bg-surface: #f4f4f5;
    --bg-surface-elevated: #e4e4e7;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #f4f4f5;
    --bg-glass: rgba(255, 255, 255, 0.94);
    --bg-glass-heavy: rgba(255, 255, 255, 0.98);
    --border-subtle: rgba(0, 0, 0, 0.12);
    --border-medium: rgba(0, 0, 0, 0.22);
    --border-accent: #000000;
    --text-primary: #09090b;
    --text-secondary: #27272a;
    --text-muted: #52525b;
    --text-accent: #000000;
    --text-inverse: #ffffff;
    --accent-primary: #09090b;
    --accent-primary-hover: #27272a;
    --accent-secondary: #52525b;
    --accent-glow: rgba(0, 0, 0, 0.12);
    --accent-gradient: linear-gradient(135deg, #18181b 0%, #000000 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.02) 100%);
    --hero-overlay-start: rgba(255, 255, 255, 0.96);
    --hero-overlay-mid: rgba(255, 255, 255, 0.82);
    --hero-overlay-end: rgba(255, 255, 255, 0.45);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.16);
}

/* THEME 7: VINTAGE PARCHMENT (Svetla klasika) */
[data-theme="parchment"] {
    --bg-base: #f7f3e8;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #efe8d5;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-card-hover: #ffffff;
    --bg-glass: rgba(247, 243, 232, 0.92);
    --bg-glass-heavy: rgba(247, 243, 232, 0.98);
    --border-subtle: rgba(120, 80, 40, 0.14);
    --border-medium: rgba(120, 80, 40, 0.24);
    --border-accent: #92400e;
    --text-primary: #1c150c;
    --text-secondary: #453424;
    --text-muted: #6e5844;
    --text-accent: #78350f;
    --text-inverse: #ffffff;
    --accent-primary: #92400e;
    --accent-primary-hover: #78350f;
    --accent-secondary: #b45309;
    --accent-glow: rgba(146, 64, 14, 0.16);
    --accent-gradient: linear-gradient(135deg, #b45309 0%, #78350f 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(180, 83, 9, 0.14) 0%, rgba(180, 83, 9, 0.04) 100%);
    --hero-overlay-start: rgba(247, 243, 232, 0.96);
    --hero-overlay-mid: rgba(247, 243, 232, 0.82);
    --hero-overlay-end: rgba(247, 243, 232, 0.45);
    --shadow-sm: 0 2px 8px rgba(120, 80, 40, 0.08);
    --shadow-md: 0 8px 24px rgba(120, 80, 40, 0.12);
    --shadow-lg: 0 16px 44px rgba(120, 80, 40, 0.16);
}

/* THEME 8: NORDIC FROST (Svetla modrina) */
[data-theme="nordic"] {
    --bg-base: #f0f4f8;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --bg-glass: rgba(240, 244, 248, 0.92);
    --bg-glass-heavy: rgba(240, 244, 248, 0.98);
    --border-subtle: rgba(15, 23, 42, 0.10);
    --border-medium: rgba(15, 23, 42, 0.20);
    --border-accent: #0284c7;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-accent: #0369a1;
    --text-inverse: #ffffff;
    --accent-primary: #0284c7;
    --accent-primary-hover: #0369a1;
    --accent-secondary: #0ea5e9;
    --accent-glow: rgba(2, 132, 199, 0.15);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(2, 132, 199, 0.03) 100%);
    --hero-overlay-start: rgba(240, 244, 248, 0.96);
    --hero-overlay-mid: rgba(240, 244, 248, 0.82);
    --hero-overlay-end: rgba(240, 244, 248, 0.45);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 16px 44px rgba(15, 23, 42, 0.16);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; outline: none; border: none; }
button { cursor: pointer; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--accent-secondary);
    outline-offset: 3px;
}

button:disabled {
    cursor: not-allowed;
}

/* SVG Icon Base */
.svg-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    flex-shrink: 0;
}

.svg-icon-sm { width: 14px; height: 14px; }
.svg-icon-lg { width: 22px; height: 22px; }

/* ==========================================================================
   APP HEADER & NAVIGATION
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

/* Bespoke Brand Sigil */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.brand-sigil {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--border-subtle);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-accent);
}

.nav-link.nav-link-play {
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.nav-link.nav-link-play:hover {
    background: var(--accent-gradient);
    color: #000000;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.nav-link.nav-link-play.active {
    background: var(--accent-gradient);
    color: #000000;
    border-color: transparent;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all var(--transition-fast);
}

.lang-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.profile-pill-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.profile-pill-btn:hover {
    border-color: var(--border-accent);
}

/* ==========================================================================
   APP CONTAINER & VIEWS
   ========================================================================== */
.app-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 2.25rem 1.5rem;
    min-height: calc(100vh - var(--header-height));
}

.view-page {
    display: none;
    animation: fadeIn 200ms ease;
}

.view-page.active { display: block; }

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

/* ==========================================================================
   PAGE: HOME (Hero & Curated Showcase)
   ========================================================================== */
.hero-showcase {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    padding: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 3.5rem;
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-surface);
}

.hero-bg-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-bg-overlay {
    position: absolute;
    inset: -2px;
    background: 
        linear-gradient(to top, var(--hero-overlay-start) 12%, var(--hero-overlay-mid) 55%, var(--hero-overlay-end) 100%),
        radial-gradient(ellipse at center, transparent 30%, var(--hero-overlay-mid) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--accent-primary);
    color: var(--text-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.1rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.6rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Premium Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.85rem;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: var(--text-inverse);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

/* Continue Playing Bar */
.continue-playing-section { margin-bottom: 3.5rem; }

.continue-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.continue-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.continue-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.continue-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.continue-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-link {
    font-size: 0.88rem;
    color: var(--accent-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.section-link:hover { color: var(--text-primary); }

/* ==========================================================================
   PAGE: DISCOVER (Browse, Filters, Clean Grid/List)
   ========================================================================== */
.discover-controls {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.85rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.92rem;
}

.search-input:focus { border-color: var(--accent-primary); }

.sort-select {
    padding: 0.75rem 1.2rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
}

.view-toggle-btns {
    display: flex;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.view-toggle-btn.active {
    background: var(--accent-primary);
    color: #000000;
}

.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.genre-pill {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.genre-pill:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.genre-pill.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: var(--text-inverse);
    font-weight: 600;
}

/* ==========================================================================
   GAME CARDS
   ========================================================================== */
.games-container {
    display: grid;
    gap: 1.75rem;
}

.games-container.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.games-container.list-view {
    grid-template-columns: 1fr;
}

.game-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
    position: relative;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
}

.game-card-cover-wrap {
    position: relative;
    width: 100%;
    height: 190px;
    overflow: hidden;
}

.game-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.game-card:hover .game-card-cover {
    transform: scale(1.04);
}

.game-card-genre-pill {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-card-like-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-medium);
    color: var(--text-muted);
    display: grid;
    place-items: center;
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-card-like-btn:hover {
    color: #f43f5e;
    transform: scale(1.15);
}

.game-card-like-btn.liked {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #f43f5e;
}

.game-card-like-btn.liked svg {
    fill: #f43f5e;
    stroke: #f43f5e;
    filter: drop-shadow(0 2px 8px rgba(244, 63, 94, 0.65));
    transform: scale(1.2);
}

.game-card-body {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-card-region {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

.game-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.game-card-author {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.game-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-metas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.game-card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.game-card-actions .btn-play-card {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.game-card-actions .btn-overview-card {
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==========================================================================
   PAGE: DETAILS
   ========================================================================== */
.details-page { max-width: 920px; margin: 0 auto; }

.details-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 290px;
    border: 1px solid var(--border-medium);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.details-hero img { width: 100%; height: 100%; object-fit: cover; }

.details-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-base) 10%, rgba(7, 9, 14, 0.45) 100%);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.details-back-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.details-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.details-author {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.dungeon-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.dungeon-stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dungeon-stat-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.dungeon-stat-label svg { color: var(--accent-primary); }

.dungeon-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.details-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag-pill {
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
}

.details-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.details-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.details-synopsis {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.details-cta-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ==========================================================================
   PAGE: CHARACTER / CLASS SELECTION (STANDALONE VIEW)
   ========================================================================== */
.character-select-page {
    max-width: 760px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.char-select-header {
    margin-bottom: 2rem;
    text-align: center;
}

.char-select-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0.5rem auto 0;
    line-height: 1.6;
}

.char-select-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 4vw, 2rem);
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.char-select-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.char-name-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.char-name-input {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.char-name-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.char-classes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.char-class-option {
    background: var(--bg-surface-elevated);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.char-class-option:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

.char-class-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-gradient-subtle);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.char-class-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.char-class-name {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.char-class-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-accent);
    border: 1px solid var(--border-subtle);
}

.char-class-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.char-class-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.char-class-perk {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
}

.char-select-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

/* ==========================================================================
   PAGE: GAMEPLAY (Reading Experience & Choices)
   ========================================================================== */
.gameplay-wrapper {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height) - 4rem);
}

.gameplay-header {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.gameplay-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.btn-gameplay-back {
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.gameplay-title-group {
    min-width: 0;
    flex: 1;
}

.game-current-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.game-current-scene {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.gameplay-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    min-width: 0;
}

.btn-gameplay-action {
    padding: 0.42rem 0.75rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 600px) {
    .gameplay-header {
        padding: 0.5rem 0.65rem;
        gap: 0.5rem;
    }
    .btn-gameplay-back span,
    .btn-gameplay-action span {
        display: none;
    }
    .btn-gameplay-back,
    .btn-gameplay-action {
        padding: 0.45rem 0.55rem;
    }
    .game-current-title {
        font-size: 0.84rem;
    }
    .game-current-scene {
        font-size: 0.72rem;
    }
}

/* Compact Inline HUD Stats (integrated in header) */
.hud-inline-stats {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hud-inline-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.hud-inline-stat svg {
    width: 12px;
    height: 12px;
}

.hud-hp svg { color: var(--status-danger); }
.hud-attack svg { color: var(--status-warning); }
.hud-defense svg { color: var(--status-success); }
.hud-magic svg { color: var(--accent-secondary); }
.hud-gold svg { color: var(--status-warning); }
.hud-inv svg { color: var(--text-accent); }

.hud-inv {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hud-inv:hover {
    border-color: var(--accent-primary);
    background: var(--bg-surface-elevated);
}

/* Ambient Mini Indicator (integrated in header) */
.hud-ambient-mini {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hud-ambient-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-accent);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.hud-ambient-btn:hover {
    background: var(--accent-primary);
    color: #fff;
}

.hud-ambient-btn.muted {
    color: var(--text-muted);
    opacity: 0.5;
}

.ambient-volume-slider-mini {
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 3px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.ambient-volume-slider-mini::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.ambient-volume-slider-mini::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

/* Story Progress Bar */
.story-progress-bar {
    width: 100%;
    height: 2px;
    background: var(--border-subtle);
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ambient Dynamic Audio Bar */
.ambient-sound-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    margin-bottom: 1rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.ambient-sound-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ambient-sound-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.ambient-sound-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ambient-volume-control {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.ambient-sound-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.ambient-sound-btn:hover {
    background: var(--accent-primary);
    color: #ffffff;
    transform: scale(1.05);
}

.ambient-sound-btn.muted {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-muted);
    opacity: 0.6;
}

.ambient-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 75px;
    height: 4px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ambient-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
    transition: transform var(--transition-fast);
}

.ambient-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ambient-volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

.ambient-sound-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.ambient-sound-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-accent);
}

.ambient-volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ambient-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ambient-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform var(--transition-fast);
}

.ambient-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ambient-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

@media (max-width: 480px) {
    .ambient-sound-bar {
        flex-direction: row;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    .ambient-volume-slider {
        width: 60px;
    }
    .ambient-sound-badge {
        display: none;
    }
}

/* Reading Modes on Story Box */
.story-reading-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: clamp(1.75rem, 5vw, 3rem);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.75rem;
}

.story-scene-title {
    font-family: var(--font-story);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.story-narrative-text {
    line-height: 1.9;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* Typography styles — enoten sistem: velikost in družina vplivata na pripoved IN naslov prizora */
.font-size-small .story-narrative-text { font-size: 1rem; }
.font-size-normal .story-narrative-text { font-size: 1.12rem; }
.font-size-large .story-narrative-text { font-size: 1.28rem; }

.font-size-small .story-scene-title { font-size: 1.22rem; }
.font-size-normal .story-scene-title { font-size: 1.35rem; }
.font-size-large .story-scene-title { font-size: 1.5rem; }

.font-family-serif .story-narrative-text { font-family: var(--font-story-read); }
.font-family-serif .story-scene-title { font-family: var(--font-story); }

.font-family-sans .story-narrative-text,
.font-family-sans .story-scene-title { font-family: var(--font-sans); }

.font-family-mono .story-narrative-text,
.font-family-mono .story-scene-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: -0.01em;
}
.font-size-large.font-family-mono .story-scene-title { font-size: 1.3rem; }

/* Interactive Words */
.changeable-word {
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px dashed var(--accent-primary);
    cursor: pointer;
    color: var(--text-accent);
    display: inline;
}

.changeable-word:hover {
    background: var(--accent-glow);
    border-style: solid;
}

.changeable-word-done {
    border: none;
    cursor: default;
    color: var(--text-accent);
}

.invisible-word {
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px dotted var(--text-muted);
    cursor: pointer;
    color: transparent;
    user-select: none;
    display: inline;
}

.invisible-word:hover {
    border-color: var(--accent-secondary);
    background: rgba(56, 189, 248, 0.1);
}

.invisible-word-revealed {
    color: var(--accent-secondary);
    border: none;
    cursor: default;
    font-weight: 600;
}

.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.story-input-container { margin-top: 1.5rem; }

.story-input-field {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 1rem;
}

.story-input-field:focus { border-color: var(--accent-primary); }

.choices-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.choice-btn {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    animation: choiceSlideIn 350ms ease forwards;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform 180ms ease;
}

/* Staggered entrance — set by JS via style="animation-delay" */
@keyframes choiceSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.choice-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

/* Animated gradient sweep on hover */
.choice-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--accent-glow) 50%, transparent 100%);
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 200ms ease;
    pointer-events: none;
}

.choice-btn:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.choice-btn:hover::before { opacity: 1; }
.choice-btn:hover::after {
    opacity: 1;
    transform: translateX(100%);
    transition: opacity 200ms ease, transform 600ms ease;
}

/* Pulse on click */
.choice-btn:active {
    transform: scale(0.985) translateX(4px);
    transition: transform 80ms ease;
}

.choice-btn .svg-icon {
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.choice-btn:hover .svg-icon {
    transform: translateX(3px);
}

.choice-btn-locked {
    color: var(--text-muted);
    cursor: not-allowed;
    filter: saturate(0.35);
}

.choice-btn-locked:hover {
    border-color: var(--border-subtle);
    transform: none;
}

.choice-btn-locked small {
    color: var(--status-warning);
    font-size: 0.78em;
    font-weight: 600;
}

.choice-check-label {
    color: var(--text-accent);
    font-size: 0.78em;
    font-weight: 600;
}

/* Scene Crossfade Animations */
.scene-exit {
    animation: sceneFadeOut 200ms ease forwards;
}

.scene-enter {
    animation: sceneFadeIn 350ms ease forwards;
}

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

@keyframes sceneFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.choice-btn-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient-subtle);
    color: var(--text-accent);
    font-weight: 600;
}

.choice-btn-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Live HUD */
.gameplay-hud {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: auto;
}

.hud-stats {
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

.hud-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hud-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hud-stat-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.health-bar-container {
    width: 110px;
    height: 7px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    background: var(--status-success);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.hud-inventory-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.inventory-chip {
    padding: 0.25rem 0.6rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   PAGE: LIBRARY (Bookmarks & Saves)
   ========================================================================== */
.library-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.library-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #ffffff;
}

.library-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.library-tab-nav {
    display: inline-flex;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.3rem;
    gap: 0.3rem;
    width: fit-content;
    max-width: 100%;
}

.library-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.library-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.library-tab-btn.active {
    background: var(--accent-gradient);
    color: #000000;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.library-tab-btn .tab-badge {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
}

.library-tab-btn:not(.active) .tab-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.library-panel {
    display: none;
}

.library-panel.active {
    display: block;
    animation: fadeIn 250ms ease forwards;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.25rem;
}

.save-slot-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.2rem;
    transition: all var(--transition-normal);
}

.save-slot-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.save-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.save-slot-num {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
}

.save-slot-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.save-slot-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
    margin-bottom: 0.35rem;
}

.save-slot-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.save-slot-actions {
    display: flex;
    gap: 0.6rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

.empty-state-box {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    max-width: 520px;
    margin: 2rem auto;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   MODALS: CHARACTER SELECTOR & PROFILE VAULT
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    place-items: center;
    padding: 1.5rem;
}

.modal-overlay.active { display: grid; }

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    max-width: 620px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.character-selection-grid {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.character-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.character-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.character-card.selected {
    border-color: var(--accent-primary);
    background: var(--accent-gradient-subtle);
}

.character-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.character-card-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

.character-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.character-card-role {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.25rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

.toast.toast-success { border-color: var(--status-success); }
.toast.toast-warning { border-color: var(--status-warning); }
.toast.toast-error { border-color: var(--status-danger); }
.toast.toast-info { border-color: var(--status-info); }

/* ==========================================================================
   MOBILE NAVIGATION DRAWER & BOTTOM BAR
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
}

.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-medium);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    z-index: 260;
    overflow-y: auto;
}

.mobile-drawer-overlay.active .mobile-drawer {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: var(--accent-gradient-subtle);
    color: #ffffff;
    border: 1px solid var(--border-accent);
}

.mobile-nav-link.mobile-nav-link-play {
    color: var(--accent-primary);
    border-color: var(--border-accent);
}

.mobile-drawer-footer {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.mobile-settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-drawer-action-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.mobile-drawer-action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.mobile-drawer-action-btn .svg-icon {
    color: var(--accent-primary);
}

/* Mobile Bottom Navigation Bar (PWA Style) */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 64px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-medium);
    z-index: 120;
    padding: 0.25rem 0.5rem calc(0.25rem + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
}

.mobile-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 0;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.mobile-tab-btn .svg-icon {
    width: 20px;
    height: 20px;
}

.mobile-tab-btn:hover, .mobile-tab-btn.active {
    color: var(--accent-primary);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Down to 270px)
   ========================================================================== */
@media (max-width: 950px) {
    .nav-links { display: none !important; }
    .mobile-menu-toggle { display: grid !important; place-items: center; }
    .mobile-bottom-bar { display: flex; }
    .app-container { padding-bottom: 5.5rem; }
}

@media (max-width: 768px) {
    .app-header { padding: 0 0.85rem; height: 56px; }
    .app-container { padding: 1.25rem 0.85rem 5.5rem 0.85rem; }
    
    .profile-pill-btn span { display: none; }
    .profile-pill-btn { padding: 0.45rem; }
    
    .hero-showcase { min-height: 320px; padding: 1.5rem 1.25rem; margin-bottom: 2.25rem; }
    .hero-title { font-size: clamp(1.5rem, 5vw, 2.2rem); }
    .hero-meta { gap: 0.85rem; font-size: 0.8rem; }
    
    .games-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
        gap: 1.25rem;
    }
    
    .dungeon-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .gameplay-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .gameplay-header-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .hud-inline-stats {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
    
    .gameplay-hud {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem;
    }
    
    .hud-stats {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .modal-box {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 600px) {
    .desktop-only-header-btn { display: none !important; }
    .mobile-menu-toggle { display: grid !important; place-items: center; }
    
    .app-header {
        padding: 0 0.85rem;
        height: 56px;
        justify-content: space-between;
    }
    
    .header-left {
        gap: 0.5rem;
        flex: 1;
    }
    
    .header-right {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    html { font-size: 14.5px; }
    
    .app-header { padding: 0 0.6rem; height: 52px; }
    .header-left { gap: 0.6rem; }
    .brand-logo span { font-size: 1.1rem; }
    
    .hero-showcase { min-height: 280px; padding: 1.25rem 0.9rem; }
    .hero-actions { display: flex; flex-direction: column; width: 100%; gap: 0.5rem; }
    .hero-actions button { width: 100%; justify-content: center; }
    
    .search-row { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .view-toggle-btns { display: none; }
    
    .genre-pills { gap: 0.35rem; }
    .genre-pill { padding: 0.3rem 0.75rem; font-size: 0.75rem; }
    
    .details-hero { height: 210px; }
    .details-cta-bar { flex-direction: column; gap: 0.6rem; }
    .details-cta-bar button { width: 100%; justify-content: center; }
    
    .dungeon-stat-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .dungeon-stat-card { padding: 0.6rem; }
    
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 4.8rem;
    }
    .toast { width: 100%; }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-box {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92vh;
        padding: 1.25rem 1rem 4rem 1rem;
    }

    .gameplay-header-right {
        justify-content: space-between;
    }

    .hud-inline-stat {
        padding-inline: 0.4rem;
    }
}

@media (max-width: 320px) {
    /* Ultra-compact for 270px - 320px */
    html { font-size: 13.5px; }
    
    .app-header { padding: 0 0.4rem; }
    .brand-sigil { width: 26px; height: 26px; }
    .brand-logo span { font-size: 0.98rem; }
    
    .app-container { padding: 0.75rem 0.5rem 5.5rem 0.5rem; }
    .hero-showcase { padding: 1rem 0.75rem; min-height: 250px; }
    
    .hud-stats { grid-template-columns: 1fr; }
    .game-card-body { padding: 0.9rem 0.75rem; }
    .game-card-actions { flex-direction: column; }
    
    .character-card { padding: 0.75rem; }
    .character-card-avatar { width: 34px; height: 34px; }
}

/* ==========================================================================
   COMBAT ARENA UI (Interactive RPG Combat)
   ========================================================================== */
.combat-arena-container {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-md);
    animation: combatSlideIn 300ms ease-out forwards;
}

.combat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.combat-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.combat-round-badge {
    font-size: 0.85rem;
    background: var(--bg-base);
    color: var(--text-accent);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.combat-fighters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fighter-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.fighter-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.combat-hp-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 0.35rem;
}

.combat-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.combat-hp-fill.enemy-hp {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.combat-log-box {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    min-height: 48px;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.combat-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.combat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid var(--border-medium);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.combat-btn:hover:not(:disabled) {
    background: var(--bg-surface-elevated);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.combat-btn-attack {
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.combat-btn-attack:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.combat-btn-defend {
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.combat-btn-defend:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.combat-btn-item {
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.combat-btn-item:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

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

/* ==========================================================================
   EPUB / KINDLE IMMERSIVE READER MODE
   Distraction-free reading experience: auto-hides navigation chrome & HUD
   ========================================================================== */

#site-header {
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease;
}

.mobile-bottom-bar {
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease;
}

body.reader-chrome-hidden #site-header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

body.reader-chrome-hidden .mobile-bottom-bar {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

body.reader-chrome-hidden .gameplay-top-bar {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.reader-chrome-hidden .hud-inline-stats,
body.reader-chrome-hidden #btn-gameplay-save,
body.reader-chrome-hidden .hud-ambient-mini {
    opacity: 0.25;
    transition: opacity 300ms ease;
}

body.reader-chrome-hidden .gameplay-top-bar:hover .hud-inline-stats,
body.reader-chrome-hidden .gameplay-top-bar:hover #btn-gameplay-save,
body.reader-chrome-hidden .gameplay-top-bar:hover .hud-ambient-mini {
    opacity: 1;
}

.story-narrative-text {
    cursor: pointer;
}

.story-narrative-text * {
    cursor: auto;
}

.reader-immersive-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.55;
    margin: 1.25rem 0 0.5rem 0;
    user-select: none;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.reader-immersive-hint:hover {
    opacity: 0.9;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .combat-fighters-row { grid-template-columns: 1fr; }
    .combat-actions-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
