@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  color-scheme: dark;
  --bg: #10131c;
  --panel: #181d29;
  --field: #10151f;
  --line: #2c3342;
  --ink: #f3f2f7;
  --muted: #a0a8ba;
  --gold: #f0ca77;
  --buttonink: #251d10;
  --soft: #242b39;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px "DM Sans",
    sans-serif;
}
body.light {
  color-scheme: light;
  --bg: #f3f5fa;
  --panel: #fff;
  --field: #f1f3f8;
  --line: #d5dbe7;
  --ink: #192133;
  --muted: #5d687e;
  --gold: #c38a23;
  --buttonink: #fff;
  --soft: #edf0f6;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 14px;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
button:hover:not(:disabled) {
  background: var(--soft);
  border-color: var(--muted);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
header {
  height: 86px;
  border-bottom: 1px solid var(--line);
  padding: 0 max(5%, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font:
    800 27px "Manrope",
    sans-serif;
  letter-spacing: -1px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
}
.brand > span:not(.brandmark):not(.brandtag) {
  font-weight: 400;
}
.brandmark {
  color: var(--gold);
  font-size: 39px;
  margin-right: 10px;
}
.brandtag {
  font:
    600 11px "DM Sans",
    sans-serif !important;
  letter-spacing: 2px !important;
  margin-left: 24px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.head-actions button {
  font-size: 23px;
  padding: 4px 12px;
}
.secure {
  font-size: 13px;
  color: var(--muted);
  margin-right: 20px;
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 38px 24px 24px;
}
.pageheading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 27px;
}
.eyebrow {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 2.3px;
  font-weight: 700;
}
h1 {
  font:
    700 clamp(27px, 3.2vw, 39px) "Manrope",
    sans-serif;
  letter-spacing: -1.4px;
  margin: 9px 0 0;
}
h1 span {
  color: var(--gold);
}
.pageheading > p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 6px;
}
h2 {
  font:
    700 17px "Manrope",
    sans-serif;
  margin: 0;
}
h3 {
  font-size: 15px;
  margin: 0;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 338px;
  gap: 22px;
}
.stagepanel,
.setup {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
}
.stagepanel {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 38%, #242c4033, transparent 65%),
    var(--panel);
}
.stagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px;
  gap: 12px;
}
.stagehead > div {
  display: flex;
  align-items: center;
  gap: 11px;
}
.modeindex {
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  padding: 5px 7px;
}
.pill {
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 20px;
  color: var(--muted);
  white-space: nowrap;
}
.canvaswrap {
  position: relative;
  max-width: 620px;
  margin: -15px auto -7px;
  aspect-ratio: 1000/690;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#canvasOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  pointer-events: none;
}
#canvasOverlay button {
  pointer-events: auto;
  background: var(--gold);
  color: var(--buttonink);
  font-weight: 700;
  margin-top: 110px;
}
.result {
  text-align: center;
  padding: 0 20px;
  min-height: 75px;
}
.result > span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.1px;
  color: var(--gold);
  margin-bottom: 8px;
}
.result strong {
  font:
    700 clamp(24px, 3vw, 34px) "Manrope",
    sans-serif;
  display: block;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}
.result-congrats,
.result-winner {
  display: block;
}
.result-congrats {
  font-size: 0.72em;
  line-height: 1.15;
  white-space: nowrap;
}
.result-winner {
  margin-top: 2px;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.result button {
  padding: 4px 10px;
  margin-top: 8px;
}
.presentation-note {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 10px auto 19px;
  max-width: 560px;
  padding: 0 18px;
  min-height: 19px;
}
.drawbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 20px 20px;
}
.primary {
  background: var(--gold);
  color: var(--buttonink);
  font-weight: 800;
  border: 0;
  font-size: 16px;
  padding: 16px 36px;
  min-width: 260px;
  box-shadow: 0 5px 24px #d5ac4f12;
}
.primary:hover:not(:disabled) {
  background: var(--gold);
  filter: brightness(1.07);
}
.stagefoot {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  color: var(--muted);
  font-size: 12px;
  gap: 10px;
}
.stagefoot button {
  border: 0;
  padding: 6px;
  font-size: 12px;
}
#error {
  color: #ff8989;
  text-align: center;
  font-size: 14px;
  margin: 0 20px 15px;
}
#error:empty {
  display: none;
}
.setup {
  padding: 24px;
}
.setupheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 19px;
}
.count {
  font-size: 12px;
  background: var(--soft);
  border-radius: 6px;
  padding: 4px 8px;
}
.tabs {
  display: flex;
  background: var(--field);
  padding: 4px;
  border-radius: 9px;
  margin-bottom: 20px;
}
.tabs button {
  flex: 1;
  border: 0;
  padding: 9px 5px;
  font-size: 12px;
}
.tabs button[aria-selected="true"] {
  background: var(--soft);
  box-shadow: 0 2px 5px #0001;
  color: var(--gold);
}
label {
  font-size: 14px;
  color: var(--muted);
}
textarea {
  width: 100%;
  height: 214px;
  resize: vertical;
  display: block;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--ink);
  padding: 13px 15px;
  line-height: 1.72;
  font-size: 14px;
}
input:not([type="checkbox"]):not([type="range"]) {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  margin-top: 8px;
}
.entrymeta {
  flex-wrap: wrap;
  gap: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding-top: 4px;
}
.entry-actions { display: flex; align-items: center; gap: 16px; }
.entry-actions #shuffleEntries { font-size: 14px; min-height: 40px; padding: 6px 8px; }
.entrymeta button {
  font-size: 11px;
  border: 0;
  padding: 6px 0;
}
.entries-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.entries-label-row button {
  padding: 8px 11px;
  border-color: #f0ca7766;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pooltools {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
}
.pooltools button {
  font-size: 11px;
  padding: 8px 6px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.switchrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  margin: 20px 0 0;
}
.switchrow small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.switchrow input {
  appearance: none;
  flex: 0 0 32px;
  height: 19px;
  border-radius: 20px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  margin: 0;
}
.switchrow input:before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s;
}
.switchrow input:checked {
  background: var(--gold);
}
.switchrow input:checked:before {
  transform: translateX(13px);
  background: var(--buttonink);
}
.settingsheading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 19px;
}
.settingsheading span {
  color: var(--muted);
}
.durationlabel {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.durationlabel output {
  color: var(--gold);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  margin: 15px 0 6px;
}
.rangecaptions {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}
.localnote {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  margin: 26px 0 0;
}
.rangeinputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.sectionheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 16px;
  gap: 12px;
}
.sectionheading > span {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
.modegrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.modecard {
  text-align: left;
  padding: 15px 14px;
  background: var(--panel);
  border-radius: 12px;
  min-width: 0;
  position: relative;
}
.modecard[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(135deg, #edc76d12, transparent), var(--panel);
}
.modecard[aria-pressed="true"]:after {
  content: "✓";
  position: absolute;
  right: 11px;
  top: 10px;
  color: var(--gold);
  font-size: 12px;
}
.modeicon {
  font-size: 29px;
  height: 43px;
  display: block;
  color: var(--accent);
  font-family: system-ui;
}
.modecard strong {
  font-size: 13px;
  display: block;
}
.modecard small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  margin-top: 6px;
}
.history {
  margin-top: 27px;
}
.history .sectionheading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  margin-bottom: 0;
}
.sectionheading button {
  border: 0;
  font-size: 12px;
  color: var(--muted);
  padding: 5px;
}
.sectionheading h2 span {
  font: 400 12px "DM Sans";
  color: var(--muted);
  margin-left: 8px;
}
.emptyhistory {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 25px;
}
.historyrow {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px 5px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.historyrow span {
  color: var(--muted);
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 27px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 25px;
}
footer .brand {
  font-size: 20px;
  color: var(--muted);
}
footer p,
footer button {
  font-size: 11px;
  color: var(--muted);
}
footer button {
  border: 0;
}
#fairness {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 800px;
  padding-top: 20px;
}
#duplicates {
  background: #f0ca7710;
  border: 1px solid #f0ca7755;
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
  font-size: 12px;
}
#duplicates p {
  margin: 0 0 7px;
}
#duplicates button {
  font-size: 11px;
  padding: 5px;
}
#participantPanel {
  margin-top: 15px;
}
#participantResults {
  font-size: 12px;
  max-height: 150px;
  overflow: auto;
  color: var(--muted);
  padding: 8px 0;
  line-height: 1.8;
}
body.present header,
body.present .pageheading,
body.present .setup,
body.present .modes,
body.present .history,
body.present footer {
  display: none;
}
body.present .workspace {
  display: block;
  max-width: 950px;
  margin: auto;
}
body.present main {
  padding-top: 12px;
}
body.present .canvaswrap {
  max-width: 620px;
}
body.present #exitPresentation {
  position: fixed;
  right: 15px;
  top: 15px;
  z-index: 5;
  background: var(--panel);
}
@media (min-width: 1450px) {
  main {
    padding-top: 45px;
  }
  .canvaswrap {
    max-width: 600px;
  }
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 15px;
  }
  .setup {
    padding: 20px;
  }
  .modegrid {
    grid-template-columns: repeat(3, 1fr);
  }
  .brandtag {
    display: none;
  }
  .secure {
    font-size: 11px;
    margin-right: 0;
  }
  .stagehead {
    padding: 20px 18px;
  }
  .stagefoot {
    padding: 10px 15px;
  }
  .stagefoot > span {
    font-size: 10px;
  }
}
@media (max-width: 720px) {
  header {
    height: 68px;
    padding: 0 18px;
  }
  .secure {
    display: none;
  }
  main {
    padding: 25px 14px;
  }
  .pageheading {
    margin-bottom: 22px;
  }
  .pageheading > p {
    display: none;
  }
  .eyebrow {
    font-size: 10px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .canvaswrap {
    max-width: 500px;
  }
  .stagehead {
    padding: 17px 14px;
  }
  .stagehead h2 {
    font-size: 15px;
  }
  .pill {
    font-size: 10px;
  }
  .drawbar {
    position: sticky;
    bottom: 8px;
    z-index: 2;
    padding-bottom: 16px;
  }
  .primary {
    min-width: 0;
    flex: 1;
    max-width: 370px;
  }
  .stagefoot {
    font-size: 11px;
  }
  .setup {
    padding: 22px;
  }
  .modegrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .modecard {
    padding: 13px 10px;
  }
  .modecard strong {
    font-size: 12px;
  }
  .modecard small {
    font-size: 10px;
    line-height: 1.4;
  }
  .sectionheading h2 {
    font-size: 15px;
  }
  .sectionheading > span {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .historyrow {
    grid-template-columns: 1fr 1fr;
    font-size: 12px;
  }
  footer {
    flex-wrap: wrap;
    gap: 10px;
  }
  footer p {
    order: 3;
    width: 100%;
    line-height: 1.5;
  }
  #skip {
    font-size: 12px;
    padding: 10px;
  }
  .result strong {
    font-size: 27px;
  }
}

/* Social comment importer */
.comment-importer {
  width: min(760px, calc(100% - 24px));
  max-height: min(880px, calc(100dvh - 24px));
  padding: 0;
  border: 1px solid #f0ca7755;
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 100px #000b;
  overflow: hidden;
}
.comment-importer::backdrop {
  background: #05070bc9;
  backdrop-filter: blur(7px);
}
.importer-shell {
  max-height: min(880px, calc(100dvh - 24px));
  overflow-y: auto;
}
.importer-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px 15px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(12px);
}
.importer-header h2,
.analysis-heading h3,
.importer-section-heading h3 {
  margin: 4px 0 0;
  color: var(--ink);
}
.importer-header h2 {
  font-size: clamp(20px, 4vw, 27px);
}
.importer-kicker {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}
.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}
.importer-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.importer-label {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}
.importer-help {
  margin: 6px 0 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.comment-paste {
  min-height: 150px;
  height: 22vh;
  max-height: 230px;
  margin-top: 0;
  font-size: 16px;
}
.importer-section-heading,
.analysis-heading,
.review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.importer-section-heading {
  margin-bottom: 15px;
}
.importer-section-heading h3,
.analysis-heading h3 {
  font-size: 18px;
}
.importer-section-heading > span,
.review-toolbar span {
  color: var(--muted);
  font-size: 12px;
}
.entry-rule {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.entry-rule legend {
  padding: 0;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.entry-rule-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.entry-choice,
.simple-rules label,
.rule-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.entry-choice {
  min-height: 65px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.entry-choice:has(input:checked) {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, var(--field));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent);
}
.entry-choice span,
.rule-toggle span {
  min-width: 0;
}
.entry-choice strong,
.rule-toggle strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}
.entry-choice small,
.rule-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.entry-choice input[type="radio"],
.simple-rules input,
.rule-with-input input[type="checkbox"] {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
}
.rule-with-input {
  display: grid;
  grid-template-columns: minmax(185px, 0.8fr) minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  margin: 9px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.rule-with-input input:not([type="checkbox"]):not([type="range"]) {
  margin: 0;
  font-size: 16px;
}
.mention-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.mention-count input:not([type="checkbox"]):not([type="range"]) {
  width: 70px;
}
.simple-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 10px 2px 14px;
}
.importer-primary {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-weight: 850;
}
.importer-error {
  margin: 10px 0 0;
  color: #f19a8d;
  font-size: 13px;
}
.importer-error:empty {
  display: none;
}
.analysis-section {
  background: linear-gradient(145deg, #f0ca770d, transparent 45%);
}
#qualifiedBadge {
  padding: 8px 11px;
  border: 1px solid #f0ca7766;
  border-radius: 999px;
  color: var(--gold);
  font-size: 12px;
}
.analysis-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 17px 0;
}
.analysis-summary div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.analysis-summary strong {
  color: var(--ink);
  font-size: 20px;
}
.analysis-summary span {
  color: var(--muted);
  font-size: 12px;
}
.review-alert {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #e8b96788;
  border-radius: 9px;
  background: #e8b96712;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}
.analysis-actions {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 10px;
}
.analysis-actions button {
  min-height: 46px;
  font-weight: 800;
}
.comment-review {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.review-toolbar {
  margin-bottom: 11px;
}
#commentReviewRows {
  display: grid;
  gap: 9px;
}
.review-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid #859c77;
  border-radius: 10px;
  background: var(--field);
}
.review-row.status-review {
  border-left-color: #e8b967;
}
.review-row.status-disqualified,
.review-row.status-removed {
  border-left-color: #dc796a;
  opacity: 0.82;
}
.review-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.review-row-top input:not([type="checkbox"]):not([type="range"]) {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}
.review-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.comment-excerpt,
.review-reason {
  margin: 9px 1px 0;
  line-height: 1.4;
}
.comment-excerpt {
  color: var(--muted);
  font-size: 13px;
}
.review-reason {
  color: #e5b964;
  font-size: 12px;
}
.review-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.review-row-actions button {
  padding: 7px 10px;
  font-size: 12px;
}
.review-row-actions .include-entry {
  border-color: #f0ca7788;
  color: var(--gold);
}

@media (max-width: 560px) {
  .comment-importer {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }
  .importer-shell {
    max-height: 100dvh;
  }
  .importer-header,
  .importer-section {
    padding-left: 17px;
    padding-right: 17px;
  }
  .comment-paste {
    min-height: 165px;
    height: 23vh;
  }
  .entry-rule-options {
    grid-template-columns: 1fr;
  }
  .rule-with-input {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .analysis-summary {
    grid-template-columns: 1fr;
  }
  .analysis-actions {
    grid-template-columns: 1fr;
  }
  .entries-label-row {
    align-items: flex-end;
  }
  .review-row-top {
    grid-template-columns: 1fr;
  }
  .review-chip {
    justify-self: start;
  }
}

/* Wheel workspace: controls and information frame the wheel on desktop. */
@media (min-width: 1101px) {
  main {
    max-width: 1680px;
    padding-left: 22px;
    padding-right: 22px;
  }
  .workspace {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .workspace > .setup {
    grid-column: 1;
    grid-row: 1;
  }
  .workspace > .stagepanel {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(245px, 285px);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    min-width: 0;
  }
  .stagepanel > .stagehead,
  .stagepanel > .giveaway-title,
  .stagepanel > .canvaswrap,
  .stagepanel > #pointerReadout {
    grid-column: 1;
  }
  .stagepanel > .stagehead { grid-row: 1; }
  .stagepanel > .giveaway-title { grid-row: 2; }
  .stagepanel > .canvaswrap { grid-row: 3; }
  .stagepanel > #pointerReadout { grid-row: 4; }
  .stagepanel > .wheel-details {
    grid-column: 2;
    grid-row: 1 / 5;
  }
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    height: clamp(590px, calc(100vh - 185px), 850px);
  }
}

.wheel-details {
  min-width: 0;
  padding: 22px 18px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--soft) 48%, transparent), transparent 34%);
}
.wheel-details .result {
  margin: 0;
  min-height: 112px;
  padding: 19px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.wheel-details .result strong {
  font-size: clamp(20px, 2vw, 28px);
  overflow-wrap: normal;
  word-break: normal;
}
.wheel-details .presentation-note {
  margin: 16px 2px;
  text-align: left;
  line-height: 1.55;
}
.wheel-details > .drawbar {
  margin: 16px 0;
}
.wheel-details > .drawbar #draw {
  width: 100%;
}
.wheel-details .stagefoot {
  margin-top: 16px;
  padding: 14px 0 0;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.wheel-details .history {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.wheel-details .history .sectionheading {
  margin: 0 0 12px;
  align-items: center;
}
.wheel-details .history .sectionheading h2 {
  font-size: 15px;
}
.wheel-details .history .sectionheading button {
  padding: 7px 9px;
  font-size: 11px;
}
.wheel-details #historyRows {
  max-height: 315px;
  overflow: auto;
}

/* Keep both wheel adjustments genuinely vertical in the left rail. */
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 245px;
  margin-bottom: 20px;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .wheel-setting {
  display: grid;
  grid-template-columns: 28px auto;
  grid-template-rows: 52px 165px;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .durationlabel {
  grid-column: 1 / 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  text-align: center;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) input[type="range"] {
  grid-column: 1;
  grid-row: 2;
  writing-mode: vertical-rl;
  direction: rtl;
  width: 24px;
  height: 155px;
  margin: 0;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .rangecaptions {
  grid-column: 2;
  grid-row: 2;
  height: 149px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .wheel-details {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.raffle {
  margin-top: 32px;
}
.rafflebody {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 45px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 28px;
  border-radius: 15px;
}
.rafflefields {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 12px;
  margin: 15px 0;
}
.rafflebody .primary {
  font-size: 14px;
  padding: 12px 18px;
  min-width: 0;
}
.rafflebody .hint {
  font-size: 12px;
  margin-bottom: 0;
}
.ticketpreview {
  align-self: center;
  border: 1px solid #c8a35e;
  border-radius: 14px;
  background: linear-gradient(120deg, #fff1cc, #edcf88);
  color: #453414;
  padding: 27px;
  box-shadow: 0 15px 30px #0002;
  transform: rotate(-2deg);
}
.ticketpreview > span {
  font-size: 11px;
  letter-spacing: 2px;
}
.ticketpreview h3 {
  font:
    800 27px Manrope,
    sans-serif;
  margin: 22px 0 13px;
  overflow-wrap: anywhere;
}
.ticketpreview p {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.ticketbottom {
  border-top: 1px dashed #a07d3c;
  margin-top: 28px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ticketbottom span {
  font-size: 9px;
  letter-spacing: 1px;
}
.raffleactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}
.raffleactions strong {
  font-size: 13px;
  margin-right: auto;
}
.raffleactions button {
  font-size: 12px;
}
.ticketrow {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  padding: 11px 0;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#raffleMessage {
  color: var(--gold);
  font-size: 13px;
}
body.present .raffle {
  display: none;
}
@media (max-width: 720px) {
  .rafflebody {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 20px;
  }
  .ticketpreview {
    margin: 5px;
  }
  .ticketrow {
    grid-template-columns: 80px 1fr 1fr;
    font-size: 12px;
  }
  .raffleactions strong {
    width: 100%;
  }
}
/* Keep interactive labels readable at all viewport sizes. */
.tabs button,
.modecard strong,
.switchrow,
.durationlabel,
.pooltools button,
.entrymeta button,
.raffleactions button {
  font-size: 14px;
}
.entrymeta,
.rangecaptions,
.localnote,
.switchrow small,
.modecard small,
.stagefoot,
.stagefoot button {
  font-size: 12px;
}
.tabs button {
  padding: 9px 4px;
}
.pooltools {
  flex-wrap: wrap;
}
.pooltools button {
  flex: 1;
}
.modecard {
  min-height: 125px;
}
.ticketbottom span {
  font-size: 11px;
}
@media (max-width: 720px) {
  .modecard strong {
    font-size: 14px;
  }
  .modecard small {
    font-size: 12px;
  }
  .modecard {
    padding: 13px 8px;
  }
  .stagefoot > span {
    font-size: 12px;
  }
  .stagefoot {
    align-items: flex-start;
  }
  .stagefoot button {
    white-space: nowrap;
  }
  .brand {
    font-size: 25px;
  }
}
.sectiontabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 24px;
  padding-bottom: 10px;
}
.sectiontabs button {
  font-size: 15px;
  padding: 11px 20px;
  border-color: transparent;
}
.sectiontabs button[aria-selected="true"] {
  color: var(--gold);
  background: var(--panel);
  border-color: var(--line);
  font-weight: 700;
}
.sectiontabs .locked-tab:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--line);
  border-style: dashed;
  background: color-mix(in srgb, var(--panel), transparent 45%);
}
#rafflePanel .raffle {
  margin-top: 0;
}
#rafflePanel .sectionheading {
  margin-top: 0;
}
body.present .sectiontabs {
  display: none;
}
.pageheading h1 {
  margin-top: 0;
}
@media (max-width: 720px) {
  .sectiontabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sectiontabs button {
    padding: 11px 8px;
    font-size: 14px;
  }
}
/* The wheel is a stationary studio assembly; only its rotor and pointer move. */
#wheelStudio {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 48% 42%, #64748b22, transparent 67%);
}
#wheelStudio > canvas {
  position: relative;
  z-index: 1;
}
.wheel-bees {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  transform: rotate(var(--wheel-angle, 0deg));
  transform-origin: 50% 45.55%;
}
.wheel-bee {
  position: absolute;
  left: var(--bee-left);
  top: var(--bee-top);
  font-size: clamp(15px, 2.4vw, 25px);
  line-height: 1;
  filter: drop-shadow(0 2px 2px #0008);
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) rotate(var(--bee-rotation)) scale(0.94);
}
.wheel-bees.bees-away .wheel-bee {
  animation: bee-fly-away 1.15s cubic-bezier(0.4, 0, 0.8, 0.25)
    var(--scatter-delay) forwards;
}
@keyframes bee-fly-away {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--bee-rotation)) scale(0.94); }
  35% { opacity: 1; transform: translate(-42px, var(--scatter-bend)) rotate(-24deg) scale(1); }
  100% { opacity: 0; transform: translate(245px, var(--scatter-y)) rotate(22deg) scale(0.72); }
}
@media (prefers-reduced-motion: reduce) {
  .wheel-bee { animation: none; }
  .wheel-bees.bees-away .wheel-bee { animation: none; opacity: 0; }
}
.canvaswrap:has(#wheelStudio:not([hidden])) {
  max-width: 760px;
  aspect-ratio: 1.12;
  margin: -10px auto 0;
  width: 100%;
}
#pointerReadout {
  text-align: center;
  padding: 0 22px 16px;
  min-height: 65px;
}
#pointerReadout span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1.3px;
  margin-bottom: 5px;
}
#pointerReadout strong {
  font-size: 16px;
  overflow-wrap: anywhere;
  display: block;
}
#removeSelected {
  margin-left: 8px;
}
.result > span {
  font-size: 12px;
}
.result strong {
  font-size: clamp(24px, 3vw, 34px);
}
@media (min-width: 1000px) {
  main {
    padding-top: 24px;
  }
  .pageheading {
    margin-bottom: 18px;
  }
  .stagehead {
    padding-bottom: 12px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    max-height: 570px;
  }
  .stagepanel:has(#wheelStudio:not([hidden])) .presentation-note {
    margin-bottom: 14px;
  }
}
@media (max-width: 720px) {
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    aspect-ratio: 1.04;
  }
  .drawbar {
    flex-wrap: wrap;
  }
  #pointerReadout {
    padding-bottom: 12px;
  }
  .stagepanel .result {
    min-height: 65px;
  }
  .stagehead {
    gap: 6px;
  }
  .pill {
    white-space: normal;
    text-align: right;
  }
  .canvaswrap {
    width: 100%;
  }
}
.canvaswrap:has(#wheelStudio:not([hidden])) {
  aspect-ratio: 1;
  max-width: 760px;
  max-height: none;
}
.stagepanel:has(#wheelStudio:not([hidden])) .canvaswrap {
  background: #dcecf4;
}
@media (max-width: 720px) {
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    aspect-ratio: 1;
  }
}
.draw-compact {
  display: none;
}
.canvaswrap:has(#wheelStudio:not([hidden])) {
  aspect-ratio: 1.22;
  max-width: 860px;
  isolation: isolate;
}
.canvaswrap > #wheelSpeedControls {
  position: absolute;
  z-index: 6;
  left: 8px;
  top: 12%;
  height: 72%;
  width: 82px;
  display: flex;
  justify-content: space-evenly;
  gap: 4px;
  padding: 9px 5px;
  border: 1px solid #e8c88788;
  border-radius: 13px;
  background: #17130dbf;
  box-shadow: 0 7px 24px #0005;
  backdrop-filter: blur(5px);
}
.canvaswrap > #wheelSpeedControls .wheel-setting {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 31px;
}
.canvaswrap > #wheelSpeedControls .durationlabel {
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  color: #fff4d5;
  font-size: 10px;
  white-space: nowrap;
}
.canvaswrap > #wheelSpeedControls .durationlabel output {
  font-size: 9px;
  color: #f0ca77;
}
.canvaswrap > #wheelSpeedControls input[type="range"] {
  writing-mode: vertical-rl;
  direction: rtl;
  width: 24px;
  height: calc(100% - 48px);
  margin: 0;
  accent-color: #e2aa43;
}
.canvaswrap > #wheelSpeedControls .rangecaptions {
  display: none;
}
.canvaswrap > #drawbar {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 45.55556%;
  width: auto;
  height: auto;
  padding: 0;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.canvaswrap > #drawbar #draw {
  pointer-events: auto;
  min-width: 0;
  width: clamp(68px, 13%, 106px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  border: 3px solid #684319;
  background: radial-gradient(
    circle at 35% 28%,
    #fff0a5 0,
    #d7a03e 30%,
    #9b641f 74%,
    #533013 100%
  );
  box-shadow:
    inset 0 2px 4px #fff9,
    inset 0 -6px 9px #4e2a1399,
    0 5px 12px #21110788;
  color: #2b190b;
  font-size: 14px;
  letter-spacing: 1px;
}
.canvaswrap > #drawbar #draw:hover:not(:disabled) {
  background: radial-gradient(
    circle at 35% 28%,
    #fff5b9 0,
    #e3ad4a 32%,
    #a66d25 76%,
    #593415 100%
  );
}
.canvaswrap > #drawbar .draw-full {
  display: none;
}
.canvaswrap > #drawbar .draw-compact {
  display: block;
}
.canvaswrap > #drawbar #skip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  white-space: nowrap;
  background: #17130ddd;
  color: #fff4d5;
  border-color: #d4aa5e;
}
.canvaswrap > #drawbar #skip:active {
  transform: translateX(-50%) translateY(1px);
}
@media (max-width: 720px) {
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    aspect-ratio: 1.08;
  }
  .canvaswrap > #wheelSpeedControls {
    left: 5px;
    top: 13%;
    height: 68%;
    width: 66px;
    padding: 7px 3px;
  }
  .canvaswrap > #wheelSpeedControls .durationlabel {
    height: 42px;
    font-size: 9px;
  }
  .canvaswrap > #wheelSpeedControls .durationlabel output {
    font-size: 8px;
  }
  .canvaswrap > #wheelSpeedControls input[type="range"] {
    width: 20px;
    height: calc(100% - 42px);
  }
  .canvaswrap > #drawbar #draw {
    width: clamp(54px, 14vw, 74px);
    font-size: 11px;
    border-width: 2px;
  }
  .canvaswrap > .drawbar {
    position: absolute;
    bottom: auto;
    padding: 0;
  }
}
.canvaswrap > #drawbar #draw {
  width: clamp(68px, 10vw, 106px);
}
@media (max-width: 720px) {
  .canvaswrap > #drawbar #draw {
    width: clamp(54px, 14vw, 74px);
  }
}
.canvaswrap > #wheelSpeedControls {
  width: 96px;
  gap: 6px;
  padding: 10px 6px;
}
.canvaswrap > #wheelSpeedControls .wheel-setting {
  width: 38px;
  min-width: 38px;
}
.canvaswrap > #wheelSpeedControls .durationlabel {
  width: 100%;
  height: 54px;
  gap: 5px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
}
.canvaswrap > #wheelSpeedControls .durationlabel span {
  font-size: 9px;
}
.canvaswrap > #wheelSpeedControls .durationlabel output {
  max-width: 38px;
  white-space: normal;
  line-height: 1.05;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9px;
}
@media (max-width: 720px) {
  .canvaswrap > #wheelSpeedControls {
    width: 72px;
    gap: 2px;
    padding: 7px 3px;
  }
  .canvaswrap > #wheelSpeedControls .wheel-setting {
    width: 31px;
    min-width: 31px;
  }
  .canvaswrap > #wheelSpeedControls .durationlabel {
    height: 46px;
  }
  .canvaswrap > #wheelSpeedControls .durationlabel span {
    font-size: 8px;
  }
  .canvaswrap > #wheelSpeedControls .durationlabel output {
    max-width: 31px;
    font-size: 8px;
  }
}

/* Header navigation and compact music controls. */
header {
  height: auto;
  display: block;
}
.headerbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.headerbar .head-actions {
  gap: 12px;
}
.music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.music-controls button {
  color: var(--ink);
  min-width: 112px;
  font-size: 14px;
  padding: 8px 11px;
}
.music-controls input {
  width: 76px;
  min-height: 30px;
  accent-color: var(--gold);
}
#music-status:empty {
  display: none;
}
#music-status {
  font-size: 12px;
}
.headerbar + .sectiontabs {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 0;
}
.headerbar + .sectiontabs button {
  padding-top: 9px;
  padding-bottom: 9px;
}
main {
  padding-top: 24px;
}
@media (max-width: 720px) {
  header {
    height: auto;
    padding: 0 18px;
  }
  .headerbar {
    min-height: 68px;
  }
  .headerbar .head-actions {
    gap: 6px;
  }
  .music-controls label,
  .music-controls input {
    display: none;
  }
  .music-controls button {
    min-width: 0;
    padding: 7px 9px;
    font-size: 13px;
  }
  .headerbar + .sectiontabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: 10px;
  }
  main {
    padding-top: 18px;
  }
}
@media (max-width: 440px) {
  .headerbar .brandmark {
    margin-right: 6px;
  }
  .headerbar .brand {
    font-size: 22px;
  }
  .head-actions > button {
    font-size: 19px;
    padding: 4px 8px;
  }
}

/* Temporarily reduced mode lineup. */
.modegrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
}
.modecard[data-locked="true"] {
  opacity: 0.58;
  background: var(--field);
  border-style: dashed;
  cursor: not-allowed;
}
.modecard[data-locked="true"] .modeicon {
  filter: grayscale(1);
  font-size: 24px;
}
@media (max-width: 560px) {
  .modegrid {
    grid-template-columns: 1fr;
  }
  .modecard {
    min-height: 0;
  }
}

/* Final layout authority for the wheel workspace. */
@media (min-width: 1101px) {
  main { max-width: 1680px; }
  .workspace {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .workspace > .setup { grid-column: 1; grid-row: 1; width: 100%; }
  .workspace > .stagepanel {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(245px, 285px);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .stagepanel > .stagehead,
  .stagepanel > .giveaway-title,
  .stagepanel > .canvaswrap,
  .stagepanel > #pointerReadout { grid-column: 1; }
  .stagepanel > .stagehead { grid-row: 1; }
  .stagepanel > .giveaway-title { grid-row: 2; }
  .stagepanel > .canvaswrap { grid-row: 3; }
  .stagepanel > #pointerReadout { grid-row: 4; }
  .stagepanel > .wheel-details { grid-column: 2; grid-row: 1 / 5; }
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    height: clamp(590px, calc(100vh - 185px), 850px);
  }
}

#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 245px;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .wheel-setting {
  display: grid;
  grid-template-columns: 28px auto;
  grid-template-rows: 52px 165px;
  justify-content: center;
  align-items: center;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .durationlabel {
  grid-column: 1 / 3;
  grid-row: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) input[type="range"] {
  grid-column: 1;
  grid-row: 2;
  writing-mode: vertical-rl;
  direction: rtl;
  width: 24px;
  height: 155px;
  margin: 0;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .rangecaptions {
  grid-column: 2;
  grid-row: 2;
  height: 149px;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 0;
}

/* The marble machine reveals a pre-shuffled, complete finishing order. */
.canvaswrap:has(#marbleStudio:not([hidden])) {
  max-width: 820px;
  aspect-ratio: 4 / 3;
  margin: 0 auto 4px;
  width: 100%;
}
#marbleStudio {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #17202b;
  box-shadow:
    inset 0 0 0 1px #f0ca7738,
    0 18px 45px #05080d66;
}
#marbleStudio canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#marbleResults {
  margin: 4px 22px 18px;
  border: 1px solid #f0ca7755;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0ca7714, transparent 45%), var(--field);
  overflow: hidden;
}
.marble-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}
.marble-results-head > div:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.marble-results-head span,
.runs-dialog-head span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 5px;
}
.marble-results-head h3 {
  font: 800 19px Manrope, sans-serif;
  overflow-wrap: anywhere;
}
.marble-results-head button {
  padding: 8px 10px;
  font-size: 12px;
}
#marbleStandings {
  list-style: none;
  margin: 0;
  padding: 6px 18px 13px;
  max-height: 390px;
  overflow: auto;
}
#marbleStandings li {
  display: grid;
  grid-template-columns: 34px 21px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
#marbleStandings li:last-child { border-bottom: 0; }
#marbleStandings li > strong {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
#marbleStandings li > small { font-size: 11px; color: var(--muted); }
#marbleStandings .podium { font-weight: 800; }
#marbleStandings .place-1 { color: var(--gold); font-size: 16px; }
#marbleStandings .still-racing { opacity: 0.54; }
.marble-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 27%, #fff 0 7%, var(--marble-color) 32%, color-mix(in srgb, var(--marble-color), #000 34%) 100%);
  box-shadow: inset -2px -3px 5px #0005, 0 1px 4px #0006;
  border: 1px solid #fff6;
}
#runsDialog {
  width: min(650px, calc(100% - 28px));
  max-height: min(760px, calc(100% - 28px));
  padding: 0;
  border: 1px solid #f0ca7777;
  border-radius: 17px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 100px #000c;
}
#runsDialog::backdrop { background: #06080ec9; backdrop-filter: blur(6px); }
.runs-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.runs-dialog-head h2 { font-size: 22px; }
#runsList { padding: 12px 22px 24px; }
#runsList details { border-bottom: 1px solid var(--line); padding: 13px 0; }
#runsList summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
#runsList summary span { color: var(--muted); font-size: 12px; text-align: right; }
#runsList ol {
  columns: 2;
  margin: 14px 0 3px;
  padding-left: 28px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}
body.present #marbleResults { max-width: 780px; margin-left: auto; margin-right: auto; }
@media (max-width: 720px) {
  .canvaswrap:has(#marbleStudio:not([hidden])) { aspect-ratio: 4 / 3; }
  #marbleResults { margin: 4px 12px 16px; }
  .marble-results-head { display: block; align-items: flex-start; padding: 14px; }
  .marble-results-head > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-top: 12px;
  }
  #marbleStandings { padding: 4px 12px 11px; max-height: 330px; }
  #marbleStandings li { grid-template-columns: 27px 20px minmax(0, 1fr); font-size: 13px; }
  #marbleStandings li > small { display: none; }
  #runsList ol { columns: 1; }
}

/* Giveaway identity, full-size wheel stage, and unobstructed controls. */
.giveaway-title-editor {
  position: relative;
  padding: 14px;
  margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 8%, transparent), transparent 48%),
    color-mix(in srgb, var(--field) 88%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 5%, transparent),
    0 8px 20px #00000014;
}
.giveaway-title-editor label {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.giveaway-title-editor input {
  margin-top: 8px !important;
  border-color: color-mix(in srgb, var(--gold) 34%, var(--line));
  background: color-mix(in srgb, var(--bg) 72%, var(--field));
  box-shadow: inset 0 2px 5px #0000002b;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.giveaway-title-editor input:focus {
  border-color: var(--gold);
  box-shadow:
    inset 0 2px 5px #0000002b,
    0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent);
}
.giveaway-title-editor small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.giveaway-title {
  position: relative;
  justify-self: center;
  width: fit-content;
  max-width: calc(100% - 48px);
  margin: 8px auto 12px;
  padding: 10px 34px 11px;
  text-align: center;
  color: #fffaf0;
  font:
    750 clamp(17px, 2vw, 24px) "Manrope",
    sans-serif;
  letter-spacing: -0.25px;
  overflow-wrap: anywhere;
  border: 1px solid #d7a8478f;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff0b 0%, transparent 45%),
    linear-gradient(100deg, #5b3b171f, #111722 32%, #151c28 68%, #5b3b171f);
  box-shadow:
    inset 0 1px 0 #fff2c82b,
    inset 0 -1px 0 #00000073,
    0 7px 18px #0000003d,
    0 1px 0 #e5ba5b2e;
  text-shadow: 0 2px 3px #000b;
}
.giveaway-title::before,
.giveaway-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe09a, #9a631d 72%);
  box-shadow: 0 1px 2px #000b, inset 0 1px 1px #fff7;
}
.giveaway-title::before {
  left: 12px;
}
.giveaway-title::after {
  right: 12px;
}
.winner-giveaway-title {
  display: block;
  margin: 4px auto 10px;
  max-width: 28rem;
  color: var(--gold);
  font:
    800 clamp(15px, 2.4vw, 21px) "Manrope",
    sans-serif;
  overflow-wrap: anywhere;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .wheel-setting {
  min-width: 0;
}
#wheelSpeedControls:not(.canvaswrap > #wheelSpeedControls) .durationlabel {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
@media (min-width: 721px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .canvaswrap:has(#wheelStudio:not([hidden])) {
    width: 100%;
    max-width: none;
    max-height: none;
    height: clamp(620px, calc(100vh - 150px), 980px);
    aspect-ratio: auto;
  }
  .setup {
    width: 100%;
  }
}
@media (max-width: 720px) {
  .giveaway-title {
    max-width: calc(100% - 24px);
    margin: 7px auto 10px;
    padding: 9px 27px 10px;
    font-size: 17px;
  }
  .giveaway-title-editor {
    padding: 13px;
    margin-bottom: 17px;
  }
}

/* Quick participant entry and winner celebration. */
.quickadd {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #f0ca7755;
  border-radius: 11px;
  background: linear-gradient(135deg, #f0ca7714, transparent), var(--field);
}
.quickadd > label {
  display: block;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 8px;
}
.quickadd > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.quickadd input:not([type="checkbox"]):not([type="range"]) {
  margin: 0;
}
.quickadd button {
  border-color: #f0ca7788;
  background: var(--gold);
  color: var(--buttonink);
  font-weight: 800;
  white-space: nowrap;
}
.quickadd button:hover:not(:disabled) {
  background: var(--gold);
  filter: brightness(1.07);
}
#addNameStatus {
  min-height: 17px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.winner-banner {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #06080ebf;
  backdrop-filter: blur(9px);
}
.winner-card {
  position: relative;
  width: min(620px, 100%);
  padding: clamp(34px, 7vw, 68px) 28px 30px;
  text-align: center;
  border: 2px solid #f0ca77;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0, #f0ca7730, transparent 48%), var(--panel);
  box-shadow:
    0 24px 90px #000b,
    0 0 45px #f0ca7733;
  animation: winner-pop 0.4s cubic-bezier(0.2, 0.9, 0.2, 1.1);
}
.winner-spark {
  display: block;
  color: var(--gold);
  font-size: 52px;
  line-height: 1;
  margin-bottom: 18px;
  text-shadow: 0 0 24px #f0ca77;
}
.winner-card p {
  margin: 0 auto 28px;
  font:
    800 clamp(29px, 6vw, 54px) / 1.08 "Manrope",
    sans-serif;
  letter-spacing: -1.8px;
  overflow-wrap: anywhere;
}
.winner-won {
  display: block;
  margin-top: 12px;
  color: var(--gold);
  font-size: clamp(21px, 3.5vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.winner-card button {
  min-width: 170px;
  background: var(--gold);
  color: var(--buttonink);
  border: 0;
  font-weight: 800;
  font-size: 16px;
  padding: 14px 26px;
}
@keyframes winner-pop {
  from {
    opacity: 0;
    transform: scale(0.86) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@media (max-width: 560px) {
  .quickadd > div {
    grid-template-columns: 1fr;
  }
  .quickadd button {
    width: 100%;
  }
  .winner-card {
    padding: 38px 20px 24px;
  }
  .winner-card p {
    letter-spacing: -1px;
  }
}
