/* FUZZY DUCK - a chalkboard behind the bar, made for a phone held upright. */
@font-face {
  font-family: 'Pixelify Sans';
  src: url('pixelify-sans.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
:root {
  --board: #18231e;
  --board-2: #22322b;
  --chalk: #f2efe4;
  --chalk-dim: #a9b5ab;
  --fuzzy: #ffd23a;
  --ducky: #ff8a3a;
  --does: #5ac8e8;
  --bad: #e8343c;
  --wood: #6a4428;
  --ink: #1a1208;
  --logo: 'Pixelify Sans', 'Trebuchet MS', sans-serif;
  --ui: 'Pixelify Sans', 'Trebuchet MS', sans-serif;
  --num: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The pixel lettering: one glyph row is a seventh of the font size. */
.bm { height: 0.62em; width: auto; vertical-align: middle; overflow: visible; shape-rendering: crispEdges; }

html, body { height: 100%; }
body {
  margin: 0;
  color: var(--chalk);
  font-family: var(--ui);
  font-size: 18px;
  line-height: 1.35;
  background:
    radial-gradient(ellipse at 30% 10%, #2a3b33 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, #213028 0%, transparent 55%),
    var(--board);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--fuzzy); outline-offset: 2px; }

#sound {
  position: fixed; z-index: 5;
  top: max(8px, env(safe-area-inset-top), calc(var(--corner-b, 0px) + 6px)); right: max(8px, env(safe-area-inset-right));   /* below the site's corner buttons (--corner-b) */
  font-family: var(--logo); font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
  padding: 8px 10px; border-radius: 6px;
  background: #0006; border: 2px solid #ffffff30; color: var(--chalk-dim);
}

#app {
  max-width: 520px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
  display: flex; flex-direction: column;
}
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.screen.center { align-items: center; justify-content: center; text-align: center; }

/* ----------------------------------------------------------- the duck */
.duck { width: 112px; height: 96px; margin: 0 auto; }
.duck svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.flop { transform: rotate(180deg); width: 88px; height: 76px; }
@media (prefers-reduced-motion: no-preference) {
  .bob { animation: bob 1.6s ease-in-out infinite; }
  @keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
}

/* -------------------------------------------------------------- setup */
.hero { text-align: center; padding-top: 18px; }
.logo {
  font-family: var(--logo); font-weight: 700;
  font-size: clamp(56px, 18vw, 84px); line-height: 0.95; margin: 10px 0 6px;
  color: var(--fuzzy);
}
.logo .bm { height: 0.9em; margin: 0.06em 0; filter: drop-shadow(4px 4px 0 var(--ducky)) drop-shadow(4px 4px 0 #0008); }
.tagline { margin: 0; color: var(--chalk-dim); font-size: 17px; }
.field h2, .howto summary {
  font-family: var(--logo); font-weight: 700; font-size: 17px; letter-spacing: 0.5px;
  margin: 0 0 10px; color: var(--chalk);
}
.field h2 small { color: var(--chalk-dim); font-size: 13px; font-weight: 400; }
.hint { margin: -2px 0 10px; color: var(--chalk-dim); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 52px; height: 48px; padding: 0 12px; border-radius: 10px;
  font-family: var(--num); font-weight: 800; font-size: 20px;
  background: var(--board-2); border: 2px solid #ffffff28; color: var(--chalk);
}
.chip[aria-checked="true"] { background: var(--fuzzy); color: var(--ink); border-color: var(--fuzzy); }

.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.knob {
  flex: none; width: 60px; height: 34px; border-radius: 17px; position: relative;
  background: var(--board-2); border: 2px solid #ffffff28; transition: background .15s;
}
.knob::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--chalk-dim); transition: transform .15s, background .15s;
}
.switch input:checked + .knob { background: var(--ducky); border-color: var(--ducky); }
.switch input:checked + .knob::after { transform: translateX(26px); background: #fff; }
.switch input:focus-visible + .knob { outline: 2px solid var(--fuzzy); outline-offset: 2px; }
.switch__text b { font-family: var(--logo); font-weight: 700; font-size: 17px; }
.switch__text small { color: var(--chalk-dim); font-size: 15px; }

.players { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.players li {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 20px;
  background: var(--board-2); border: 2px solid #ffffff20; font-size: 17px;
}
.players li span.n { color: var(--chalk-dim); font-size: 13px; }
.players li button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #ffffff18; font-size: 16px; line-height: 1; }
.addrow { display: flex; gap: 8px; }
.addrow input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 10px;
  font: inherit; font-size: 18px; color: var(--chalk);
  background: #0003; border: 2px solid #ffffff28;
  -webkit-user-select: text; user-select: text;
}
.addrow input::placeholder { color: #ffffff55; }
button.small {
  height: 48px; padding: 0 16px; border-radius: 10px; border: 0;
  font-family: var(--logo); font-weight: 700; font-size: 17px; background: var(--does); color: var(--ink);
}

.howto { background: #0002; border: 2px dashed #ffffff26; border-radius: 12px; padding: 12px 14px; }
.howto summary { margin: 0; cursor: pointer; list-style: none; }
.howto summary::before { content: '\25B8  '; }
.howto[open] summary::before { content: '\25BE  '; }
.howto ol { margin: 10px 0 0; padding-left: 22px; font-size: 16px; }
.howto li { margin-bottom: 6px; }
.w-fuzzy { color: var(--fuzzy); } .w-ducky { color: var(--ducky); } .w-does { color: var(--does); }
b.w-fuzzy, b.w-ducky, b.w-does { white-space: nowrap; }

.big {
  width: 100%; min-height: 64px; border-radius: 14px; border: 0;
  font-family: var(--logo); font-weight: 700; font-size: 26px; letter-spacing: 0.5px;
  box-shadow: 0 6px 0 #0008;
}
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #0008; }
.go { background: var(--fuzzy); color: var(--ink); margin-top: 6px; }
.tiny { text-align: center; color: var(--chalk-dim); font-size: 14px; margin: 0; }
.link { background: none; border: 0; color: var(--chalk-dim); font-size: 17px; padding: 12px; text-decoration: underline; }

/* ------------------------------------------------- the word buttons */
.word {
  position: relative; width: 100%; border: 0; border-radius: 18px;
  font-family: var(--logo); font-weight: 700; font-size: clamp(30px, 10vw, 42px); letter-spacing: 0.5px;
  color: var(--ink); box-shadow: 0 7px 0 #0009, inset 0 -6px 0 #0002, inset 0 3px 0 #fff6;
}
.word:active, .word.hit { transform: translateY(5px); box-shadow: 0 2px 0 #0009, inset 0 -3px 0 #0002; }
.word.w-fuzzy { background: var(--fuzzy); }
.word.w-ducky { background: var(--ducky); }
.word.w-does { background: var(--does); }
.word kbd {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--num); font-weight: 700; font-size: 14px; padding: 2px 7px; border-radius: 4px;
  background: #0002; color: #0008; display: none;
}
@media (hover: hover) and (pointer: fine) { .word kbd { display: block; } }
.huge { min-height: 40vh; font-size: clamp(40px, 13vw, 60px); }

/* ---------------------------------------------------------------- first */
.who { font-family: var(--logo); font-weight: 700; font-size: 20px; letter-spacing: 0.5px; color: var(--does); margin: 0; }
.say { margin: 0; color: var(--chalk-dim); font-size: 18px; }
#first .huge { margin: 18px 0 4px; }
.count { margin: 0; color: var(--chalk-dim); font-size: 15px; }

/* ---------------------------------------------------------------- turn */
.passit { margin: 0 0 6px; font-family: var(--logo); font-weight: 700; font-size: 20px; color: var(--fuzzy); letter-spacing: 0.5px; }
#turn { gap: 10px; }
.turntop { text-align: center; padding-top: 18px; }
.said-lbl { margin: 8px 0 2px; font-family: var(--logo); font-weight: 700; font-size: 15px; color: var(--chalk-dim); letter-spacing: 1px; }
.said { margin: 0; font-family: var(--logo); font-weight: 700; font-size: clamp(40px, 13vw, 58px); line-height: 1.1; }
.timer { height: 14px; border-radius: 7px; background: #0005; overflow: hidden; border: 2px solid #ffffff20; }
.timer__bar { height: 100%; width: 100%; background: var(--chalk); transform-origin: left; }
.timer__bar.low { background: var(--bad); }
.secs { margin: 0; text-align: center; font-family: var(--num); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--chalk-dim); }
.choices { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.choices .word { flex: 1; min-height: 76px; }

/* ----------------------------------------------------------------- out */
#out { background: radial-gradient(circle at 50% 35%, #e8343c55, transparent 65%); border-radius: 20px; }
/* the losing words */
.outbig .bm, .drink .bm { filter: drop-shadow(4px 4px 0 #0009); }
.drink .bm { filter: drop-shadow(3px 3px 0 var(--ducky)); }
.outbig {
  font-family: var(--logo); font-weight: 700; font-size: clamp(48px, 16vw, 72px); line-height: 1; margin: 6px 0;
  color: var(--bad); text-shadow: 4px 4px 0 #0009;
}
#out .who { font-size: 18px; color: var(--chalk); }
.why { margin: 0; font-family: var(--num); font-weight: 600; font-size: 18px; max-width: 26em; }
.drink {
  margin: 4px 0; font-family: var(--logo); font-weight: 700; font-size: 40px; color: var(--fuzzy);
  text-shadow: 3px 3px 0 var(--ducky);
}
.tally { font-family: var(--num); list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 16px; color: var(--chalk-dim); }
.tally b { color: var(--chalk); }
#out .big { max-width: 360px; }

/* A short landscape screen (a phone on its side, or the site's 4:3 frame):
   the choices sit side by side. */
@media (orientation: landscape) and (max-height: 620px) {
  .choices { flex-direction: row; }
  .choices .word { font-size: clamp(22px, 4.4vw, 36px); padding: 0 8px; }
  .choices .word kbd { top: 12px; transform: none; }
  .said { font-size: clamp(30px, 8vh, 48px); }
  .turntop { padding-top: 0; }
  #turn { gap: 6px; }
  .turntop { padding-top: 4px; }
  .huge { min-height: 30vh; }
  #app { max-width: 760px; }
  .hero { padding-top: 0; }
  .duck { width: 80px; height: 68px; }
}

/* The card art leaves out the controls round the edge. */
.shot #sound, .shot .word kbd { display: none !important; }
