:root {
  color-scheme: light;
  --page-width: 1220px;
  --page-gutter: clamp(1rem, 3vw, 1.5rem);
  --heading: #28223E;
  --accent: #5945BE;
  --accent-hover: #4934A9;
  --control-edge: #817597;
  --hover: #F2EDFC;
  --action: var(--accent);
  --action-hover: var(--accent-hover);
  --on-action: #FFFFFF;
  --paper: #FFFCF8;
  --ink: #2D263E;
  --muted: #5F546D;
  --subtle: #F4F0FA;
  --line: #CFC5DD;
  --surface: #FFFFFF;
  --lavender: #EDE5FF;
  --peach: #FFEDDA;
  --rose: #FBE4EF;
  --seafoam: #DBF2E9;
  --sky: #E1ECFF;
  --backdrop: rgb(40 34 62 / 48%);
  --shadow: 0 12px 36px rgb(58 42 87 / 8%);
  --radius: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --heading: #F7F1FF;
  --accent: #C9B7FF;
  --accent-hover: #DED0FF;
  --control-edge: #A193BA;
  --hover: #383047;
  --action: #C5B3FA;
  --action-hover: #D6C7FF;
  --on-action: #221733;
  --paper: #1D1929;
  --ink: #EEE7F8;
  --muted: #C0B4CE;
  --subtle: #30283F;
  --line: #675A79;
  --surface: #262035;
  --lavender: #3C3054;
  --peach: #493637;
  --rose: #493245;
  --seafoam: #293E3B;
  --sky: #303951;
  --backdrop: rgb(15 11 22 / 72%);
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; color: var(--heading); }
button:disabled, button[aria-disabled="true"] { cursor: default; opacity: .68; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { color: var(--heading); line-height: 1.15; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  min-height: 72px;
  padding: .5rem max(var(--page-gutter), calc((100% - var(--page-width)) / 2 + var(--page-gutter)));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  padding: 0;
  min-height: 44px;
  background: none;
  border: 0;
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -.065em;
}
.site-header a { display: inline-flex; align-items: center; color: var(--heading); text-decoration: none; }
.brand span { color: var(--accent); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.theme-toggle {
  display: grid;
  place-content: center;
  justify-items: center;
  width: 52px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle span {
  display: grid;
  place-items: center;
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  z-index: 1;
  line-height: 1;
  font-size: .82rem;
}
.theme-sun { transform: translateX(-11px); }
.theme-moon { transform: translateX(11px); }
.theme-toggle::before {
  content: "";
  grid-area: 1 / 1;
  place-self: center;
  width: 46px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--subtle);
}
.theme-toggle:hover::before { border-color: var(--accent); background: var(--hover); }
.theme-toggle::after {
  content: "";
  grid-area: 1 / 1;
  place-self: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--action);
  transform: translateX(-11px);
  transition: transform .18s ease;
}
.theme-toggle[aria-checked="true"]::after { transform: translateX(11px); }
.theme-toggle[aria-checked="false"] .theme-sun,
.theme-toggle[aria-checked="true"] .theme-moon { color: var(--on-action); }
.shell { flex: 1; width: min(100%, var(--page-width)); margin-inline: auto; padding: clamp(1.5rem, 4vw, 3.5rem) var(--page-gutter) 3rem; }
.entry-actions:not([hidden]) { display: grid; gap: .5rem; }
.entry-actions button { min-height: 48px; min-width: 0; }
#quickResult .winner-card { margin-bottom: .75rem; }

.hero { display: grid; gap: 1.35rem; }
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.hero h1 span { display: block; color: var(--accent); }
.lede { max-width: 34ch; margin: .8rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.entry-card { padding: clamp(1rem, 3vw, 1.75rem); box-shadow: var(--shadow); }
.entry-card label, .tool-panel label { display: block; margin-bottom: .5rem; font-weight: 750; color: var(--heading); }
.entry-card label span { font-weight: 500; }
textarea, input, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .7rem .85rem;
  border: 1px solid var(--control-edge);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }
textarea::placeholder, input::placeholder { color: var(--muted); opacity: 1; }
textarea:focus-visible, input:focus-visible, select:focus-visible { border-color: var(--accent); }
#choiceCount { color: var(--heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem .75rem; margin: .65rem 0 1.1rem; color: var(--muted); font-size: .875rem; }

.primary-btn, .secondary-btn, .text-btn, .back-btn, .option-pill, .saved-actions button, .icon-btn, .dislike-btn {
  min-height: 44px;
  padding: .6rem .85rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
}
.primary-btn { background: var(--action); color: var(--on-action); border-color: var(--control-edge); }
.primary-btn:hover:enabled { background: var(--action-hover); }
.secondary-btn, .option-pill, .saved-actions button, .icon-btn { background: var(--subtle); border-color: var(--control-edge); }
.secondary-btn:hover, .option-pill:hover, .saved-actions button:hover, .icon-btn:hover { background: var(--hover); border-color: var(--control-edge); }
.text-btn, .back-btn, .dislike-btn { background: transparent; }
.text-btn:hover, .back-btn:hover, .dislike-btn:hover { background: var(--subtle); }

.quick-section { margin-top: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.quick-section h2 { margin: 0 0 1rem; font-size: clamp(1.3rem, 3vw, 1.65rem); letter-spacing: -.035em; }
.quick-grid, .mode-grid, .tools-grid { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
.quick-grid button, .mode-card {
  min-width: 0;
  text-align: left;
  border: 1px solid var(--control-edge);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .18s ease, background-color .18s ease;
}
.quick-grid button { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .1rem .85rem; padding: 1rem; }
.quick-grid button:hover, .mode-card:hover { border-color: var(--accent); background: var(--subtle); }
.quick-grid span, .mode-icon {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 12px;
  background: var(--subtle);
  font-size: 1.25rem;
}
.quick-grid span { grid-row: 1 / span 2; background: var(--quick-tint, var(--lavender)); }
[data-preset="food"] { --quick-tint: var(--peach); }
[data-preset="watch"] { --quick-tint: var(--sky); }
[data-preset="first"] { --quick-tint: var(--seafoam); }
[data-preset="tonight"] { --quick-tint: var(--rose); }
[data-preset="go"] { --quick-tint: var(--sky); }
.quick-grid small, .mode-card p { color: var(--muted); font-size: .95rem; }

.view-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.view-head h1, .play-card h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.85rem); letter-spacing: -.055em; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1.75rem; }
.chip { min-width: 0; max-width: 100%; padding: .35rem .75rem; border-radius: 999px; background: var(--subtle); color: var(--heading); font-weight: 650; }
.mode-card { display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; gap: .85rem; padding: 1rem; }
.mode-card h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.mode-card p { margin: 0; font-size: .925rem; }
.mode-arrow { font-size: 1.15rem; color: var(--accent); }

.play-topbar { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.play-card { max-width: 760px; margin: auto; padding: clamp(1rem, 4vw, 2.75rem); text-align: center; box-shadow: var(--shadow); }
.play-card h1 { margin: .65rem 0; }
.play-card p { color: var(--muted); }
.wheel-game, .tournament-game, .shortlist-game { max-width: 980px; }
.wheel-layout, .shortlist-layout { display: grid; gap: 1rem; align-items: center; }
.wheel-controls, .shortlist-controls, .shortlist-candidates { min-width: 0; }
.wheel-controls > .action-row:first-child { margin-top: 0; }
.eyebrow { color: var(--accent); font-weight: 750; font-size: .875rem; }
.result { margin: 1.4rem 0; font-size: clamp(1.65rem, 4.8vw, 3.25rem); line-height: 1.1; font-weight: 850; letter-spacing: -.045em; color: var(--heading); }
.result:empty { margin: 0; }
.winner-card {
  display: grid;
  gap: .45rem;
  max-width: 530px;
  margin: 1.25rem auto;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid var(--control-edge);
  border-radius: 18px;
  background: var(--lavender);
  animation: game-reveal .22s ease-out both;
}
.winner-label {
  color: var(--accent);
  font-size: .95rem;
  font-weight: 750;
  letter-spacing: 0;
}
.game-progress {
  display: grid;
  gap: .35rem;
  max-width: 22rem;
  margin: 1rem auto;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
}
.game-progress progress { width: 100%; height: .6rem; accent-color: var(--accent); }
@keyframes game-reveal {
  from { opacity: .55; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
#elimStatus { font-size: 1.15rem; font-weight: 750; color: var(--heading); }
.play-card .microcopy { font-weight: 750; color: var(--accent); }
.action-row, .shortlist-options, .best-options { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.dislike-btn { margin-top: .65rem; color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.wheel-wrap { position: relative; width: min(100%, 450px); aspect-ratio: 1; margin: 1.5rem auto; }
.wheel-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: clamp(4px, 1vw, 8px) solid var(--surface);
  border-radius: 50%;
  transition: transform 4s cubic-bezier(.12, .75, .12, 1);
}
.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 43%;
  transform-origin: 0 0;
  text-align: right;
  font-size: clamp(.72rem, 2vw, 1rem);
  font-weight: 800;
  color: #17212B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pointer {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -7px;
  width: 30px;
  height: 35px;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 1px rgb(40 34 62 / 38%));
}
.pointer::before, .pointer::after {
  content: "";
  position: absolute;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.pointer::before { inset: 0; background: var(--surface); }
.pointer::after { inset: 3px 4px 7px; background: var(--heading); }
.wheel-wrap::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--heading);
}
.wheel-landed { outline: 2px solid var(--accent); outline-offset: 4px; }
#spinBtn { min-inline-size: 9.25rem; }
.elim-list, .ranking { display: grid; gap: .5rem; max-width: 530px; margin: 1.25rem auto; }
.elim-item { padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.elim-item { text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) 3.4rem; align-items: center; gap: .5rem; }
.elim-tag { color: var(--accent); font-size: .875rem; font-weight: 750; text-align: right; }
.elim-item.out { color: var(--muted); background: var(--subtle); }
.elim-item.out span { color: inherit; }
.elim-item.out .elim-name { text-decoration: line-through; font-weight: 500; }
.elim-item.elim-winner { background: var(--lavender); border-color: var(--accent); }
.elim-item.just-out { animation: game-reveal .2s ease-out both; }
.ranking { text-align: left; }
.matchup { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: .6rem; margin: 1.25rem 0; animation: game-reveal .18s ease-out both; }
.choice-btn { min-height: 80px; min-width: 0; padding: 1rem; border: 1px solid var(--control-edge); border-radius: 16px; background: var(--lavender); font-size: clamp(1.1rem, 3vw, 1.55rem); font-weight: 780; transition: background-color .15s, border-color .15s; }
.choice-btn:last-child { background: var(--seafoam); }
.choice-btn:hover { border-color: var(--accent); background: var(--hover); }
.choice-btn:active { border-color: var(--accent); background: var(--subtle); }
.tournament-matchup .choice-btn:first-child:is(:hover, :active, :focus-visible) { background: var(--hover); }
.tournament-matchup .choice-btn:last-child:is(:hover, :active, :focus-visible) { background: color-mix(in srgb, var(--seafoam) 89%, var(--heading)); border-color: currentColor; }
.tournament-matchup .choice-btn:last-child:is(:hover, :active) { box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 20%, transparent); }
.preference-prompt { font-size: 1.2rem; }
.preference-matchup .choice-btn { border-radius: 22px; background: var(--peach); font-weight: 650; }
.preference-matchup .choice-btn:hover { background: var(--subtle); }
.vs { display: grid; place-items: center; color: var(--muted); font-weight: 750; }
.ranking { list-style: none; padding: 0; }
.ranking li { display: flex; align-items: center; gap: .65rem; min-width: 0; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.preference-results li { padding: .65rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.preference-results li:first-child { border-color: var(--control-edge); background: var(--lavender); font-weight: 750; }
.shortlist {
  display: grid;
  gap: .5rem;
  max-width: 530px;
  margin: 1rem auto;
  padding: 0;
  list-style: none;
  text-align: left;
}
.shortlist li { padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); }
.shortlist li { font-weight: 700; }
.shortlist-candidates { align-self: start; text-align: left; }
.shortlist-candidates h2, .shortlist-controls h2 { font-size: 1.2rem; }
.shortlist-candidates .shortlist { max-height: clamp(19rem, 55svh, 24rem); overflow: auto; padding: .25rem; }
.shortlist-candidates .shortlist li { display: grid; grid-template-columns: minmax(0, 1fr) 4.25rem; gap: .5rem; }
.shortlist li.shortlist-kept { border-color: var(--accent); background: var(--lavender); }
.shortlist-out { color: var(--muted); }
.shortlist-out span { text-decoration: line-through; }
.rank-num { display: grid; place-items: center; flex: 0 0 2rem; min-height: 2rem; border-radius: 8px; background: var(--subtle); color: var(--accent); font-weight: 750; }

.tools-grid { margin-block: 1.25rem; }
.tool-link, .tool-panel { padding: clamp(1rem, 3vw, 1.5rem); }
.tool-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-content: start;
  align-items: center;
  gap: .35rem .7rem;
  color: var(--heading);
  text-decoration: none;
  border-color: var(--control-edge);
  transition: background-color .18s ease, border-color .18s ease;
}
.tool-link:is(:hover, :focus-visible) { background: var(--hover); border-color: var(--accent); }
.tool-link .mode-icon { grid-row: 1 / span 2; align-self: start; background: var(--lavender); }
.tool-link .mode-arrow { grid-area: 1 / 3; }
.tool-link:nth-child(3n + 2) .mode-icon { background: var(--seafoam); }
.tool-link:nth-child(3n) .mode-icon { background: var(--peach); }
.tool-link h2 { margin: 0; font-size: 1.125rem; }
.tool-link p { grid-column: 2 / -1; margin: 0; color: var(--muted); }
.tool-panel h2 { margin: .75rem 0 .35rem; }
.tool-panel { margin-top: 1.25rem; }
.tool-panel h2 { margin-top: 0; }
.form-grid, .team-results { display: grid; gap: .75rem; }
.team-results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin-top: 1rem; }
.team { padding: 1rem; border-radius: 12px; background: var(--subtle); }
.team h3 { margin-top: 0; }
.coin { width: min(100%, 148px); aspect-ratio: 1; margin: 1rem auto; display: grid; place-items: center; border: 7px double #a26716; border-radius: 50%; background: #ffe0a1; color: #0B2545; font-size: 1.75rem; font-weight: 850; }
.coin.flipping { animation: coinflip .75s ease; }
@keyframes coinflip { from { transform: rotateY(0); } to { transform: rotateY(1440deg); } }

dialog { width: min(calc(100% - 2rem), 590px); max-height: calc(100% - 2rem); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--backdrop); }
.dialog-card { padding: clamp(1rem, 4vw, 1.5rem); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.dialog-head h2 { margin: 0; }
.icon-btn { min-width: 44px; padding: 0; font-size: 1.5rem; }
.saved-items { display: grid; gap: .5rem; margin: 1rem 0; }
.saved-item { min-width: 0; border: 1px solid var(--line); border-radius: 12px; }
.saved-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 48px;
  padding: .65rem .75rem;
  border-radius: inherit;
  cursor: pointer;
}
.saved-item summary::-webkit-details-marker { display: none; }
.saved-item summary::after {
  content: "";
  flex: 0 0 .55rem;
  height: .55rem;
  margin-inline-end: .25rem;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.saved-item[open] summary::after { transform: rotate(225deg); }
.saved-item strong, .saved-item small { display: block; }
.saved-item small { color: var(--muted); }
.saved-preview { padding: 0 .75rem .75rem; animation: game-reveal .18s ease-out; }
.saved-preview ol {
  max-height: 12rem;
  overflow: auto;
  margin: .25rem 0 .75rem;
  padding: .5rem .75rem .5rem 2rem;
  border-radius: 8px;
  background: var(--subtle);
}
.saved-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.saved-actions .delete-list { margin-inline-start: auto; text-decoration: underline; }
.saved-actions .primary-btn { background: var(--action); color: var(--on-action); }
.saved-actions .primary-btn:hover { background: var(--action-hover); }
.shortlist-context:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.shuffle-preview {
  max-width: 530px;
  margin: 1.25rem auto;
  padding: 1rem;
  border: 1px solid var(--control-edge);
  border-radius: 18px;
  background: var(--subtle);
}
.bracket { min-width: 0; margin-top: 1.75rem; text-align: left; }
.bracket h2 { font-size: 1.2rem; }
.bracket-scroll { overflow-x: auto; padding: .25rem .25rem .75rem; border-radius: 8px; }
.bracket-rounds { display: flex; gap: 1.25rem; width: max-content; min-width: 100%; }
.bracket-round { display: flex; flex: 0 0 10.5rem; flex-direction: column; width: 10.5rem; }
.bracket-round h3 { margin: .25rem 0 .65rem; font-size: .95rem; }
.bracket-round ol, .bracket-match ul { margin: 0; padding: 0; list-style: none; }
.bracket-round ol { display: flex; flex: 1; flex-direction: column; justify-content: space-around; gap: .6rem; }
.bracket-match, .bracket-final p { position: relative; padding: .55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.bracket-match::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 1.25rem;
  border-top: 1px solid var(--line);
}
.bracket-match.active { border-color: var(--accent); background: var(--lavender); }
.bracket-match small, .bracket-advancing strong { display: block; color: var(--accent); font-size: .8rem; }
.bracket-match li { display: flex; align-items: baseline; justify-content: space-between; gap: .35rem; margin-top: .2rem; }
.bracket-match li + li { border-top: 1px solid var(--line); padding-top: .2rem; }
.bracket-out { color: var(--muted); text-decoration: line-through; }
.bracket-advancing { font-weight: 750; animation: game-reveal .18s ease-out; }
.bracket-final p { margin: auto 0; background: var(--lavender); font-weight: 750; }
.seed-options { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; max-width: 25rem; margin: 1rem auto; border: 1px solid var(--line); border-radius: 12px; }
.seed-options label { display: flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; }
.seed-options input { width: 1rem; min-height: auto; margin: 0; accent-color: var(--accent); }
.seed-list { display: grid; gap: .35rem; max-width: 36rem; margin: 1rem auto; padding: 0; list-style: none; text-align: left; }
.seed-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; cursor: grab; }
.seed-list.is-dragging li:not(.seed-source) { border-style: dashed; }
.seed-list .seed-source { opacity: .45; cursor: grabbing; }
.seed-list .seed-target { background: var(--lavender); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.seed-swapped { animation: game-reveal .22s ease-out both; background: var(--subtle); }
.seed-swap { display: grid; gap: .75rem; max-width: 36rem; margin: 1rem auto; text-align: left; }
.seed-swap label, .seed-swap select { min-width: 0; }
.seed-swap select { margin-top: .25rem; }
.seed-swap button { grid-column: 1 / -1; justify-self: start; }
.simulation-form { display: grid; gap: .5rem; max-width: 24rem; margin: 1rem auto; }
.inline-check { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; cursor: pointer; }
.inline-check input { width: 1.1rem; min-height: 1.1rem; accent-color: var(--accent); }
.simulation-reveal { animation: game-reveal .22s ease-out both; }
.simulation-progress { display: grid; gap: .4rem; max-width: 24rem; margin: 1rem auto; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); color: var(--heading); font-variant-numeric: tabular-nums; }
.simulation-progress progress { width: 100%; accent-color: var(--accent); }
.simulation-results { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.simulation-results caption { color: var(--muted); padding: .5rem; }
.simulation-results :is(th, td) { padding: .45rem; border-bottom: 1px solid var(--line); }
.simulation-results :is(th, td):not(:first-child) { width: 5rem; text-align: end; font-variant-numeric: tabular-nums; }
.simulation-results .simulation-leader { background: var(--lavender); }
.random-tool { text-align: center; }
.number-fields { display: grid; gap: .75rem; max-width: 32rem; margin: 0 auto; }
.tool-result { font-weight: 750; }
.number-result { color: var(--heading); font-size: clamp(1.5rem, 5vw, 2.5rem); }
.die-face, .playing-card { margin: .75rem auto; border: 1px solid var(--control-edge); background: var(--surface); color: var(--heading); }
.die-face { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; width: 5.5rem; height: 5.5rem; padding: .65rem; border-radius: 16px; font-size: 2rem; }
.die-face span { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.die-rolled { animation: die-roll .24s ease-out; }
@keyframes die-roll { from { transform: rotate(-18deg) scale(.94); } to { transform: none; } }
.playing-card { display: grid; width: 5.5rem; aspect-ratio: 2 / 3; padding: .45rem; border-radius: 12px; text-align: left; }
.playing-card strong { text-align: center; font-size: 1.8rem; }
.playing-card span:last-child { justify-self: end; align-self: end; }
.playing-card:is(.hearts, .diamonds) { color: #a32650; }
[data-theme="dark"] .playing-card:is(.hearts, .diamonds) { color: #ff9fbd; }
.card-back { background: var(--lavender); place-items: center; font-size: 1.8rem; }
.card-reveal { animation: game-reveal .2s ease-out; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner {
  width: min(100%, var(--page-width));
  margin: auto;
  padding: .65rem var(--page-gutter);
  color: var(--muted);
}
.tool-page { max-width: 54rem; }
.tool-heading { justify-content: flex-start; flex-wrap: nowrap; }
.tool-heading .mode-icon { flex-shrink: 0; background: var(--lavender); }
.tool-page .tool-panel { box-shadow: var(--shadow); }
.tool-page section { margin-top: 2rem; }
.related-tools { display: flex; gap: .5rem 1rem; flex-wrap: wrap; }
.related-tools a { display: inline-flex; align-items: center; gap: .45rem; color: var(--heading); text-decoration: none; }
.save-current { display: flex; flex-wrap: wrap; gap: .5rem; }
.save-current input { flex: 1 1 12rem; }
#savedStatus { margin: .65rem 0 0; color: var(--heading); }
#savedStatus:empty { margin: 0; }
.toast { position: fixed; bottom: 1rem; left: 50%; width: max-content; max-width: calc(100% - 2rem); transform: translateX(-50%); padding: .65rem 1rem; border-radius: 12px; background: var(--action); color: var(--on-action); border: 1px solid var(--control-edge); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.toast.show { opacity: 1; }

@media (min-width: 560px) {
  .quick-grid, .mode-grid, .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matchup { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .preference-matchup, .entry-actions:not([hidden]), .number-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-btn { min-height: 110px; }
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(9rem, 28%); }
  .seed-swap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 740px) {
  .shortlist-candidates .shortlist { max-height: clamp(25rem, 68svh, 36rem); }
  .wheel-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; }
  .shortlist-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

@media (min-width: 850px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); column-gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
  .quick-section { grid-column: 1 / -1; margin-top: 1.25rem; }
  .quick-grid, .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .wheel { transition: none !important; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
