:root {
  --bg: #11131a;
  --surface: #1a1d28;
  --surface-2: #222634;
  --text: #e8eaf0;
  --muted: #8b92a6;
  --accent: #ffcf4d;     /* hard-word color */
  --label: #6fb0ff;      /* Answer:/Note: label color */
  --correct: #35c66b;
  --line: #2c3142;
  --maxw: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: 88px; /* room for fixed navbar */
  -webkit-text-size-adjust: 100%;
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: .3px; }
.topbar-mid { flex: 1; min-width: 0; }
.g-venue { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pos { color: var(--muted); font-size: 13px; }
.back {
  text-decoration: none; color: var(--text); font-size: 28px; line-height: 1;
  width: 32px; text-align: center; flex: none;
}
.toggle {
  flex: none; display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer; user-select: none;
}
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }

/* Game list */
.list { max-width: var(--maxw); margin: 0 auto; padding: 16px; display: grid; gap: 12px; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; transition: background .12s, transform .12s;
}
.card:active { transform: scale(.99); }
.card:hover { background: var(--surface-2); }
.card-date { font-size: 18px; font-weight: 700; }
.card-venue { margin-top: 2px; }
.card-meta { margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Viewer */
.viewer { max-width: var(--maxw); margin: 0 auto; padding: 18px 16px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 20px; }
.special {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #111; background: var(--accent);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 10px;
}
.cat { font-size: 15px; color: var(--text); margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.qtext { font-size: 22px; line-height: 1.35; margin: 0 0 16px; font-weight: 600; }

.answers { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.answers li {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px;
}
.answers li.correct { border-left: 3px solid var(--correct); }
.answer, .note, .music { margin: 10px 0 0; }
.answer { font-size: 18px; }
.note, .music { color: var(--text); }
.music { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.lbl { font-weight: 700; color: var(--label); margin-right: 4px; }
.music .lbl { color: var(--muted); }

/* Hard words */
.hard { color: var(--accent); text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); font-weight: 600; }
.hard:active { opacity: .7; }
.ph { display: none; color: var(--muted); font-size: .85em; font-weight: 500; }
body.show-phonics .ph { display: inline; }

/* Per-question pronunciation block */
.pron {
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 14px; margin: 0 0 16px;
}
.pron-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.pron ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pron li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw { font-weight: 700; color: var(--accent); }
.pp { color: var(--text); }
.say { background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 4px; line-height: 1; }
.say:disabled { opacity: .3; cursor: default; }

/* Bottom nav */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 10px; max-width: var(--maxw); margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-top: 1px solid var(--line);
}
.navbtn {
  flex: 1; font-size: 17px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; cursor: pointer;
}
.navbtn:active { transform: scale(.98); }
.navbtn:disabled { opacity: .4; cursor: default; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
