/* Veritas Historical Simulation Timeline — instrument HUD over the 3D stage */
body.tl-page { height: 100vh; overflow: hidden; background: var(--abyss); }
#tl-stage { position: fixed; inset: 0; z-index: 0; }
#tl-stage canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
#tl-stage canvas:active { cursor: grabbing; }
.tl-page .page { position: relative; z-index: 6; }
.tl-hud { position: fixed; inset: 61px 0 0 0; z-index: 4; pointer-events: none; }
.tl-hud > * { pointer-events: auto; }
.tl-hud .glass { background: rgba(9, 12, 26, .62); border-radius: 16px; }

.tl-clocks { position: absolute; left: 16px; top: 14px; width: 300px; padding: 14px 16px; display: grid; gap: 8px; }
.tl-title { margin: 0 0 4px; font: 500 1.05rem/1.25 var(--serif); letter-spacing: .04em; color: var(--vellum); }
.tl-title span { color: var(--gold); }
.tl-clock { display: grid; gap: 1px; padding-left: 10px; border-left: 2px solid var(--ash); }
.tl-clock .k, .tl-sync .k { font: 700 .62rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ash); }
.tl-clock b { font: 500 1.02rem/1.25 var(--serif); color: var(--vellum); font-variant-numeric: tabular-nums; }
.tl-clock.prog { border-color: var(--gold); } .tl-clock.prog b { color: #F3E3B8; }
.tl-clock.world { border-color: var(--signal); }
.tl-clock.run { border-color: #b9a8ff; }
.tl-sync { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 2px; }
.tl-sync .bar { height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.tl-sync .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--signal), var(--gold), #fff); transition: width .25s; }
.tl-sync span:last-child { font-size: .74rem; color: var(--vellum); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.tl-era { font-size: .78rem; color: var(--ash); border-top: 1px solid var(--line); padding-top: 8px; }
.tl-era b { display: block; font: 500 .98rem var(--serif); color: var(--gold); }

.tl-controls { position: absolute; right: 16px; top: 14px; display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: min(640px, calc(100vw - 360px)); padding: 10px 12px; font-size: .82rem; }
.tl-controls select { width: auto; padding: 5px 8px; font-size: .8rem; }
.tl-controls .check { font-size: .8rem; gap: 6px; }
.tl-controls .check input { width: 15px; height: 15px; }

.tl-legend { position: absolute; left: 18px; bottom: 88px; display: flex; gap: 12px; font-size: .7rem; letter-spacing: .06em; color: var(--ash); pointer-events: none; }
.tl-legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.tl-legend .sci::before { background: #62F0FF; } .tl-legend .scr::before { background: #D8B26A; } .tl-legend .find::before { background: #b18cff; } .tl-legend .ver::before { background: #fff; box-shadow: 0 0 8px #fff; }

.tl-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tl-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); padding: 4px 9px 5px; border-radius: 9px; background: rgba(5, 6, 13, .72); border: 1px solid rgba(255, 255, 255, .08); white-space: nowrap; pointer-events: auto; cursor: pointer; transition: opacity .25s; max-width: 280px; }
.tl-label b { display: block; font: 600 .78rem var(--sans); color: var(--vellum); overflow: hidden; text-overflow: ellipsis; }
.tl-label small { display: block; font-size: .66rem; color: var(--ash); }
.tl-label em { display: block; font: italic 500 .78rem var(--serif); color: var(--gold); overflow: hidden; text-overflow: ellipsis; }
.tl-label.sci, .tl-label.his { border-color: rgba(98, 240, 255, .35); }
.tl-label.scr { border-color: rgba(216, 178, 106, .5); }
.tl-label.find { border-color: rgba(177, 140, 255, .55); }
.tl-label.day { border-color: rgba(216, 178, 106, .8); background: rgba(40, 30, 10, .7); }
.tl-label.day b { font: 500 1rem var(--serif); color: #F3E3B8; }
.tl-label.life { background: transparent; border: 0; padding: 0; }
.tl-label.life b { font: 600 .68rem var(--sans); color: rgba(243, 227, 184, .9); text-shadow: 0 0 8px #000; }
.tl-label:hover { border-color: #fff; z-index: 5; }

.tl-prologue { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; transition: opacity .8s; width: min(900px, 90vw); }
.tl-prologue .verse { margin: 0; font: 400 clamp(1.8rem, 4vw, 3.4rem)/1.15 var(--serif); color: #FBF1D4; text-shadow: 0 0 40px rgba(216, 178, 106, .55); }
.tl-prologue .ref { margin: 10px 0 0; font: 700 .76rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--signal); }
.tl-prologue .ver { margin: 14px 0 0; font: italic 400 1.2rem var(--serif); color: var(--gold); }

.tl-card { position: absolute; right: 16px; top: 120px; bottom: 96px; width: min(400px, calc(100vw - 32px)); padding: 16px 18px; overflow: auto; display: grid; gap: 10px; align-content: start; }
.tl-card header { display: flex; align-items: center; gap: 8px; }
.tl-card .tag { font: 700 .62rem var(--sans); letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; border: 1px solid; }
.tl-card .tag.sci, .tl-card .tag.his { color: var(--signal); } .tl-card .tag.scr, .tl-card .tag.day { color: var(--gold); } .tl-card .tag.find { color: #c7adff; }
.tl-card h3 { margin: 0; font: 500 1.5rem/1.2 var(--serif); }
.tl-card .date { font-size: .82rem; color: var(--ash); margin: 0; }
.tl-card p { margin: 0; font-size: .92rem; line-height: 1.55; }
.tl-card .lens { padding: 10px 12px; border-radius: 10px; background: rgba(216, 178, 106, .08); border: 1px solid rgba(216, 178, 106, .25); font: italic 400 1.05rem/1.45 var(--serif); color: #F3E3B8; }
.tl-card .lens small { display: block; font: 700 .6rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dim); font-style: normal; margin-bottom: 3px; }
.tl-card .tl-verse { border-left: 2px solid var(--gold); padding: 4px 0 4px 12px; font: 400 1.02rem/1.5 var(--serif); }
.tl-card .tl-verse small { display: block; font: 700 .62rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ash); margin-bottom: 2px; }
.tl-card .tl-verse.v2 { border-color: var(--signal); }
.tl-card .links { display: flex; gap: 8px; flex-wrap: wrap; }
.tl-card .close { margin-left: auto; }
.tl-card ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.tl-card ul a { cursor: pointer; }

.tl-ribbon { position: absolute; left: 16px; right: 16px; bottom: 34px; height: 44px; display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: rgba(5, 6, 13, .7); }
.tl-ribbon button { position: relative; flex: none; border: 0; border-right: 1px solid rgba(216, 178, 106, .14); background: transparent; color: var(--ash); cursor: pointer; padding: 4px 8px; text-align: left; overflow: hidden; font-size: .7rem; line-height: 1.2; min-width: 0; }
.tl-ribbon button b { display: block; font: 600 .72rem var(--sans); color: var(--vellum); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ribbon button span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ribbon button.on { background: rgba(216, 178, 106, .12); }
.tl-ribbon button.on b { color: var(--gold); }
.tl-ribbon .head { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 12px #fff; pointer-events: none; transition: left .15s linear; }
.tl-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); margin: 0; font-size: .72rem; color: var(--ash); white-space: nowrap; pointer-events: none; }

.tl-intro { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(5, 6, 13, .35), rgba(5, 6, 13, .85)); transition: opacity .8s; }
.tl-intro.gone { opacity: 0; pointer-events: none; }
.tl-intro .glass { max-width: 560px; padding: 30px; text-align: center; display: grid; gap: 14px; justify-items: center; background: rgba(9, 12, 26, .78); }
.tl-intro .eyebrow { margin: 0; font: 700 .7rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--signal); }
.tl-intro h2 { margin: 0; font: 400 clamp(1.8rem, 4vw, 2.6rem)/1.1 var(--serif); color: #FBF1D4; }
.tl-intro p { margin: 0; color: var(--ash); line-height: 1.6; }

@media (max-width: 820px) {
  .tl-clocks { width: auto; right: 16px; padding: 10px 12px; gap: 5px; }
  .tl-clocks .tl-era, .tl-legend, .tl-hint { display: none; }
  .tl-controls { top: auto; bottom: 88px; left: 16px; right: 16px; max-width: none; justify-content: center; }
  .tl-card { top: auto; bottom: 88px; max-height: 52vh; }
  .tl-ribbon button span { display: none; }
}
.tl-card[hidden] { display: none; }
.tl-hud .tl-card { background: rgba(9, 12, 26, .93); z-index: 3; }
