@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700;900&family=Space+Grotesk:wght@400;500;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ink: #0f0f14;
  --pit: #08080b;
  --slate: #191922;
  --slate-2: #22222e;
  --edge: rgba(246, 243, 234, 0.11);
  --bone: #f6f3ea;
  --bone-dim: rgba(246, 243, 234, 0.55);
  --bone-faint: rgba(246, 243, 234, 0.3);
  --shock: #ff2d7e;
  --lilac: #c9b6ff;
  --sulfur: #ffd84d;

  --display: 'Big Shoulders Display', 'Haettenschweiler', 'Arial Narrow', sans-serif;
  --body: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --r: 14px;
  /* 5:7 is roughly a real card. Height drives it; width is derived. */
  --card-h: clamp(190px, 34vh, 330px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255, 45, 126, 0.16), transparent 60%),
    radial-gradient(90% 60% at 110% 110%, rgba(201, 182, 255, 0.1), transparent 60%);
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; }

/* ---------- type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.headline {
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
}

.code {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.22em;
}

/* ---------- shell ---------- */

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px env(safe-area-inset-bottom);
}

.strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 2px 12px;
  border-bottom: 1px solid var(--edge);
}

.strip .tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--bone-dim);
}

.strip .spacer { flex: 1; }

.score-chip {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.score-chip small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--bone-faint);
}

/* ---------- prompt (the dark card) ---------- */

.prompt {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto; /* never let the stage squeeze it and clip the text */
  background: var(--pit);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: 26px 22px 24px;
  min-height: 200px;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

.prompt::after {
  content: 'BLANKS';
  position: absolute;
  right: 22px;
  bottom: 24px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--bone-faint);
}

.prompt-text {
  font-family: var(--body);
  font-weight: 700;
  flex: 0 1 auto;
  min-height: 0;
  font-size: clamp(19px, 5.4vw, 25px);
  line-height: 1.3;
  letter-spacing: -0.012em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-y: auto;
  max-height: 42vh;
  margin: 0;
}

/* the signature move: answers drop into the blank */
.blank {
  display: inline;
  border-bottom: 2px solid var(--bone-faint);
  padding: 0 22px;
}

.fill {
  color: var(--shock);
  /* text-decoration follows the words across line breaks; a border-bottom would
     run to the end of each line and drop off the last one */
  text-decoration: underline;
  text-decoration-color: var(--shock);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: none;
}

.prompt .pick-note {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--shock);
}
.pip.on { background: var(--shock); }

/* ---------- white cards ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: var(--bone);
  color: #14141a;
  border-radius: 11px;
  padding: 15px 14px 30px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.24;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

/* the wordmark in the corner is what reads as "card" more than the shape does */
.card::after {
  content: 'BLANKS';
  position: absolute;
  left: 14px;
  bottom: 11px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(20, 20, 26, 0.26);
}

.card.picked {
  box-shadow: 0 0 0 3px var(--shock), 0 12px 24px -14px rgba(255, 45, 126, 0.8);
  transform: translateY(-6px);
}

.card .order {
  position: absolute;
  top: -9px;
  right: -7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--shock);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  display: grid;
  place-items: center;
}

/* hand: a real fan you swipe through */
.hand {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 14px 0 18px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}
.hand::-webkit-scrollbar { display: none; }

/* scrollable when a card runs long, but never showing a desktop scrollbar */
.prompt-text, .card { scrollbar-width: none; }
.prompt-text::-webkit-scrollbar, .card::-webkit-scrollbar { display: none; }

.hand .card {
  flex: 0 0 auto;
  height: var(--card-h);
  width: calc(var(--card-h) * 5 / 7);
  overflow-y: auto;
  scroll-snap-align: center;
}

/* ---------- buttons ---------- */

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 11px;
  background: var(--shock);
  color: #fff;
  font-family: var(--display);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}
.btn:disabled { background: var(--slate-2); color: var(--bone-faint); cursor: default; }
.btn.ghost { background: none; border: 1px solid var(--edge); color: var(--bone-dim); }
.btn.small { padding: 11px; font-size: 15px; }

.sticky {
  position: sticky;
  bottom: 0;
  padding: 10px 0 16px;
  background: linear-gradient(to top, var(--ink) 55%, transparent);
}

/* ---------- roster ---------- */

.roster { display: flex; flex-direction: column; gap: 7px; }

.seat {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--slate);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 11px 13px;
}
.seat .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.seat .who { font-weight: 500; font-size: 15px; }
.seat .pts { margin-left: auto; font-family: var(--display); font-weight: 900; font-size: 19px; }
.seat.away { opacity: 0.42; }
.seat.won { border-color: var(--sulfur); }
.seat .role {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--lilac);
  border: 1px solid rgba(201, 182, 255, 0.4);
  border-radius: 20px;
  padding: 2px 7px;
}
.seat .tick { color: var(--shock); font-size: 13px; }

/* ---------- misc ---------- */

.field {
  width: 100%;
  background: var(--slate);
  border: 1px solid var(--edge);
  border-radius: 11px;
  padding: 15px;
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
}
.field::placeholder { color: var(--bone-faint); }
.field.code-field {
  font-family: var(--mono);
  font-size: 30px;
  text-align: center;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.note {
  font-size: 13px;
  line-height: 1.45;
  color: var(--bone-dim);
}

.warn {
  border-left: 2px solid var(--sulfur);
  padding-left: 11px;
  font-size: 13px;
  color: var(--bone-dim);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 20;
  background: var(--bone);
  color: #14141a;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 88vw;
}
.toast.up { opacity: 1; transform: translateX(-50%) translateY(0); }

.stack { display: flex; flex-direction: column; gap: 12px; }
/* on tall screens, keep the prompt near the hand instead of stranding it at the top */
.stage { justify-content: center; }
.grow { flex: 1; }
.center { display: grid; place-items: center; text-align: center; }

.enter { animation: rise 0.26s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* Desktop: a wheel has no horizontal axis, so the hand needs real affordances. */
.handnav { display: none; gap: 8px; justify-content: flex-end; padding: 0 0 2px; }
.handnav button {
  width: 40px; height: 40px; border: 1px solid var(--edge); border-radius: 50%;
  color: var(--bone-dim); font-size: 17px; display: grid; place-items: center;
}
.handnav button:hover:not(:disabled) { border-color: var(--shock); color: var(--shock); }
.handnav button:disabled { opacity: 0.3; cursor: default; }

@media (hover: hover) and (pointer: fine) {
  .handnav { display: flex; }
  .onlytouch { display: none; } /* "swipe" is wrong advice with a mouse */
  .hand {
    scrollbar-width: thin;
    scrollbar-color: rgba(246, 243, 234, 0.25) transparent;
    padding-bottom: 12px;
  }
  .hand::-webkit-scrollbar { display: block; height: 9px; }
  .hand::-webkit-scrollbar-track { background: transparent; }
  .hand::-webkit-scrollbar-thumb { background: rgba(246, 243, 234, 0.22); border-radius: 9px; }
  .hand::-webkit-scrollbar-thumb:hover { background: rgba(246, 243, 234, 0.4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
