:root {
    --bg-main: #090c15;
    --bg-card: #101524;
    --border-subtle: #1d253a;
    --text-primary: #f8fafc;
    --text-muted: #64748b;
    --studio-cyan: #38bdf8;
    --studio-green: #22c55e;
    --studio-red: #dc2626;
    --studio-amber: #d97706;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

html, body { background-color: var(--bg-main); color: var(--text-primary); width: 100vw; height: 100vh; overflow: hidden; }

body { display: flex; flex-direction: column; }

.studio-top-nav { max-width: 1200px; width: 100%; margin: 0 auto; padding: 10px 20px; border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.brand-group { display: flex; align-items: center; gap: 8px; }
.brand-group h1 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.5px; color: #fff; }
.status-indicator { width: 6px; height: 6px; background-color: var(--studio-green); border-radius: 50%; box-shadow: 0 0 6px var(--studio-green); }
.subtitle-tag { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }

.theater-main-deck { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; max-width: 1200px; margin: 0 auto; padding: 8px 20px 36px; height: calc(100vh - 75px); gap: 10px; overflow: hidden; flex: 1; min-height: 0; width: 100%; }

.top-config-ribbon { width: 100%; max-width: 650px; display: flex; justify-content: space-between; align-items: center; gap: 15px; background-color: var(--bg-card); padding: 6px 16px; border-radius: 6px; border: 1px solid var(--border-subtle); font-size: 0.78rem; font-weight: 600; flex-shrink: 0; }
.warning-row { padding: 0; }
.checkbox-container { display: flex; align-items: center; gap: 6px; color: #94a3b8; cursor: pointer; user-select: none; font-weight: 500; }
.checkbox-container input[type="checkbox"] { accent-color: var(--studio-amber); width: 14px; height: 14px; cursor: pointer; }
.custom-box { display: none; }
.metric-block { color: var(--text-primary); white-space: nowrap; }
.cyan-text-glow { color: var(--studio-cyan); }
#viralScoreDisplay { color: var(--studio-cyan); font-weight: 800; }

#gamifiedDisplayBox,
.studio-viewport-window { height: calc(100vh - 280px); aspect-ratio: 9/16; background-color: #000000; border: 2px solid var(--border-subtle); border-radius: 16px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 0 40px rgba(56, 189, 248, 0.08); border-color: #38bdf8; flex-shrink: 1; min-height: 0; max-width: 100%; transition: background 0.04s ease; }
.studio-viewport-window.matrix-flash-active,
#gamifiedDisplayBox.matrix-flash-active { background-color: #1e2538; }

#flashingWordOutput { font-size: 2.2rem; font-weight: 900; text-transform: uppercase; color: #fff; letter-spacing: -1px; text-align: center; word-break: break-word; padding: 0 15px; width: 100%; box-sizing: border-box; line-height: 1.3; z-index: 10; transition: color 0.02s ease; position: relative; user-select: none; }
#flashingWordOutput.matrix-flash-active { color: #facc15; text-shadow: 0 0 15px #facc15; }
#flashingWordOutput.word-flash-pulse { color: #38bdf8; text-shadow: 0 0 18px rgba(56, 189, 248, 0.55); animation: wordFlashPulse 0.14s ease; }

@keyframes wordFlashPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.03); }
}

.state-win { color: var(--studio-green) !important; font-size: 1.8rem !important; }
.state-loss { color: var(--studio-red) !important; font-size: 1.8rem !important; }
.verdict-subline { font-size: 0.8rem; font-weight: 500; display: block; margin-top: 8px; color: #94a3b8; text-transform: none; letter-spacing: 0; line-height: 1.4; }

.falling-pixel-node { position: absolute; font-weight: 800; font-size: 0.95rem; font-family: monospace; white-space: nowrap; z-index: 20; pointer-events: none; bottom: 20px; right: 20px; animation: floatUpStream 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.pixel-damage { color: var(--studio-red); text-shadow: 0 0 8px rgba(220, 38, 38, 0.6); }
.pixel-heal { color: var(--studio-green); text-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }

@keyframes floatUpStream {
    0% { transform: translateY(0) scale(0.6); opacity: 0; }
    15% { opacity: 1; transform: translateY(-15px) scale(1.1); }
    80% { opacity: 0.8; }
    100% { transform: translateY(-180px) translateX(-15px) scale(0.9); opacity: 0; }
}

.controls-dashboard-anchor { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
#blindVaultStatusCard { text-align: center; font-size: 0.72rem; color: #94a3b8; font-weight: 500; line-height: 1.4; border: 1px dashed var(--border-subtle); padding: 6px 12px; border-radius: 6px; background-color: var(--bg-card); }
#blindVaultStatusCard.is-live { color: var(--studio-cyan); border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.08); }
#blindVaultStatusCard.is-concluded { color: var(--studio-green); border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.08); font-weight: 600; }

.playback-engine-deck { display: flex; gap: 8px; width: 100%; }
.deck-btn { flex: 1; padding: 10px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; border-radius: 5px; cursor: pointer; border: none; transition: background 0.15s; }

.play-trigger { background-color: var(--studio-cyan); color: #000; }
.play-trigger.active-state { background-color: var(--studio-red); color: #fff; }
.pause-trigger { background-color: var(--studio-amber); color: #fff; }
.pause-trigger.freeze-active { background-color: #b45309; box-shadow: 0 0 10px rgba(217, 119, 6, 0.4); }
.clear-trigger { background-color: transparent; border: 1px solid var(--border-subtle); color: #fff; }

/* 👤 Clean Workspace Footer Alignment */
.global-workspace-footer { position: absolute; bottom: 0; left: 0; width: 100%; text-align: center; padding: 8px 0; font-size: 0.65rem; color: var(--text-muted); border-top: 1px solid var(--border-subtle); background-color: var(--bg-main); z-index: 100; }
.footer-divider { margin: 0 6px; color: var(--border-subtle); }

/* 🌟 High-Visibility Contrast Anchor Links Rule Update */
.footer-support-link { color: #94a3b8; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; transition: color 0.15s ease, text-shadow 0.15s ease; }
.footer-support-link:hover { color: var(--studio-cyan); text-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }

@media (max-width: 768px) {
    .top-config-ribbon { flex-direction: column; align-items: stretch; gap: 8px; max-width: 100%; }
    .metric-block { white-space: normal; text-align: center; }
    #gamifiedDisplayBox, .studio-viewport-window { height: calc(100vh - 340px); min-height: 220px; }
    #flashingWordOutput { font-size: clamp(1.5rem, 7vw, 2.2rem); }
    .playback-engine-deck { flex-direction: column; }
}
