:root {
    --bg: #071325;
    --bg-2: #0b1f39;
    --card: rgba(9, 22, 40, 0.8);
    --line: rgba(151, 196, 250, 0.22);
    --text: #ecf5ff;
    --muted: #a8c3e1;
    --orange: #ff9147;
    --teal: #26d8be;
    --lime: #bdfd6b;
    --shadow: 0 18px 40px rgba(3, 8, 18, 0.48);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "IBM Plex Sans", sans-serif;
    background: radial-gradient(circle at 20% 10%, #183d66 0, transparent 45%),
        radial-gradient(circle at 82% 85%, #4a1e3a 0, transparent 42%),
        linear-gradient(135deg, var(--bg), var(--bg-2));
    overflow-x: hidden;
}

.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at center, black 50%, transparent 88%);
}

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
    opacity: 0.22;
}

.glow-a {
    width: 300px;
    height: 300px;
    top: -90px;
    left: -90px;
    background: var(--orange);
}

.glow-b {
    width: 260px;
    height: 260px;
    bottom: -75px;
    right: -65px;
    background: var(--teal);
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1200px, 94vw);
    margin: 18px auto 28px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.topbar {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 1.4fr;
    gap: 12px;
    margin-bottom: 14px;
}

.top-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
}

.score-box {
    background: linear-gradient(130deg, rgba(255, 145, 71, 0.1), rgba(38, 216, 190, 0.08));
}

.label {
    margin: 0 0 6px;
    color: #ffd2b3;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
}

.scoreline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.25rem;
}

.scoreline strong {
    font-size: 2rem;
    line-height: 1;
}

.sep {
    color: var(--muted);
}

.meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

h1 {
    margin: 0;
    font-family: "Barlow Condensed", sans-serif;
    letter-spacing: 0.03em;
    line-height: 1;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
}

h2 {
    margin: 0;
    font-size: 1.04rem;
}

h3 {
    margin: 10px 0 8px;
    font-size: 0.98rem;
}

.hint {
    margin: 8px 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.main-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 14px;
}

.panel-head {
    margin-bottom: 6px;
}

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

.between {
    justify-content: space-between;
}

.video-stage {
    min-height: 350px;
    border: 1px solid var(--line);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(12, 29, 51, 0.95), rgba(16, 43, 73, 0.88));
}

.scene-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.85;
}

.video-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 20%, rgba(255, 145, 71, 0.28), transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(38, 216, 190, 0.26), transparent 40%);
    z-index: 0;
}

.video-overlay {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: rgba(6, 14, 27, 0.72);
}

.video-overlay p {
    margin: 0;
}

#overlayTitle {
    font-weight: 700;
}

#overlaySub {
    color: var(--muted);
    margin-top: 4px;
    font-size: 0.9rem;
}

.play-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
    cursor: pointer;
    color: #11253d;
    background: linear-gradient(120deg, var(--lime), #ffdb89);
    z-index: 1;
}

.video-controls {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

#progressFill {
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--orange));
    transition: width 0.3s ease;
}

.status-dot {
    border-radius: 999px;
    background: rgba(255, 91, 110, 0.2);
    color: #ff9ca9;
    border: 1px solid rgba(255, 91, 110, 0.5);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 9px;
}

.transcript-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 340px;
    overflow: auto;
}

.transcript-list li {
    border: 1px solid rgba(151, 196, 250, 0.22);
    border-radius: 10px;
    padding: 9px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.transcript-list li.commentator-line {
    border-color: rgba(255, 145, 71, 0.5);
    background: rgba(255, 145, 71, 0.12);
}

.transcript-list li.commentator-line .stamp {
    color: #ffd6b5;
}

.speaker-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid rgba(151, 196, 250, 0.35);
    color: #c6deff;
}

.speaker-tag.commentator {
    border-color: rgba(255, 145, 71, 0.55);
    color: #ffd7b9;
    background: rgba(255, 145, 71, 0.14);
}

.commentator-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 4px 0 10px;
}

.commentator-badge {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(255, 145, 71, 0.55);
    color: #ffd8bb;
    background: rgba(255, 145, 71, 0.12);
}

.vllm-box {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.vllm-row {
    margin: 0 0 6px;
    color: var(--muted);
    line-height: 1.35;
}

.vllm-row:last-child {
    margin-bottom: 0;
}

.stamp {
    display: inline-block;
    margin-right: 6px;
    color: #9be8d7;
    font-weight: 700;
    font-size: 0.82rem;
}

.transcript-list li p {
    margin: 4px 0 0;
    color: #dcecff;
    line-height: 1.45;
}

mark {
    border-radius: 4px;
    padding: 0 2px;
    color: #fff0df;
    background: rgba(255, 145, 71, 0.38);
}

.terms-box {
    margin-top: 8px;
}

.terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.term {
    border: 1px solid rgba(255, 145, 71, 0.48);
    border-radius: 999px;
    background: rgba(255, 145, 71, 0.12);
    color: #ffd5b7;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.82rem;
}

.term-detail,
.answer {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    color: var(--muted);
}

.chat-wrap {
    margin-top: 14px;
}

.chat-log {
    border: 1px solid var(--line);
    border-radius: 10px;
    min-height: 120px;
    max-height: 180px;
    overflow: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.msg {
    margin-bottom: 8px;
    line-height: 1.4;
}

.msg strong {
    color: #fff;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.suggestion {
    border: 1px solid rgba(38, 216, 190, 0.5);
    border-radius: 999px;
    background: rgba(38, 216, 190, 0.12);
    color: #bcffef;
    font-size: 0.8rem;
    padding: 5px 10px;
    cursor: pointer;
}

.qa {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 10px;
    font-family: inherit;
}

.btn,
.btn-secondary {
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 9px 12px;
}

.btn {
    color: #102641;
    background: linear-gradient(120deg, var(--orange), #ffc075);
}

.btn-secondary {
    color: #d8fff6;
    border: 1px solid rgba(38, 216, 190, 0.55);
    background: rgba(38, 216, 190, 0.14);
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 160px;
    overflow: auto;
}

.timeline li {
    border-left: 2px solid rgba(151, 196, 250, 0.45);
    margin: 0 0 8px 4px;
    padding: 6px 10px;
    color: #d7e7fb;
}

.pill {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(151, 196, 250, 0.3);
}

.reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.6s ease forwards;
}

.d1 {
    animation-delay: 0.08s;
}

.d2 {
    animation-delay: 0.16s;
}

.d3 {
    animation-delay: 0.24s;
}

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .video-stage {
        min-height: 260px;
    }
}

@media (max-width: 640px) {
    .qa {
        flex-direction: column;
    }

    .video-controls {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}