.g-page.wide { max-width: 1100px; }
.bigemoji { font-size: 3.4rem; }
.setup { display: grid; gap: 10px; margin-bottom: 14px; }
.opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.opt[hidden] { display: none; }
.lbl { width: 62px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
#region { flex: 1; }
#region .g-chip { font-size: 0.82rem; padding: 5px 11px; }

.layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); } }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 78vh;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(120% 100% at 50% 40%, #12275a 0%, #081230 55%, #040816 100%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  touch-action: none;
}
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.stage-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #b9c8ef; font-weight: 600; }
.stage-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 3; }
.g-btn.sm { padding: 6px 12px; font-size: 0.8rem; background: rgba(12, 20, 46, 0.72); color: #eef1fa; border-color: rgba(255, 255, 255, 0.2); }
.g-btn.sm[hidden] { display: none; }
.hintline { margin: 8px 4px 0; font-size: 0.82rem; color: var(--muted); text-align: center; }

.quizbar {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(8, 14, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eef1fa;
}
.quizbar[hidden] { display: none; }
.q-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.q-flag { font-size: 2rem; line-height: 1; }
.q-flag:empty { display: none; }
.q-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #9fb0da; }
.q-text { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.q-stats { display: grid; gap: 2px; text-align: right; font-variant-numeric: tabular-nums; }
.q-stats b:first-child { font-size: 0.8rem; color: #9fb0da; }
.q-stats b:last-child { font-size: 1.15rem; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(10px);
  max-width: 88%;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: rgba(20, 30, 60, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { background: #1c8a58; }
.toast.bad { background: #c23a3f; }

.side { display: grid; gap: 12px; align-content: start; }
.card { display: grid; gap: 12px; }
.card .empty { color: var(--muted); }
.card h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.card .head { display: flex; align-items: center; gap: 12px; }
.card .flagbig { font-size: 3rem; line-height: 1; }
.card .sub { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.stat span { display: block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; font-size: 0.95rem; overflow-wrap: anywhere; }
.stat.wide { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips button { font: 700 0.8rem var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.chips button:hover { background: var(--gold-soft); border-color: var(--gold); }
.fact { padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold); font-weight: 650; line-height: 1.5; }
.fact small { display: block; margin-bottom: 4px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); }
:root[data-theme="dark"] .fact small { color: var(--gold); }
.cardbar { display: flex; flex-wrap: wrap; gap: 8px; }

.answers { display: grid; gap: 8px; }
.answers[hidden], .typebox[hidden] { display: none; }
.ans {
  padding: 12px 14px;
  text-align: left;
  font: 700 1rem var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--line-strong);
  cursor: pointer;
}
.ans:hover:not(:disabled) { background: var(--gold-soft); }
.ans.right { background: color-mix(in srgb, var(--green) 26%, var(--surface)); border-color: var(--green); }
.ans.wrong { background: color-mix(in srgb, var(--red) 22%, var(--surface)); border-color: var(--red); }
.typebox form { display: flex; gap: 8px; }
.typebox input { flex: 1; min-width: 0; font: 700 1rem var(--font); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; }
.typebox input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.note { margin: 18px 4px 0; font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.missed { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 16px; max-height: 140px; overflow: auto; }
.missed span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 0.85rem; }
.missed b { width: 100%; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 560px) { .stage { aspect-ratio: 1 / 1.05; } .q-text { font-size: 1rem; } }

.g-btn.sm2 { padding: 7px 14px; font-size: 0.85rem; }
.sublabel { align-self: center; margin-left: 6px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.track { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.track.big { height: 16px; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; }
.track .seen { background: rgba(255, 205, 80, 0.75); }
.track .done { background: #2ed278; }
.pbar .pl { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; margin-bottom: 3px; }
.pbar { margin: 2px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.legend .dot.done { background: #2ed278; }
.legend .dot.seen { background: rgba(255, 205, 80, 0.85); }
.legend .dot.none { background: #1a2340; border: 1px solid var(--line-strong); }

.share { margin-top: 8px; font-size: 1.5rem; letter-spacing: 0.06em; }
