:root {
  --maroon: #7a1f2b;
  --maroon-deep: #52141d;
  --gold: #f2b705;
  --gold-soft: #ffd75e;
  --bg: #16090c;
  --card: #241016;
  --card-2: #2f161e;
  --line: #4a2530;
  --text: #f7ecdf;
  --muted: #c4a58f;
  --good: #3fbf6f;
  --bad: #e04f4f;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #331119 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }

h1, h2, h3 { line-height: 1.15; }
.brand {
  text-align: center; padding: 18px 0 6px;
  font-weight: 800; letter-spacing: .04em; color: var(--gold);
}
.brand small { display: block; color: var(--muted); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: .7rem; margin-top: 4px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 12px 0;
}

label { display: block; font-size: .8rem; color: var(--muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .06em; }

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; font-size: 1.05rem; padding: 13px 14px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); outline: none;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 18px; margin-top: 12px;
  font-size: 1.05rem; font-weight: 700; letter-spacing: .02em;
  color: #241016; background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: none; border-radius: 12px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none; appearance: none;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { width: auto; padding: 9px 14px; font-size: .9rem; margin-top: 0; }

.choices { display: grid; gap: 10px; margin-top: 14px; }
.choice {
  padding: 16px; font-size: 1.05rem; font-weight: 600; text-align: left;
  background: var(--card-2); color: var(--text);
  border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none; appearance: none;
}
.choice:active { transform: scale(.985); }
.choice.picked { border-color: var(--gold); background: #3a2410; }
.choice.right { border-color: var(--good); }
.choice.wrong { border-color: var(--bad); opacity: .7; }
.choice:disabled { cursor: default; }

.timebar { height: 10px; border-radius: 6px; background: var(--card-2); overflow: hidden; margin: 12px 0; }
.timebar > div { height: 100%; background: linear-gradient(90deg, var(--gold), #e0761b); transition: width .2s linear; }

.qmeta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.qtext { font-size: 1.3rem; font-weight: 700; margin: 10px 0; line-height: 1.35; }

.standings { width: 100%; border-collapse: collapse; }
.standings td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.standings tr.me { background: #3a2410; }
.standings td.rank { color: var(--gold); font-weight: 800; width: 2.2em; }
.standings td.score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.big-result { text-align: center; padding: 12px 0; }
.big-result .pts { font-size: 2.6rem; font-weight: 800; }
.big-result.good .pts { color: var(--good); }
.big-result.bad .pts { color: var(--bad); }

.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--bad); margin-top: 10px; min-height: 1.2em; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.media img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.media audio { width: 100%; margin: 8px 0; }
.gamecode { font-size: 2.4rem; letter-spacing: .35em; text-align: center; color: var(--gold); font-weight: 800; padding-left: .35em; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.hidden { display: none !important; }
