/* ==========================================================================
   WOLFENSTEIN 3D — BROWSER REMAKE
   Complete UI Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */
:root {
    /* Wolfenstein palette */
    --wolf-black: #0a0a0a;
    --wolf-gold: #c8b060;
    --wolf-gold-dim: #9a8545;
    --wolf-gold-bright: #e0cc80;
    --wolf-red: #8b0000;
    --wolf-red-bright: #bb2020;
    --wolf-grey: #888888;
    --wolf-grey-dark: #2a2a2a;
    --wolf-grey-darker: #1a1a1a;
    --wolf-white: #d8d0b8;
    --wolf-btn-hover: #4a3a1a;
    --wolf-menu-bg: rgba(0, 0, 0, 0.95);
    --wolf-green: #40a040;
    --wolf-yellow: #c8c030;
    --wolf-orange: #d07020;

    /* Typography */
    --font-title: 'Trebuchet MS', 'Arial Black', Impact, sans-serif;
    --font-body: 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'Courier New', 'Consolas', 'Liberation Mono', monospace;

    /* Sizing */
    --hud-height: 80px;
    --hud-height-mobile: 60px;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--wolf-black);
    color: var(--wolf-white);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* --------------------------------------------------------------------------
   UTILITY CLASSES
   -------------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

.screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: screenFadeIn 0.4s ease-out;
}

.screen-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    max-height: 100vh;
    overflow-y: auto;
}

.screen-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(200, 176, 96, 0.3);
    text-align: center;
}

/* --------------------------------------------------------------------------
   ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes screenFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 30px rgba(200, 176, 96, 0.4), 0 0 60px rgba(139, 0, 0, 0.2); }
    50%      { text-shadow: 0 0 40px rgba(200, 176, 96, 0.7), 0 0 80px rgba(139, 0, 0, 0.4); }
}

@keyframes progressGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(200, 176, 96, 0.4); }
    50%      { box-shadow: 0 0 14px rgba(200, 176, 96, 0.8); }
}

@keyframes subtitleDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* --------------------------------------------------------------------------
   1. LOADING SCREEN
   -------------------------------------------------------------------------- */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wolf-black);
    background: radial-gradient(ellipse at center, #1a0a0a 0%, var(--wolf-black) 70%);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.loading-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    text-align: center;
    animation: titlePulse 3s ease-in-out infinite;
}

.loading-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--wolf-grey);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.progress-track {
    width: min(400px, 80vw);
    height: 4px;
    background: var(--wolf-grey-dark);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--wolf-gold-dim), var(--wolf-gold), var(--wolf-gold-bright));
    border-radius: 2px;
    transition: width 0.3s ease-out;
    animation: progressGlow 2s ease-in-out infinite;
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--wolf-gold-dim);
    letter-spacing: 0.15em;
}

/* --------------------------------------------------------------------------
   2. MAIN MENU
   -------------------------------------------------------------------------- */
#main-menu {
    z-index: 200;
}

.menu-background {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.6) 100%),
        url('../assets/ui/screens/title_screen.jpg') center/cover no-repeat;
    background-color: var(--wolf-black);
    z-index: -1;
}

/* Subtle noise texture via CSS */
.menu-background::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    z-index: 1;
}

.menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.menu-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 900;
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    text-shadow:
        0 0 30px rgba(200, 176, 96, 0.5),
        0 0 60px rgba(139, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
    line-height: 1.1;
}

.menu-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--wolf-grey);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.menu-footer {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--wolf-grey-dark);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: absolute;
    bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   BUTTONS (SHARED)
   -------------------------------------------------------------------------- */
.btn {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--wolf-gold);
    background: transparent;
    border: 2px solid var(--wolf-gold-dim);
    padding: 0.7rem 2.5rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.2s ease;
    min-width: 260px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--wolf-btn-hover);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.btn:hover::before,
.btn:focus-visible::before {
    opacity: 1;
}

.btn:hover,
.btn:focus-visible {
    border-color: var(--wolf-gold);
    color: var(--wolf-gold-bright);
    outline: none;
    text-shadow: 0 0 8px rgba(200, 176, 96, 0.4);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    border-width: 3px;
    font-size: 1.15rem;
    padding: 0.9rem 3rem;
}

.btn-primary::before {
    background: linear-gradient(180deg, rgba(200, 176, 96, 0.15), rgba(74, 58, 26, 0.9));
}

.btn-large {
    font-size: 1.3rem;
    padding: 1rem 3.5rem;
}

.btn-secondary {
    border-color: var(--wolf-grey-dark);
    color: var(--wolf-grey);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    border-color: var(--wolf-gold-dim);
    color: var(--wolf-gold);
}

.btn-danger {
    border-color: var(--wolf-red);
    color: #cc4444;
}

.btn-danger::before {
    background: rgba(139, 0, 0, 0.3);
}

.btn-danger:hover,
.btn-danger:focus-visible {
    border-color: var(--wolf-red-bright);
    color: #ee5555;
    text-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
}

.btn-back {
    border: none;
    color: var(--wolf-grey);
    font-size: 0.9rem;
    min-width: auto;
    padding: 0.5rem 1.5rem;
}

.btn-back:hover,
.btn-back:focus-visible {
    color: var(--wolf-gold);
    border: none;
}

.btn-back::before {
    display: none;
}

/* --------------------------------------------------------------------------
   3. EPISODE SELECT
   -------------------------------------------------------------------------- */
#episode-select {
    background: var(--wolf-menu-bg);
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 900px;
    width: 100%;
    padding: 0 1rem;
}

.episode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 1.2rem;
    background: rgba(42, 42, 42, 0.4);
    border: 2px solid var(--wolf-grey-dark);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    color: var(--wolf-white);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    min-height: 160px;
}

/* Episode card background images */
.episode-card[data-episode="1"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.7) 100%), url('../assets/ui/screens/episode_1.jpg'); }
.episode-card[data-episode="2"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.7) 100%), url('../assets/ui/screens/episode_2.jpg'); }
.episode-card[data-episode="3"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.7) 100%), url('../assets/ui/screens/episode_3.jpg'); }
.episode-card[data-episode="4"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.7) 100%), url('../assets/ui/screens/episode_4.jpg'); }
.episode-card[data-episode="5"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.7) 100%), url('../assets/ui/screens/episode_5.jpg'); }
.episode-card[data-episode="6"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.7) 100%), url('../assets/ui/screens/episode_6.jpg'); }
.episode-card[data-episode="7"] { background-image: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(30,0,0,0.8) 100%), url('../assets/ui/screens/episode_7.jpg'); }

.episode-card:not(.locked):hover,
.episode-card:not(.locked):focus-visible {
    border-color: var(--wolf-gold);
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(200, 176, 96, 0.15);
    filter: brightness(1.2);
}

.episode-card:not(.locked):active {
    transform: translateY(0);
}

.episode-number {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--wolf-gold-dim);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.episode-name {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--wolf-gold);
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.episode-desc {
    font-size: 0.8rem;
    color: var(--wolf-grey);
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Locked episodes */
.episode-card.locked {
    cursor: not-allowed;
    opacity: 0.4;
    border-color: var(--wolf-grey-darker);
    filter: grayscale(0.8) brightness(0.6);
}

.episode-card.locked .episode-name,
.episode-card.locked .episode-number {
    color: var(--wolf-grey);
}

.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.7);
    z-index: 2;
}

.lock-icon {
    font-size: 1.8rem;
    filter: grayscale(1) brightness(0.6);
}

.lock-text {
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--wolf-grey);
    letter-spacing: 0.3em;
    margin-top: 0.3rem;
}

/* --------------------------------------------------------------------------
   4. DIFFICULTY SELECT
   -------------------------------------------------------------------------- */
#difficulty-select {
    background: var(--wolf-menu-bg);
}

.difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 480px;
    padding: 0 1rem;
}

.difficulty-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.5rem;
    background: rgba(42, 42, 42, 0.3);
    border: 2px solid var(--wolf-grey-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    color: var(--wolf-white);
    text-align: left;
}

.difficulty-card:hover,
.difficulty-card:focus-visible {
    outline: none;
    transform: translateX(4px);
    background: rgba(42, 42, 42, 0.6);
}

.difficulty-card[data-difficulty="baby"] {
    border-color: #2a4a2a;
}
.difficulty-card[data-difficulty="baby"]:hover,
.difficulty-card[data-difficulty="baby"]:focus-visible {
    border-color: var(--wolf-green);
    box-shadow: 0 0 15px rgba(64, 160, 64, 0.2);
}

.difficulty-card[data-difficulty="easy"] {
    border-color: #4a4a20;
}
.difficulty-card[data-difficulty="easy"]:hover,
.difficulty-card[data-difficulty="easy"]:focus-visible {
    border-color: var(--wolf-yellow);
    box-shadow: 0 0 15px rgba(200, 192, 48, 0.2);
}

.difficulty-card[data-difficulty="medium"] {
    border-color: #4a3020;
}
.difficulty-card[data-difficulty="medium"]:hover,
.difficulty-card[data-difficulty="medium"]:focus-visible {
    border-color: var(--wolf-orange);
    box-shadow: 0 0 15px rgba(208, 112, 32, 0.2);
}

.difficulty-card[data-difficulty="hard"] {
    border-color: #4a1a1a;
}
.difficulty-card[data-difficulty="hard"]:hover,
.difficulty-card[data-difficulty="hard"]:focus-visible {
    border-color: var(--wolf-red-bright);
    box-shadow: 0 0 15px rgba(187, 32, 32, 0.3);
}

.difficulty-face {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    font-size: 2rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.difficulty-face--green  { background: rgba(64, 160, 64, 0.15); border: 1px solid rgba(64, 160, 64, 0.3); }
.difficulty-face--yellow { background: rgba(200, 192, 48, 0.15); border: 1px solid rgba(200, 192, 48, 0.3); }
.difficulty-face--orange { background: rgba(208, 112, 32, 0.15); border: 1px solid rgba(208, 112, 32, 0.3); }
.difficulty-face--red    { background: rgba(187, 32, 32, 0.15); border: 1px solid rgba(187, 32, 32, 0.3); }

.difficulty-label {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wolf-gold);
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   5b. CROSSHAIR
   -------------------------------------------------------------------------- */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    pointer-events: none;
}

.crosshair-dot {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* Crosshair style: cross */
.crosshair-cross .crosshair-dot {
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow: none;
    position: relative;
}
.crosshair-cross .crosshair-dot::before,
.crosshair-cross .crosshair-dot::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}
.crosshair-cross .crosshair-dot::before {
    width: 16px;
    height: 2px;
    top: 0;
    left: -7px;
}
.crosshair-cross .crosshair-dot::after {
    width: 2px;
    height: 16px;
    top: -7px;
    left: 0;
}

/* Hit marker — brief X flash on enemy hit */
#hit-marker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 16;
    pointer-events: none;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.08s ease-out;
}
#hit-marker.active {
    opacity: 1;
}
#hit-marker::before,
#hit-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}
#hit-marker::before {
    transform: translate(-50%, -50%) rotate(45deg);
}
#hit-marker::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. GAME CANVAS
   -------------------------------------------------------------------------- */
#game-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: var(--wolf-black);
    image-rendering: pixelated;
}

/* --------------------------------------------------------------------------
   6. GAME HUD
   -------------------------------------------------------------------------- */
#game-hud {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: var(--hud-height);
    pointer-events: none;
}

.hud-bar {
    display: grid;
    grid-template-columns: auto auto 1fr auto 1fr auto auto auto;
    align-items: center;
    height: 100%;
    background: linear-gradient(180deg, #2e2820 0%, #1a1610 40%, #0f0d0a 100%);
    border-top: 3px solid var(--wolf-gold-dim);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(200, 176, 96, 0.1);
    padding: 0 1rem;
    gap: 0.3rem;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.8rem;
    height: 100%;
    position: relative;
}

/* Separator between HUD items */
.hud-item + .hud-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12%;
    bottom: 12%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(200, 176, 96, 0.15), transparent);
}

.hud-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--wolf-gold-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 3px;
    text-shadow: 0 0 4px rgba(200, 176, 96, 0.15);
}

.hud-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--wolf-gold-bright);
    line-height: 1;
    text-shadow: 0 0 8px rgba(200, 176, 96, 0.25);
}

/* Floor */
.hud-floor .hud-value {
    font-size: 1.2rem;
    color: var(--wolf-white);
}

/* Par time countdown */
.hud-par-time {
    display: block;
    font-size: 0.55rem;
    color: #8a8a6a;
    letter-spacing: 0.05em;
    margin-top: 2px;
    white-space: nowrap;
}

.hud-par-time.under-par {
    color: #40c040;
}

.hud-par-time.over-par {
    color: #cc4444;
}

/* Score */
.hud-score .hud-value {
    font-size: 1.2rem;
    min-width: 70px;
    text-align: center;
    color: var(--wolf-gold-bright);
    letter-spacing: 0.05em;
}

/* BJ Face */
.hud-face {
    padding: 0 0.6rem;
}

.hud-face-frame {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--wolf-grey-darker);
    border: 3px solid var(--wolf-gold-dim);
    border-radius: 4px;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(200, 176, 96, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.hud-face-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

/* Lives */
.hud-lives .hud-value {
    color: var(--wolf-gold);
    font-size: 1.5rem;
}

/* Health */
.hud-health {
    min-width: 110px;
}

.hud-health-bar {
    width: 100%;
    max-width: 110px;
    height: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(200, 176, 96, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.hud-health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2d8a2d, #40c040);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 1px;
    box-shadow: 0 0 6px rgba(64, 192, 64, 0.3);
}

/* Health color states via JS class toggling */
.hud-health-fill.health-high   { background: linear-gradient(90deg, #2d8a2d, #40c040); }
.hud-health-fill.health-medium { background: linear-gradient(90deg, #c8a020, #e0c030); }
.hud-health-fill.health-low    { background: linear-gradient(90deg, #8b0000, #cc2020); }

.hud-health-number {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Ammo */
.hud-ammo .hud-value {
    color: var(--wolf-white);
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(216, 208, 184, 0.2);
}

/* Keys */
.hud-key-icons {
    display: flex;
    gap: 8px;
}

.hud-key {
    width: 22px;
    height: 22px;
    border: 2px solid #3a3a3a;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hud-key--gold {
    background: rgba(200, 176, 96, 0.08);
    border-color: #3a3520;
}

.hud-key--gold.active {
    background: linear-gradient(135deg, #d4b840, #c8a020);
    border-color: #e0c850;
    box-shadow: 0 0 12px rgba(200, 176, 64, 0.7), 0 0 24px rgba(200, 176, 64, 0.3);
    animation: keyGlow 2s ease-in-out infinite;
}

.hud-key--silver {
    background: rgba(170, 170, 170, 0.08);
    border-color: #333333;
}

.hud-key--silver.active {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    border-color: #d0d0d0;
    box-shadow: 0 0 12px rgba(180, 180, 180, 0.7), 0 0 24px rgba(180, 180, 180, 0.3);
    animation: keyGlow 2s ease-in-out infinite;
}

@keyframes keyGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(200, 176, 64, 0.5); }
    50%      { box-shadow: 0 0 18px rgba(200, 176, 64, 0.9), 0 0 30px rgba(200, 176, 64, 0.4); }
}

/* Weapon */
.hud-weapon .hud-value {
    font-size: 0.9rem;
    color: var(--wolf-gold);
    letter-spacing: 0.15em;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(200, 176, 96, 0.2);
}

/* Difficulty face images */
.difficulty-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   7. PAUSE MENU
   -------------------------------------------------------------------------- */
#pause-menu {
    z-index: 300;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pause-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.pause-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    text-shadow: 0 0 30px rgba(200, 176, 96, 0.4);
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.pause-buttons .btn {
    min-width: 240px;
}

/* --------------------------------------------------------------------------
   8. MOBILE CONTROLS
   -------------------------------------------------------------------------- */
#mobile-controls {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    bottom: var(--hud-height);
}

.mobile-left {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50%;
    height: 50%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.5rem;
    pointer-events: auto;
}

.joystick-area {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.joystick-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(200, 176, 96, 0.25);
    background: rgba(42, 42, 42, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.joystick-knob {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(200, 176, 96, 0.4), rgba(200, 176, 96, 0.15));
    border: 2px solid rgba(200, 176, 96, 0.35);
    transition: transform 0.05s linear;
}

.mobile-right {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 50%;
    height: 50%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1.5rem;
    pointer-events: auto;
}

.mobile-btn {
    font-family: var(--font-title);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid rgba(200, 176, 96, 0.3);
    border-radius: 8px;
    background: rgba(42, 42, 42, 0.4);
    cursor: pointer;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.mobile-btn--fire {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 0.85rem;
    border-color: var(--wolf-red);
    color: #cc4444;
    background: rgba(139, 0, 0, 0.2);
}

.mobile-btn--fire:active {
    background: rgba(139, 0, 0, 0.5);
    border-color: var(--wolf-red-bright);
    color: #ff5555;
}

.mobile-btn--weapon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

.mobile-btn--weapon:active {
    background: rgba(200, 176, 96, 0.2);
    border-color: var(--wolf-gold);
}

.mobile-btn--interact {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border-color: rgba(64, 160, 64, 0.3);
    color: var(--wolf-green);
}

.mobile-btn--interact:active {
    background: rgba(64, 160, 64, 0.2);
    border-color: var(--wolf-green);
}

/* --------------------------------------------------------------------------
   9. SETTINGS SCREEN
   -------------------------------------------------------------------------- */
#settings-screen {
    z-index: 300;
    background: var(--wolf-menu-bg);
}

.settings-panel {
    max-width: 520px;
    width: 100%;
}

.settings-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--wolf-grey-dark);
}

.settings-group:last-of-type {
    border-bottom: none;
}

.settings-group-title {
    font-family: var(--font-title);
    font-size: 0.85rem;
    color: var(--wolf-gold-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.3rem;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.setting-label {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--wolf-white);
    min-width: 140px;
    flex-shrink: 0;
}

.setting-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--wolf-gold);
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* Range slider — Wolfenstein gold theme */
.setting-range {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: var(--wolf-grey-dark);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wolf-gold);
    border: 2px solid var(--wolf-gold-bright);
    box-shadow: 0 0 6px rgba(200, 176, 96, 0.4);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.setting-range::-webkit-slider-thumb:hover {
    box-shadow: 0 0 12px rgba(200, 176, 96, 0.7);
}

.setting-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wolf-gold);
    border: 2px solid var(--wolf-gold-bright);
    box-shadow: 0 0 6px rgba(200, 176, 96, 0.4);
    cursor: pointer;
}

.setting-range::-moz-range-track {
    height: 4px;
    background: var(--wolf-grey-dark);
    border-radius: 2px;
}

/* Select dropdown — dark styled */
.setting-select {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--wolf-gold);
    background: var(--wolf-grey-darker);
    border: 1px solid var(--wolf-grey-dark);
    padding: 0.4rem 2rem 0.4rem 0.6rem;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c8b060'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 10px 6px;
}

.setting-select:hover,
.setting-select:focus {
    border-color: var(--wolf-gold-dim);
}

.setting-select option {
    background: var(--wolf-grey-darker);
    color: var(--wolf-gold);
}

/* Settings back button */
#settings-screen .btn-primary {
    margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLETS (max-width: 900px)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .episode-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .episode-card {
        padding: 1rem;
    }

    .episode-name {
        font-size: 0.9rem;
    }

    .episode-desc {
        font-size: 0.75rem;
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — MOBILE (max-width: 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    :root {
        --hud-height: var(--hud-height-mobile);
    }

    .screen-title {
        font-size: 1.6rem;
    }

    .menu-title {
        font-size: 2rem;
        letter-spacing: 0.15em;
    }

    .menu-subtitle {
        font-size: 0.85rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.8rem;
        min-width: 220px;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 0.75rem 2rem;
    }

    .episode-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        max-width: 360px;
    }

    .episode-card {
        padding: 0.8rem;
    }

    .difficulty-card {
        padding: 0.8rem 1rem;
        gap: 0.8rem;
    }

    .difficulty-face {
        width: 44px;
        height: 44px;
        font-size: 1.6rem;
    }

    .difficulty-label {
        font-size: 0.95rem;
    }

    /* HUD compact */
    .hud-bar {
        grid-template-columns: repeat(8, 1fr);
        padding: 0 0.4rem;
        gap: 0;
    }

    .hud-label {
        font-size: 0.45rem;
    }

    .hud-value {
        font-size: 0.95rem;
    }

    .hud-face-frame {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        border-width: 2px;
    }

    .hud-health-bar {
        max-width: 60px;
        height: 5px;
    }

    .hud-health {
        min-width: 70px;
    }

    .hud-key {
        width: 16px;
        height: 16px;
    }

    .hud-score .hud-value {
        font-size: 0.85rem;
        min-width: auto;
    }

    .hud-floor .hud-value {
        font-size: 0.85rem;
    }

    .hud-weapon .hud-value {
        font-size: 0.7rem;
    }

    .hud-health-number {
        font-size: 0.8rem;
    }

    /* Pause */
    .pause-title {
        letter-spacing: 0.2em;
    }

    .pause-buttons .btn {
        min-width: 200px;
    }
}

/* --------------------------------------------------------------------------
   TOUCH DEVICE DETECTION — show mobile controls
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    #mobile-controls:not(.hidden) {
        display: block;
    }
}

/* On non-touch devices, keep mobile controls hidden even without .hidden */
@media (hover: hover) and (pointer: fine) {
    #mobile-controls {
        display: none !important;
    }
}

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

/* --------------------------------------------------------------------------
   SCROLLBAR STYLING (for episode grid overflow on small screens)
   -------------------------------------------------------------------------- */
.screen-inner::-webkit-scrollbar {
    width: 4px;
}

.screen-inner::-webkit-scrollbar-track {
    background: transparent;
}

.screen-inner::-webkit-scrollbar-thumb {
    background: var(--wolf-grey-dark);
    border-radius: 2px;
}

.screen-inner::-webkit-scrollbar-thumb:hover {
    background: var(--wolf-grey);
}

/* ==========================================================================
   CINEMATIC OVERLAY
   ========================================================================== */

/* --- Full-screen cinematic container --- */
#cinematic-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    /* Vignette effect */
    background-image: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* --- Centered text container --- */
#cinematic-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    width: 100%;
    padding: 2rem;
    text-align: center;
}

/* --- Text style: title (year, location) --- */
.cinematic-title {
    font-family: var(--font-title);
    font-size: 3rem;
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    text-shadow:
        0 0 20px rgba(200, 176, 96, 0.5),
        0 0 40px rgba(200, 176, 96, 0.2);
}

/* --- Text style: narration --- */
.cinematic-narration {
    font-family: var(--font-body);
    font-size: 1.4rem;
    color: #ffffff;
    font-style: italic;
    line-height: 1.8;
    max-width: 600px;
}

/* --- Text style: episode number --- */
.cinematic-episode {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--wolf-red);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-shadow:
        0 0 20px rgba(139, 0, 0, 0.5),
        0 0 40px rgba(139, 0, 0, 0.2);
}

/* --- Text style: subtitle (episode name) --- */
.cinematic-subtitle {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--wolf-gold);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-shadow:
        0 0 15px rgba(200, 176, 96, 0.4);
}

/* --- Skip hint --- */
#cinematic-skip {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(136, 136, 136, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
}

/* --- Responsive adjustments --- */
@media (max-width: 600px) {
    .cinematic-title {
        font-size: 2rem;
        letter-spacing: 0.2em;
    }

    .cinematic-narration {
        font-size: 1.1rem;
        line-height: 1.6;
        padding: 0 1rem;
    }

    .cinematic-episode {
        font-size: 1.8rem;
    }

    .cinematic-subtitle {
        font-size: 1.3rem;
    }

    #cinematic-skip {
        bottom: 1rem;
        right: 1rem;
        font-size: 0.65rem;
    }
}

/* ==========================================================================
   PHASE 2: WEAPON DISPLAY (DEPRECATED — replaced by 3D WeaponViewmodel)
   Old 2D sprite weapon HUD rules commented out. The weapon is now rendered
   as a 3D overlay via weapon-viewmodel.js using a separate Three.js scene.
   ========================================================================== */

/*
#weapon-display {
    position: fixed;
    bottom: var(--hud-height);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

#weapon-sprite {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: transform 0.15s ease;
    image-rendering: pixelated;
}

#weapon-img {
    display: block;
    width: 300px;
    height: auto;
    pointer-events: none;
    image-rendering: pixelated;
    mix-blend-mode: screen;
    filter: brightness(1);
    transition: filter 0.1s ease;
    drop-shadow: 0 -2px 8px rgba(0, 0, 0, 0.5);
}

.weapon-knife #weapon-img { width: 200px; }
.weapon-pistol #weapon-img { width: 280px; }
.weapon-mp40 #weapon-img { width: 320px; }
.weapon-chaingun #weapon-img { width: 340px; }

@keyframes weaponBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.weapon-bobbing {
    animation: weaponBob 0.33s ease-in-out infinite;
}

@keyframes weaponFire {
    0%   { transform: scale(1);    filter: brightness(1); }
    20%  { transform: scale(1.08); filter: brightness(2); }
    60%  { transform: scale(1.04); filter: brightness(1.4); }
    100% { transform: scale(1);    filter: brightness(1); }
}

.weapon-firing #weapon-img {
    animation: weaponFire 0.12s ease-out forwards;
}

.weapon-firing::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(255, 240, 120, 0.9) 0%, rgba(255, 160, 40, 0.5) 50%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.weapon-switching-out {
    transform: translateY(100px) !important;
    transition: transform 0.15s ease-in !important;
}

.weapon-switching-in {
    transform: translateY(0) !important;
    transition: transform 0.15s ease-out !important;
}
*/

/* ==========================================================================
   PHASE 2: DAMAGE OVERLAY & FEEDBACK
   ========================================================================== */

/* --- Damage vignette: full-screen red overlay --- */
#damage-overlay {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

/* Fade class — applied after setting initial opacity to trigger CSS transition */
#damage-overlay.damage-fade {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

/* --- Pickup flash: full-screen colored overlay --- */
#pickup-flash {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

#pickup-flash.pickup-fade {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* --- Low health persistent pulse --- */
@keyframes lowHealthPulse {
    0%, 100% {
        background: radial-gradient(ellipse at center, transparent 40%, rgba(139, 0, 0, 0) 100%);
    }
    50% {
        background: radial-gradient(ellipse at center, transparent 40%, rgba(139, 0, 0, 0.15) 100%);
    }
}

#damage-overlay.low-health-pulse {
    opacity: 1 !important;
    animation: lowHealthPulse 1s ease-in-out infinite;
}

/* ==========================================================================
   PHASE 2: RESPONSIVE ADJUSTMENTS (weapon rules deprecated — 3D viewmodel)
   ========================================================================== */
/*
@media (max-width: 600px) {
    #weapon-display {
        bottom: var(--hud-height-mobile);
    }

    .weapon-knife #weapon-img   { width: 140px; }
    .weapon-pistol #weapon-img  { width: 200px; }
    .weapon-mp40 #weapon-img    { width: 220px; }
    .weapon-chaingun #weapon-img { width: 240px; }

    #weapon-img {
        width: 200px;
    }
}
*/

/* Episode Coming Soon badge */
.episode-badge {
    display: block;
    margin-top: 8px;
    padding: 3px 10px;
    background: rgba(255, 100, 50, 0.2);
    color: #ff8855;
    border: 1px solid rgba(255, 100, 50, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s;
}

/* ==========================================================================
   CREDITS SEQUENCE
   ========================================================================== */

/* ── Overlay ─────────────────────────────────────────────────────── */
.credits-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    overflow: hidden;
    animation: creditsFadeIn 1.2s ease-out;
}

.credits-overlay.credits-fadeout {
    animation: creditsFadeOut 0.8s ease-in forwards;
}

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

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

/* ── Background Image Layer ──────────────────────────────────────── */
.credits-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.credits-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.credits-bg-image.credits-bg-visible {
    opacity: 1;
}

.credits-bg-dim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.6) 30%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

/* ── Scroll Container ────────────────────────────────────────────── */
.credits-scroll {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform;
}

.credits-spacer {
    height: 100vh;
    flex-shrink: 0;
}

.credits-gap {
    height: 40vh;
    flex-shrink: 0;
}

/* ── Sections ────────────────────────────────────────────────────── */
.credits-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 3rem 2rem;
    max-width: 700px;
    width: 90%;
    text-align: center;
}

/* ── Skip Hint ───────────────────────────────────────────────────── */
.credits-skip-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
    animation: creditsHintPulse 3s ease-in-out infinite;
}

@keyframes creditsHintPulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.15; }
}

/* ── Title Card (Section 1) ──────────────────────────────────────── */
.credits-game-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--wolf-gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-shadow:
        0 0 40px rgba(200, 176, 96, 0.6),
        0 0 80px rgba(139, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8);
    animation: creditsTitleGlow 4s ease-in-out infinite;
}

.credits-game-subtitle {
    font-family: var(--font-title);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: var(--wolf-red-bright);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: -0.3rem;
}

.credits-tagline {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--wolf-white);
    font-style: italic;
    margin-top: 0.5rem;
}

@keyframes creditsTitleGlow {
    0%, 100% {
        text-shadow:
            0 0 40px rgba(200, 176, 96, 0.6),
            0 0 80px rgba(139, 0, 0, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow:
            0 0 60px rgba(200, 176, 96, 0.9),
            0 0 120px rgba(139, 0, 0, 0.5),
            0 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* ── Divider ─────────────────────────────────────────────────────── */
.credits-divider {
    width: 120px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--wolf-gold) 20%,
        var(--wolf-gold-bright) 50%,
        var(--wolf-gold) 80%,
        transparent 100%
    );
    margin: 0.5rem 0;
    opacity: 0.7;
}

/* ── Role Headers ────────────────────────────────────────────────── */
.credits-role {
    font-family: var(--font-title);
    font-size: clamp(1.3rem, 3vw, 2rem);
    color: var(--wolf-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(200, 176, 96, 0.4);
}

/* ── Portrait Frame ──────────────────────────────────────────────── */
.credits-portrait-frame {
    width: clamp(200px, 40vw, 320px);
    aspect-ratio: 4 / 3;
    border: 2px solid var(--wolf-gold-dim);
    border-radius: 4px;
    overflow: hidden;
    box-shadow:
        0 0 30px rgba(200, 176, 96, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    margin: 0.5rem 0;
}

.credits-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Names ───────────────────────────────────────────────────────── */
.credits-name {
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 2.8vw, 1.8rem);
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    margin-top: 0.3rem;
}

/* ── Detail Lines ────────────────────────────────────────────────── */
.credits-detail {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: rgba(216, 208, 184, 0.85);
    line-height: 1.6;
}

.credits-link {
    color: var(--wolf-gold-dim);
    font-weight: bold;
}

/* ── Sub-Block (Agents) ──────────────────────────────────────────── */
.credits-sub-block {
    margin-top: 0.8rem;
    padding: 1rem;
    border: 1px solid rgba(200, 176, 96, 0.15);
    border-radius: 4px;
    background: rgba(200, 176, 96, 0.05);
}

.credits-sub-title {
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
    color: var(--wolf-gold);
    font-weight: bold;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

/* ── Tools ───────────────────────────────────────────────────────── */
.credits-tool {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: rgba(216, 208, 184, 0.85);
    line-height: 1.8;
}

.credits-tool-name {
    color: var(--wolf-gold-bright);
    font-weight: bold;
}

/* ── Stats (Section 6) ───────────────────────────────────────────── */
.credits-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.credits-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.credits-stat-number {
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--wolf-gold-bright);
    font-weight: bold;
    text-shadow:
        0 0 20px rgba(200, 176, 96, 0.5),
        0 0 40px rgba(200, 176, 96, 0.2);
    line-height: 1;
}

.credits-stat-label {
    font-size: clamp(0.75rem, 1.6vw, 0.95rem);
    color: rgba(216, 208, 184, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.credits-stat--highlight .credits-stat-number {
    color: var(--wolf-red-bright);
    font-size: clamp(3rem, 7vw, 5rem);
    text-shadow:
        0 0 30px rgba(187, 32, 32, 0.6),
        0 0 60px rgba(187, 32, 32, 0.3);
}

.credits-stat--highlight .credits-stat-label {
    color: #fff;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: bold;
    letter-spacing: 0.2em;
}

/* ── Thanks (Section 7) ──────────────────────────────────────────── */
.credits-thanks {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: rgba(216, 208, 184, 0.85);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.credits-thanks-name {
    color: var(--wolf-gold);
    font-weight: bold;
}

.credits-mein-leben {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--wolf-red-bright);
    font-style: italic;
    text-shadow: 0 0 20px rgba(187, 32, 32, 0.5);
    display: inline-block;
    margin: 0.5rem 0;
}

/* ── Finale (Section 8) ──────────────────────────────────────────── */
.credits-section--finale {
    padding: 4rem 2rem;
}

.credits-finale-title {
    font-family: var(--font-title);
    font-size: clamp(3rem, 7vw, 5rem);
    color: var(--wolf-gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    text-shadow:
        0 0 60px rgba(200, 176, 96, 0.7),
        0 0 120px rgba(139, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.9);
    animation: creditsTitleGlow 4s ease-in-out infinite;
}

.credits-finale-subtitle {
    font-family: var(--font-title);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--wolf-red-bright);
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

.credits-finale-url {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: var(--wolf-gold-dim);
    margin-top: 1rem;
}

.credits-finale-location {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--wolf-white);
    margin-top: 0.5rem;
}

/* ── Mobile Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .credits-section {
        padding: 2rem 1.5rem;
        gap: 0.6rem;
    }

    .credits-gap {
        height: 30vh;
    }

    .credits-portrait-frame {
        width: clamp(160px, 60vw, 280px);
    }

    .credits-skip-hint {
        font-size: 0.65rem;
        bottom: 12px;
    }

    .credits-sub-block {
        padding: 0.6rem;
    }
}
