@property --from {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

@property --to {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@keyframes colorSpin {
  0% {
    --from: 20%;
    --to: 270;
  }

  100% {
    --from: 15%;
    --to: 220;
  }
}

:root {
  color-scheme: dark;
  --glass: rgb(255 255 255 / 0.08);
  --glass-border: rgb(255 255 255 / 0.18);
  --text: rgb(255 255 255 / 0.92);
  --muted: rgb(255 255 255 / 0.6);
  --accent: hsl(45 100% 60%);
  --spin: hsl(142 72% 36%);
  --radius: 14px;
  --gap: clamp(12px, 2vw, 20px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  accent-color: var(--accent);
}

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

body {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: linear-gradient(hsl(270 100% var(--from)), hsl(var(--to) 100% 5%) 70%);
  animation: colorSpin 10s linear infinite alternate;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#fireworks {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* Background effect for themes that use one (see backdrops.js) */
#backdrop {
  position: fixed;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
}

/* Shared */

.panel {
  position: fixed;
  z-index: 10;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}

.row {
  display: flex;
  gap: 8px;
}

.btn {
  font: inherit;
  color: inherit;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 16px;
  transition: background-color 0.15s, transform 0.1s, opacity 0.15s;

  &:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
  }

  &:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  &:disabled {
    cursor: default;
    opacity: 0.5;
  }
}

.btn-ghost {
  flex: 1;
  font-size: 14px;
  background: rgb(255 255 255 / 0.1);
  border: 1px solid var(--glass-border);

  &:hover:not(:disabled) {
    background: rgb(255 255 255 / 0.2);
  }
}

/* Names */

.names-panel {
  left: var(--gap);
  bottom: var(--gap);
  width: 240px;
  padding: 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;

  & label {
    flex: 1;
  }
}

.collapse-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -4px -4px -4px 0;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background: transparent;
  transition: background-color 0.15s, color 0.15s;

  &:hover {
    color: var(--text);
    background: rgb(255 255 255 / 0.12);
  }

  &:focus-visible {
    outline: 2px solid var(--accent);
  }

  & svg {
    transition: rotate 0.25s;
  }

  /* Chevron points down to collapse, up to expand */
  &[aria-expanded="false"] svg {
    rotate: 180deg;
  }
}

/* Animates between auto height and 0 via a 1fr/0fr grid row */
.names-collapse {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease;

  .names-collapsed & {
    grid-template-rows: 0fr;
  }
}

.names-content {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;

  /* Spacing below the header lives inside the clipped box, so collapsing reaches 0 */
  & > :first-child {
    margin-top: 10px;
  }
}

.badge {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.15);
  color: var(--muted);
}

/* Editor: transparent textarea over a styled mirror of its text (see names.js).
   Both layers must share font, line height and padding exactly. */

.names-editor {
  --line: 24px;
  --pad: 10px;
  display: grid;
  grid-template-columns: 26px 1fr;
  overflow: hidden;
  background: rgb(0 0 0 / 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 8px;

  &:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
  }
}

.names-text {
  margin: 0;
  padding: var(--pad) var(--pad) var(--pad) 4px;
  font-family: inherit;
  font-size: 15px;
  line-height: var(--line);
  letter-spacing: normal;
  white-space: pre;
  tab-size: 4;
}

.names-lines {
  padding-top: var(--pad);
  will-change: transform;

  & .line {
    height: var(--line);
  }
}

.names-body {
  position: relative;
  min-width: 0;
}

.names-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;

  & .marker {
    color: var(--muted);
    opacity: 0.6;
  }

  & .off {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: rgb(255 255 255 / 0.5);
  }
}

#namesList {
  position: relative;
  display: block;
  width: 100%;
  /* Height is set from content in names.js. The panel is anchored at the bottom, so it grows upward */
  min-height: calc(6 * var(--line) + 2 * var(--pad));
  max-height: calc(100dvh - 200px);
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: white;
  scrollbar-width: thin;

  &::selection {
    color: transparent;
    background: rgb(140 170 255 / 0.35);
  }

  &::placeholder {
    color: var(--muted);
  }
}

.names-gutter {
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgb(255 255 255 / 0.08);

  /* Out of flow, so long lists don't stretch the editor past the textarea */
  & .names-lines {
    position: absolute;
    inset: 0 0 auto;
  }

  & .line {
    display: grid;
    place-items: center;
  }

  & button {
    width: 12px;
    height: 12px;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid var(--dot, rgb(255 255 255 / 0.35));
    background: var(--dot, transparent);
    box-shadow: 0 0 0 0 transparent;
    transition: scale 0.1s, box-shadow 0.15s;

    &:hover {
      scale: 1.3;
      box-shadow: 0 0 0 3px rgb(255 255 255 / 0.15);
    }
  }
}

.hint {
  margin: -2px 0 0;
  font-size: 12px;
  color: var(--muted);

  & kbd {
    font-size: 10px;
    padding: 1px 4px 2px;
    min-width: 1.6em;
  }

  & code {
    font-size: 12px;
    padding: 0 3px;
    border-radius: 3px;
    background: rgb(255 255 255 / 0.12);
  }
}

/* Spin dock */

.dock {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: var(--gap);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-spin {
  min-width: 200px;
  padding: 14px 28px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: white;
  background: var(--spin);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.35), inset 0 -3px 0 rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.25);

  &:hover:not(:disabled) {
    background: hsl(142 72% 32%);
  }

  & kbd {
    margin-left: 6px;
  }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14px;
  font-size: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);

  &:hover {
    background: rgb(255 255 255 / 0.18);
  }
}

/* Keycap: sits raised, sinks when its button is pressed */

kbd {
  display: inline-block;
  min-width: 2em;
  padding: 2px 6px 3px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: center;
  vertical-align: middle;
  color: rgb(255 255 255 / 0.95);
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.3);
  border-radius: 5px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-bottom-color: rgb(0 0 0 / 0.25);
  background: linear-gradient(rgb(255 255 255 / 0.3), rgb(255 255 255 / 0.1));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 2px 0 rgb(0 0 0 / 0.35),
    0 3px 5px rgb(0 0 0 / 0.25);
  translate: 0 -1px;
  transition: translate 0.08s, box-shadow 0.08s;

  :is(.btn:active:not(:disabled), .btn.is-pressed) & {
    translate: 0 1px;
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.25),
      0 0 0 rgb(0 0 0 / 0.35),
      0 1px 2px rgb(0 0 0 / 0.25);
  }
}

/* Winner */

.winner {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.winner-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: min(90vw, 900px);
  padding: 24px 40px 20px;
  text-align: center;
  border-radius: 24px;
  background: rgb(10 0 25 / 0.55);
  border: 1px solid rgb(255 220 120 / 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;

  &[hidden] {
    display: none;
  }

  & .row {
    width: 220px;
    margin-top: 8px;
  }
}

.winner-label {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.winner-name {
  font-family: "Dancing Script", cursive;
  font-size: clamp(48px, 10vw, 96px);
  line-height: 1.2;
  overflow-wrap: anywhere;
  background: linear-gradient(to bottom, #fff6a9 10%, #ffcc33 50%, #f1c232 51%, #ffb700 100%);
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 6px rgb(255 255 0 / 0.5)) drop-shadow(0 4px 6px rgb(0 0 0 / 0.6));
  animation: winner-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pop-in {
  from {
    opacity: 0;
    scale: 0.6;
  }
}

@keyframes winner-pulse {
  to {
    scale: 1.08;
  }
}

/* Themes bar */

.theme-bar {
  top: var(--gap);
  left: var(--gap);
  display: flex;
  align-items: center;
  padding: 5px;
  border-radius: 999px;
  font-size: 14px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font: inherit;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  background: transparent;
  transition: background-color 0.15s, color 0.15s;

  &:hover {
    color: var(--text);
    background: rgb(255 255 255 / 0.1);
  }

  &:focus-visible {
    outline: 2px solid var(--accent);
  }

  & svg {
    transition: rotate 0.25s;
  }

  /* Chevron points out (expand) when collapsed, back in (collapse) when open */
  &[aria-expanded="true"] svg {
    rotate: 180deg;
  }
}

/* Same 1fr/0fr grid trick as the names panel, sideways */
.theme-collapse {
  display: grid;
  grid-template-columns: 1fr;
  transition: grid-template-columns 0.25s ease;

  .themes-collapsed & {
    grid-template-columns: 0fr;
  }
}

.theme-list {
  min-width: 0;
  overflow: hidden;
  display: flex;
  gap: 6px;

  /* Spacing after the toggle lives inside the clipped box, so collapsing reaches 0 */
  & > :first-child {
    margin-left: 4px;
  }
}

.theme-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  font: inherit;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  transition: background-color 0.15s, border-color 0.15s;

  &:hover {
    background: rgb(255 255 255 / 0.14);
  }

  &[aria-pressed="true"] {
    border-color: var(--accent);
    background: rgb(255 255 255 / 0.14);
  }

  &:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  & .swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3);
  }

  /* Each option previews its theme's lettering */
  &[data-theme-id="classic"] {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size-adjust: none;
    color: rgb(255 255 255 / 0.92);
    text-shadow: none;
  }

  &[data-theme-id="matrix"] {
    font-family: VT323, ui-monospace, monospace;
    font-size-adjust: 0.55;
    color: #4dff7c;
  }

  &[data-theme-id="imperium"] {
    font-family: Cinzel, serif;
    font-size-adjust: none;
    font-weight: 700;
    color: #f3d98b;
  }
}

/* Matrix theme: phosphor-green terminal on black, CRT scanlines, digital rain */

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

html[data-theme="matrix"] {
  --glass: rgb(0 18 4 / 0.82);
  --glass-border: rgb(0 255 65 / 0.35);
  --text: #4dff7c;
  --muted: rgb(77 255 124 / 0.6);
  --accent: #00ff41;
  --radius: 2px;
  --glow: 0 0 6px rgb(0 255 65 / 0.6);
  font-family: VT323, ui-monospace, monospace;
  /* VT323 runs small; scale glyphs up to a normal x-height (keeps both names-editor layers in sync) */
  font-size-adjust: 0.55;

  & body {
    background: #000;
    animation: none;
  }

  & #backdrop {
    display: block;
  }

  /* Scanlines and vignette over everything; purely decorative */
  & body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background:
      repeating-linear-gradient(rgb(0 0 0 / 0.22) 0 1px, transparent 1px 3px),
      radial-gradient(ellipse at center, transparent 60%, rgb(0 0 0 / 0.55));
  }

  & .panel {
    backdrop-filter: none;
    box-shadow: 0 0 24px rgb(0 255 65 / 0.12);
    text-shadow: var(--glow);
  }

  & .theme-bar,
  & .btn,
  & .theme-option,
  & .theme-toggle,
  & .collapse-toggle,
  & .badge {
    border-radius: var(--radius);
  }

  & .theme-option .swatch {
    border-radius: 0;
  }

  & .btn-ghost {
    text-transform: uppercase;
    background: transparent;
    border-color: var(--glass-border);

    &:hover:not(:disabled) {
      background: rgb(0 255 65 / 0.12);
    }
  }

  & .btn-spin {
    color: var(--accent);
    background: #000;
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px rgb(0 255 65 / 0.5), inset 0 0 12px rgb(0 255 65 / 0.25);
    text-shadow: var(--glow);

    &:hover:not(:disabled) {
      color: #000;
      background: var(--accent);
      text-shadow: none;
    }
  }

  & .btn-icon {
    background: #000;
  }

  & kbd {
    color: var(--accent);
    text-shadow: none;
    background: #000;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 2px 0 rgb(0 255 65 / 0.35);
  }

  & .badge {
    color: var(--text);
    background: rgb(0 255 65 / 0.12);
  }

  & .names-editor {
    background: rgb(0 0 0 / 0.6);
    border-radius: var(--radius);
  }

  & #namesList {
    caret-color: var(--accent);

    &::selection {
      background: rgb(0 255 65 / 0.3);
    }
  }

  & .names-backdrop .off {
    text-decoration-color: rgb(77 255 124 / 0.6);
  }

  /* Square "pixels" instead of round dots, outlined so the darkest greens stay visible */
  & .names-gutter button {
    border-radius: 0;

    &[aria-pressed="true"] {
      border-color: rgb(0 255 65 / 0.55);
    }
  }

  & .hint code {
    background: rgb(0 255 65 / 0.12);
  }

  & .winner-card {
    background: rgb(0 10 2 / 0.9);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    backdrop-filter: none;
    box-shadow: 0 0 30px rgb(0 255 65 / 0.35);
  }

  & .winner-label {
    color: var(--text);
    letter-spacing: 0.1em;
    text-transform: none;
  }

  & .winner-name {
    font-family: VT323, ui-monospace, monospace;
    color: #b8ffc8;
    background: none;
    filter: none;
    text-shadow: 0 0 8px #00ff41, 0 0 24px rgb(0 255 65 / 0.6);
    animation: none;

    &::after {
      content: "█";
      margin-left: 0.1em;
      color: var(--accent);
      animation: cursor-blink 1s steps(1) infinite;
    }
  }
}

/* Imperium theme: Roman purple, crimson and gold on dark marble, with Greek-key
   (meander) bands and laurels. Ornaments are inline SVG so nothing extra loads. */

html[data-theme="imperium"] {
  --glass: rgb(34 12 30 / 0.8);
  --glass-border: rgb(212 175 55 / 0.5);
  --text: #f3e7c9;
  --muted: rgb(243 231 201 / 0.65);
  --accent: #d4af37;
  --spin: #8e1b24;
  --radius: 3px;
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23d4af37' stroke-width='1.2'%3E%3Cpath d='M0 11.4H12M0 .6H12M10.5 11.4V2.5H3v6h4.5V5.5'/%3E%3C/svg%3E");
  --laurel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 60' fill='%23d4af37'%3E%3Cpath d='M22 58Q6 36 20 4' fill='none' stroke='%23d4af37' stroke-width='1.6'/%3E%3Cg%3E%3Cellipse cx='11' cy='50' rx='6' ry='2.4' transform='rotate(-35 11 50)'/%3E%3Cellipse cx='22' cy='45' rx='6' ry='2.4' transform='rotate(35 22 45)'/%3E%3Cellipse cx='7' cy='39' rx='6' ry='2.4' transform='rotate(-45 7 39)'/%3E%3Cellipse cx='18' cy='33' rx='6' ry='2.4' transform='rotate(30 18 33)'/%3E%3Cellipse cx='7' cy='27' rx='6' ry='2.4' transform='rotate(-55 7 27)'/%3E%3Cellipse cx='18' cy='21' rx='6' ry='2.4' transform='rotate(25 18 21)'/%3E%3Cellipse cx='11' cy='14' rx='5.5' ry='2.2' transform='rotate(-65 11 14)'/%3E%3Cellipse cx='20' cy='8' rx='5' ry='2' transform='rotate(10 20 8)'/%3E%3C/g%3E%3C/svg%3E");
  font-family: Cinzel, serif;

  /* The marble itself is drawn on #backdrop (backdrops.js); this gradient shows until then */
  & body {
    animation: none;
    background: radial-gradient(ellipse at 50% 35%, #3b1433, #1a0818 60%, #0c040b);
  }

  & #backdrop {
    display: block;
  }

  & .panel {
    backdrop-filter: blur(10px) saturate(1.2);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(212 175 55 / 0.12);
  }

  & .theme-bar,
  & .btn,
  & .theme-option,
  & .theme-toggle,
  & .collapse-toggle,
  & .badge {
    border-radius: var(--radius);
  }

  /* Greek-key band along the top of the names panel */
  & .names-panel {
    padding-top: 22px;

    &::before {
      content: "";
      position: absolute;
      inset: 4px 6px auto;
      height: 12px;
      background: var(--meander) repeat-x;
      opacity: 0.8;
    }
  }

  & .panel-header {
    letter-spacing: 0.08em;
  }

  & .btn-ghost {
    letter-spacing: 0.06em;
    background: rgb(212 175 55 / 0.08);
    border-color: var(--glass-border);

    &:hover:not(:disabled) {
      background: rgb(212 175 55 / 0.18);
    }
  }

  & .btn-spin {
    font-weight: 700;
    letter-spacing: 0.18em;
    color: #f6e9c8;
    background: linear-gradient(#a3202b, #6e1018);
    border: 1px solid var(--accent);
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 220 150 / 0.35), inset 0 -3px 0 rgb(0 0 0 / 0.3);

    &:hover:not(:disabled) {
      background: linear-gradient(#b52532, #7a121b);
    }
  }

  & kbd {
    color: #f6e9c8;
    border-color: rgb(212 175 55 / 0.5);
    border-radius: var(--radius);
    background: linear-gradient(rgb(212 175 55 / 0.3), rgb(212 175 55 / 0.1));
  }

  & .badge {
    color: var(--accent);
    background: rgb(212 175 55 / 0.12);
  }

  & .names-editor {
    background: rgb(10 2 8 / 0.45);
    border-radius: var(--radius);
  }

  & #namesList {
    caret-color: var(--accent);

    &::selection {
      background: rgb(212 175 55 / 0.3);
    }
  }

  & .names-backdrop .off {
    text-decoration-color: rgb(212 175 55 / 0.6);
  }

  & .winner-card {
    position: relative; /* anchors the meander bands */
    padding-block: 34px 30px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    background: rgb(26 6 22 / 0.82);
    box-shadow: 0 20px 60px rgb(0 0 0 / 0.6), inset 0 0 40px rgb(212 175 55 / 0.08);

    /* Greek-key bands top and bottom */
    &::before,
    &::after {
      content: "";
      position: absolute;
      inset-inline: 10px;
      height: 12px;
      background: var(--meander) repeat-x;
    }

    &::before {
      top: 8px;
    }

    &::after {
      bottom: 8px;
    }
  }

  & .winner-label {
    color: var(--accent);
    letter-spacing: 0.4em;
  }

  /* Gold lettering flanked by laurel branches */
  & .winner-name {
    display: flex;
    align-items: center;
    gap: 0.15em;
    font-family: Cinzel, serif;
    font-weight: 700;
    font-size: clamp(40px, 8vw, 80px);
    letter-spacing: 0.04em;
    background: linear-gradient(to bottom, #fff2c4 10%, #e8bf4f 50%, #c99a2e 51%, #8a6414 100%);
    background-clip: text;
    filter: drop-shadow(0 2px 0 rgb(0 0 0 / 0.6)) drop-shadow(0 0 10px rgb(212 175 55 / 0.35));

    &::before,
    &::after {
      content: "";
      flex: none;
      width: 0.5em;
      height: 1em;
      background: var(--laurel) center / contain no-repeat;
    }

    &::after {
      scale: -1 1;
    }
  }
}

/* Small screens: themes bar spans the top, names panel sits below it */

@media (max-width: 640px) {
  .names-panel {
    top: calc(var(--gap) + 52px);
    bottom: auto;
    width: 170px;
  }

  .theme-bar {
    max-width: calc(100vw - 2 * var(--gap));
  }

  .theme-list {
    overflow-x: auto;
    scrollbar-width: none;
  }

  /* Anchored at the top here, so cap growth before it covers the wheel */
  #namesList {
    max-height: 40dvh;
  }

  .btn-spin {
    min-width: 160px;
  }
}

/* Touch devices have no keyboard: hide shortcut hints */

@media (pointer: coarse) {
  kbd,
  .shortcut-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .winner-name,
  .winner-card {
    animation: none;
  }

  .names-collapse,
  .collapse-toggle svg,
  .theme-collapse,
  .theme-toggle svg {
    transition: none;
  }

  html[data-theme="matrix"] .winner-name::after {
    animation: none;
  }
}
