:root {
  --night: #1b1416;
  --cream: #fbf1d9;
  --paper: #fffbe9;
  --cherry: #d62839;
  --cherry-deep: #8e1424;
  --teal: #37c0bd;
  --teal-deep: #0f5960;
  --mustard: #f2b33d;
  --pink: #ff5fa2;
  --chrome: #c9d1d5;
  --chalk: #f3f1ea;
  --board: #24302b;
  --ink: #2a2220;
  --leaf: #3f8a3a;
  --sign: 'Bungee', 'Arial Black', sans-serif;
  --script: 'Pacifico', cursive;
  --body: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

html { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  /* Exactly the visible screen. On iPhone, 100% / 100vh can run taller than
     what's showing while Safari's toolbar is up, which hid the controls under it. */
  height: 100vh;
  height: 100dvh;
  background: var(--night);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--cream);
  color: #111;
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  border: 1px solid #8d7f72;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: 700 14px var(--body);
  text-align: center;
}

/* ---------- the bar ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 14px;
  background: linear-gradient(#2a1d21, var(--night));
  border-bottom: 3px solid var(--chrome);
}
.logo {
  margin: 0;
  font: 400 30px/1.1 var(--script);
  color: #ffe3f0;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink);
  white-space: nowrap;
}
.hud { display: flex; align-items: center; gap: 16px; }
.height {
  margin: 0;
  padding: 2px 12px;
  border: 2px solid var(--chrome);
  border-radius: 8px;
  background: #0b0708;
  font: 400 26px/1.15 var(--sign);
  color: var(--mustard);
  font-variant-numeric: tabular-nums;
}
.height small { font-size: 13px; color: var(--teal); }
.strikes { margin: 0; }
.marks { display: flex; gap: 6px; }
.marks span {
  width: 22px;
  height: 22px;
  border: 2px solid #6b5a52;
  border-radius: 50%;
}
.marks span.hit {
  border-color: var(--cherry);
  background:
    linear-gradient(45deg, transparent 42%, var(--cherry) 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--cherry) 42% 58%, transparent 58%);
}
.next {
  margin: 0;
  padding: 4px 10px 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.next-label { font: 400 11px var(--sign); color: var(--cherry); }
.corner { display: flex; gap: 6px; margin-left: auto; }
.corner button, .quit {
  padding: 6px 12px;
  border: 2px solid var(--chrome);
  border-radius: 999px;
  background: rgba(22, 15, 18, 0.85);
  color: var(--cream);
  font: 700 15px var(--body);
  text-decoration: none;
  cursor: pointer;
}
.corner button[aria-pressed='false'] { opacity: 0.6; text-decoration: line-through; }
.quit { border-color: var(--cherry); }

/* ---------- the kitchen ---------- */

.kitchen {
  position: relative;
  flex: 1;
  min-height: 0;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#stage { position: absolute; inset: 0; display: block; }

/* The controls sit below the kitchen, on the front of the counter, so they
   never cover the plate */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(var(--cherry), var(--cherry-deep));
  border-top: 4px solid var(--chrome);
}
.controls[hidden] { display: none; }
.controls .arrow {
  min-width: 64px;
  padding: 10px 0;
  font-size: 22px;
  line-height: 1;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.controls .arrow[hidden], #btn-drop[hidden] { display: none; }

.big {
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  color: var(--cherry-deep);
  font: 400 17px var(--sign);
  box-shadow: 0 4px 0 #5c0d17;
  cursor: pointer;
}
.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #5c0d17; }
.big.ghost { background: var(--teal-deep); color: var(--cream); box-shadow: 0 4px 0 #062a2e; }
.big:disabled { opacity: 0.45; cursor: default; }
#btn-drop { min-width: 140px; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(27, 20, 22, 0.45);
}
.overlay[hidden] { display: none; }
.card {
  width: min(460px, 100%);
  margin: auto;
  padding: 18px 20px 16px;
  border: 3px solid var(--chrome);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.card.small { width: min(360px, 100%); }
.card-script {
  margin: 0;
  font: 400 40px/1.25 var(--script);
  color: var(--cherry);
}
.card-sub { margin: 2px 0 12px; font-size: 18px; }
.card-title { margin: 0 0 6px; font: 400 24px var(--sign); color: var(--cherry); }
.card-hint { margin: 10px 0 0; font-size: 15px; line-height: 1.7; }

.choose {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  text-align: left;
}
.choose legend { margin-bottom: 4px; font: 400 13px var(--sign); color: var(--teal-deep); }
.choose label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 4px;
  border: 2px solid #e1d6bd;
  border-radius: 10px;
  cursor: pointer;
}
.choose label:has(input:checked) { border-color: var(--cherry); background: #fff3ef; }
.choose input { margin-top: 4px; accent-color: var(--cherry); }
.choose b { display: inline-block; min-width: 4.2em; font-size: 18px; }
.leaf {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border-radius: 0 12px 0 12px;
  background: var(--leaf);
  vertical-align: -1px;
}

.board {
  margin-top: 14px;
  padding: 10px 14px 12px;
  border: 8px solid #6b4a2f;
  border-radius: 6px;
  background: var(--board);
  color: var(--chalk);
  text-align: left;
}
.board h2 { margin: 0 0 6px; font: 400 26px/1.1 'Reenie Beanie', cursive; text-align: center; }
.board-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.board-tabs button {
  flex: 1;
  padding: 3px 6px;
  border: 1px solid rgba(243, 241, 234, 0.4);
  border-radius: 6px;
  background: transparent;
  color: var(--chalk);
  font: 600 15px var(--body);
  cursor: pointer;
}
.board-tabs button[aria-selected='true'] { background: rgba(243, 241, 234, 0.15); border-color: var(--chalk); }
.board-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; font-size: 18px; }
.board-list li {
  display: flex;
  gap: 8px;
  padding: 2px;
  border-bottom: 1px dashed rgba(243, 241, 234, 0.2);
  counter-increment: rank;
}
.board-list li::before { content: counter(rank) '.'; width: 1.6em; opacity: 0.6; }
.board-list .who { flex: 1; font-family: var(--sign); letter-spacing: 0.12em; }
.board-list .leaf { background: #8fd18a; }
.board-list li.you { color: var(--mustard); }
.board-list li.empty { justify-content: center; opacity: 0.75; }
.board-list li.empty::before { content: none; }

.fine-print { margin: 12px 0 0; font-size: 14px; color: #6b5d55; }
.fine-print a { color: var(--cherry-deep); }

.over-line { margin: 0 0 4px; font-size: 18px; }
.final { margin: 0 0 12px; font: 400 32px var(--sign); color: var(--cherry-deep); }
.over-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#initials-form label { display: block; margin-bottom: 6px; }
.initials-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
#initials {
  width: 4.2em;
  padding: 6px 8px;
  border: 3px solid var(--chrome);
  border-radius: 8px;
  background: var(--board);
  color: var(--chalk);
  font: 400 22px var(--sign);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.form-msg { min-height: 1.3em; margin: 0 0 8px; font-size: 15px; }

.noscript { padding: 40px; text-align: center; }

/* The share card */
.share-card .bar { display: none; }

@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 6px 12px; padding: 6px 10px; }
  .logo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .height { font-size: 21px; }
  .marks span { width: 18px; height: 18px; }
  .next { font-size: 15px; }
  .corner button, .quit { padding: 4px 10px; font-size: 14px; }
  .card-script { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .big:active { transform: none; }
}
