/* Juleølsmaking. One stylesheet, no build step.
 *
 * A dark room lit by something warm: deep spruce green, the gold of the beer,
 * and the red of the label kept for what is dangerous or wrong. Headings and
 * numbers are set in Fraunces; everything else in the system's own typeface.
 */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-5.3.0-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08140f;
  --bg-2: #0e2019;
  --panel: #10231c;
  --text: #f6eedd;
  --muted: #a9bfb1;
  --faint: #78917f;
  --line: rgba(255, 247, 230, 0.1);
  --wash: rgba(255, 247, 230, 0.06);
  --gold: #f4b740;
  --gold-hi: #ffd978;
  --gold-lo: #e3941f;
  --ink: #2b1a04;
  --foam: #fff7e6;
  --red: #d9442f;
  --red-soft: #ffb4a6;
  --ok: #58c98b;

  --display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font: 400 1rem/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* The light in the room. Fixed, so it stays put while the page scrolls. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 55% at 50% -12%, rgba(244, 183, 64, 0.22), transparent 62%),
    radial-gradient(70% 45% at 105% 105%, rgba(217, 68, 47, 0.13), transparent 60%),
    radial-gradient(60% 40% at -10% 80%, rgba(47, 125, 91, 0.2), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2,
.bignum,
.bigcode {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.2;
}

strong {
  font-weight: 700;
}

a {
  color: var(--gold);
}

:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.hint .icon {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
  margin-right: 0.2em;
}

.error {
  color: var(--red-soft);
  font-size: 0.925rem;
  font-weight: 600;
}

.eyebrow {
  font: 700 0.75rem/1.3 var(--ui);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow.ok {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ok);
}

.eyebrow .icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 3;
}

.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
}

/* --------------------------------------------------------------- layout -- */

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: min(100%, 31rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.125rem calc(2.5rem + env(safe-area-inset-bottom));
}

.page.center {
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Room at the bottom for the dock that is fixed there. */
.has-dock {
  padding-bottom: 8.5rem;
}

.center-text {
  text-align: center;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #172d24, #11241c);
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.8);
}

.pad {
  padding: 1.25rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.count {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.noscript {
  max-width: 24rem;
  margin: 4rem auto;
  padding: 0 1.25rem;
  text-align: center;
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: none;
  color: var(--text);
  font: 650 1rem/1.2 var(--ui);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    transform 0.12s var(--ease),
    filter 0.15s,
    background-color 0.15s;
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
}

.btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.btn.busy:disabled {
  opacity: 1;
}

.btn-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn.busy .btn-label {
  visibility: hidden;
}

.btn .spinner {
  position: absolute;
  inset: 0;
  margin: auto;
}

.btn.primary {
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-lo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 12px 26px -12px rgba(244, 183, 64, 0.65);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn.secondary {
  border-color: rgba(255, 247, 230, 0.16);
  background: rgba(255, 247, 230, 0.08);
}

.btn.secondary:hover:not(:disabled),
.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 247, 230, 0.13);
}

.btn.ghost {
  color: var(--muted);
}

.btn.danger {
  color: #fff;
  background: var(--red);
}

.btn.ghost.danger {
  color: var(--red-soft);
  background: none;
}

.btn.xl {
  min-height: 3.75rem;
  border-radius: 18px;
  font-size: 1.125rem;
}

.btn.small {
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border-radius: 12px;
  font-size: 0.875rem;
}

.btn.block {
  display: flex;
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--wash);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(255, 247, 230, 0.13);
}

.icon-btn.quiet {
  background: none;
  color: var(--faint);
}

.icon-btn:disabled {
  cursor: default;
  opacity: 0.3;
}

.spinner {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.big {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--gold);
}

/* ---------------------------------------------------------------- forms -- */

.field {
  display: block;
}

.label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 650;
}

.label small {
  margin-left: 0.35rem;
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 400;
}

.field .hint,
.field .error {
  display: block;
  margin-top: 0.4rem;
}

.input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid rgba(255, 247, 230, 0.16);
  border-radius: 14px;
  background: #0c1a14;
  color: var(--text);
  /* 16px or more, or iOS zooms the page in on every tap. */
  font: 500 1rem/1.4 var(--ui);
}

.input::placeholder {
  color: var(--faint);
  opacity: 1;
}

.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 183, 64, 0.25);
}

.input.invalid {
  border-color: var(--red-soft);
}

textarea.input {
  min-height: 4.4rem;
  resize: vertical;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setting .label {
  margin-bottom: 0.1rem;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
}

.stepper-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 247, 230, 0.16);
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.08);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}

.stepper-btn:disabled {
  cursor: default;
  opacity: 0.3;
}

.stepper-value {
  min-width: 2.75rem;
  font: 700 1.6rem/1 var(--display);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: center;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.switch.disabled {
  cursor: default;
  opacity: 0.55;
}

.switch-text {
  display: grid;
  gap: 0.1rem;
}

.switch-title {
  font-weight: 650;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 3.25rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.16);
  transition: background-color 0.2s;
}

.switch-thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--foam);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--gold);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(1.25rem);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--gold-hi);
  outline-offset: 2px;
}

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.choice-item {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.9rem 0.5rem;
  border: 2px solid rgba(255, 247, 230, 0.12);
  border-radius: 18px;
  background: rgba(255, 247, 230, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.choice-item:disabled {
  cursor: default;
  opacity: 0.55;
}

.choice-item.on {
  border-color: var(--gold);
  background: rgba(244, 183, 64, 0.14);
}

.choice-art {
  display: grid;
  place-items: center;
  height: 2.4rem;
}

.choice-title {
  font-weight: 700;
}

/* The six digits. The real input lies invisible on top of the boxes. */
.code {
  position: relative;
  display: block;
}

.code-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: transparent;
  caret-color: transparent;
  font-size: 1rem;
  opacity: 0;
}

.code-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 0.35fr repeat(3, 1fr);
  gap: 0.45rem;
}

.code-slot {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border: 2px solid rgba(255, 247, 230, 0.16);
  border-radius: 14px;
  background: #0c1a14;
  font: 700 clamp(1.6rem, 9vw, 2.25rem) / 1 var(--display);
  font-variant-numeric: lining-nums;
}

.code-slot.gap {
  grid-column: 5;
}

.code:focus-within .code-slot.next {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 183, 64, 0.25);
}

.code:focus-within .code-slot.next:empty::after {
  content: "";
  width: 2px;
  height: 45%;
  border-radius: 2px;
  background: var(--gold);
  animation: blink 1.1s steps(1) infinite;
}

.code.invalid .code-slot {
  border-color: var(--red-soft);
  animation: shake 0.35s;
}

.notice {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(244, 183, 64, 0.1);
  color: #ffe6b3;
  font-size: 0.925rem;
}

/* ----------------------------------------------------------- front page -- */

.hero {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.75rem 0 0.75rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 12vw, 3.6rem);
  font-weight: 750;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  background: linear-gradient(180deg, var(--foam) 30%, var(--gold) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: normal;
}

.hero-mug {
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5));
  animation: bob 5s ease-in-out infinite;
}

.lead {
  max-width: 25rem;
  color: var(--muted);
  font-size: 1.075rem;
}

.recent {
  margin-top: 0.5rem;
}

.recent-list {
  display: grid;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.recent-item {
  display: flex;
  align-items: center;
  padding-right: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #13271f;
}

.recent-link {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: 0.85rem 0.5rem 0.85rem 1rem;
  color: inherit;
  text-decoration: none;
}

.recent-name {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-code {
  flex: none;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.foot {
  margin-top: auto;
  padding-top: 1rem;
}

.how {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.925rem;
}

.how b {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: rgba(244, 183, 64, 0.16);
  color: var(--gold);
  font-size: 0.8rem;
}

.pagehead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pagehead h1 {
  font-size: 1.75rem;
}

.beer-fields,
.tool-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.beer-field,
.tool-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.beer-field .input,
.tool-row .input,
.tool-add .input {
  flex: 1;
  min-width: 0;
}

.beer-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.08);
  color: var(--muted);
  font: 700 0.95rem/1 var(--display);
  font-variant-numeric: lining-nums;
}

/* ----------------------------------------------------------------- room -- */

.topbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.topbar-text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.topbar-text strong {
  overflow: hidden;
  font: 650 1.075rem/1.25 var(--display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-text span {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.offline {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(217, 68, 47, 0.22);
  color: #ffc9bf;
  font-size: 0.9rem;
  text-align: center;
}

.invite h1 {
  margin: 0.3rem 0 0.4rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(244, 183, 64, 0.13);
  color: #ffe0a0;
  font-size: 0.875rem;
  font-weight: 650;
}

.facts + .hint {
  margin-top: 0.75rem;
}

.invite-card {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
}

.invite-card.compact {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.invite-card .pair {
  width: 100%;
  margin-top: 0.6rem;
}

.bigcode {
  font-size: clamp(3rem, 16vw, 4.25rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.qr-frame {
  width: min(58%, 12.5rem);
  margin-top: 0.5rem;
  padding: 0.35rem;
  border-radius: 18px;
  background: var(--foam);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.7);
}

.qr {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--wash);
  font-weight: 650;
  animation: pop 0.35s var(--ease) backwards;
}

.person.away {
  opacity: 0.6;
}

.person.empty {
  border-style: dashed;
  background: none;
  color: var(--faint);
  font-weight: 500;
  animation: none;
}

.seats {
  display: inline-flex;
}

.seats .avatar {
  width: 28px;
  height: 28px;
}

.seats .avatar + .avatar {
  margin-left: -8px;
}

.person-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsl(var(--hue, 38) 58% 40%);
  color: #fff;
  font-weight: 750;
  line-height: 1;
}

.avatar.hollow {
  border: 2px dashed rgba(255, 247, 230, 0.28);
  background: var(--bg-2);
}

.avatar.todo {
  filter: saturate(0.35);
  opacity: 0.65;
}

.avatar.done {
  box-shadow: 0 0 0 2.5px var(--ok);
}

.avatar-tick {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--ok);
  color: #06301c;
  animation: pop 0.3s var(--ease) both;
}

.avatar-tick .icon {
  width: 12px;
  height: 12px;
  stroke-width: 4;
}

.tag {
  flex: none;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(244, 183, 64, 0.18);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag.you {
  background: rgba(88, 201, 139, 0.18);
  color: var(--ok);
}

.tag.quiet {
  background: rgba(255, 255, 255, 0.08);
  color: var(--faint);
}

.waiting {
  padding: 0.5rem 0;
  color: var(--muted);
  text-align: center;
}

.dots {
  display: inline-flex;
  gap: 0.25rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.dots i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--gold);
  animation: dot 1.2s ease-in-out infinite;
}

.dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.dots i:nth-child(3) {
  animation-delay: 0.3s;
}

/* The host's next step, fixed to the bottom of the screen. */
.dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  gap: 0.5rem;
  padding: 1.75rem 1.125rem calc(0.9rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8, 20, 15, 0), rgba(8, 20, 15, 0.94) 34%);
  pointer-events: none;
}

.dock > * {
  width: min(100%, 28.75rem);
  margin-inline: auto;
  pointer-events: auto;
}

/* On the dock nothing may show through: a quiet button there is a solid one. */
.dock .btn.secondary {
  border-color: rgba(255, 247, 230, 0.22);
  background: #24382f;
}

.dock-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* ---------------------------------------------------------------- round -- */

.progress {
  display: grid;
  gap: 0.45rem;
}

.progress-track {
  display: flex;
  gap: 4px;
}

.progress-track i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 247, 230, 0.12);
}

.progress-track i.done {
  background: #a87a22;
}

.progress-track i.now {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(244, 183, 64, 0.7);
}

.beer {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0 0.25rem;
  text-align: center;
}

.beer .hint {
  margin-top: 0.3rem;
}

.cap {
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5));
  animation: cap-in 0.6s var(--ease) both;
}

.cap-no {
  fill: var(--gold-hi);
  font: 750 34px var(--display);
  font-variant-numeric: lining-nums;
}

.cap-q {
  fill: var(--faint);
  font: 700 6.5px var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scores {
  display: grid;
  gap: 0.6rem;
}

.scores.dice {
  grid-template-columns: repeat(3, 1fr);
}

.scores.ten {
  grid-template-columns: repeat(5, 1fr);
}

.score-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 22px;
  background: rgba(255, 247, 230, 0.055);
  color: var(--text);
  font: 700 1.5rem/1 var(--display);
  font-variant-numeric: lining-nums;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.18s var(--ease),
    background-color 0.15s,
    border-color 0.15s;
}

.scores.ten .score-btn {
  border-radius: 50%;
}

.score-btn .die {
  width: 66%;
  height: auto;
}

.score-btn:active {
  transform: scale(0.94);
}

.score-btn.on {
  border-color: var(--gold);
  background: rgba(244, 183, 64, 0.18);
  transform: scale(1.05) rotate(-3deg);
}

.scores.ten .score-btn.on {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  color: var(--ink);
  transform: scale(1.08);
}

.die {
  flex: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

.die-face {
  fill: var(--foam);
}

.die-pip {
  fill: #1c130a;
}

.score-btn.on .die-face {
  fill: var(--gold-hi);
}

.points {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--foam);
  color: #1c130a;
  font-family: var(--display);
  font-weight: 750;
  font-variant-numeric: lining-nums;
  line-height: 1;
}

.points.small {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.score-word {
  min-height: 1.6rem;
  color: var(--gold);
  font: 650 1.15rem/1.4 var(--display);
  text-align: center;
}

.score-word.empty {
  color: var(--faint);
  font: 400 0.875rem/1.8 var(--ui);
}

.given {
  display: grid;
  gap: 0.85rem;
}

.given .btn {
  justify-self: start;
}

.given-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.given-row strong,
.given-row .muted {
  display: block;
}

.quote {
  color: #eadfca;
  font-style: italic;
  overflow-wrap: anywhere;
}

.given-row .quote {
  margin-top: 0.35rem;
}

.average {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.bignum {
  color: var(--gold);
  font-size: 3.6rem;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.average.big .bignum {
  font-size: 4.25rem;
}

.bars {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 0.4rem;
  height: 9rem;
}

.bar-count,
.bar-label {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25rem;
  text-align: center;
}

.bars .bar {
  display: grid;
  grid-template-rows: 1.25rem 1fr 1.25rem;
  justify-items: center;
  min-width: 0;
}

.bar-count {
  font-weight: 750;
}

.bar-label {
  color: var(--muted);
}

.bar-col {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 2.75rem;
  height: 100%;
  border-radius: 8px;
  background: rgba(255, 247, 230, 0.05);
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  transform-origin: bottom;
  animation: grow 0.7s var(--ease) both;
}

.bars .bar.own .bar-label {
  color: var(--gold);
  font-weight: 800;
}

.votes {
  display: grid;
  gap: 0.15rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.5rem;
  border-radius: 14px;
}

.vote-row.own {
  background: rgba(244, 183, 64, 0.09);
}

.vote-who {
  display: grid;
  flex: 1;
  min-width: 0;
}

.vote-who .quote {
  font-size: 0.875rem;
}

/* --------------------------------------------------------------- finale -- */

.finale-head {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0 0.25rem;
  text-align: center;
}

.rank-list {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.45rem;
  list-style: none;
}

.rank {
  border-radius: 16px;
}

.rank:not(.secret) {
  animation: rise 0.5s var(--ease) backwards;
}

.rank.p1 {
  background: rgba(244, 183, 64, 0.11);
}

.rank-main,
.rank.secret {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
}

.rank-main {
  border: 0;
  border-radius: 16px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rank.secret {
  color: var(--faint);
  opacity: 0.55;
}

.rank-name {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.rank-name strong {
  overflow-wrap: anywhere;
}

.rank-name .muted {
  font-size: 0.82rem;
}

.rank-score {
  color: var(--gold);
  font: 750 1.4rem/1 var(--display);
  font-variant-numeric: tabular-nums lining-nums;
}

.rank-more {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 1rem;
}

.ranking-note {
  padding: 0 1.1rem 1rem;
}

.medal {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.09);
  color: var(--muted);
  font: 750 1.1rem/1 var(--display);
  font-variant-numeric: lining-nums;
}

.medal.p1 {
  background: linear-gradient(135deg, #ffe9a8, var(--gold-lo));
  color: var(--ink);
  box-shadow: 0 0 20px rgba(244, 183, 64, 0.5);
}

.medal.p2 {
  background: linear-gradient(135deg, #f4f6f7, #98a3ab);
  color: #1d2327;
}

.medal.p3 {
  background: linear-gradient(135deg, #f3ba92, #a65d2a);
  color: #2b1305;
}

.winner {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  border-color: rgba(244, 183, 64, 0.45);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(244, 183, 64, 0.26), transparent 70%),
    linear-gradient(180deg, #172d24, #11241c);
  text-align: center;
}

.winner-crown {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe9a8, var(--gold-lo));
  color: var(--ink);
  box-shadow: 0 0 30px rgba(244, 183, 64, 0.55);
  animation: pop 0.6s var(--ease) both;
}

.winner-crown .icon {
  width: 1.9rem;
  height: 1.9rem;
}

.winner .average {
  margin-top: 0.5rem;
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(4, 10, 8, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade 0.3s both;
  cursor: pointer;
}

.spotlight.winner {
  background:
    radial-gradient(60% 45% at 50% 45%, rgba(244, 183, 64, 0.3), transparent 70%),
    rgba(4, 10, 8, 0.92);
}

.spotlight-card {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  max-width: 30rem;
  text-align: center;
  animation: reveal 0.7s var(--ease) both;
}

.spotlight-card h1 {
  font-size: clamp(2.2rem, 11vw, 3.75rem);
}

.spotlight-card .medal {
  width: 4.5rem;
  height: 4.5rem;
  font-size: 2rem;
}

.spotlight-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.awards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.award {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(255, 247, 230, 0.05);
  overflow-wrap: anywhere;
}

.award-title {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.award .muted {
  font-size: 0.85rem;
}

.toplist {
  display: grid;
  gap: 0.6rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.toplist-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toplist-name {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.toplist-name .muted {
  font-size: 0.82rem;
}

/* --------------------------------------------------------------- sheets -- */

dialog.sheet {
  width: min(100%, 32rem);
  max-width: 100%;
  height: fit-content;
  max-height: min(90vh, 48rem);
  max-height: min(90dvh, 48rem);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

dialog.sheet[open] {
  display: flex;
  animation: sheet-up 0.3s var(--ease);
}

dialog.sheet::backdrop {
  background: rgba(3, 9, 7, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.sheet-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.5rem 1.25rem;
}

.sheet-head h2 {
  font-size: 1.35rem;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-text {
  color: var(--muted);
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 40rem) {
  dialog.sheet {
    margin: auto;
    border-radius: 26px;
  }
}

.tabs {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
}

.tab {
  min-height: 2.5rem;
  border: 0;
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font: 650 0.95rem/1 var(--ui);
  cursor: pointer;
}

.tab.on {
  background: rgba(255, 247, 230, 0.13);
  color: var(--text);
}

.tool-row.now .beer-no {
  background: var(--gold);
  color: var(--ink);
}

.tool-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-add {
  display: flex;
  gap: 0.5rem;
}

.tool-add .btn {
  flex: none;
}

.tool-flow {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.menu-me {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-list {
  display: grid;
  gap: 0.15rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.8rem 0.75rem;
  border: 0;
  border-radius: 14px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--wash);
}

.menu-item span {
  display: grid;
  line-height: 1.3;
}

.menu-item small {
  color: var(--muted);
  font-size: 0.85rem;
}

.menu-item.danger {
  color: var(--red-soft);
}

/* --------------------------------------------------------------- toasts -- */

/* A popover, so a toast is drawn above an open sheet and not underneath it. */
.toasts {
  position: fixed;
  inset: auto 0 calc(8rem + env(safe-area-inset-bottom)) 0;
  z-index: 70;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
  pointer-events: none;
}

.toasts:popover-open,
.toasts:not([popover]) {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
}

.toast {
  padding: 0.7rem 1rem;
  border-radius: 14px;
  background: var(--foam);
  color: #1c130a;
  font-weight: 650;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.7);
  animation: toast 0.3s var(--ease) both;
}

.toast.bad {
  background: #ffd9d1;
  color: #5a1409;
}

/* -------------------------------------------------------------- weather -- */

.snow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.snow i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #fff;
  opacity: var(--alpha);
  filter: blur(1.2px);
  animation: snow var(--fall) linear var(--delay) infinite;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --------------------------------------------------------------- the TV -- */

/* Everything is sized in rem, so the big screen is the phone's layout with a
   bigger rem: readable from the sofa on a 4K panel and on a laptop alike. */
html.tv {
  font-size: clamp(16px, 0.85vw + 0.9vh, 40px);
}

.tvpage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.75rem 2.75rem 2.25rem;
}

.tv-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font: 650 1.4rem/1.2 var(--display);
}

.tv-code {
  margin-left: auto;
  color: var(--muted);
  font: 500 1.05rem/1.2 var(--ui);
}

.tv-code b {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.tv-grid {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
}

.tv-invite,
.tv-beer {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  text-align: center;
}

.tv-beer .progress {
  width: min(100%, 24rem);
}

.tv-where {
  color: var(--muted);
  font-size: 1.35rem;
}

.tv-invite .bigcode {
  font-size: clamp(4rem, 9vw, 7rem);
}

.tv-invite .qr-frame {
  width: min(55%, 17rem);
}

.tv-side {
  display: grid;
  gap: 1rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #172d24, #11241c);
}

.tv-side .card-head {
  margin-bottom: 0;
}

.tv-side .bars {
  height: 11rem;
}

.tvpage .tag.you {
  display: none;
}

.tv-finale {
  width: min(100%, 44rem);
  margin: 0 auto;
}

@media (max-aspect-ratio: 1 / 1) {
  .tv-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tvpage {
    padding-inline: 1.25rem;
  }

  .tv-code {
    display: none;
  }
}

/* ------------------------------------------------------------ animation -- */

.rise {
  animation: rise 0.45s var(--ease) backwards;
}

.pop {
  animation: pop 0.5s var(--ease) backwards;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  70% {
    transform: scale(1.08);
  }
}

@keyframes cap-in {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-50deg);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
}

@keyframes toast {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

@keyframes bob {
  50% {
    transform: translateY(-7px) rotate(-2deg);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes dot {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes snow {
  to {
    transform: translate3d(var(--drift), 105vh, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .snow {
    display: none;
  }

  .spinner {
    animation-duration: 1.2s !important;
    animation-iteration-count: infinite !important;
  }
}
