:root {
  --k: #1a1626;
  --d: #3a2d4a;
  --c: #f4e4c1;
  --s: #e39b3c;
  --g: #4f8f46;
  --r: #c2483a;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--k);
  color: var(--c);
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 8px;
  gap: 20px;
}
h1 { margin: 0; line-height: 0; }
.logo {
  display: block;
  width: min(92vw, 616px);
  height: auto;
  image-rendering: pixelated;
}
.game { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 100%; }
#game {
  display: block;
  max-width: 100%;
  background: var(--k);
  border: 4px solid var(--d);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.stage { position: relative; max-width: 100%; }
.entry {
  position: absolute;
  inset: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(26, 22, 38, 0.88);
  text-align: center;
  font-size: 8px;
}
.entry[hidden] { display: none; }
.entry label { color: var(--c); line-height: 1.8; }
#entry-title { color: var(--s); }
.entry input {
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  width: 11ch;
  padding: 4px 6px;
  text-align: center;
  text-transform: uppercase;
  color: var(--c);
  background: var(--k);
  border: 2px solid var(--s);
  border-radius: 0;
  outline: none;
}
.entry input:focus { border-color: var(--c); }
.entry-btns { display: flex; gap: 8px; }
.entry button, .mute {
  font: inherit;
  font-size: 8px;
  color: var(--c);
  background: var(--d);
  border: 0;
  padding: 6px 8px;
  cursor: pointer;
}
.entry button:hover, .entry button:focus-visible,
.mute:hover, .mute:focus-visible { background: var(--r); outline: none; }
.board { width: min(100%, 320px); }
.board h2 { margin: 0 0 8px; font-size: 10px; color: var(--s); text-align: center; font-weight: normal; }
.board ol { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.board li {
  counter-increment: rank;
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  font-size: 8px;
}
.board li:nth-child(odd) { background: var(--d); }
.board li::before { content: counter(rank) "."; width: 3ch; text-align: right; color: var(--s); }
.board .who { flex: 1; overflow: hidden; white-space: nowrap; }
.board .pts { font-variant-numeric: tabular-nums; }
.board li.mine { background: var(--r); }
.board li.mine::before { color: var(--c); }
.board-empty { margin: 0; font-size: 8px; text-align: center; }
footer { padding: 16px; font-size: 8px; color: var(--s); }
.lost { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.lost h2 { font-size: 16px; color: var(--s); margin: 16px 0 0; line-height: 1.4; }
.lost p { margin: 0; max-width: 36ch; }
.lost a {
  color: var(--k);
  background: var(--s);
  padding: 10px 14px;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--r);
}
.lost a:hover, .lost a:focus-visible { background: var(--c); outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
