:root {
  --bg: #0d0f14; --panel: #161a22; --line: #262c38; --text: #eef1f6; --muted: #8d96a8;
  --accent: #f5b83d; --good: #3ccf7a; --bad: #ff5d5d;
  --s1: 8px; --s2: 16px; --s3: 28px; --s4: 40px;
  --r: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: var(--s3) var(--s2) var(--s4); }
.narrow { max-width: 560px; }
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 0 0 var(--s2); letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 var(--s2); }
p { margin: 0 0 var(--s2); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 18px; margin-bottom: var(--s3); display: inline-block; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); margin-bottom: var(--s2); }
.grid { display: grid; gap: var(--s2); }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.choice { display: block; text-decoration: none; color: var(--text); }
.choice:hover { border-color: var(--accent); }
.choice b { display: block; font-size: 18px; margin-bottom: var(--s1); }
button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer;
  background: var(--accent); color: #1a1300; text-decoration: none; display: inline-block;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .45; cursor: default; }
input, select {
  font: inherit; color: var(--text); background: #0f1218; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%;
}
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: var(--s1); }
.row { display: flex; gap: var(--s2); align-items: end; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row > .shrink { flex: 0 0 auto; }

/* video: never anything on top of the YouTube player */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r); overflow: hidden; }
.video > div, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.video .empty { display: grid; place-items: center; color: var(--muted); text-align: center; padding: var(--s3); }

/* now / next lane */
.lane { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: var(--s2); align-items: stretch; text-align: center; }
.lane .cell { background: #0f1218; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s2); }
.lane .cap { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.lane .big { font-size: 34px; font-weight: 800; }
.lane .now { border-color: var(--accent); }
.lane .now .big { font-size: 56px; line-height: 1.1; }
.lane .now.good { border-color: var(--good); box-shadow: 0 0 0 3px rgba(60, 207, 122, .25); }
.lane .now.bad { border-color: var(--bad); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: var(--s1); }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; }

.fret svg { width: 100%; height: auto; display: block; }
.feedback { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #0f1218; border: 1px solid var(--line); font-size: 14px; }
.pill.good { border-color: var(--good); color: var(--good); }
.pill.bad { border-color: var(--bad); color: var(--bad); }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--good); width: 0; transition: width .05s; }
.code { font-size: 64px; font-weight: 800; letter-spacing: .18em; color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.hide { display: none !important; }

/* TV surface: fixed 1280x720 scaled to fit (Deadline Day lesson: Android TV reports 960x540) */
body.tv { overflow: hidden; }
.tvstage { position: fixed; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: 0 0; }
.tvgrid { display: grid; grid-template-columns: 880px 1fr; gap: 28px; height: 100%; padding: 36px; }

@media (max-width: 600px) {
  .wrap { padding: var(--s2) var(--s2) var(--s4); }
  .panel { padding: var(--s2); }
  .lane { gap: var(--s1); }
  .lane .cell { padding: var(--s2) 4px; }
  .lane .cap { font-size: 10px; letter-spacing: .08em; }
  .lane .big { font-size: 26px; }
  .lane .now .big { font-size: 44px; }
  .code { font-size: 48px; }
}
