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

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0C1724;
    min-height: 100vh;
    color: #e0e0e0;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Splunk light trail decorations */
body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -60px;
    left: -100px;
    width: 70vw;
    height: 40vh;
    background: url('/static/light-trail-top.png') no-repeat;
    background-size: contain;
}

body::after {
    bottom: -60px;
    right: -100px;
    width: 70vw;
    height: 40vh;
    background: url('/static/light-trail-bottom.png') no-repeat bottom right;
    background-size: contain;
}

.container { max-width: 900px; margin: 0 auto; position: relative; z-index: 1; }

/* Hero header */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.mascot {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(228, 0, 123, 0.3));
}

.hero-text {
    text-align: left;
}

h1 { 
    font-size: 2.5em; 
    margin-bottom: 2px;
    background: linear-gradient(90deg, #E4007B, #F16122, #65A637);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.subtitle { color: #888; font-size: 0.95em; }

/* ============================================================
   SESSION BADGE — prominent bar below the hero
   ============================================================ */
.session-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #111b2b 0%, #162030 100%);
    border: 1px solid #2a3a4f;
    border-radius: 12px;
    padding: 14px 24px;
    margin-bottom: 20px;
}

.session-badge-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #556;
    font-weight: 600;
}

.session-badge-id {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ff5ca0;
    text-shadow: 0 0 12px rgba(228, 0, 123, 0.3);
}

.session-badge-timer {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 1.3em;
    font-weight: 600;
    color: #F16122;
    min-width: 70px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.session-badge-timer.timer-done {
    color: #65A637;
    text-shadow: 0 0 12px rgba(101, 166, 55, 0.4);
}

/* ============================================================
   LEVEL TABS
   Three distinct states:
     1. Active (current)  → blue border + subtle blue bg
     2. Completed (done)  → green border + green bg + ✅
     3. Locked (gated)    → faded out + 🔒
   ============================================================ */
.level-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.level-tab {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid #333;
    border-radius: 10px;
    background: #0C1724;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
}

.level-tab:hover { border-color: #5a9fd4; }
.level-tab h3 { margin-bottom: 5px; font-size: 1em; }
.level-tab p { font-size: 0.75em; color: #888; }

/* ACTIVE — blue accent (clearly "in progress", not "done") */
.level-tab.active { 
    border-color: #5a9fd4; 
    background: linear-gradient(135deg, #0C1724 0%, #142638 100%);
    box-shadow: 0 0 12px rgba(90, 159, 212, 0.15);
}

.level-tab.active h3 {
    color: #fff;
}

/* COMPLETED — green with checkmark */
.level-tab.completed {
    border-color: #65A637;
    background: linear-gradient(135deg, #0C1724 0%, #1a2a1a 100%);
}

.level-tab.completed::after {
    content: '✅';
    display: block;
    font-size: 0.75em;
    margin-top: 2px;
}

/* COMPLETED + ACTIVE — green stays, subtle inner blue ring shows selection */
.level-tab.completed.active {
    border-color: #65A637;
    background: linear-gradient(135deg, #0C1724 0%, #1a2a1a 100%);
    box-shadow: 0 0 12px rgba(101, 166, 55, 0.2), inset 0 0 0 1px rgba(90, 159, 212, 0.3);
}

/* LOCKED — faded, non-interactive */
.level-tab.locked {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    border-color: #222;
}

.level-tab.locked::after {
    content: '🔒';
    display: block;
    font-size: 0.75em;
    margin-top: 2px;
}

.level-tab.locked:hover {
    border-color: #222;
}

/* Chat */
.chat-container {
    background: #0a0f18;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    max-width: 80%;
}

.message.user {
    background: #1a2a3d;
    border: 1px solid #2d4a6b;
    margin-left: auto;
}

.message.assistant {
    background: #1e1e2e;
    border: 1px solid #333;
}

.message.system {
    background: #3d1a1a;
    border: 1px solid #ff4444;
    text-align: center;
    max-width: 100%;
}

.message.warning {
    background: #3d2e1a;
    border: 1px solid #F16122;
    text-align: center;
    max-width: 100%;
}

.message.success {
    background: #1a3d1a;
    border: 1px solid #65A637;
    text-align: center;
    max-width: 100%;
}

/* Input areas */
.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    border: 2px solid #333;
    border-radius: 10px;
    background: #0C1724;
    color: #e0e0e0;
    font-size: 1em;
}

input[type="text"]:focus {
    outline: none;
    border-color: #65A637;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #E4007B, #F16122);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

button:hover { transform: scale(1.05); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.guess-area {
    display: flex;
    gap: 10px;
}

.guess-area input[type="text"] { border-color: #E4007B; }
.guess-area input[type="text"]:focus { border-color: #65A637; }
.guess-area button {
    background: linear-gradient(90deg, #65A637, #4a8a28);
    color: white;
}

/* Stats bar */
.stats {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: #888;
    flex-wrap: wrap;
}

.stat { 
    background: #0C1724;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 80px;
}

.stat-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.stat-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #ccc;
    font-variant-numeric: tabular-nums;
}

.stat-mono {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    color: #ff5ca0;
    letter-spacing: 1px;
}

/* Info box */
.info-box {
    background: #0C1724;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-box h4 { color: #65A637; margin-bottom: 10px; }
.info-box p { margin-bottom: 6px; }
.info-box ul { padding-left: 20px; }
.info-box li { margin-bottom: 5px; color: #888; }

.monitoring-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(241, 97, 34, 0.06);
    border: 1px solid rgba(241, 97, 34, 0.2);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 0.78em;
    color: #999;
    line-height: 1.4;
}

.monitoring-notice strong {
    color: #ccc;
}

.monitoring-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F16122;
    box-shadow: 0 0 6px rgba(241, 97, 34, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(241, 97, 34, 0.6); }
    50% { opacity: 0.4; box-shadow: 0 0 2px rgba(241, 97, 34, 0.3); }
}

/* Thinking indicator */
.message.thinking {
    opacity: 0.7;
    border: 1px solid #65A637;
}

.message.thinking .dots {
    display: inline-block;
    min-width: 1.2em;
}

.message.thinking .elapsed {
    color: #888;
    font-size: 0.85em;
}

.input-label {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 4px;
    padding-left: 4px;
}

/* ============================================================
   COMPLETION BANNER
   ============================================================ */
.completion-banner {
    background: linear-gradient(135deg, #0a1a0a 0%, #1a3d1a 50%, #0a1a0a 100%);
    border: 2px solid #65A637;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: bannerSlideIn 0.5s ease-out;
}

.completion-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(101, 166, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.completion-inner {
    position: relative;
    z-index: 1;
}

.completion-trophy {
    font-size: 3em;
    margin-bottom: 8px;
    animation: trophyBounce 0.6s ease-out 0.3s both;
}

@keyframes trophyBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.completion-banner h2 {
    font-size: 1.6em;
    margin-bottom: 4px;
    background: linear-gradient(90deg, #65A637, #a0e060);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.completion-time {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 2.2em;
    font-weight: 700;
    color: #65A637;
    margin: 8px 0 16px;
    text-shadow: 0 0 20px rgba(101, 166, 55, 0.4);
}

.completion-stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
}

.completion-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.completion-stat-value {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 1.8em;
    font-weight: 700;
    color: #e0e0e0;
}

.completion-stat-label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
}

.completion-details {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 12px;
}

.completion-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.completion-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.completion-value {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: 600;
    color: #ff5ca0;
    letter-spacing: 2px;
}

.copy-btn {
    background: none;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.85em;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
    transform: scale(1.05);
}

.completion-cta {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}