/**
 * VALORIA - Design System & Main Stylesheet
 * Dark Fantasy Action RPG Visual Language
 *
 * This file contains all CSS for the game.
 */

/* ============================================================================
   GOOGLE FONTS (fallback to system fonts if unavailable)
   ============================================================================ */

/* ============================================================================
   DESIGN TOKENS - The foundation of the visual language
   ============================================================================ */

:root {
    /* === COLOR SYSTEM === */

    /* Base Palette - Ancient, dangerous, physical */
    --color-void: #050505;           /* Deepest darkness */
    --color-abyss: #0a0808;          /* Background darkness */
    --color-obsidian: #121010;       /* Primary dark surface */
    --color-charcoal: #1a1614;       /* Secondary dark surface */
    --color-iron: #252220;           /* Tertiary dark surface */
    --color-steel: #3a3632;          /* Borders, dividers */
    --color-worn-steel: #4a4540;     /* Inactive elements */

    /* Accent Colors - Used sparingly, with meaning */
    --color-blood: #8b2020;          /* Primary accent - danger, damage, rage */
    --color-crimson: #a82a2a;        /* Lighter blood - highlights */
    --color-dark-crimson: #5c1515;   /* Deep blood - shadows */
    --color-gore: #6b1818;           /* Medium blood - fills */

    --color-gold: #c9a227;           /* Secondary accent - interaction, selection */
    --color-amber: #d4b44a;          /* Lighter gold - highlights */
    --color-ancient-gold: #9a7a1a;   /* Darker gold - shadows */

    --color-ember: #ff4400;          /* Rage meter - active state */
    --color-flame: #ff6622;          /* Rage highlights */

    --color-health: #cc2222;         /* Health bar fill */
    --color-health-low: #ff2222;     /* Health < 25% */
    --color-stamina: #3a7a3a;       /* Stamina fill - muted green */

    /* Text Colors */
    --color-text-primary: #e8e4e0;   /* Primary text - warm off-white */
    --color-text-secondary: #a09890; /* Secondary text - muted */
    --color-text-dim: #605850;       /* Disabled/hint text */

    /* Functional Colors */
    --color-danger: var(--color-blood);
    --color-warning: var(--color-gold);
    --color-success: #4a7a4a;
    --color-info: #5a6a7a;

    /* === TYPOGRAPHY === */

    /* Font Stacks */
    --font-display: 'Cinzel', 'Times New Roman', Georgia, serif;
    --font-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* Font Sizes - Modular scale (1.25 ratio) */
    --text-xs: 0.64rem;      /* 10.24px - very small labels */
    --text-sm: 0.8rem;       /* 12.8px - metadata, hints */
    --text-base: 0.9rem;      /* 14.4px - body text */
    --text-md: 1rem;          /* 16px - default */
    --text-lg: 1.25rem;       /* 20px - subheadings */
    --text-xl: 1.563rem;      /* 25px - section headers */
    --text-2xl: 1.953rem;     /* 31px - screen titles */
    --text-3xl: 2.441rem;     /* 39px - main titles */
    --text-4xl: 3.052rem;     /* 49px - hero text */
    --text-5xl: 3.815rem;     /* 61px - VALORIA title */

    /* Font Weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-black: 900;

    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.05em;
    --tracking-wider: 0.1em;
    --tracking-widest: 0.2em;

    /* Line Heights */
    --leading-tight: 1.1;
    --leading-normal: 1.4;
    --leading-relaxed: 1.6;

    /* === SPACING SYSTEM === */
    /* Based on 4px unit */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* === BORDERS === */

    --border-thin: 1px;
    --border-normal: 2px;
    --border-thick: 3px;

    --radius-none: 0;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;

    /* Border Colors */
    --border-color-default: var(--color-steel);
    --border-color-subtle: var(--color-iron);
    --border-color-emphasis: var(--color-worn-steel);
    --border-color-active: var(--color-gold);
    --border-color-danger: var(--color-blood);

    /* === SHADOWS === */
    /* Subtle, restrained - no glowy fantasy effects */

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.8);

    /* === TRANSITIONS === */

    /* Durations */
    --duration-instant: 50ms;
    --duration-fast: 100ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
    --duration-slower: 500ms;

    /* Easing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-sharp: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* === Z-INDEX SCALE === */
    --z-base: 1;
    --z-hud: 10;
    --z-overlay: 20;
    --z-menu: 30;
    --z-modal: 40;
    --z-tooltip: 50;
    --z-notification: 60;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--color-void);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--color-void);
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* ============================================================================
   TYPOGRAPHY UTILITIES
   ============================================================================ */

.text-display {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.text-heading {
    font-family: var(--font-display);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.text-body {
    font-family: var(--font-ui);
    font-weight: var(--weight-normal);
    letter-spacing: var(--tracking-normal);
}

.text-mono {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wide);
}

/* Text Sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

/* Text Colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-dim { color: var(--color-text-dim); }
.text-gold { color: var(--color-gold); }
.text-blood { color: var(--color-blood); }
.text-danger { color: var(--color-danger); }

/* ============================================================================
   BUTTON SYSTEM
   ============================================================================ */

.btn {
    /* Base button styling */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-text-primary);
    background: linear-gradient(180deg, var(--color-iron) 0%, var(--color-obsidian) 100%);
    border: var(--border-normal) solid var(--color-steel);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
        background var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out),
        transform var(--duration-instant) var(--ease-out);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.btn:hover {
    background: linear-gradient(180deg, var(--color-steel) 0%, var(--color-iron) 100%);
    border-color: var(--color-worn-steel);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-obsidian), 0 0 0 4px var(--color-gold);
}

/* Button Variants */
.btn-primary {
    border-color: var(--color-blood);
}

.btn-primary:hover {
    border-color: var(--color-crimson);
    box-shadow: 0 0 12px rgba(139, 32, 32, 0.3);
}

.btn-gold {
    border-color: var(--color-gold);
}

.btn-gold:hover {
    border-color: var(--color-amber);
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.3);
}

.btn-secondary {
    background: linear-gradient(180deg, var(--color-charcoal) 0%, var(--color-obsidian) 100%);
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, var(--color-iron) 0%, var(--color-charcoal) 100%);
}

.btn:disabled,
.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================================
   PANEL SYSTEM
   ============================================================================ */

.panel {
    background: var(--color-obsidian);
    border: var(--border-thin) solid var(--color-steel);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: inherit;
}

.panel-dark {
    background: var(--color-void);
    border-color: var(--color-iron);
}

.panel-subtle {
    background: rgba(10, 8, 8, 0.9);
    border-color: var(--color-charcoal);
}

/* ============================================================================
   INPUT SYSTEM
   ============================================================================ */

.input {
    appearance: none;
    background: var(--color-charcoal);
    border: var(--border-thin) solid var(--color-steel);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    transition:
        border-color var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out);
}

.input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
}

/* Range Slider */
.input-range {
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--color-iron);
    border-radius: 2px;
    border: none;
    padding: 0;
}

.input-range::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-blood);
    border: 2px solid var(--color-crimson);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out);
}

.input-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.input-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-blood);
    border: 2px solid var(--color-crimson);
    border-radius: 50%;
    cursor: pointer;
}

/* ============================================================================
   SCREEN CONTAINERS
   ============================================================================ */

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: var(--z-menu);
}

.screen.hidden {
    display: none;
}

/* ID selectors like #controls-help set display, so the utility needs to win. */
.hidden {
    display: none !important;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.m-auto { margin: auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { inset: 0; }

.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

.z-hud { z-index: var(--z-hud); }
.z-overlay { z-index: var(--z-overlay); }
.z-menu { z-index: var(--z-menu); }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulseGold {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(201, 162, 39, 0);
    }
    50% {
        box-shadow: 0 0 12px 2px rgba(201, 162, 39, 0.3);
    }
}

@keyframes shakeLight {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@keyframes shakeMedium {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-4px, 2px); }
    40% { transform: translate(4px, -2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

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

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale var(--duration-slow) var(--ease-out) forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-shake-light {
    animation: shakeLight 0.1s ease-out;
}

.animate-shake-medium {
    animation: shakeMedium 0.15s ease-out;
}

/* Stagger delays for sequential animations */
.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }
.stagger-5 { animation-delay: 500ms; }
/**
 * VALORIA - Dark Fantasy Action RPG
 * Main Stylesheet
 *
 * This file imports the design system and provides game-specific styling.
 */

/* ============================================================================
   GAME CONTAINER
   ============================================================================ */

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-void);
    overflow: hidden;
}

#game-canvas {
    position: absolute;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    image-rendering: auto;
    background: var(--color-abyss);
}

#ui-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

#ui-layer .screen,
#ui-layer button {
    pointer-events: auto;
    cursor: pointer;
}

#ui-layer .stat-bar,
#ui-layer .ability-bar,
#ui-layer .ability-slot,
#ui-layer #controls-help,
#ui-layer #debug-info {
    pointer-events: none;
}

#vfx-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-overlay);
}

/* ============================================================================
   MAIN MENU
   ============================================================================ */

#main-menu {
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    overflow: hidden;
}

#main-menu::before {
    display: none;
}

/* ==================== CEMETERY HILLS MENU UI ==================== */

/* Top-Left Branding Header */
.menu-brand-header {
    position: absolute;
    top: 28px;
    left: 36px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    z-index: 10;
    animation: fadeInDown 0.8s var(--ease-out) forwards;
}

.menu-brand-header .game-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    color: #f7dc6f;
    margin: 0;
    padding: 0;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 4px 12px rgba(0, 0, 0, 0.7),
        0 0 18px rgba(244, 208, 63, 0.35);
    animation: none;
}

.menu-brand-header .game-title::after {
    display: none;
}

.menu-subtitle {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #a6acaf;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    text-transform: uppercase;
}

/* Center Prompt - Removed */
.menu-hero-prompt {
    display: none !important;
}

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

/* Bottom-Left Action Buttons (Matching Reference) */
.menu-bottom-left-cluster {
    position: absolute;
    bottom: 28px;
    left: 36px;
    pointer-events: auto;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    z-index: 10;
}

.menu-circle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.circle-btn-frame {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #28242c 0%, #151318 65%, #0c0b0e 100%);
    border: 2px solid #8d7318;
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.85),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eaeded;
    transition: all 0.22s ease;
}

.circle-btn-icon {
    width: 22px;
    height: 22px;
    stroke: #eaeded;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    transition: all 0.22s ease;
}

.circle-btn-label {
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #bdc3c7;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
    transition: color 0.2s ease;
}

.menu-circle-btn:hover {
    transform: translateY(-3px) scale(1.06);
}

.menu-circle-btn:hover .circle-btn-frame {
    border-color: #f4d03f;
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.95),
        0 0 16px rgba(244, 208, 63, 0.45),
        inset 0 1px 3px rgba(255, 255, 255, 0.35);
    color: #f4d03f;
}

.menu-circle-btn:hover .circle-btn-icon {
    stroke: #f4d03f;
    transform: scale(1.1);
}

.menu-circle-btn:hover .circle-btn-label {
    color: #f7dc6f;
}

.menu-circle-btn:active {
    transform: translateY(-1px) scale(0.97);
}

/* Bottom-Right Play Pill Button (Matching Reference) */
.menu-bottom-right-cluster {
    position: absolute;
    bottom: 28px;
    right: 36px;
    pointer-events: auto;
    z-index: 10;
}

.menu-pill-play {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 175px;
    height: 54px;
    padding: 0 32px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #102a43 0%, #154360 40%, #1b4f72 75%, #2471a3 100%);
    border: 2px solid #5dade2;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(41, 128, 185, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    overflow: hidden;
    outline: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-pill-play .pill-play-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.menu-pill-play .pill-play-text {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    color: #ffffff;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 12px rgba(93, 173, 226, 0.7);
}

.menu-pill-play .pill-play-icon {
    width: 18px;
    height: 18px;
    fill: #5dade2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    transition: transform 0.2s ease;
}

.menu-pill-play:hover {
    transform: translateY(-2px) scale(1.04);
    border-color: #85c1e9;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.95),
        0 0 24px rgba(93, 173, 226, 0.7),
        inset 0 2px 5px rgba(255, 255, 255, 0.4);
}

.menu-pill-play:hover .pill-play-icon {
    transform: translateX(3px) scale(1.1);
}

.menu-pill-play:active {
    transform: translateY(1px) scale(0.97);
}

/* Game title - removed duplicate, using menu-brand-header .game-title */

@keyframes titleReveal {
    0% {
        opacity: 0;
        letter-spacing: 0.5em;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        letter-spacing: 0.3em;
        transform: translateY(0);
    }
}

/* Menu buttons container */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 280px;
}

/* Individual menu button */
.menu-btn {
    display: block;
    width: 280px;
    padding: 16px 32px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    background: linear-gradient(180deg, #3a3632 0%, #252220 100%);
    border: 2px solid #3a3632;
    border-radius: 2px;
    cursor: pointer;
    pointer-events: auto;
    margin: 8px 0;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #4a4540 0%, #3a3632 100%);
    border-color: #8b2020;
}

.menu-btn:active {
    background: linear-gradient(180deg, #252220 0%, #1a1614 100%);
}

.menu-btn.secondary {
    background: linear-gradient(180deg, #252220 0%, #1a1614 100%);
    font-size: 12px;
}

.menu-btn.secondary:hover {
    border-color: #4a4540;
}

/* Menu decoration - atmospheric elements */
.menu-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
    overflow: hidden;
    background: linear-gradient(0deg, rgba(139, 32, 32, 0.15) 0%, transparent 100%);
}

.menu-decoration::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(0deg,
        rgba(139, 32, 32, 0.1) 0%,
        transparent 100%);
}

/* Crossed swords SVG decoration */
.crossed-swords {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 60px;
    opacity: 0.15;
}

/* ============================================================================
   SETTINGS MENU
   ============================================================================ */

/* ============================================================================
   FULLSCREEN PROMPT MODAL
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    pointer-events: auto;
    animation: fadeIn 0.25s ease-out;
}

.modal-card {
    background: linear-gradient(180deg, #1e1712 0%, #0d0a08 100%);
    border: 2px solid #c9a227;
    border-radius: 12px;
    padding: 30px 36px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 215, 0, 0.25),
        0 0 25px rgba(201, 162, 39, 0.2);
}

.modal-icon {
    font-size: 32px;
    color: #ffd700;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.5));
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 0.14em;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px #000;
}

.modal-text {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: #d1be9b;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

#settings-menu {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(20, 15, 10, 0.98) 0%, transparent 70%),
        var(--color-void);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    pointer-events: auto;
}

.settings-title {
    font-family: var(--font-display);
    font-size: 1.95rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-gold);
    margin-bottom: 40px;
    text-shadow: 0 0 30px rgba(201, 162, 39, 0.2);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: min(400px, 90vw);
    padding: 24px;
    background: var(--color-obsidian);
    border: 1px solid var(--color-steel);
    border-radius: 4px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-iron);
}

.setting-row:last-of-type {
    border-bottom: none;
}

.setting-row label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    min-width: 120px;
}

.setting-row input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--color-iron);
    border-radius: 2px;
    border: none;
    outline: none;
    cursor: pointer;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--color-blood);
    border: 2px solid var(--color-crimson);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--duration-fast);
}

.setting-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.setting-row span {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-dim);
    min-width: 40px;
    text-align: right;
}

.toggle-btn {
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-secondary);
    background: var(--color-charcoal);
    border: var(--border-thin) solid var(--color-iron);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
        border-color var(--duration-fast),
        color var(--duration-fast);
}

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

.toggle-btn.active {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.back-btn {
    margin-top: var(--space-6);
    align-self: center;
}

/* ============================================================================
   CHARACTER SELECTION MODAL (SETTINGS STYLE - MINIMAL RED)
   ============================================================================ */

#char-select-screen {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(35, 10, 14, 0.98) 0%, transparent 70%),
        rgba(5, 4, 6, 0.92);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    pointer-events: auto;
    backdrop-filter: blur(8px);
}

.char-modal-title {
    font-family: var(--font-display);
    font-size: 1.95rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-blood);
    margin-bottom: 24px;
    text-shadow: 0 0 25px rgba(139, 32, 32, 0.5);
    text-transform: uppercase;
}

.char-modal-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(450px, 92vw);
    padding: 20px;
    background: var(--color-obsidian);
    border: 1px solid var(--color-blood);
    border-radius: 4px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.85),
        0 0 20px rgba(139, 32, 32, 0.25);
}

.hero-modal-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--color-charcoal);
    border: 1px solid var(--color-iron);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-modal-row:hover {
    border-color: var(--color-crimson);
    background: linear-gradient(90deg, rgba(139, 32, 32, 0.25) 0%, var(--color-charcoal) 100%);
}

.hero-modal-row.selected {
    border-color: var(--color-blood);
    background: linear-gradient(90deg, rgba(139, 32, 32, 0.4) 0%, #1e1315 100%);
    box-shadow: 0 0 12px rgba(139, 32, 32, 0.35);
}

.hero-modal-canvas-frame {
    width: 60px;
    height: 54px;
    background: var(--color-void);
    border: 1px solid var(--color-iron);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-modal-canvas-frame canvas {
    width: 60px;
    height: 54px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    pointer-events: none;
}

.hero-modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.hero-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-modal-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: 0.05em;
}

.hero-modal-badge {
    font-family: var(--font-display);
    font-size: 7px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 2px;
    background: var(--color-dark-crimson);
    border: 1px solid var(--color-blood);
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
}

.hero-modal-badge.gold {
    background: rgba(139, 32, 32, 0.3);
    border-color: var(--color-blood);
    color: var(--color-crimson);
}

.hero-modal-badge.purple {
    background: rgba(92, 21, 21, 0.3);
    border-color: #5c1515;
    color: #a85050;
}

/* ============================================================================
   CHARACTER SELECT - EPIC DARK FANTASY SHOWCASE
   ============================================================================ */

#char-select-screen {
    background: linear-gradient(180deg, #0a0708 0%, #12100e 50%, #1a1512 100%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    pointer-events: auto;
    overflow: hidden;
}

.char-select-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(139, 32, 32, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 20% 50%, rgba(93, 173, 226, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(244, 208, 63, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.char-select-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

.char-select-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    color: #f7dc6f;
    text-transform: uppercase;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(247, 220, 111, 0.3),
        0 0 80px rgba(201, 162, 39, 0.2);
    margin: 0;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 40px rgba(247, 220, 111, 0.3), 0 0 80px rgba(201, 162, 39, 0.2); }
    50% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 60px rgba(247, 220, 111, 0.5), 0 0 100px rgba(201, 162, 39, 0.3); }
}

/* Hero Showcase - 3 Cards */
.hero-showcase {
    display: flex;
    gap: 24px;
    perspective: 1000px;
}

/* Hero Card */
.hero-card {
    position: relative;
    width: 280px;
    background: linear-gradient(180deg, rgba(26, 22, 18, 0.95) 0%, rgba(18, 14, 12, 0.98) 100%);
    border: 2px solid #3a3228;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #5a4a30;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(201, 162, 39, 0.15),
        inset 0 1px 0 rgba(255, 215, 0, 0.2);
}

/* Theme Glows */
.hero-card-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.3s;
}

.hero-card:hover .hero-card-glow {
    opacity: 0.25;
}

.knight-glow {
    background: radial-gradient(ellipse at center, rgba(93, 173, 226, 0.8) 0%, transparent 70%);
}

.blonde-glow {
    background: radial-gradient(ellipse at center, rgba(244, 208, 63, 0.8) 0%, transparent 70%);
}

.brown-glow {
    background: radial-gradient(ellipse at center, rgba(175, 122, 197, 0.8) 0%, transparent 70%);
}

/* Portrait Area */
.hero-card-portrait {
    position: relative;
    height: 140px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(180deg, rgba(10, 8, 6, 0.8) 0%, transparent 100%);
    border-bottom: 1px solid rgba(90, 74, 48, 0.3);
    overflow: hidden;
}

.hero-card-portrait canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1;
}

.hero-card-frame {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(90, 74, 48, 0.4);
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}

.knight-frame {
    border-color: rgba(93, 173, 226, 0.4);
    box-shadow: inset 0 0 20px rgba(93, 173, 226, 0.1);
}

.blonde-frame {
    border-color: rgba(244, 208, 63, 0.4);
    box-shadow: inset 0 0 20px rgba(244, 208, 63, 0.1);
}

.brown-frame {
    border-color: rgba(175, 122, 197, 0.4);
    box-shadow: inset 0 0 20px rgba(175, 122, 197, 0.1);
}

/* Card Body */
.hero-card-body {
    position: relative;
    z-index: 2;
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-card-class {
    display: inline-block;
    padding: 3px 10px;
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-radius: 3px;
    width: fit-content;
}

.hero-card-class.knight {
    background: rgba(93, 173, 226, 0.2);
    border: 1px solid rgba(93, 173, 226, 0.4);
    color: #5dade2;
}

.hero-card-class.blonde {
    background: rgba(244, 208, 63, 0.2);
    border: 1px solid rgba(244, 208, 63, 0.4);
    color: #f4d03f;
}

.hero-card-class.brown {
    background: rgba(175, 122, 197, 0.2);
    border: 1px solid rgba(175, 122, 197, 0.4);
    color: #af7ac5;
}

.hero-card-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #f7dc6f;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-card-title-text {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-style: italic;
    color: #a6acaf;
    margin: -4px 0 0;
    letter-spacing: 0.05em;
}

.hero-card-trait {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    color: #706858;
    line-height: 1.4;
    margin: 4px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-left: 2px solid rgba(90, 74, 48, 0.5);
}

/* Stats Display */
.hero-card-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.hero-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-stat-label {
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #706858;
    width: 28px;
}

.hero-stat-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(60, 50, 40, 0.5);
}

.hero-stat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.hp-fill {
    background: linear-gradient(90deg, #8b2020 0%, #e74c3c 100%);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

.atk-fill {
    background: linear-gradient(90deg, #8b6914 0%, #f39c12 100%);
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.spd-fill {
    background: linear-gradient(90deg, #1a5276 0%, #3498db 100%);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

.def-fill {
    background: linear-gradient(90deg, #7d6608 0%, #f1c40f 100%);
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.5);
}

.hero-stat-value {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #c9a227;
    width: 40px;
    text-align: right;
}

/* Select Button */
.hero-select-btn {
    margin-top: 8px;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e8e4e0;
    background: linear-gradient(180deg, #3a3228 0%, #2a2218 100%);
    border: 2px solid #5a4a30;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

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

.knight-btn {
    border-color: rgba(93, 173, 226, 0.5);
}

.knight-btn:hover {
    background: linear-gradient(180deg, rgba(93, 173, 226, 0.3) 0%, rgba(93, 173, 226, 0.15) 100%);
    border-color: #5dade2;
    color: #5dade2;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(93, 173, 226, 0.3);
}

.blonde-btn {
    border-color: rgba(244, 208, 63, 0.5);
}

.blonde-btn:hover {
    background: linear-gradient(180deg, rgba(244, 208, 63, 0.3) 0%, rgba(244, 208, 63, 0.15) 100%);
    border-color: #f4d03f;
    color: #f4d03f;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 208, 63, 0.3);
}

.brown-btn {
    border-color: rgba(175, 122, 197, 0.5);
}

.brown-btn:hover {
    background: linear-gradient(180deg, rgba(175, 122, 197, 0.3) 0%, rgba(175, 122, 197, 0.15) 100%);
    border-color: #af7ac5;
    color: #af7ac5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(175, 122, 197, 0.3);
}

/* Back Button */
.char-back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #a09890;
    background: transparent;
    border: 1px solid #3a3228;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.char-back-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.char-back-btn:hover {
    color: #f7dc6f;
    border-color: rgba(247, 220, 111, 0.5);
    background: rgba(247, 220, 111, 0.05);
}

/* ============================================================================
   GAME HUD - IN-GAME GOTHIC INTEGRATION
   ============================================================================ */

#game-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 90;
}

/* --- PLAYER BARS DOCK (Top-Left In-Game HUD) --- */
#player-bars-container {
    position: absolute;
    top: 20px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 10px;
    background: linear-gradient(135deg, rgba(22, 18, 16, 0.94) 0%, rgba(10, 8, 8, 0.96) 100%);
    border: 2px solid #5a4520;
    border-radius: 8px;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.85),
        inset 0 0 12px rgba(0, 0, 0, 0.9),
        0 0 0 1px #1a1208;
    pointer-events: none;
    animation: hudFadeIn 0.3s ease-out;
}

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

/* Knight Crest Portrait Frame */
.player-crest {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.crest-frame {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #2a2016 0%, #0d0a08 100%);
    border: 2.5px solid #d4af37;
    box-shadow:
        0 0 12px rgba(212, 175, 55, 0.45),
        0 4px 10px rgba(0, 0, 0, 0.8),
        inset 0 0 8px rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.crest-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 235, 150, 0.35);
    pointer-events: none;
}

.crest-avatar-canvas {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    image-rendering: pixelated;
    display: block;
}

/* Bars stack */
.player-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 220px;
}

/* Stat bar common */
.stat-bar {
    position: relative;
    background: #0d0a08;
    border: 1.5px solid #3d2f1f;
    border-radius: 4px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.6);
}

.stat-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 3;
}

.bar-fill {
    height: 100%;
    transition: width 0.15s var(--ease-out);
    position: relative;
}

/* Tags (HP, SP, RG) */
.bar-tag {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 1px 2px #000;
    z-index: 4;
    letter-spacing: 0.05em;
    user-select: none;
}

.bar-text {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: #f0e6d2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    z-index: 4;
    user-select: none;
}

/* Health Bar */
.health-bar {
    height: 20px;
    border-color: #8b1818;
}

.health-bar .bar-fill {
    background: linear-gradient(180deg, #d32f2f 0%, #991414 55%, #5a0000 100%);
    box-shadow: inset 0 1px 0 rgba(255, 180, 180, 0.4);
}

.health-bar .bar-fill.low {
    background: linear-gradient(180deg, #ff3333 0%, #aa0000 100%);
    animation: healthPulse 0.5s ease-in-out infinite;
}

.health-bar.low {
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
}

.health-bar.damage-flash {
    animation: damageFlash 0.15s ease-out;
}

@keyframes damageFlash {
    0% { filter: brightness(1); }
    30% { filter: brightness(2) saturate(1.5); }
    100% { filter: brightness(1); }
}

@keyframes healthPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Stamina Bar */
.stamina-bar {
    height: 12px;
    border-color: #1e6b36;
}

.stamina-bar .bar-fill {
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 50%, #196f3d 100%);
    box-shadow: inset 0 1px 0 rgba(180, 255, 180, 0.4);
}

/* Rage Bar */
.rage-bar {
    height: 10px;
    border-color: #7a3a10;
}

.rage-bar .bar-fill {
    background: linear-gradient(180deg, #f39c12 0%, #e67e22 50%, #d35400 100%);
    box-shadow: inset 0 1px 0 rgba(255, 230, 150, 0.4);
}

.rage-bar.ready {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.6);
    animation: rageReady 0.8s ease-in-out infinite;
}

@keyframes rageReady {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 100, 0, 0.4); }
    50% { box-shadow: 0 0 16px rgba(255, 160, 0, 0.85); }
}

/* --- ABILITY BAR DOCK (Bottom-Left In-Game HUD) --- */
.ability-bar {
    position: absolute;
    bottom: 20px;
    left: 24px;
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(20, 16, 12, 0.78) 0%, rgba(10, 8, 6, 0.86) 100%);
    backdrop-filter: blur(4px);
    border: 1.5px solid rgba(138, 112, 32, 0.55);
    border-radius: 8px;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 215, 0, 0.15);
    pointer-events: none;
    z-index: 10;
}

.ability-slot {
    position: relative;
    width: 48px;
    height: 48px;
    background: radial-gradient(circle at 50% 30%, #251c14 0%, #0d0a08 100%);
    border: 1.5px solid #5a4520;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 3px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.85),
        0 2px 6px rgba(0, 0, 0, 0.5);
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        transform 0.1s;
    user-select: none;
    overflow: hidden;
}

.ability-slot:hover {
    transform: translateY(-2px);
    border-color: #c9a227;
}

.ability-slot.ready {
    border-color: #c9a227;
    box-shadow:
        0 0 8px rgba(201, 162, 39, 0.4),
        inset 0 0 6px rgba(201, 162, 39, 0.15);
}

.ability-slot.on-cooldown {
    border-color: #33271a;
    opacity: 0.65;
}

/* Stamped Gold Hotkey Badge - Compact & Sleek */
.ability-key {
    position: absolute;
    top: 2px;
    left: 2px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #ffd700;
    background: rgba(10, 8, 5, 0.9);
    border: 1px solid rgba(201, 162, 39, 0.65);
    border-radius: 3px;
    padding: 1px 3.5px;
    text-shadow: 0 1px 2px #000;
    z-index: 5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* Ability Name Underneath */
.ability-name {
    font-family: var(--font-display);
    font-size: 7px;
    font-weight: 600;
    color: #b5a278;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 4;
    text-shadow: 0 1px 2px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 94%;
    line-height: 1.1;
}

/* Center Icons */
.ability-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    transition: transform 0.15s ease-out;
}

.ability-slot:hover .ability-icon {
    transform: scale(1.08);
}

/* Icon SVGs */
.icon-valor-strike {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M6 26 L13 19 L26 6 L26 2 L22 2 L9 15 L2 22 Z' fill='%23d8e0f0' stroke='%238890a8' stroke-width='1.2'/%3E%3Cpath d='M26 26 L19 19 L6 6 L6 2 L10 2 L23 15 L30 22 Z' fill='%23d8e0f0' stroke='%238890a8' stroke-width='1.2'/%3E%3Cpolygon points='16,13 18,16 16,19 14,16' fill='%23ff3322'/%3E%3Ccircle cx='16' cy='16' r='2' fill='%23ffd700'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-iron-breaker {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='7' y='6' width='18' height='10' rx='2' fill='%23c9a227' stroke='%23664d14' stroke-width='1.5'/%3E%3Crect x='14' y='16' width='4' height='14' fill='%235c3a1a' stroke='%232e1d0d' stroke-width='1'/%3E%3Cpolygon points='16,8 19,13 13,13' fill='%23ffe580'/%3E%3Cpath d='M9 11 L23 11' stroke='%23fff' stroke-width='1' opacity='0.7'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-valoria-rage {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 C10 8 6 14 6 21 C6 27 10 30 16 30 C22 30 26 27 26 21 C26 14 22 8 16 2 Z' fill='%23ff3300'/%3E%3Cpath d='M16 8 C12 13 10 18 10 23 C10 27 12 28 16 28 C20 28 22 27 22 23 C22 18 20 13 16 8 Z' fill='%23ffaa00'/%3E%3Ccircle cx='13' cy='20' r='2' fill='%23220000'/%3E%3Ccircle cx='19' cy='20' r='2' fill='%23220000'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Blonde Warrior Skill Icons */
.icon-solar-piercer {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4 16 L28 16 M20 8 L28 16 L20 24' stroke='%23ffd700' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='16' cy='16' r='5' fill='%23fff' stroke='%23ffaa00' stroke-width='2'/%3E%3Cpath d='M16 4 L16 8 M16 24 L16 28 M8 8 L10 10 M22 22 L24 24 M8 24 L10 22 M22 10 L24 8' stroke='%23ffd700' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-radiant-tempest {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='11' fill='none' stroke='%23ffd700' stroke-width='2' stroke-dasharray='8 4'/%3E%3Cpath d='M16 5 L18 13 L26 11 L20 17 L25 24 L17 21 L13 27 L13 19 L5 19 L11 14 Z' fill='%23ffe066' stroke='%23c9a227' stroke-width='1'/%3E%3Ccircle cx='16' cy='16' r='3' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-dawn-judgment {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 L19 14 L30 16 L19 18 L16 30 L13 18 L2 16 L13 14 Z' fill='%23fff8cc' stroke='%23ffd700' stroke-width='1.5'/%3E%3Cpath d='M16 6 L16 26 M6 16 L26 16' stroke='%23ffaa00' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='2' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Brown Hair Warrior Skill Icons */
.icon-phantom-blink {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4 22 L14 12 L19 17 L28 8' stroke='%23c084fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpolygon points='28,8 21,8 28,15' fill='%23c084fc'/%3E%3Ccircle cx='8' cy='24' r='4' fill='%237e22ce' opacity='0.7'/%3E%3Ccircle cx='16' cy='16' r='3' fill='%239333ea' opacity='0.8'/%3E%3Ccircle cx='24' cy='10' r='2' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-cyclone-blade {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 4 C22 4 28 9 28 16 C28 23 22 28 16 28 C9 28 4 22 4 16' fill='none' stroke='%232dd4bf' stroke-width='2.5' stroke-linecap='round' stroke-dasharray='10 5'/%3E%3Cpath d='M16 9 C20 9 24 12 24 16 C24 20 20 23 16 23' fill='none' stroke='%2399f6e4' stroke-width='2' stroke-linecap='round'/%3E%3Cpolygon points='16,13 19,16 16,19 13,16' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
}

.icon-eclipse-execution {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='10' fill='%23180828' stroke='%239333ea' stroke-width='2'/%3E%3Cpath d='M14 6 C20 6 24 10 24 16 C24 22 20 26 14 26 C19 23 21 18 19 13 C18 10 16 7 14 6 Z' fill='%23e11d48'/%3E%3Cpath d='M4 28 L28 4 M4 4 L28 28' stroke='%23ff0055' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Cooldown overlay */
.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(8, 6, 8, 0.82);
    transition: height 0.1s linear;
    border-radius: 0 0 4px 4px;
    z-index: 6;
}

.cooldown-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 2px 6px #000;
    z-index: 7;
    pointer-events: none;
}

/* Quick Fullscreen Button in HUD */
#btn-quick-fullscreen {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, rgba(22, 18, 16, 0.94) 0%, rgba(10, 8, 8, 0.96) 100%);
    border: 1.5px solid #5a4520;
    border-radius: 6px;
    color: #ffd700;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), inset 0 0 6px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    z-index: 95;
}

#btn-quick-fullscreen:hover {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

#btn-quick-fullscreen:active {
    transform: scale(0.95);
}

/* ============================================================================
   PAUSE MENU
   ============================================================================ */

#pause-menu {
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(4px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pause-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-widest);
    color: var(--color-text-primary);
    margin-bottom: var(--space-8);
    text-shadow: 0 0 30px rgba(139, 32, 32, 0.3);
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 260px;
}

/* ============================================================================
   DEATH SCREEN
   ============================================================================ */

#death-screen {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(40, 0, 0, 0.95) 0%, transparent 70%),
        linear-gradient(180deg, var(--color-void) 0%, #0a0505 100%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.death-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--color-blood);
    margin-bottom: 16px;
    text-shadow:
        0 2px 0 var(--color-dark-crimson),
        0 0 40px rgba(139, 32, 32, 0.5);
}

.death-subtitle {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 40px;
    font-style: italic;
    letter-spacing: 0.1em;
}

/* ============================================================================
   VICTORY SCREEN
   ============================================================================ */

#victory-screen {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(30, 25, 10, 0.95) 0%, transparent 70%),
        linear-gradient(180deg, var(--color-void) 0%, #0a0a05 100%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.victory-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--color-gold);
    margin-bottom: 16px;
    text-shadow:
        0 2px 0 var(--color-ancient-gold),
        0 0 40px rgba(201, 162, 39, 0.4);
}

.victory-subtitle {
    font-family: var(--font-display);
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-10);
    font-style: italic;
    letter-spacing: var(--tracking-wide);
}

/* ============================================================================
   CONTROLS HELP
   ============================================================================ */

#controls-help {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3);
    background: rgba(10, 8, 8, 0.85);
    border: var(--border-thin) solid var(--color-iron);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.control-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--color-text-dim);
}

.control-item .key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--color-text-secondary);
    background: var(--color-charcoal);
    border: 1px solid var(--color-iron);
    border-radius: 2px;
}

/* ============================================================================
   DEBUG INFO
   ============================================================================ */

#debug-info {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    padding: var(--space-2) var(--space-3);
    background: rgba(0, 0, 0, 0.9);
    border: var(--border-thin) solid var(--color-blood);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: #00ff00;
    pointer-events: none;
    z-index: var(--z-notification);
}

#debug-info > div {
    padding: 2px 0;
}

/* ============================================================================
   SCREEN TRANSITIONS
   ============================================================================ */

.screen-enter {
    animation: screenEnter var(--duration-slow) var(--ease-out) forwards;
}

.screen-exit {
    animation: screenExit var(--duration-normal) var(--ease-in-out) forwards;
}

@keyframes screenEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes screenExit {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .player-stats {
        width: 180px;
        bottom: var(--space-4);
        left: var(--space-4);
    }

    .ability-bar {
        bottom: var(--space-3);
        left: var(--space-3);
        gap: 6px;
        padding: 4px 6px;
    }

    .ability-slot {
        width: 40px;
        height: 40px;
    }

    .ability-icon {
        width: 20px;
        height: 20px;
    }

    .ability-key {
        font-size: 9px;
        padding: 0 3px;
    }

    .ability-name {
        display: none;
    }

    #controls-help {
        display: none;
    }

    .game-title {
        letter-spacing: 0.2em;
    }

    .menu-btn {
        padding: var(--space-3) var(--space-6);
    }
}

@media (min-width: 1920px) {
    .player-stats {
        width: 280px;
    }

    .ability-bar {
        bottom: 24px;
        left: 28px;
    }

    .ability-slot {
        width: 50px;
        height: 50px;
    }

    .ability-key {
        font-size: 10px;
    }
}

/* ============================================================================
   FULLSCREEN MODE
   ============================================================================ */

:fullscreen #game-container {
    width: 100vw;
    height: 100vh;
}

:fullscreen #game-canvas {
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

/* ============================================================================
   SCREEN SHAKE ANIMATIONS
   ============================================================================ */

@keyframes shakeLight {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 2px); }
    50% { transform: translate(3px, -2px); }
    75% { transform: translate(-2px, -1px); }
}

@keyframes shakeMedium {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-5px, 3px); }
    40% { transform: translate(5px, -3px); }
    60% { transform: translate(-3px, -2px); }
    80% { transform: translate(3px, 2px); }
}

@keyframes shakeHeavy {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    15% { transform: translate(-8px, 4px) rotate(-0.5deg); }
    30% { transform: translate(8px, -4px) rotate(0.5deg); }
    45% { transform: translate(-6px, -3px) rotate(-0.3deg); }
    60% { transform: translate(6px, 3px) rotate(0.3deg); }
    75% { transform: translate(-4px, -2px) rotate(-0.2deg); }
}

/* Apply shake to HUD elements */
#game-hud.shake-light {
    animation: shakeLight 0.1s ease-out;
}

#game-hud.shake-medium {
    animation: shakeMedium 0.15s ease-out;
}

#game-hud.shake-heavy {
    animation: shakeHeavy 0.2s ease-out;
}

/* ============================================================================
   ABILITY READY ANIMATION
   ============================================================================ */

@keyframes abilityReady {
    0% {
        box-shadow: 0 0 8px rgba(201, 162, 39, 0.3);
    }
    50% {
        box-shadow: 0 0 16px rgba(201, 162, 39, 0.6), 0 0 24px rgba(201, 162, 39, 0.3);
    }
    100% {
        box-shadow: 0 0 8px rgba(201, 162, 39, 0.3);
    }
}

.ability-slot.just-ready {
    animation: abilityReady 0.3s ease-out;
}

/* ============================================================================
   HIT FLASH EFFECT
   ============================================================================ */

@keyframes hitFlash {
    0% { filter: brightness(1); }
    20% { filter: brightness(1.3) saturate(1.1); }
    100% { filter: brightness(1); }
}

.hit-flash {
    animation: hitFlash 0.15s ease-out;
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

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