:root {
  --bg: #111418;
  --fg: #f4f4f2;
  --muted: #9aa0a6;
  --yes: #1f9d55;
  --yes-hi: #3ee07f;
  --no: #c62f2f;
  --no-hi: #ff5a5a;
  --maybe: #b8860b;
  --maybe-hi: #ffc93c;
  --tile: #262b33;
  --tile-hi: #4d8dff;
  --gap: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, "SF Pro Rounded", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: manipulation;
}
#app {
  height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 12px; min-height: 52px;
}
#title { font-size: 20px; font-weight: 600; color: var(--muted); text-align: center; flex: 1; }
.barbtn {
  font: inherit; font-size: 17px; color: var(--fg); background: #2a2f37; border: 0;
  border-radius: 12px; padding: 10px 14px; min-width: 64px;
}
.barbtn[hidden] { visibility: hidden; display: inline-block; }
#screen {
  flex: 1 1 auto; display: grid; gap: var(--gap); padding: var(--gap); min-height: 0;
}

/* Home menu: these are for Jay, so ordinary sizes are fine */
.menu { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.menu button {
  font: inherit; font-size: 24px; font-weight: 600; color: var(--fg); background: var(--tile);
  border: 0; border-radius: 22px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px;
}
.menu button .em { font-size: 52px; line-height: 1; }
.menu button.wide { grid-column: span 2; }
.menu button.small { font-size: 18px; background: #1c2027; color: var(--muted); }

/* Answer boards: these are for Davin, so everything is huge */
.choice {
  font: inherit; color: #fff; border: 0; border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform 120ms ease, filter 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  position: relative; overflow: hidden;
}
.choice .em { font-size: clamp(56px, 16vw, 120px); line-height: 1; }
.choice .lbl { font-size: clamp(26px, 7vw, 44px); font-weight: 800; letter-spacing: 0.5px; }
.choice.big .em { font-size: clamp(90px, 30vw, 200px); }
.choice.big .lbl { font-size: clamp(44px, 13vw, 84px); }
.choice.yes { background: var(--yes); }
.choice.no { background: var(--no); }
.choice.maybe { background: var(--maybe); }
.choice.tile { background: var(--tile); }
.choice.on { transform: scale(1.03); filter: brightness(1.35) saturate(1.2); z-index: 1; }
.choice.yes.on { background: var(--yes-hi); box-shadow: 0 0 0 8px #fff, 0 0 60px 20px var(--yes-hi); }
.choice.no.on { background: var(--no-hi); box-shadow: 0 0 0 8px #fff, 0 0 60px 20px var(--no-hi); }
.choice.maybe.on { background: var(--maybe-hi); color: #222; box-shadow: 0 0 0 8px #fff, 0 0 60px 20px var(--maybe-hi); }
.choice.tile.on { background: var(--tile-hi); box-shadow: 0 0 0 8px #fff, 0 0 60px 20px var(--tile-hi); }
.choice.dim { opacity: 0.28; }
.choice.pressing { filter: brightness(1.15); }
.choice .fill {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 0%;
  background: rgba(255,255,255,0.25); pointer-events: none;
}

.yn.side { grid-template-columns: 1fr 1fr; }
.yn.stack { grid-template-rows: 1fr 1fr; }
.yn.side.three { grid-template-columns: 1fr 1fr; grid-template-rows: 3fr 1fr; }
.yn.side.three .maybe { grid-column: span 2; }
.yn.stack.three { grid-template-rows: 2fr 2fr 1fr; }
.g2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.g1 { grid-template-columns: 1fr; grid-auto-rows: 1fr; }

/* Settings and history, for Jay */
.panel { display: block; overflow-y: auto; font-size: 18px; }
.panel h2 { font-size: 20px; color: var(--muted); margin: 18px 4px 8px; font-weight: 600; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--tile); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
}
.seg { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seg button {
  font: inherit; font-size: 16px; color: var(--fg); background: #1a1e24; border: 0;
  border-radius: 10px; padding: 10px 12px;
}
.seg button.sel { background: var(--tile-hi); }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #2a2f37; }
.hist .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 15px; line-height: 1.45; margin: 8px 4px 20px; }
.clear { font: inherit; font-size: 16px; color: var(--no-hi); background: none; border: 1px solid #3a2020; border-radius: 10px; padding: 10px 14px; margin: 8px 4px; }
