:root {
  --ink: #f4f1e8;
  --muted: #c9c2b0;
  --panel: rgba(24, 28, 38, 0.86);
  --edge: #3b4254;
  --gold: #f2c14e;
  --teal: #2bb3a3;
  --red: #e4572e;
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1d26; color: var(--ink); font-family: var(--font); }
#scene { position: fixed; inset: 0; }
#scene canvas { display: block; width: 100%; height: 100%; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
button { font: inherit; cursor: pointer; }

.th-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: linear-gradient(rgba(10, 12, 18, 0.9), rgba(10, 12, 18, 0)); z-index: 5; }
.th-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.th-brand span { display: flex; flex-direction: column; line-height: 1; }
.th-brand strong { font-size: 20px; letter-spacing: 0.02em; }
.th-brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.th-badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12px; color: #1a1d26; background: var(--gold); padding: 4px 10px; border-radius: 4px; font-weight: 700; }
.th-spacer { flex: 1; }
.th-short { display: none; }
.th-names { white-space: nowrap; flex-shrink: 0; background: #2c3242; color: var(--ink); border: 2px solid var(--edge); border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.th-names[aria-pressed="true"] { border-color: var(--gold); }
.th-cta { white-space: nowrap; flex-shrink: 0; color: #1a1d26; background: var(--teal); padding: 8px 14px; border-radius: 4px; text-decoration: none; font-weight: 700; box-shadow: 0 3px 0 #1b7b70; }
.th-cta:hover { filter: brightness(1.08); }

.th-panel { position: fixed; top: 64px; bottom: 16px; width: 330px; background: var(--panel); border: 2px solid var(--edge); border-radius: 6px; padding: 14px; overflow-y: auto; z-index: 4; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35); }
.th-left { left: 16px; }
.th-right { right: 16px; }
.th-panel h2 { margin: 0 0 10px; font-size: 18px; }
.th-panel h3 { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.th-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.th-presets button, .th-suggest button, .th-card button { background: #2c3242; color: var(--ink); border: 2px solid var(--edge); border-radius: 4px; padding: 6px 9px; font-size: 13px; }
.th-presets button:hover, .th-suggest button:hover { border-color: var(--gold); }
.th-search { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; margin-top: 10px; }
.th-search label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.th-search input, .th-search select, .th-askrow input { background: #11141b; color: var(--ink); border: 2px solid var(--edge); border-radius: 4px; padding: 7px; font: inherit; }
.th-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 210px; overflow-y: auto; }
.th-list li button { width: 100%; text-align: left; background: none; border: 0; color: var(--ink); padding: 6px 4px; border-bottom: 1px solid #2c3242; display: flex; justify-content: space-between; gap: 6px; }
.th-list li button:hover { background: #2c3242; }
.th-list small, .th-small { color: var(--muted); font-size: 12px; }
.th-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.th-chips li { background: #2c3242; border-radius: 3px; padding: 3px 4px 3px 8px; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.th-chips button { background: none; border: 0; color: var(--muted); padding: 0 4px; }
.th-go { margin-top: 12px; width: 100%; background: var(--gold); color: #1a1d26; border: 0; border-radius: 4px; padding: 10px; font-weight: 800; font-size: 15px; box-shadow: 0 3px 0 #a5801f; }
.th-go:disabled { opacity: 0.45; cursor: default; }

.th-ask { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(720px, calc(100vw - 32px)); z-index: 4; }
.th-suggest { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.th-suggest button { background: var(--panel); }
.th-askrow { display: flex; gap: 8px; background: var(--panel); border: 2px solid var(--edge); border-radius: 6px; padding: 8px; }
.th-askrow input { flex: 1; font-size: 16px; }
.th-askrow .th-go { width: auto; margin: 0; padding: 8px 22px; }

.th-ranking { padding-left: 0; list-style: none; margin: 8px 0; }
.th-ranking li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; font-size: 13px; padding: 3px 0; }
.th-ranking .bar { grid-column: 2 / 4; height: 6px; background: #2c3242; border-radius: 3px; overflow: hidden; }
.th-ranking .bar i { display: block; height: 100%; background: var(--teal); }
.th-ranking li.speaker { color: var(--gold); font-weight: 700; }
.th-ranking li.speaker .bar i { background: var(--gold); }
.th-ranking li.na { color: var(--muted); }
.th-note { background: #3a3220; border-left: 3px solid var(--gold); padding: 6px 8px; font-size: 12px; }
.th-transcript p { font-size: 13px; margin: 6px 0; }
.th-transcript strong { color: var(--gold); }

.bubble { position: absolute; transform: translate(-50%, -100%); background: #fffdf5; color: #1a1d26; border: 3px solid #1a1d26; border-radius: 8px; padding: 8px 10px; max-width: 260px; font-size: 14px; line-height: 1.3; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -12px; border: 9px solid transparent; border-top-color: #1a1d26; transform: translateX(-50%); }
.bubble small { display: block; color: #6b6458; font-size: 11px; margin-bottom: 2px; }
.tag { position: absolute; transform: translate(-50%, -100%); background: rgba(17, 20, 27, 0.78); color: var(--ink); font-size: 11px; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.tag.hidden { display: none; }
.tag span { display: none; }
.tag.full span { display: inline; }
.tag.full { z-index: 2; }
.tag b { color: var(--gold); font-weight: 700; }
.tag.speaker { font-size: 13px; padding: 3px 8px; border: 1px solid var(--gold); }
.host { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #1a1d26; font-weight: 800; padding: 6px 14px; border-radius: 4px; z-index: 3; }

.th-card { position: fixed; z-index: 6; background: var(--panel); border: 2px solid var(--gold); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.th-card-actions { display: flex; gap: 6px; margin-top: 6px; }
.th-throw { background: var(--red) !important; border-color: #a83a1b !important; font-weight: 800; }

.th-intro { max-width: 520px; background: #232836; color: var(--ink); border: 3px solid var(--gold); border-radius: 8px; padding: 20px 22px; }
.th-intro::backdrop { background: rgba(0, 0, 0, 0.6); }
.th-intro h2 { margin-top: 0; }

@media (max-width: 900px) {
  .th-panel { width: auto; left: 8px; right: 8px; top: auto; bottom: 150px; max-height: 40vh; }
  .th-right { display: none; }
  .th-badge, #names { display: none; }
  .th-top { padding: 8px; gap: 8px; }
  .th-brand strong { font-size: 16px; }
  .th-cta { font-size: 12px; padding: 6px 8px; }
  .host { top: 52px; font-size: 13px; max-width: calc(100vw - 24px); text-align: center; }
  .bubble { max-width: 200px; font-size: 13px; }
  .th-suggest button { font-size: 12px; padding: 4px 7px; }
}

.maptip { position: fixed; z-index: 6; pointer-events: none; background: rgba(17, 20, 27, 0.9); color: var(--ink); padding: 4px 9px; border-radius: 4px; font-size: 13px; border: 1px solid var(--gold); }
.halltag { position: absolute; z-index: 2; transform: translate(-50%, -100%); background: #8f2d22; color: #f6e7c1; font-weight: 800; padding: 5px 10px; border-radius: 4px; border: 2px solid #e9dcc0; text-align: center; font-size: 13px; pointer-events: none; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.halltag small { display: block; font-weight: 400; font-size: 11px; color: #e9dcc0; }
.fade { position: fixed; inset: 0; background: #0b0d12; opacity: 0; pointer-events: none; transition: opacity 0.6s ease; z-index: 20; }
.fade.on { opacity: 1; }
#runbanner { z-index: 7; }
.th-top .th-names + .th-names { margin-left: 0; }


/* the up-front choice of look */
.th-intro h3 { margin: 16px 0 8px; font-size: 15px; color: var(--muted); }
.th-looks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.th-look { display: flex; flex-direction: column; gap: 4px; text-align: left; background: #2c3242; color: var(--ink); border: 2px solid var(--edge); border-radius: 6px; padding: 10px; }
.th-look:hover, .th-look:focus-visible { border-color: var(--gold); }
.th-look.last { border-color: var(--teal); }
.th-look strong { font-size: 16px; }
.th-look small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.th-look-art { height: 64px; border-radius: 4px; display: flex; align-items: flex-end; justify-content: center; gap: 8px; padding: 8px; margin-bottom: 4px; }
.th-look-art i { display: block; width: 18px; }
.th-look-classic .th-look-art { background: linear-gradient(#9cc9e6 55%, #7fb069 55%); }
.th-look-classic .th-look-art i { background: #8a4b37; height: 26px; box-shadow: 0 -6px 0 #e9dcc0; }
.th-look-classic .th-look-art i:nth-child(2) { height: 34px; }
.th-look-news .th-look-art { background: radial-gradient(circle at 50% 120%, #13306b, #040a1c 70%); }
.th-look-news .th-look-art i { width: 6px; border-radius: 3px; background: #2bd3c3; height: 22px; box-shadow: 0 0 8px #2bd3c3; }
.th-look-news .th-look-art i:nth-child(2) { height: 44px; background: #f2c14e; box-shadow: 0 0 8px #f2c14e; }
.th-look-news .th-look-art i:nth-child(3) { height: 32px; background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }

/* the newsroom */
body[data-style="news"] { background: #02060f; }
body[data-style="news"] .th-panel { background: rgba(7, 16, 40, 0.88); border-color: #1f3c7a; }
body[data-style="news"] .th-badge { background: #c8102e; color: #fff; }
.th-lower { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.5); }
.th-lower .bar { display: flex; align-items: stretch; min-height: 70px; }
.th-lower .tag { position: static; transform: none; background: #c8102e; color: #fff; font-weight: 900; padding: 0 20px; display: flex; align-items: center; font-size: 20px; letter-spacing: 0.05em; border-radius: 0; }
.th-lower .title { flex: 1; min-width: 0; background: linear-gradient(90deg, #0b1a3a, #13306b); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 8px 20px; gap: 2px; }
.th-lower .title b { font-size: 22px; }
.th-lower .title q { font-size: 17px; font-style: italic; color: #fff; quotes: none; }
.th-lower .title span { color: #9fc4ff; font-size: 13px; }
.th-lower .ticker { background: #f2c14e; color: #0b1a3a; font-weight: 700; padding: 5px 0; font-size: 14px; white-space: nowrap; overflow: hidden; }
.th-lower .ticker span { display: inline-block; padding-left: 100%; animation: th-ticker 45s linear infinite; }
@keyframes th-ticker { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .th-lower .ticker span { animation: none; padding-left: 20px; } }
body[data-style="news"] .th-ask { bottom: 124px; }
body[data-style="news"] .th-right { bottom: 124px; }
body[data-style="news"] #runbanner { display: none; }

/* grill a mayor */
.th-grillbtn { background: #b8461f !important; border-color: #7c2d12 !important; font-weight: 800; }
.th-file { list-style: none; padding: 0; margin: 0; }
.th-file li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12px; padding: 3px 0; }
.th-file .bar { grid-column: 1 / 3; height: 5px; background: #2c3242; border-radius: 3px; overflow: hidden; }
.th-file .bar i { display: block; height: 100%; background: var(--teal); }
.th-file .bar i.weak { background: var(--red); }
.th-tough { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.th-tough button { width: 100%; text-align: left; background: #2c3242; color: var(--ink); border: 2px solid var(--edge); border-radius: 4px; padding: 7px 9px; font-size: 13px; display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; }
.th-tough button:hover:not(:disabled) { border-color: #e4572e; }
.th-tough button:disabled { opacity: 0.55; cursor: default; }
.th-tough small { white-space: nowrap; }
.th-grill-own { display: flex; gap: 6px; margin-top: 8px; }
.th-grill-own input { flex: 1; min-width: 0; background: #11141b; color: var(--ink); border: 2px solid var(--edge); border-radius: 4px; padding: 7px; font: inherit; font-size: 13px; }
.th-grill-own .th-go { width: auto; margin: 0; padding: 6px 14px; font-size: 13px; }
.grill-q { border-top: 1px solid #2c3242; padding-top: 4px; }
.grill-q .q { color: var(--muted); }
@media (max-width: 900px) {
  .th-grill { display: block; top: auto; bottom: 8px; max-height: 55vh; }
  .th-looks { grid-template-columns: 1fr; }
  body[data-style="news"] .th-ask { bottom: 108px; }
  .th-lower .title b { font-size: 15px; }
  .th-lower .title q { font-size: 13px; }
  .th-lower .tag { font-size: 14px; padding: 0 10px; }
  #reset, #stylebtn { font-size: 12px; padding: 4px 7px; }
}
@media (max-width: 1250px) { .th-badge { display: none; } }
@media (max-width: 600px) {
  .th-brand span { display: none; }
  .th-top { gap: 6px; }
  .th-cta { font-size: 11px; padding: 6px; white-space: normal; flex-shrink: 1; text-align: center; }
  #back { font-size: 12px; padding: 4px 7px; }
  .th-long { display: none; }
  .th-short { display: inline; }
  body[data-style="news"] .th-grill { bottom: 112px; max-height: 48vh; }
}
