:root { --bg1: #2b1d3a; --bg2: #5a3b73; --accent: #ffb347; --text: #fbf3ea; --panel: #34224aee; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
body {
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(900px 500px at 50% 0%, var(--bg2), var(--bg1) 70%);
  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);
  user-select: none; -webkit-user-select: none;
}
#bar { display: flex; align-items: center; gap: 8px; padding: 4px 8px; height: 44px; flex: none; background: #00000040; }
#bar .spacer { flex: 1; }
#bar .stat { font-size: .9rem; color: #e6d7f0; white-space: nowrap; }
#bar .stat span { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
button {
  font: inherit; font-size: .85rem; color: var(--text); background: #ffffff1c; border: 1px solid #ffffff2e;
  border-radius: 10px; padding: 0 12px; height: 36px; min-width: 40px; cursor: pointer;
}
button:active { background: #ffffff38; }
button:disabled { opacity: .4; }
button.primary { background: var(--accent); color: #2a1600; border-color: var(--accent); font-weight: 700; }
button.on { background: #4aa3ff44; border-color: #4aa3ff; }
#board { flex: 1; min-height: 0; width: 100%; display: block; touch-action: none; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #140b1ecc; padding: 12px; z-index: 5; }
.overlay[hidden] { display: none; }
.card { background: var(--panel); border: 1px solid #ffffff22; border-radius: 18px; padding: 14px 20px; width: min(100%, 760px); max-height: 100%; overflow: auto; text-align: center; }
.card.small { width: min(100%, 420px); }
.card h1 { margin: 0; font-size: 1.9rem; letter-spacing: .04em; text-transform: uppercase; }
.card h1 span { color: var(--accent); }
.card h2 { margin: 0 0 6px; color: var(--accent); }
.tag { margin: 4px 0 12px; color: #d3bfe3; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.levels button { height: auto; padding: 10px 8px; text-align: center; line-height: 1.3; }
.levels b { display: block; font-size: 1rem; color: var(--accent); }
.levels small { color: #d3bfe3; display: block; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
details { text-align: left; color: #d3bfe3; font-size: .85rem; margin-top: 4px; }
summary { cursor: pointer; text-align: center; }
.noscript { padding: 20px; }
