/* Shared look: flat print on paper. Black ink lines, solid colours, no gradients or glow. */
:root { color-scheme: light; --paper: #f4f4f0; --ink: #17171b; --blue: #2448c8; --red: #e8462f; --yellow: #ffd400; --green: #1f8a5f; --gray: #66666e; }
* { box-sizing: border-box; }
/* Phones: no double-tap zoom or grey tap flash while playing. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body, button { touch-action: manipulation; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper);
  font-family: "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
  display: flex; flex-direction: column; align-items: center; padding: 12px;
}
a { color: var(--blue); }
h1 { font-size: 24px; font-weight: 900; margin: 6px 0 14px; letter-spacing: .04em; }
.wrap { width: min(94vw, 440px); }
.lead { font-size: 14px; line-height: 1.8; text-align: center; }
.back { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; padding: 6px 10px 6px 0; }
.hud { display: flex; justify-content: space-between; font-size: 14px; }
.hud b { font-size: 20px; font-variant-numeric: tabular-nums; }
.box {
  margin-top: 12px; padding: 22px 18px; border-radius: 8px; background: #fff;
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  text-align: center; line-height: 1.8; font-size: 14px;
}
.box[hidden], [hidden] { display: none !important; }
.big { font-size: 56px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 8px 0; }
button {
  font: inherit; font-weight: 800; border: 2px solid var(--ink); border-radius: 6px; padding: 10px 28px;
  background: var(--yellow); color: var(--ink); cursor: pointer; margin: 4px; min-height: 48px; -webkit-user-select: none; user-select: none;
  box-shadow: 3px 3px 0 var(--ink);
}
button:active { transform: translate(3px, 3px); box-shadow: none; }
button.sub { background: #fff; }
.grid { display: grid; gap: 6px; aspect-ratio: 1; margin-top: 10px; }
.grid button { min-height: 0; border: 0; border-radius: 6px; padding: 0; margin: 0; touch-action: manipulation; box-shadow: none; }
.grid button:active { transform: scale(.96); }
/* Game pages: <body class="game theme-xxx">. The theme colour matches the thumbnail. */
.theme-blue { --accent: var(--blue); --on-accent: #fff; }
.theme-red { --accent: var(--red); --on-accent: #fff; }
.theme-green { --accent: var(--green); --on-accent: #fff; }
.theme-yellow { --accent: var(--yellow); --on-accent: var(--ink); }
.game .wrap, .top { width: min(100%, 440px); }
.top { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 3px solid var(--ink); }
.top .back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; font-size: 20px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 3px 3px 0 var(--ink); }
.top .back:active { transform: translate(3px, 3px); box-shadow: none; }
.top h1 { flex: 1; margin: 0; font-size: clamp(18px, 5.6vw, 23px); }
.top::after { content: ""; flex: none; width: 26px; height: 26px; background: var(--accent); border: 2px solid var(--ink); border-radius: 50%; }
.game .hud { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; font-size: 12px; font-weight: 700; }
.game .hud span { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding: 2px 10px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; white-space: nowrap; }
.game .hud b { font-size: 22px; font-weight: 900; margin-left: auto; }
.game .box { margin-top: 10px; padding: 16px; }
.game .box p { margin: 0 0 8px; }
.game .box .cover { display: block; width: calc(100% + 32px); margin: -16px -16px 14px; aspect-ratio: 2.1 / 1; object-fit: cover; border-bottom: 2px solid var(--ink); border-radius: 6px 6px 0 0; }
.game .box button { display: block; width: calc(100% - 6px); margin: 6px 6px 10px 0; min-height: 56px; font-size: 18px; }
.game .box button.sub { min-height: 48px; font-size: 15px; }
.game .box .best { margin: 4px 0 0; font-size: 12px; color: var(--gray); }
.game .box .best b { font-size: 18px; color: var(--ink); margin-left: 4px; }
.game[data-phase="over"] .box .cover { display: none; }
.game[data-phase="over"] .box .big { margin: 0 0 12px; padding: 10px; line-height: 1.3; color: var(--on-accent); background: var(--accent); border: 2px solid var(--ink); border-radius: 6px; }
.game .grid { padding: 8px; background: #fff; border: 2px solid var(--ink); border-radius: 8px; box-shadow: 5px 5px 0 var(--ink); }
.game .grid button { border: 2px solid var(--ink); }
.policy { line-height: 1.9; font-size: 14px; }
.policy h2 { font-size: 16px; margin-top: 24px; }
footer { margin-top: 24px; font-size: 12px; color: var(--gray); text-align: center; line-height: 1.8; }
footer a { color: var(--gray); }
