/* ============================================================
   Splunk Arcade - Styles
   Layout, typography, and design system (DS) classes defined here.
   ============================================================ */

/* --- CSS custom properties ---------------------------------- */
:root {
    --font-arcade: "Press Start 2P", cursive;
    --font-display: "Orbitron", system-ui, sans-serif;
    --font-body: "Exo 2", system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- Base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overscroll-behavior: none; }

.page-base {
    background-color: #0a0a1a;
    color: #e5e7eb;
    margin: 0;
    font-family: var(--font-body);
}
.app-root { min-height: 100vh; }

/* --- Line clamp ---------------------------------------------- */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Design system (DS) – semantic classes ------------------- */
.ds-btn-primary {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(237, 139, 0, 0.5);
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    box-shadow: 0 0 12px rgba(237, 139, 0, 0.3), 0 0 30px rgba(232, 76, 138, 0.15);
    transition: all 0.2s;
}
.ds-btn-primary:hover {
    box-shadow: 0 0 20px rgba(237, 139, 0, 0.5), 0 0 50px rgba(232, 76, 138, 0.25);
    filter: brightness(1.1);
}
.ds-btn-primary:active { transform: scale(0.97); }
.ds-btn-primary.neon-btn,
.ds-btn-primary { animation: neon-pulse 2.5s ease-in-out infinite; text-shadow: 0 0 8px rgba(255,255,255,0.3); }
.ds-btn-primary.neon-btn:hover,
.ds-btn-primary:hover { animation: none; text-shadow: 0 0 12px rgba(255,255,255,0.5); }

.ds-btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #ED8B00;
    cursor: pointer;
    border: 1px solid rgba(237, 139, 0, 0.4);
    background: rgba(237, 139, 0, 0.05);
    box-shadow: 0 0 8px rgba(237, 139, 0, 0.1);
    transition: all 0.2s;
}
.ds-btn-secondary:hover {
    background: rgba(237, 139, 0, 0.15);
    border-color: rgba(237, 139, 0, 0.7);
    box-shadow: 0 0 15px rgba(237, 139, 0, 0.3), 0 0 35px rgba(237, 139, 0, 0.1);
    color: #F5A623;
}
.ds-btn-secondary { animation: neon-outline-pulse 3s ease-in-out infinite; text-shadow: 0 0 6px rgba(237,139,0,0.2); }
.ds-btn-secondary:hover { animation: none; text-shadow: 0 0 10px rgba(237,139,0,0.4); }

.ds-btn-danger {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(239, 68, 68, 0.5);
    background: #dc2626;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.25);
    transition: all 0.2s;
}
.ds-btn-danger:hover {
    background: #ef4444;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4), 0 0 40px rgba(220, 38, 38, 0.15);
}
.ds-btn-danger:active { transform: scale(0.97); }
.ds-btn-danger--sm { font-size: 0.75rem; padding: 0.375rem 0.75rem; }

.ds-btn-header {
    font-family: var(--font-display);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #00dcff;
    cursor: pointer;
    border: 1px solid rgba(0, 220, 255, 0.4);
    background: rgba(0, 220, 255, 0.05);
    box-shadow: 0 0 8px rgba(0, 220, 255, 0.15);
    transition: all 0.2s;
}
.ds-btn-header:hover {
    background: rgba(0, 220, 255, 0.15);
    border-color: rgba(0, 220, 255, 0.7);
    box-shadow: 0 0 18px rgba(0, 220, 255, 0.35), 0 0 40px rgba(0, 220, 255, 0.12);
    color: #fff;
}
.ds-btn-header { animation: neon-cyan-pulse 3s ease-in-out infinite; text-shadow: 0 0 6px rgba(0,220,255,0.3); }
.ds-btn-header:hover { animation: none; text-shadow: 0 0 12px rgba(0,220,255,0.5); }
.ds-btn-header--sm { font-size: 0.75rem; padding: 0.375rem 0.75rem; }

.ds-btn-ghost {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #ED8B00;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s;
}
.ds-btn-ghost:hover {
    background: rgba(237, 139, 0, 0.1);
    border-color: rgba(237, 139, 0, 0.3);
    color: #F5A623;
    box-shadow: 0 0 10px rgba(237, 139, 0, 0.15);
}

.ds-btn-nav {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #ED8B00;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s;
}
.ds-btn-nav:hover {
    background: rgba(237, 139, 0, 0.1);
    border-color: rgba(237, 139, 0, 0.3);
    color: #F5A623;
    box-shadow: 0 0 10px rgba(237, 139, 0, 0.15);
}

.ds-btn-small {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.ds-card {
    position: relative;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    border: 1px solid rgba(237, 139, 0, 0.15);
    padding: 1.25rem;
    box-shadow: 0 0 15px rgba(237, 139, 0, 0.06);
}
.ds-card.arcade-card { position: relative; overflow: hidden; }

.ds-card-hover:hover {
    border-color: rgba(237, 139, 0, 0.4);
    box-shadow: 0 0 25px rgba(237, 139, 0, 0.15), 0 0 60px rgba(232, 76, 138, 0.08);
    transform: translateY(-4px);
    transition: all 0.3s;
}

.ds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(3, 7, 18, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(237, 139, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 20px rgba(237, 139, 0, 0.05);
    overflow: hidden;
}

.ds-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.2s;
}
.ds-input::placeholder { color: #6b7280; }
.ds-input:focus {
    border-color: rgba(237, 139, 0, 0.5);
    box-shadow: 0 0 12px rgba(237, 139, 0, 0.15);
}

.ds-step-card {
    width: 100%;
    max-width: 720px;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 1rem;
    border: 1px solid rgba(237, 139, 0, 0.15);
    box-shadow: 0 0 30px rgba(237, 139, 0, 0.08), 0 0 60px rgba(232, 76, 138, 0.04);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.ds-step-card.arcade-step-card { position: relative; }

.ds-title-gradient {
    font-family: var(--font-arcade);
    font-weight: 700;
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ds-heading { font-family: var(--font-arcade); }
.ds-meta { font-size: 0.875rem; color: #9ca3af; }
.ds-error { color: #fca5a5; font-size: 0.875rem; min-height: 18px; }

.ds-page-body { padding: 1.5rem; min-height: 100vh; }
.ds-page-body.arcade-scanlines { position: relative; }
/* Dashboard (user) page: let content grow so the page scrolls when content exceeds viewport */
.ds-dashboard-body {
    overflow: visible;
    min-height: calc(100vh - 52px);
    background-image: linear-gradient(rgba(10, 10, 26, 0.75), rgba(10, 10, 26, 0.75)), url("/images/arcade_bg.png");
    background-size: cover;
    background-position: center;
}

/* --- DS Header layout children --------------------------------- */
.ds-header-left { display: flex; align-items: center; gap: 0.75rem; }
.ds-header-right { display: flex; align-items: center; gap: 0.75rem; }
.ds-header-center { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* --- Player badge text column ---------------------------------- */
.player-badge-info { display: flex; flex-direction: column; }

/* --- Auth form layout ------------------------------------------ */
.auth-form { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.auth-form-footer { display: flex; justify-content: center; }

/* --- Loading / status text ------------------------------------- */
.ds-loading-text { color: #9ca3af; animation: animate-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* --- Welcome modal paragraph ----------------------------------- */
.welcome-msg-paragraph { color: #d1d5db; margin-bottom: 0.75rem; }

/* --- Run summary text ------------------------------------------ */
.run-summary-text { color: #d1d5db; margin-bottom: 0.5rem; }

/* --- Storyboard card header layout ----------------------------- */
.storyboard-card-title-col { display: flex; flex-direction: column; min-width: 0; }
.storyboard-card-header-row { display: flex; align-items: center; gap: 1rem; }

/* --- Game step controls bar ------------------------------------ */
.game-step-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

/* --- Info step wrapper ----------------------------------------- */
.info-step-wrapper { display: flex; justify-content: center; align-items: flex-start; padding: 2rem; }

/* --- Prerequisite label ---------------------------------------- */
.card-meta-prereq { font-style: italic; }

/* --- Pulse animation (used by ds-loading-text) --------------- */
@keyframes animate-pulse {
    50% { opacity: 0.5; }
}

/* --- CRT Scanline Overlay ----------------------------------- */
.arcade-scanlines { position: relative; }
.arcade-scanlines::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* --- Card Shimmer on Hover ---------------------------------- */
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.arcade-card { position: relative; overflow: hidden; }
.arcade-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(237,139,0,0.3), rgba(232,76,138,0.2), rgba(237,139,0,0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.arcade-card:hover::before {
    opacity: 1;
}
.arcade-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        120deg,
        transparent 25%,
        rgba(237,139,0,0.08) 45%,
        rgba(232,76,138,0.05) 55%,
        transparent 75%
    );
    background-size: 250% 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.arcade-card:hover::after {
    opacity: 1;
    animation: shimmer 2.5s ease infinite;
}

/* --- Step Card Top Accent Bar ------------------------------- */
.arcade-step-card::before {
    content: '';
    position: absolute;
    top: 0; left: 16px; right: 16px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ED8B00, #E84C8A, #F5A623);
    opacity: 0.85;
}

/* --- Neon Text Glow ----------------------------------------- */
.neon-text {
    text-shadow:
        0 0 8px  rgba(237,139,0,0.35),
        0 0 24px rgba(237,139,0,0.12);
}

/* --- Neon Button Effects ------------------------------------ */
@keyframes neon-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(237,139,0,0.3), 0 0 25px rgba(232,76,138,0.12); }
    50%      { box-shadow: 0 0 18px rgba(237,139,0,0.45), 0 0 45px rgba(232,76,138,0.2); }
}
@keyframes neon-outline-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(237,139,0,0.1), inset 0 0 6px rgba(237,139,0,0.05); }
    50%      { box-shadow: 0 0 14px rgba(237,139,0,0.2), inset 0 0 10px rgba(237,139,0,0.08); }
}

.neon-btn {
    animation: neon-pulse 2.5s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
}
.neon-btn:hover {
    animation: none;
    text-shadow: 0 0 12px rgba(255,255,255,0.5);
}
.neon-btn:active {
    animation: none;
}

.neon-btn-outline {
    animation: neon-outline-pulse 3s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(237,139,0,0.2);
}
.neon-btn-outline:hover {
    animation: none;
    text-shadow: 0 0 10px rgba(237,139,0,0.4);
}
.neon-btn-outline:active {
    animation: none;
}

@keyframes neon-cyan-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(0,220,255,0.15), inset 0 0 4px rgba(0,220,255,0.05); }
    50%      { box-shadow: 0 0 14px rgba(0,220,255,0.25), inset 0 0 8px rgba(0,220,255,0.08); }
}
.neon-btn-cyan {
    animation: neon-cyan-pulse 3s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(0,220,255,0.3);
}
.neon-btn-cyan:hover {
    animation: none;
    text-shadow: 0 0 12px rgba(0,220,255,0.5);
}
.neon-btn-cyan:active {
    animation: none;
}

/* --- CRT Panel (left image on login) ----------------------- */
.crt-panel {
    position: relative;
}
.crt-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.08) 2px,
        rgba(0,0,0,0.08) 4px
    );
    pointer-events: none;
    z-index: 1;
}
.crt-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
    z-index: 2;
}

/* --- Pulse Glow --------------------------------------------- */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 6px rgba(237,139,0,0.2); }
    50%      { box-shadow: 0 0 22px rgba(237,139,0,0.45), 0 0 50px rgba(237,139,0,0.15); }
}
.pulse-glow { animation: pulse-glow 2.2s ease-in-out infinite; }

/* --- Shake Animation ---------------------------------------- */
.shake-no { animation: shakeNo 220ms ease-in-out; }
@keyframes shakeNo {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

/* --- Tron Canvas -------------------------------------------- */
.tron-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* --- Arcade Header Marquee --------------------------------- */
@keyframes marquee-sweep {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.ds-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        #ED8B00 15%,
        #E84C8A 35%,
        #00dcff 50%,
        #E84C8A 65%,
        #ED8B00 85%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: marquee-sweep 4s linear infinite;
    opacity: 0.8;
}

/* --- Player Badge (header user identity) ------------------- */
.player-badge {
    position: relative;
    background: linear-gradient(135deg, rgba(237,139,0,0.08), rgba(232,76,138,0.05));
    border: 1px solid rgba(237,139,0,0.2);
    border-radius: 8px;
    padding: 4px 12px 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.player-badge::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(237,139,0,0.15), rgba(232,76,138,0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.player-badge:hover::before { opacity: 1; }

.player-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ED8B00, #E84C8A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: white;
    text-shadow: 0 0 6px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

/* --- Player Badge (header user identity) ------------------- */
.player-badge {
    position: relative;
    background: linear-gradient(135deg, rgba(237,139,0,0.08), rgba(232,76,138,0.05));
    border: 1px solid rgba(237,139,0,0.2);
    border-radius: 8px;
    padding: 4px 12px 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.player-badge::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(237,139,0,0.15), rgba(232,76,138,0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.player-badge:hover::before { opacity: 1; }

.player-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ED8B00, #E84C8A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: white;
    text-shadow: 0 0 6px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.player-role-label {
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(237,139,0,0.7);
    line-height: 1;
}
.player-name-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #e5e7eb;
    line-height: 1.25;
}

/* --- Run/Dashboard Wrappers --------------------------------- */
.ds-dash-wrapper {
    position: relative;
    background: #0a0a1a url('/images/arcade_bg.png') center center / cover no-repeat;
    height: calc(100vh - 52px);
    overflow: hidden;
}
.ds-run-wrapper {
    position: relative;
    background: #0a0a1a url('/images/arcade_bg.png') center center / cover no-repeat;
    height: calc(100vh - 52px);
    overflow-y: auto;
    min-height: 0;
    scrollbar-gutter: stable;
}
.ds-run-wrapper--game-active {
    overflow: hidden;
    height: calc(100dvh - 52px);
}
.ds-run-body { position: relative; z-index: 10; }
.ds-z-content { position: relative; z-index: 10; }

/* Background animation canvas (dash-bg / tron grid overlay) */
.dash-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Storyboard card staggered entry; --dashboard-card-edge-color and --dashboard-card-delay set per card in JS */
.dashboard-card-enter {
    opacity: 0;
    border-left: 3px solid var(--dashboard-card-edge-color, #ED8B00);
    animation: card-enter 0.5s ease-out forwards;
    animation-delay: var(--dashboard-card-delay, 0ms);
}

/* --- Custom Scrollbar --------------------------------------- */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(237,139,0,0.22); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(237,139,0,0.4); }

/* --- Radio Accent ------------------------------------------- */
input[type="radio"] { accent-color: #ED8B00; }

/* --- Quiz Choice Text (force inline for generateQBodyMaybeWithHTML output) --- */
.quiz-choice-text         { display: inline; margin: 0; line-height: 1.25; }
.quiz-choice-text p,
.quiz-choice-text div     { display: inline; margin: 0; }
.quiz-choice-row          { margin: 0; }

/* --- Game Iframe -------------------------------------------- */
.game-iframe {
    width: 100%;
    min-height: 300px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    display: block;
    overflow: hidden;
}

.game-iframe--viewport {
    min-height: clamp(360px, calc(100vh - 260px), 1200px);
}

/* --- Inline Code (generateQBodyMaybeWithHTML) --------------- */
.inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    font-size: 0.9em;
}

/* --- Markdown Bullets --------------------------------------- */
.maybehtml-bullets       { margin: 0.4rem 0 0.6rem 1.2rem; }
.maybehtml-bullets li    { margin: 0.25rem 0; }

/* --- Step Link (quiz content links) ------------------------- */
.step-link {
    color: #ED8B00;
    text-decoration: none;
    border-bottom: 1px solid rgba(237,139,0,0.3);
    transition: all 0.2s;
}
.step-link:hover {
    color: #F5A623;
    border-bottom-color: #F5A623;
}

/* --- Step Image (runtime quiz/info) ------------------------- */
.step-image {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(11,18,32,0.4);
    margin: 10px 0 16px;
    display: block;
}

/* --- Icon shimmer (storyboard card icons) ------------------- */
@keyframes icon-breathe {
    0%, 100% { box-shadow: 0 0 8px rgba(237,139,0,0.25); }
    50%      { box-shadow: 0 0 16px rgba(237,139,0,0.45); }
}

/* --- Staggered Card Entry ----------------------------------- */
@keyframes card-enter {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Neon Section Divider ----------------------------------- */
.neon-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #ED8B00, #E84C8A, #00dcff, transparent);
    border: none;
    margin: 2.5rem 0 1.5rem;
    opacity: 0.5;
}

/* --- Trophy Pulse ------------------------------------------- */
@keyframes trophy-pulse {
    0%, 100% { text-shadow: 0 0 8px rgba(237,139,0,0.4), 0 0 2px rgba(237,139,0,0.6); transform: scale(1); }
    50%      { text-shadow: 0 0 24px rgba(237,139,0,0.9), 0 0 50px rgba(237,139,0,0.4), 0 0 80px rgba(232,76,138,0.2); transform: scale(1.1); }
}
.trophy-glow { animation: trophy-pulse 2s ease-in-out infinite; display: inline-block; font-size: 1.25rem; }


/* ============================================================
   ADMIN STYLES  -  Clean dark slate theme (no neon / arcade)
   ============================================================ */

/* Legacy admin-section kept for non-editor admin views */
.admin-section {
    background: #1e293b;
    color: #f1f1f1;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}
.admin-body {
    background: #0f172a;
    color: #e4e4e4;
    padding: 20px 24px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-table {
    background: #1e293b;
    color: #eee;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 10px;
}
.admin-table th { background: #334155; color: #fff; font-weight: 600; }
.admin-table td { background: #1e293b; color: #eee; border: none; padding: 0; }

.admin-section input,
.admin-section textarea,
.admin-section select {
    background: #334155;
    color: #f8f8f8;
    border: 1px solid #475569;
    padding: 6px;
    border-radius: 4px;
}
.admin-section input::placeholder,
.admin-section textarea::placeholder { color: #94a3b8; }

.admin-section button {
    background: #475569;
    color: #fff;
    border: 1px solid #64748b;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.admin-section button:hover { background: #64748b; }

.danger-button {
    background-color: #dc2626 !important;
    border: none !important;
    color: #fff !important;
}
.danger-button:hover { background-color: #ef4444 !important; }

.step-editor-card {
    position: relative;
    color: #f1f1f1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.step-editor-body    { display: flex; flex-direction: column; gap: 8px; }

.step-editor-card input,
.step-editor-card textarea,
.step-editor-card select {
    background: #334155;
    color: #f8f8f8;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 6px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    width: 100%;
    box-sizing: border-box;
}
.step-editor-card label { font-size: 12px; color: #94a3b8; }

.admin-form-column { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-form-column > label { margin-top: 0.75rem; }
.admin-form-column > label:first-child { margin-top: 0; }
.admin-form-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.admin-form-row > input[type="file"] { width: auto; flex: 1 1 auto; min-width: 0; }

.slider-value    { font-weight: 600; margin-left: 4px; }
.step-add-btn    { background: #ED8B00; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.step-add-btn:hover { background: #F5A623; }

.storyboard-icon-preview {
    width: 56px; height: 56px;
    border-radius: 10px;
    border: 1px solid #475569;
    background: #0f172a;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.hidden-badge {
    background: #fbbf24;
    color: #000;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    border: 1px solid #f59e0b;
}

.user-admin-table tbody tr:nth-child(odd)  { background-color: rgba(255,255,255,0.03) !important; }
.user-admin-table tbody tr:nth-child(even) { background-color: rgba(255,255,255,0.06) !important; }
.user-admin-table tbody tr:hover           { background-color: rgba(255,255,255,0.12) !important; }
.user-admin-table tr.row-selected td       { background: #1e40af20; }

.admin-textarea-large   { font-family: monospace; }
.welcome-preview-box    { border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; padding: 14px; }
.admin-preview-title    { font-weight: 600; margin-bottom: 8px; opacity: 0.9; }

.step-image-preview {
    width: 96px; height: 96px;
    border-radius: 10px;
    border: 1px solid #475569;
    background: #0f172a;
    object-fit: contain;
    display: block;
}

.scenario-editor-root { width: 100%; box-sizing: border-box; }
.scenario-quiz-panel  { flex: 0 0 360px; }
.scenario-steps-panel { flex: 1 1 auto; min-width: 0; }
.scenario-editor-root.no-quiz .scenario-quiz-panel { display: none; }
.info-step-editor { width: 100%; }
.scenario-steps-panel,
.info-step-editor { min-width: 0; }

/* --- Step Wrapper (used by quiz and run summary) --- */
.step-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 16px;
}

/* Admin header fallback (used by render_admin.js) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #020617;
    border-bottom: 1px solid #1f2937;
}
.app-title-small { font-weight: 600; }

/* Admin link-button in headers – same style as storyboard launch (used by render_admin.js).
   !important ensures these win over .admin-section button and any other generic button rules. */
.app-header .link-button,
.link-button {
    padding: 6px 12px !important;
    border-radius: 6px !important;
    border: none !important;
    background: linear-gradient(135deg, #ED8B00, #E84C8A) !important;
    color: #fff !important;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.app-header .link-button:hover,
.link-button:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(237,139,0,0.25);
    color: #fff !important;
    background: linear-gradient(135deg, #ED8B00, #E84C8A) !important;
}

/* Admin launch button fallback (used by render_admin.js) */
.storyboard-launch {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #ED8B00, #E84C8A);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.storyboard-launch:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(237,139,0,0.25);
}

/* ============================================================
   ADMIN UI – Semantic classes
   Use these in render_admin.js and related views for consistency.
   ============================================================ */

/* --- Page layout ------------------------------------------------- */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #020617;
    border-bottom: 1px solid #1e293b;
}
.admin-page-header-left { display: flex; align-items: center; gap: 0.75rem; }
.admin-page-header-right { display: flex; align-items: center; gap: 0.5rem; }
.admin-page-title { font-size: 0.875rem; font-weight: 600; color: #e2e8f0; }
/* !important ensures these win over .admin-section button and any other generic button rules. */
.admin-page-header .admin-back-link,
.admin-back-link {
    padding: 6px 12px !important;
    border-radius: 6px !important;
    border: none !important;
    background: linear-gradient(135deg, #ED8B00, #E84C8A) !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}
.admin-page-header .admin-back-link:hover,
.admin-back-link:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(237,139,0,0.25);
    color: #fff !important;
    background: linear-gradient(135deg, #ED8B00, #E84C8A) !important;
}

.admin-content-wrapper { max-width: 80rem; margin-left: auto; margin-right: auto; padding: 1.5rem 0; }
.admin-content-wrapper--narrow { max-width: 56rem; }
.admin-content-gap { display: flex; flex-direction: column; gap: 1.25rem; }

/* Storyboard editor two-column layout (1/3 sidebar + 2/3 main) */
.sb-editor-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; align-items: start; }
.sb-editor-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sb-editor-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
@media (max-width: 960px) { .sb-editor-grid { grid-template-columns: 1fr; } }

/* Hidden file inputs / elements toggled by JS */
.admin-hidden { display: none; }
.admin-inline-block { display: inline-block; }

/* --- Cards ------------------------------------------------------- */
.admin-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    overflow: hidden;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.admin-card-header--danger {
    border-bottom-color: rgba(127, 29, 29, 0.3);
    background: rgba(127, 29, 29, 0.15);
}
.admin-card-body { padding: 1.25rem; }
.admin-card-body--gap { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.admin-card-title { font-size: 0.875rem; font-weight: 600; color: #e2e8f0; }
.admin-card-title--danger { color: #f87171; }
.admin-card-badge {
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
}

/* Danger zone / red cards */
.admin-card-danger {
    background: rgba(127, 29, 29, 0.1);
    border: 1px solid rgba(127, 29, 29, 0.3);
    border-radius: 0.5rem;
    overflow: hidden;
}
.admin-card-danger .admin-card-body { padding: 1.25rem; }
.admin-card-danger-divider { border-top: 1px solid rgba(127, 29, 29, 0.2); padding-top: 0.25rem; }
.admin-card-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0;
}
.admin-card-label { font-size: 0.875rem; font-weight: 500; color: #e2e8f0; }
.admin-card-hint { font-size: 0.75rem; color: #64748b; margin-top: 0.125rem; }
.admin-card-actions { display: flex; align-items: center; gap: 0.75rem; }

/* --- Buttons ------------------------------------------------------ */
.admin-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #475569;
    background: #475569;
    color: #e2e8f0;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.admin-btn:hover { background: #64748b; border-color: #64748b; }
.admin-btn--sm { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.admin-btn--toggle { min-width: 4.5rem; justify-content: center; }
.admin-btn-danger {
    background: #dc2626;
    border: none;
    color: #fff;
}
.admin-btn-danger:hover { background: #ef4444; }
.admin-btn-danger:disabled { opacity: 0.3; cursor: not-allowed; }
.admin-btn-ghost {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.admin-btn-ghost:hover { color: #e2e8f0; background: #475569; }
.admin-btn-ghost--danger:hover { color: #f87171; background: rgba(127, 29, 29, 0.2); }
.admin-btn-icon {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s, background 0.2s;
}
.admin-btn-icon:hover { color: #e2e8f0; background: #475569; }
.admin-btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.admin-btn-icon--danger:hover { color: #f87171; background: rgba(127, 29, 29, 0.2); }

/* --- Form inputs ------------------------------------------------- */
.admin-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    color: #f1f5f9;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.admin-input:focus { border-color: #3b82f6; }
.admin-input::placeholder { color: #94a3b8; }
.admin-textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    color: #f1f5f9;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.admin-textarea:focus { border-color: #3b82f6; }
.admin-textarea--lg { min-height: 6rem; }
.admin-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}
.admin-label-inline {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}
.admin-checkbox { width: 1rem; height: 1rem; accent-color: #E84C8A; border-radius: 0.25rem; }
.admin-select {
    background: #0f172a;
    border: 1px solid #475569;
    color: #f1f5f9;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}
.admin-select:focus { border-color: #3b82f6; }

/* --- Table (user admin, etc.) ------------------------------------- */
.admin-table-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    overflow: hidden;
}
.admin-table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.admin-table-card-body { overflow-x: auto; }
.ctf-admin-cell {
  min-width: 210px;
}
.ctf-admin-cell-summary {
  font-size: 0.82rem;
  color: #d3dcf7;
  margin-bottom: 0.2rem;
}
.ctf-admin-cell-time {
  font-size: 0.74rem;
  color: #8fa1d4;
  margin-bottom: 0.3rem;
}
.ctf-admin-cell-message {
  font-size: 0.74rem;
  color: #a6b6e4;
  min-height: 1.1rem;
  margin-bottom: 0.35rem;
}
.ctf-admin-cell-message--error {
  color: #ff8c8c;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead tr { border-bottom: 1px solid #334155; }
.admin-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    transition: background 0.2s;
}
.admin-table tbody tr:hover { background: rgba(30, 41, 59, 0.6); }
.admin-table .td--muted { color: #94a3b8; }
.admin-table .td--yes { color: #34d399; }
.admin-table .td--mono { font-family: ui-monospace, monospace; color: #94a3b8; }
.admin-table .td--actions { padding: 0.75rem 1rem; }
.admin-table-actions-inner { display: flex; align-items: center; gap: 0.5rem; }
.admin-empty-state { text-align: center; font-size: 0.875rem; color: #64748b; padding: 2rem 1rem; }

/* --- Steps list (storyboard editor) ------------------------------ */
.admin-steps-divider { }
.admin-steps-divider > * + * { border-top: 1px solid rgba(51, 65, 85, 0.5); }
.admin-step-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.admin-step-row:hover { background: rgba(30, 41, 59, 0.5); }
.admin-step-row--expanded { background: rgba(30, 41, 59, 0.4); }
.admin-step-chevron {
    display: inline-block;
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s;
}
.admin-step-chevron--open { transform: rotate(90deg); }
.admin-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    color: #cbd5e1;
    flex-shrink: 0;
}
.admin-step-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}
.admin-step-badge--quiz { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.25); }
.admin-step-badge--game { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.25); }
.admin-step-badge--info { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.25); }
.admin-step-badge--unknown { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border-color: rgba(100, 116, 139, 0.25); }
.admin-step-preview { font-size: 0.875rem; color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.admin-step-actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; margin-left: auto; }
.admin-step-editor-body { padding: 1rem; background: rgba(30, 41, 59, 0.2); border-top: 1px solid rgba(51, 65, 85, 0.3); }
.admin-step-editor-inner { padding-left: 1rem; }

/* --- Modal (confirm dialog) -------------------------------------- */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}
.admin-modal-dialog {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(0, 220, 255, 0.25);
    border-radius: 0.75rem;
    box-shadow:
        0 0 20px rgba(0, 220, 255, 0.1),
        0 0 60px rgba(237, 139, 0, 0.05),
        0 25px 50px -12px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 28rem;
    margin: 0 1rem;
    overflow: hidden;
}
.admin-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 220, 255, 0.15);
}
.admin-modal-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 220, 255, 0.3);
}
.admin-modal-body { padding: 1rem 1.5rem; }
.admin-modal-body p { font-size: 0.875rem; color: #94a3b8; line-height: 1.5; }
.admin-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 220, 255, 0.15);
    background: rgba(15, 23, 42, 0.5);
}
.admin-modal-footer button {
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.admin-modal-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 220, 255, 0.2);
    color: #f1f5f9;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    margin-top: 0.75rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-modal-input:focus {
    border-color: rgba(0, 220, 255, 0.6);
    box-shadow: 0 0 8px rgba(0, 220, 255, 0.2);
}

/* --- Grid / flex helpers ---------------------------------------- */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .admin-grid-2 { grid-template-columns: 1fr; } }
.admin-flex-between { display: flex; align-items: center; justify-content: space-between; }
.admin-flex-between--gap4 { gap: 1rem; }
.admin-flex-gap2 { display: flex; align-items: center; gap: 0.5rem; }
.admin-flex-gap3 { display: flex; align-items: center; gap: 0.75rem; }
.admin-flex-gap4 { display: flex; align-items: center; gap: 1rem; }
.admin-flex-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.admin-pt-gap { padding-top: 0.25rem; }
.admin-pt-gap .admin-flex-gap3 { gap: 0.75rem; }
.admin-form-row-gap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.625rem 0; }
.admin-section-space { padding: 1.25rem; border-top: 1px solid rgba(51, 65, 85, 0.5); background: rgba(30, 41, 59, 0.2); }
.admin-section-space .admin-flex-wrap { gap: 0.5rem; }
.admin-section-space .admin-flex-wrap .admin-input { width: auto; }
.admin-section-space .admin-flex-gap2 { gap: 0.5rem; }
.user-label { font-size: 0.875rem; color: #94a3b8; }
.welcome-title { font-weight: 600; margin-bottom: 8px; opacity: 0.9; }
.welcome-text { line-height: 1.5; }
.admin-status-muted { font-size: 0.75rem; color: #94a3b8; }
.admin-metric-form-container { margin-top: 1rem; }
.metric-admin-form { width: 100%; }
.metric-form-row { margin-bottom: 0.75rem; }
.metric-form-row label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; color: #9ca3af; }
.metric-admin-form-container .admin-input,
.metric-admin-form-container .admin-textarea { width: 100%; }
.admin-btn--export { background: #dc2626; border: none; color: #fff; }
.admin-btn--export:hover { background: #ef4444; }
.admin-btn-export-card { background: rgba(127, 29, 29, 0.1); border: 1px solid rgba(127, 29, 29, 0.3); border-radius: 0.5rem; }
.admin-btn-export-card .admin-card-body { padding: 1.25rem; }
.admin-btn-export-card .admin-flex-between { gap: 1rem; }
.admin-btn-export-card .admin-card-label { font-size: 0.875rem; font-weight: 500; color: #e2e8f0; }
.admin-btn-export-card .admin-card-hint { font-size: 0.75rem; margin-top: 0.125rem; }
.admin-btn-export-card .admin-flex-gap3 { gap: 0.75rem; }

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

/* ============================================================
   AUTH (login/register layout)
   ============================================================ */
.auth-layout { display: flex; min-height: 100vh; width: 100%; }
.auth-panel-left {
    display: none;
    width: 50%;
    position: relative;
    background-size: cover;
    background-position: center;
}
@media (min-width: 768px) {
    .auth-panel-left { display: block; }
}
.auth-panel-left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(10, 10, 26, 0.8));
}
.auth-panel-right {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}
@media (min-width: 768px) {
    .auth-panel-right { width: 50%; }
}
.auth-card {
    position: relative;
    z-index: 10;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(24px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    width: 100%;
    max-width: 24rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.auth-logo { width: 5rem; height: auto; filter: drop-shadow(0 10px 8px rgba(0,0,0,0.3)); }
.auth-made-by { margin-top: 1.5rem; font-size: 0.75rem; color: #6b7280; letter-spacing: 0.025em; }
.auth-link { color: #6b7280; transition: color 0.2s; text-decoration: none; }
.auth-link:hover { color: #d1d5db; }

/* ============================================================
   DASHBOARD / USER (welcome modal, storyboard grid, leaderboards)
   ============================================================ */

/* Dashboard header (render_user.js) – semantic classes instead of variables/concatenation */
.dashboard-header-title {
    font-family: var(--font-arcade);
    font-weight: 700;
    font-size: 0.875rem;
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 8px rgba(237,139,0,0.35), 0 0 24px rgba(237,139,0,0.12);
}
.dashboard-user-label {
    font-size: 0.875rem;
    color: #9ca3af;
}
.dashboard-admin-nav-btn {
    font-family: var(--font-display);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #00dcff;
    cursor: pointer;
    border: 1px solid rgba(0, 220, 255, 0.4);
    background: rgba(0, 220, 255, 0.05);
    box-shadow: 0 0 8px rgba(0, 220, 255, 0.15);
    transition: all 0.2s;
    animation: neon-cyan-pulse 3s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(0,220,255,0.3);
}
.dashboard-admin-nav-btn:hover {
    background: rgba(0, 220, 255, 0.15);
    border-color: rgba(0, 220, 255, 0.7);
    box-shadow: 0 0 18px rgba(0, 220, 255, 0.35), 0 0 40px rgba(0, 220, 255, 0.12);
    color: #fff;
    animation: none;
    text-shadow: 0 0 12px rgba(0,220,255,0.5);
}

/* Dashboard storyboard card (card + hover + layout) */
.dashboard-storyboard-card {
    position: relative;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    border: 1px solid rgba(237, 139, 0, 0.15);
    padding: 1.25rem;
    box-shadow: 0 0 15px rgba(237, 139, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dashboard-storyboard-card.arcade-card { position: relative; overflow: hidden; }
.dashboard-storyboard-card:hover {
    border-color: rgba(237, 139, 0, 0.4);
    box-shadow: 0 0 25px rgba(237, 139, 0, 0.15), 0 0 60px rgba(232, 76, 138, 0.08);
    transform: translateY(-4px);
    transition: all 0.3s;
}

/* Dashboard launch button (primary, small) */
.dashboard-launch-btn {
    padding: 0.375rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(237, 139, 0, 0.5);
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    box-shadow: 0 0 12px rgba(237, 139, 0, 0.3), 0 0 30px rgba(232, 76, 138, 0.15);
    transition: all 0.2s;
}
.dashboard-launch-btn:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(237, 139, 0, 0.5), 0 0 50px rgba(232, 76, 138, 0.25); }
.dashboard-launch-btn:active { transform: scale(0.97); }
.dashboard-launch-btn--locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.dashboard-launch-btn--locked:hover { filter: none; }

/* Dashboard edit button (ghost, small) */
.dashboard-edit-btn {
    padding: 0.375rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ED8B00;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s;
}
.dashboard-edit-btn:hover {
    background: rgba(237, 139, 0, 0.1);
    border-color: rgba(237, 139, 0, 0.3);
    color: #F5A623;
    box-shadow: 0 0 10px rgba(237, 139, 0, 0.15);
}

/* Dashboard card description area */
.dashboard-card-description-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.75rem;
}
.storyboard-card-description {
    font-size: 0.875rem;
    color: #9ca3af;
    line-height: 1.625;
}
.dashboard-card-no-desc {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

/* Dashboard leaderboard card (reuses card look) */
.dashboard-leaderboard-card {
    position: relative;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    border: 1px solid rgba(237, 139, 0, 0.15);
    padding: 1.25rem;
    box-shadow: 0 0 15px rgba(237, 139, 0, 0.06);
}
.dashboard-leaderboard-card:hover {
    border-color: rgba(237, 139, 0, 0.4);
    box-shadow: 0 0 25px rgba(237, 139, 0, 0.15), 0 0 60px rgba(232, 76, 138, 0.08);
    transform: translateY(-4px);
    transition: all 0.3s;
}

/* Leaderboard list and entry row */
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.leaderboard-list > * + * { margin-top: 0.5rem; }
.leaderboard-entry-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.leaderboard-entry-rank { font-weight: 700; color: #ED8B00; }
.leaderboard-entry-score { font-weight: 600; color: #fff; }
.leaderboard-entry-meta { font-size: 0.75rem; color: #6b7280; }

/* Storyboard card icon img container */
.storyboard-card-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.75rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-dialog {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    padding: 1.75rem;
    max-width: 560px;
    width: 90%;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: #fff; margin: 0 0 0.75rem 0; }
.modal-body { overflow-y: auto; flex: 1; }
.modal-footer {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.modal-footer-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #9ca3af; }

/* Feedback modal */
.feedback-modal-intro { font-size: 0.875rem; color: #9ca3af; margin: 0 0 1rem 0; }
.feedback-stars-wrap { margin-bottom: 1rem; }
.feedback-stars-label { display: block; font-size: 0.875rem; font-weight: 500; color: #e5e7eb; margin-bottom: 0.375rem; }
.feedback-stars { display: flex; gap: 0.5rem; align-items: center; }
.feedback-star {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #6b7280;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.feedback-star:hover { color: #d1d5db; border-color: rgba(255, 255, 255, 0.35); }
.feedback-star--on { color: #ED8B00; border-color: #ED8B00; background: rgba(237, 139, 0, 0.15); }
.feedback-message-wrap { margin-bottom: 0.75rem; }
.feedback-message-label { display: block; font-size: 0.875rem; font-weight: 500; color: #e5e7eb; margin-bottom: 0.375rem; }
.feedback-message-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #f3f4f6;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    resize: vertical;
    min-height: 4rem;
}
.feedback-message-input::placeholder { color: #6b7280; }
.feedback-char-count { font-size: 0.75rem; color: #6b7280; display: block; margin-top: 0.25rem; }
.feedback-modal-error { margin-top: 0.5rem; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dashboard-grid { grid-template-columns: repeat(3, 1fr); } }
.storyboard-badge {
    background: #1f2937;
    color: #d1d5db;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid #4b5563;
    display: inline-flex;
    align-items: center;
}
.storyboard-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    background: #0b1220;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(237, 139, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.storyboard-card-icon-wrap {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
}
.storyboard-card-icon--gradient {
    background: linear-gradient(to bottom right, #ED8B00, #E84C8A);
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}
.storyboard-ctf-badge {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.7);
    box-shadow:
        0 0 0 2px rgba(0, 220, 255, 0.28),
        0 0 12px rgba(0, 220, 255, 0.95),
        0 0 20px rgba(0, 220, 255, 0.6);
    pointer-events: none;
}
.storyboard-card-title { font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; color: #fff; line-height: 1.25; }
.dashboard-step-count { font-size: 0.75rem; color: #6b7280; margin-top: 0.125rem; }
.storyboard-card-badges { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.section-header {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(237, 139, 0, 0.3), transparent);
    margin-left: 1rem;
}
.leaderboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 640px) { .leaderboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .leaderboard-grid { grid-template-columns: repeat(3, 1fr); } }
.leaderboard-card-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.leaderboard-empty { color: #4b5563; font-size: 0.75rem; font-style: italic; text-align: center; padding: 1rem; letter-spacing: 0.05em; text-transform: uppercase; }
.card-divider { border-top: 1px solid rgba(255, 255, 255, 0.06); padding-top: 0.75rem; flex: 1; }
.card-meta-row { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: #6b7280; }
.card-actions-row { display: flex; align-items: center; gap: 0.75rem; margin-top: auto; padding-top: 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.06); }

/* ============================================================
   STEP LABEL (quiz, info, run summary – small top-right label)
   ============================================================ */
.step-label {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
}
.step-heading { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }
.step-heading--lg { font-size: 1.125rem; }
.step-center-wrapper { display: flex; justify-content: center; align-items: flex-start; padding: 2rem; min-height: 100vh; }

/* Step/quiz/game shared – meta/status line (replaces DS.meta + " mt-3") */
.step-meta {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.75rem;
}

/* Info step – continue button (replaces DS.btnPrimary + " mt-4") */
.info-continue-btn {
    margin-top: 1rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(237, 139, 0, 0.5);
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    box-shadow: 0 0 12px rgba(237, 139, 0, 0.3), 0 0 30px rgba(232, 76, 138, 0.15);
    transition: all 0.2s;
}
.info-continue-btn:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(237, 139, 0, 0.5), 0 0 50px rgba(232, 76, 138, 0.25); }
.info-continue-btn:active { transform: scale(0.97); }

/* Run view header title (replaces DS.titleGradient + " text-xs whitespace-nowrap") */
.run-view-title {
    font-family: var(--font-arcade);
    font-weight: 700;
    font-size: 0.75rem;
    white-space: nowrap;
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Auth (login/register) – title and buttons (replace DS.* + concatenations) */
.auth-title {
    font-family: var(--font-arcade);
    font-weight: 700;
    font-size: 1.125rem;
    white-space: nowrap;
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-btn-primary {
    width: 100%;
    font-size: 1rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(237, 139, 0, 0.5);
    background: linear-gradient(to right, #ED8B00, #E84C8A);
    box-shadow: 0 0 12px rgba(237, 139, 0, 0.3), 0 0 30px rgba(232, 76, 138, 0.15);
    transition: all 0.2s;
}
.auth-btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(237, 139, 0, 0.5), 0 0 50px rgba(232, 76, 138, 0.25); }
.auth-btn-ghost-sm {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #ED8B00;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s;
}
.auth-btn-ghost-sm:hover {
    background: rgba(237, 139, 0, 0.1);
    border-color: rgba(237, 139, 0, 0.3);
    color: #F5A623;
    box-shadow: 0 0 10px rgba(237, 139, 0, 0.15);
}

/* Run view – user label and loading */
.run-view-user-label { font-size: 0.875rem; color: #9ca3af; }

/* Games step card – full step card + max-width (replaces DS.stepCard + " games-step-card") */
.step-card-games {
    width: 100%;
    max-width: 1100px;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 1rem;
    border: 1px solid rgba(237, 139, 0, 0.15);
    box-shadow: 0 0 30px rgba(237, 139, 0, 0.08), 0 0 60px rgba(232, 76, 138, 0.04);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.step-card-games.arcade-step-card { position: relative; }

.step-card-games--wide {
    max-width: min(1700px, calc(100vw - 1.5rem));
    padding: 0.75rem;
}

.step-center-wrapper--game-wide {
    padding: 0.75rem;
    min-height: 100%;
}

.ds-run-wrapper--game-active .game-step-controls {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 0.5rem;
    background: linear-gradient(to top, rgba(10, 10, 26, 0.95), rgba(10, 10, 26, 0));
}

.quiz-choice-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}
.quiz-choice-label:hover { background: rgba(255, 255, 255, 0.05); }
.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}
.quiz-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.games-step-card { max-width: 1100px; }
