@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800;900&family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --stage: #231841;
  --panel: #30244e;
  --ink: #211638;
  --paper: #fcf3ff;
  --lavender: #cfbddf;
  --line: #514268;
  --mint: #b8f3b7;
  --orange: #ff9a75;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font: 16px/1.45 'DM Sans', system-ui, sans-serif;
  color: var(--paper);
  background: var(--stage);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
h1, h2, p { margin: 0; }
h1, h2, .brand, .code, .tiles, .letter, .stamp, .stop { font-family: var(--display); }
h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); line-height: .92; }
h2 { font-size: 1.9rem; line-height: 1; }
input, button { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

.frame { width: min(100% - 3rem, 67rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { font-size: 2.25rem; font-weight: 900; font-style: italic; line-height: 1; }
.brand span { color: var(--orange); }
.quiet { color: var(--lavender); border: 0; background: none; padding: .65rem 0 .65rem .75rem; }
.quiet:hover { color: var(--paper); }

#screen { padding-block: clamp(2.2rem, 8vh, 5rem); }
.entrance { min-height: min(33rem, 73vh); display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: clamp(2.75rem, 8vw, 7rem); }
.pitch h1 { font-size: clamp(3.75rem, 8.6vw, 7.25rem); letter-spacing: -.035em; }
.pitch p { margin-top: 1.4rem; max-width: 27ch; color: var(--lavender); font-size: clamp(1rem, 2vw, 1.25rem); }
.tiles { display: flex; align-items: center; margin-bottom: 1.8rem; padding-left: .25rem; }
.tiles b, .letter {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: .2em;
  color: var(--ink); background: var(--mint); font-weight: 900; line-height: 1;
}
.tiles b {
  width: clamp(3rem, 7vw, 5.8rem); font-size: clamp(2.15rem, 5.3vw, 4.8rem);
  box-shadow: 0 .075em #729e77, 0 .1em .15em #170d2d80; transform: rotate(-11deg);
}
.tiles b:nth-child(2) { background: #edceff; box-shadow: 0 .075em #b48ccf, 0 .1em .15em #170d2d80; transform: rotate(7deg); }
.tiles b:nth-child(3) { background: #ffe28e; box-shadow: 0 .075em #b39348, 0 .1em .15em #170d2d80; transform: rotate(-5deg); }
.tiles b:nth-child(4) { background: var(--orange); box-shadow: 0 .075em #b66352, 0 .1em .15em #170d2d80; transform: rotate(12deg); }

.ticket { color-scheme: light; background: var(--paper); color: var(--ink); padding: clamp(1.25rem, 4vw, 2.6rem); border-radius: 1.1rem; position: relative; }
.ticket h2 { margin-bottom: 1.7rem; }
.ticket label { display: block; margin-bottom: .4rem; font-size: .9rem; font-weight: 800; }
input { border: 1px solid; min-width: 0; width: 100%; border-radius: .55rem; padding: .7rem .8rem; }
.ticket input { color: var(--ink); background: #fffaff; border-color: #aa93c1; }
.ticket input::placeholder { color: #715e84; }
.ticket > .button { width: 100%; margin-top: .7rem; }
.ticket-cut { margin-block: 1.7rem; border-top: 2px dashed #c8b4d6; position: relative; }
.ticket-cut::before, .ticket-cut::after { content: ''; position: absolute; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--stage); top: -.69rem; }
.ticket-cut::before { left: calc(-1 * clamp(1.25rem, 4vw, 2.6rem) - .625rem); }
.ticket-cut::after { right: calc(-1 * clamp(1.25rem, 4vw, 2.6rem) - .625rem); }
.join { display: flex; gap: .6rem; }
.join input { text-transform: uppercase; letter-spacing: .06em; }
.form-note { color: #7a2439; margin-top: .75rem; font-size: .9rem; }
.form-note:empty { display: none; }

.button { min-height: 46px; padding: .55rem 1.15rem; border-radius: .55rem; font-weight: 800; border: 1px solid transparent; }
.primary { background: var(--mint); color: var(--ink); box-shadow: 0 3px #6a9c6a; }
.ticket .primary { color: var(--paper); background: var(--ink); box-shadow: 0 3px #866d9e; }
.ticket .practice-link { display: block; margin: .8rem auto 0; padding: .5rem; color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.secondary { background: transparent; color: inherit; border-color: currentColor; }
.button:not(:disabled):hover { filter: brightness(1.12); }
.ticket .secondary:not(:disabled):hover { background: #eeddf5; }
.button:not(:disabled):active { transform: translateY(2px); }
.button:disabled { opacity: .55; box-shadow: none; }

.panel { border-radius: 1.1rem; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.waiting, .reveal { text-align: center; padding: clamp(1.8rem, 7vw, 4rem) 1rem; }
.lobby { display: grid; grid-template-columns: 1fr 1fr; }
.room, .people { padding: clamp(1.25rem, 5vw, 3rem); }
.room { border-right: 1px dashed #705f83; }
.code { font-size: clamp(2.2rem, 7vw, 4.5rem); letter-spacing: .07em; font-weight: 900; color: var(--mint); line-height: 1.1; margin-block: .6rem 1.4rem; }
.people ul { display: grid; gap: .55rem; margin-block: 1.1rem 1.4rem; padding: 0; list-style: none; }
.people li { display: flex; align-items: center; gap: .65rem; overflow-wrap: anywhere; }
.people small { margin-left: auto; color: var(--lavender); font-size: .85rem; }
.avatar { display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border-radius: .4rem; background: #4b3b66; color: var(--mint); font-weight: 800; overflow: hidden; }
.hint { color: var(--lavender); }
.local-hint { margin-top: .9rem; max-width: 32ch; }
.people button + .hint { margin-top: .7rem; }

.letter { width: 1.28em; font-size: clamp(3.5rem, 9vw, 6.5rem); box-shadow: 0 .07em #73a379; }
.reveal > p:first-child { color: var(--lavender); margin-bottom: .6rem; }
.reveal-tile { margin: 1.5rem auto; width: 1.43em; font-size: clamp(5.5rem, 19vw, 11rem); overflow: hidden; display: block; }
.roll { display: block; animation: roll 1.35s cubic-bezier(.18,.7,.33,1) both; }
.roll b { display: grid; place-items: center; height: 1.43em; }
@keyframes roll { to { transform: translateY(-80%); } }
.special-preview { color: var(--mint); font-weight: 700; overflow-wrap: anywhere; }

.round-header { display: flex; align-items: center; gap: 1.3rem; margin-bottom: 1.75rem; }
.round-header p { margin-top: .35rem; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.field { display: flex; flex-direction: column; gap: .35rem; padding: .8rem; border-radius: .65rem; background: var(--panel); border: 1px solid var(--line); }
.field span { font-weight: 700; overflow-wrap: anywhere; }
.field input { margin-top: auto; color: var(--paper); border-color: #6d5a83; background: #251a3f; }
.field input::placeholder { color: #c4aecf; }
.field.featured { background: #394642; border-color: #718c78; }
.featured small { color: var(--mint); font-size: .85rem; font-weight: 800; }
.featured input { background: #243534; border-color: #718c78; }
.round-controls { position: sticky; z-index: 1; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem -.5rem -.5rem; padding: .75rem .5rem max(.75rem, env(safe-area-inset-bottom)); background: var(--stage); border-top: 1px solid var(--line); }
.progress { color: var(--lavender); font-variant-numeric: tabular-nums; font-weight: 700; }
.stop { font-size: 2rem; letter-spacing: .025em; line-height: 1; background: var(--orange); color: var(--ink); box-shadow: 0 3px #b66352; min-width: min(12rem, 55%); }

.results-header { margin-bottom: 1.3rem; }
.results-header > p:last-child { color: var(--lavender); margin-top: .55rem; }
.stamp { display: inline-block; margin: .1em .05em .6em; border: .07em solid currentColor; border-radius: .12em; padding: 0 .18em .08em; color: var(--orange); font-size: clamp(2.5rem, 9vw, 5.7rem); font-weight: 900; line-height: .92; transform: rotate(-7deg); }
.stamp-enter { animation: stamp .45s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-20deg); } }
.review-progress { margin-bottom: .65rem; }
.review-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: .65rem; overflow: hidden; background: var(--panel); }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.7rem, .3fr) minmax(7rem, .35fr); align-items: center; gap: .65rem 1rem; padding: .85rem 1rem; }
.review-row + .review-row { border-top: 1px solid var(--line); }
.review-answer, .standing { overflow-wrap: anywhere; }
.review-answer strong { font-size: 1.14rem; }
.review-score { display: grid; }
.review-score strong, .standing > strong:last-child { color: var(--mint); }
.review-score .hint { font-size: .875rem; }
.vote { justify-self: start; padding-inline: .65rem; }
.vote[aria-pressed="true"] { color: var(--ink); border-color: var(--orange); background: var(--orange); }
.vote-count { font-size: .875rem; white-space: nowrap; }
.results-footer { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1.3rem; }

.notice { position: fixed; z-index: 2; bottom: 1rem; right: 1rem; max-width: calc(100% - 2rem); color: var(--ink); background: var(--mint); border-radius: .6rem; padding: .8rem 1rem; box-shadow: 0 .3rem 1rem #140b28aa; }
.notice:empty { display: none; }

@media (max-width: 730px) {
  .frame { width: calc(100% - 2rem); }
  .entrance { max-width: 30rem; margin-inline: auto; grid-template-columns: 1fr; gap: 2rem; }
  #screen { padding-block: 2rem; }
  .tiles { margin-bottom: 1.4rem; }
  .lobby { grid-template-columns: 1fr; }
  .room { border-right: 0; border-bottom: 1px dashed #705f83; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field.featured { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .review-row:not(.standing) { grid-template-columns: minmax(0, 1fr) auto; }
  .standing { grid-template-columns: minmax(0, 1fr) auto; }
  .standing > strong:last-child { grid-column: 2; }
  .fields { grid-template-columns: 1fr; }
  .form-note { overflow-wrap: anywhere; }
  .join { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .roll { animation: none; transform: translateY(-80%); }
  .stamp { animation: none; }
}
