:root {
  --bg: #0E1016;
  --surface: #161922;
  --text: #F4F5F7;
  --muted: #9AA0AE;
  --accent: #EE4B45;
  --gold: #F2C230;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}
#app { max-width: 480px; margin: 0 auto; padding: 0 var(--gutter) 32px; }

h1, h2 { font-family: 'Bebas Neue', sans-serif; margin: 0; letter-spacing: 0.5px; }

.screen { display: none; padding-top: 24px; }
.screen.active { display: block; }

.brand { color: var(--accent); font-size: 32px; margin: 16px 0; }

.section-head {
  background: var(--surface);
  display: inline-block;
  transform: skew(-8deg);
  margin: 0 0 16px;
  padding: 8px 20px;
}
.section-head span, .btn-primary span, .btn-secondary span, .record-btn span {
  display: inline-block;
  transform: skew(8deg);
}
.section-head span { color: var(--accent); font-size: 22px; }

.card { background: var(--surface); padding: 20px; display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select {
  background: var(--bg);
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 12px;
  font-size: 16px;
  border-radius: 0;
}

.btn-primary, .btn-secondary, .record-btn {
  border: none;
  cursor: pointer;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  padding: 16px;
  transform: skew(-8deg);
  border-radius: 0;
  width: 100%;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--muted); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.record-btn {
  width: 96px;
  height: 96px;
  background: var(--accent);
  color: var(--bg);
  font-size: 18px;
  display: grid;
  place-items: center;
  margin: 24px auto;
}
.record-btn.recording { border: 4px solid var(--accent); animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(238, 75, 69, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(238, 75, 69, 0); }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chips[hidden] { display: none; }
.chip { background: var(--surface); color: var(--muted); border: none; padding: 8px 12px; font-family: 'Bebas Neue', sans-serif; font-size: 16px; transform: skew(-8deg); border-radius: 0; cursor: pointer; }
.chip span { display: inline-block; transform: skew(8deg); }
.chip.active { background: var(--accent); color: var(--bg); }

.gsi-wrap { display: flex; justify-content: center; margin-top: 24px; }

.logo { display: block; width: 100%; max-width: 340px; height: auto; margin: 8px 0 12px; }
.brand-mark { width: 34px; height: 34px; vertical-align: -6px; margin-right: 10px; }
.tagline { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.howto { padding-left: 20px; margin: 0 0 12px; display: grid; gap: 8px; font-size: 15px; }
.howto b { color: var(--text); }
.howto-fold { margin-top: 24px; color: var(--muted); }
.howto-fold summary { cursor: pointer; font-family: 'Bebas Neue', sans-serif; font-size: 18px; color: var(--accent); }
.howto-fold .howto { margin-top: 12px; }

.topbar { display: flex; justify-content: space-between; align-items: center; }
.link { color: var(--muted); font-size: 13px; }

.grid-cards { display: grid; gap: 12px; }
.stage-card { background: var(--surface); padding: 16px; display: grid; gap: 4px; cursor: pointer; }
.stage-card.locked { opacity: 0.4; cursor: default; }
.stage-card .label { font-family: 'Bebas Neue', sans-serif; font-size: 20px; }
.stage-card .best { color: var(--muted); font-size: 12px; }

.script-area { display: grid; gap: 8px; margin: 16px 0; }
.script-line { padding: 10px 12px; background: var(--surface); border-left: 4px solid transparent; font-size: 15px; }
.script-line.required::before { content: "* "; color: var(--muted); }
.script-line.missed { border-left-color: var(--accent); background: rgba(238, 75, 69, 0.12); }
.script-line.outoforder { border-left-color: var(--gold); }
.script-line.judged { border-left-color: var(--gold); background: rgba(242, 194, 48, 0.12); }
.oo-tag { color: var(--gold); font-size: 11px; margin-left: 8px; }
.judged-tag { color: var(--gold); font-size: 11px; margin-left: 8px; }

.interim { color: var(--muted); font-size: 13px; min-height: 18px; }
.warn { color: var(--accent); }

.percent { font-size: 64px; text-align: center; font-family: 'Bebas Neue', sans-serif; color: var(--accent); }
.percent.pass { color: var(--gold); }
.bar { background: var(--surface); height: 16px; margin: 8px 0 24px; }
.bar-fill { background: var(--gold); height: 100%; width: 0%; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }

.sim-messages { display: grid; gap: 8px; margin: 16px 0; max-height: 60vh; overflow-y: auto; }
.msg { padding: 10px 12px; background: var(--surface); max-width: 85%; }
.msg.you { justify-self: end; }
.msg .tag { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
.msg.you .tag { color: var(--accent); text-align: right; }
.status { color: var(--muted); min-height: 20px; }

.muted { color: var(--muted); }
.gold { color: var(--gold); }
.coral { color: var(--accent); }

.pill { display: inline-block; width: fit-content; justify-self: start; padding: 6px 10px; font-family: 'Bebas Neue', sans-serif; font-size: 13px; }
.pill span { display: inline-block; }
.pill.behind { background: var(--accent); color: var(--bg); }
.pill.onpace { background: var(--surface); color: var(--muted); border-left: 3px solid var(--gold); }
.pill.nailed { background: var(--gold); color: var(--bg); }
.pill.coming { background: var(--surface); color: var(--muted); border-left: 3px solid var(--muted); }

.offroster-tag { color: var(--muted); font-size: 11px; }

.rollup { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.stat { background: var(--surface); padding: 12px; }
.stat .num { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: var(--text); }
.stat .label { color: var(--muted); font-size: 12px; }

.tech-row { background: var(--surface); padding: 12px; display: grid; gap: 6px; cursor: pointer; font-size: 14px; }

.roleplay-status { font-size: 12px; display: grid; gap: 4px; max-height: 4.2em; overflow: hidden; }
.roleplay-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; }

.tier-row { background: var(--surface); padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; margin-bottom: 8px; }
.tier-row .tier-name { font-family: 'Bebas Neue', sans-serif; font-size: 16px; flex: 1; }
.tier-row .audio-slot { flex-basis: 100%; }
.tier-row .audio-slot audio { width: 100%; }
