body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

#app {
    min-height: 100vh;
}

.auth-logo {
    display: block;
    margin: 0 auto 12px;   /* center horizontally, 12px bottom spacing */
    max-width: 120px;      /* cap width so it doesn't dominate the card */
    width: 100%;           /* scale within the max-width */
    height: auto;          /* keep aspect ratio */
}

/* container (the div) */
.splunk-link {
    display: flex;
    justify-content: center;
    align-items: center;  /* vertical centering for both text and link */
    gap: 4px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: hotpink;
    text-align: center;
}

/* the <a> inside */
.splunk-link a {
    color: hotpink;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;       /* helps keep baseline aligned nicely */
}

.splunk-link a:hover {
    text-decoration: underline;
}


.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

/* Left panel: background image only */
.auth-left {
    flex: 1 1 50%;
    background-image: url("/images/giphy.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Right panel: centers the auth card */
.auth-right {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617;
}

/* Auth card inside the right panel */
.auth-wrapper {
    max-width: 360px;
    width: 100%;
    margin: 0;
    padding: 24px;
    background: #020617;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        flex: 1 1 auto;
        padding: 32px 16px;
    }

    .auth-wrapper {
        margin: 0 auto;
    }
}

.app-title {
    text-align: center;
    margin-bottom: 16px;
}

.auth-form input {
    width: 100%;
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
}

.auth-form button {
    display: block;
    width: auto;               /* let the content define width */
    min-width: 140px;          /* optional: consistent button size */
    margin: 10px auto 0;       /* auto left/right centers the button */
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: deeppink;
    color: black;
    font-weight: 600;
    cursor: pointer;
}

.auth-form button:hover {
    filter: brightness(1.05);
}

.auth-switch {
    margin-top: 8px;
    display: flex;
    justify-content: center;   /* center the switch button */
}

/* optional: make the switch button look more link-like while still centered */
.link-button {
    border: none;
    background: transparent;   /* or keep deeppink if you like the pill look */
    color: deeppink;
    cursor: pointer;
    padding: 0;
}

.error {
    color: #fecaca;
    margin-bottom: 8px;
    min-height: 18px;
    font-size: 0.9rem;
}

.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;
}

.dashboard-body {
    padding: 16px;

    /* Background image behind all storyboard cards */
    background-image:
            linear-gradient(
                    rgba(15, 23, 42, 0.6),
                    rgba(15, 23, 42, 0.6)
            ),
            url("/images/arcade_bg.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

.storyboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.storyboard-card {
    background: #020617;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storyboard-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: deeppink;
    color: lightpink;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 4px;
    overflow: hidden;
}

.storyboard-icon--custom {
    background: #0b1220;
}

.storyboard-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.storyboard-icon-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #111;
    object-fit: contain;
    display: block;
}

.storyboard-title {
    font-weight: 600;
}

.storyboard-description {
    font-size: 0.85rem;
    color: #9ca3af;
}

.storyboard-launch {
    margin-top: auto;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: deeppink;
    color: black;
    cursor: pointer;
    font-weight: 600;
    filter: brightness(1.05);
}

.storyboard-launch:hover {
    filter: brightness(0.75);
}

.step-link {
    color: hotpink;
    text-align: left;
}

.quiz-button {
    margin-top: auto;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: deeppink;
    color: black;
    cursor: pointer;
    font-weight: 600;
    filter: brightness(1.05);
}

.quiz-button:hover {
    filter: brightness(0.75);
}

.storyboard-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.storyboard-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    width: 100%;
    flex-direction: column;
}

.loading,
.empty {
    color: #9ca3af;
}

/* Darker background for admin sections */
.admin-section {
    background: #2b2b2b;        /* dark charcoal */
    color: #f1f1f1;            /* high-contrast light text */
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

/* Darken the entire admin body */
.admin-body {
    background: #1f1f1f;       /* very dark grey */
    color: #e4e4e4;
    padding: 16px;
    height: calc(100vh - 56px);   /* fixed height under the header */
    min-height: 0;                /* allow flex children to shrink */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}


/* Make admin table readable in dark mode */
.admin-table {
    background: #2b2b2b;
    color: #eee;
    width: 100%;
    table-layout: fixed;
}

.admin-table th {
    background: #3a3a3a;
    color: #fff;
    font-weight: 600;
}

.admin-table td {
    background: #2b2b2b;
    color: #eee;
}

/* Make inputs readable */
.admin-section input,
.admin-section textarea,
.admin-section select {
    background: #333;
    color: #f8f8f8;
    border: 1px solid #555;
    padding: 6px;
}

.admin-section input::placeholder,
.admin-section textarea::placeholder {
    color: #aaa;
}

/* Make buttons visible */
.admin-section button {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    padding: 6px 10px;
    border-radius: 4px;
}

.admin-section button:hover {
    background: #555;
}

/* Special red button */
.danger-button {
    background-color: #a83232;
    border: none;
    color: #fff;
}

.danger-button:hover {
    background-color: #c0392b;
}

/* Table tweaks so each row looks like a separate card block */
.admin-table {
    border-collapse: separate;
    border-spacing: 0 10px; /* vertical gap between step cards */
}

.admin-table td {
    border: none;
    padding: 0; /* card handles its own padding */
}

/* The step editor card box */
.step-editor-card {
    position: relative;
    background: #2b2b2b;          /* match your dark admin-section */
    color: #f1f1f1;
    border-radius: 10px;
    padding: 16px 16px 16px 64px; /* left padding to make room for the circle */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Big circular step number in top-left */
.step-index-circle {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: deeppink;
    color: lightpink;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

/* Header: title on the left, actions on the right */
.step-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.step-editor-title {
    font-weight: 600;
    font-size: 15px;
}

/* Move up/down/remove buttons in header */
.step-editor-actions {
    display: flex;
    gap: 6px;
}

.step-editor-actions button {
    padding: 4px 8px;
    font-size: 13px;
}

/* Body: where your quiz/game field editors live */
.step-editor-body {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Optional: make form controls inside step editors look consistent */
.step-editor-card input,
.step-editor-card textarea,
.step-editor-card select {
    background: #333;
    color: #f8f8f8;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px;
    width: 100%;
    box-sizing: border-box;
}

.step-editor-card label {
    font-size: 12px;
    color: #cccccc;
}

.slider-value {
    font-weight: 600;
    margin-left: 4px;
}

.button-updown {
    background-color: deeppink;
    color: lightpink;
    border: 1px solid #666;
    padding: 6px 10px;
    border-radius: 4px;
}

.step-add-row {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.step-add-btn {
    background: deeppink;
    color: lightpink;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.step-add-btn:hover {
    background: hotpink;
}

.step-action-btn {
    border: none;
    background: deeppink;
    color: lightpink;
    cursor: pointer;
    padding: 0;
}

/* Horizontal alignment of icon + hidden badge */
.storyboard-icon-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Yellow "HIDDEN" badge */
.hidden-badge {
    background: #ffeb3b;
    color: #000;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    border: 1px solid #f0c000;
}

/* Centered box for quiz/game steps */
.step-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 16px;
}

.step-card {
    width: 100%;
    max-width: 720px;
    background: #020617;              /* dark panel */
    border-radius: 14px;
    border: 1px solid #1f2937;        /* subtle border */
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.85);
    padding: 24px 24px 28px;
    position: relative;
    overflow: hidden;
}

/* decorative top accent */
.step-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #38bdf8, #a855f7, deeppink);
    opacity: 0.9;
}

/* space things nicely inside the card */
.step-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.quiz-meta,
.game-meta,
.quiz-status,
.game-status {
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.dashboard-body.game-step-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}


.game-iframe {
    width: 100%;
    height: 800px;
    max-height: 90vh;  /* ensures it is not taller than the screen */
    border: 1px solid #ccc;
    display: block;
}

.step-card-game {
    max-width: 1000px;   /* or 1000px, 1280px, etc. */
    width: 100%;
}

.quiz-choices {
    margin: 12px 0 16px;
}

.quiz-controls,
.game-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quiz-controls button,
.game-controls button {
    flex-shrink: 0;
}

/* Quiz choice rows: keep radio + label on the same line */
.quiz-choice-row {
    margin: 6px 0;
}

.quiz-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

/* Ensure the radio stays inline and aligned */
.quiz-choice input[type="radio"] {
    flex: 0 0 auto;
    margin: 2px 0 0 0; /* slight top offset for baseline alignment */
}

/* The node returned by generateQBodyMaybeWithHTML can be block-level; force inline behavior */
.quiz-choice-text {
    display: inline;
    margin: 0;
    line-height: 1.25;
}

/* If generateQBodyMaybeWithHTML returns a wrapper containing <p> or <div>, force inline + no margins */
.quiz-choice-text p,
.quiz-choice-text div {
    display: inline;
    margin: 0;
}

.step-card {
    position: relative;
    /* your existing styling */
}

.step-number {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 0.80rem;
    color: #9ca3af;        /* subtle gray */
    opacity: 0.85;
    user-select: none;
    pointer-events: none;
}

.lock-badge {
    background: #111827;
    color: #f9fafb;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.storyboard-card-locked {
    opacity: 0.75;
}

.storyboard-launch-locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.storyboard-prereq {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280; /* subtle gray */
    font-style: italic;
}

/* --- Leaderboards under main storyboard grid -------------------------------- */

.leaderboards-section {
    margin-top: 32px;
}

.leaderboards-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.leaderboard-card {
    background: #020617;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-card-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    row-gap: 2px;
    align-items: baseline;
}

.leaderboard-rank {
    font-weight: 600;
    opacity: 0.9;
}

.leaderboard-score {
    font-weight: 600;
}

.leaderboard-meta {
    grid-column: 2 / 3;
    font-size: 0.75rem;
    opacity: 0.8;
}

.leaderboard-empty,
.leaderboard-error {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* User admin table zebra striping */
.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;
}

/* Optional hover highlight */
.user-admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* Above app header/body */
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-modal {
    background: black;
    padding: 24px 28px;
    max-width: 560px;
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.welcome-title {
    margin-top: 0;
    margin-bottom: 12px;
}

.welcome-text {
    margin: 8px 0;
    color: white;
}

.welcome-footer {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.welcome-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.10);
}

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

.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; /* critical: allows horizontal expansion in flex layouts */
}

.scenario-editor-root.no-quiz .scenario-quiz-panel {
    display: none;
}

.info-step-editor {
    width: 100%;
}

.scenario-steps-panel,
.info-step-editor {
    min-width: 0; /* prevents “refuse to grow / overflow” behavior in flex/grid */
}

.step-editor-card {
    width: 100%;
    box-sizing: border-box;
}

/* Runtime step image (quiz/info) */
.step-image {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: #0b1220;
    margin: 10px 0 16px;
    display: block;
}

/* Admin step image preview (quiz/info editors) */
.step-image-preview {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    border: 1px solid #555;
    background: #111;
    object-fit: contain;
    display: block;
}

.shake-no {
    animation: shakeNo 220ms ease-in-out 0s 1;
}

@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); }
}

.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;
}
