/* The Quiet Achiever — Wheel of Names */

@font-face {
  font-family: "Literata";
  src: url("/fonts/Literata-Variable.ttf") format("truetype-variations"),
       url("/fonts/Literata-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Basier Circle";
  src: url("/fonts/BasierCircle-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Basier Circle";
  src: url("/fonts/BasierCircle-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Basier Circle";
  src: url("/fonts/BasierCircle-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Basier Circle";
  src: url("/fonts/BasierCircle-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --tqa-ember: #d54a2f;
  --tqa-ember-deep: #8a2a1c;
  --tqa-sunrise: #e5a402;
  --tqa-sunrise-soft: #f5c84b;
  --tqa-ink: #2b2b52;
  --tqa-ink-deep: #1a1a3a;
  --tqa-paper: #f5f0d3;
  --tqa-paper-soft: #faf6e1;
  --tqa-charcoal: #1e1e1e;
  --neutral-200: #e8e1be;
  --neutral-500: #8a8572;
  --neutral-700: #4a4638;

  --font-display: "Literata", ui-serif, Georgia, serif;
  --font-sans: "Basier Circle", ui-sans-serif, system-ui, sans-serif;
  --font-reading: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;
  --radius: 4px;
}

/* ---------- Ember Deep (only theme) ---------- */
:root,
[data-theme="ember"] {
  --bg: var(--tqa-ember-deep);
  --bg-alt: #6b2116;
  --panel: rgba(0, 0, 0, 0.18);
  --panel-border: rgba(245, 200, 75, 0.22);
  --text: var(--tqa-paper);
  --text-body: rgba(245, 240, 211, 0.88);
  --text-muted: rgba(245, 240, 211, 0.68);
  --heading: var(--tqa-paper);
  --accent: var(--tqa-sunrise-soft);
  --accent-hover: var(--tqa-sunrise);
  --accent-soft: rgba(245, 200, 75, 0.18);
  --secondary: var(--tqa-paper);
  --highlight: var(--tqa-sunrise);
  --rim: var(--tqa-sunrise-soft);
  --rim-edge: var(--tqa-paper);
  --pointer: var(--tqa-sunrise-soft);
  --hub-bg: var(--tqa-paper);
  --hub-fg: var(--tqa-ember-deep);
  --hub-ring: var(--tqa-sunrise);
  --input-bg: rgba(0, 0, 0, 0.22);
  --input-border: rgba(245, 200, 75, 0.28);
  --danger: #ffb4a8;
  --result-bg: var(--tqa-ink-deep);
  --result-fg: var(--tqa-paper);
  --result-accent: var(--tqa-sunrise-soft);
  --count-bg: var(--tqa-sunrise-soft);
  --count-fg: var(--tqa-ember-deep);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --wheel-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --peg: var(--tqa-paper);
  --label-stroke: rgba(26, 26, 58, 0.5);
  --label-fill: #ffffff;
  --empty-wedge: var(--tqa-ink);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--bg);
  overflow-x: hidden;
}

::selection {
  background: var(--tqa-sunrise);
  color: var(--tqa-ink);
}

.studio {
  position: relative;
  min-height: 100vh;
  padding: 1.25rem 1.5rem 2.5rem;
  background: var(--bg);
}

.masthead {
  text-align: center;
  margin-bottom: 1.5rem;
  /* Keep title clear of the top-right QR card */
  padding-inline: clamp(0px, 14vw, 12.5rem);
}

.masthead-title-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.profile-menu {
  position: relative;
  margin-left: 0.25rem;
}

.profile-menu-btn {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 14%, transparent);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.profile-menu-btn:hover,
.profile-menu-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--paper) 24%, transparent);
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 40;
  min-width: 14rem;
  padding: 0.55rem;
  border-radius: 0.75rem;
  background: var(--paper, #f5f0d3);
  color: #2b1a14;
  border: 1px solid color-mix(in srgb, #2b1a14 12%, transparent);
}

.profile-menu-panel[hidden] {
  display: none;
}

.profile-menu-email {
  margin: 0 0 0.4rem;
  padding: 0.35rem 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: color-mix(in srgb, #2b1a14 70%, transparent);
  word-break: break-all;
}

.profile-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #2b1a14;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.55rem;
  text-decoration: none;
  cursor: pointer;
}

.profile-menu-item:hover {
  background: color-mix(in srgb, #8a2a1c 10%, white);
}


.eyebrow {
  margin: 0 0 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow[hidden],
.tenant-name[hidden],
.tagline[hidden],
.logo[hidden] {
  display: none !important;
}

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--heading);
}

.names-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--tqa-paper);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.names-refresh:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.names-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
}

.names-refresh.is-busy .names-refresh-icon,
.names-refresh.is-updating .names-refresh-icon {
  animation: refresh-spin 0.7s linear infinite;
}

.names-refresh.is-updated {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.names-refresh-icon {
  display: block;
  flex-shrink: 0;
}

.names-refresh-count {
  min-width: 1.5ch;
  font-variant-numeric: tabular-nums;
}

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

.tagline {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
}

.tenant-name {
  margin: 0.35rem 0 0;
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.title-fields {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.title-fields input[type="text"] {
  width: 100%;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 400px);
  gap: 1.25rem;
  max-width: 1500px;
  margin: 0 auto;
  align-items: start;
  transition: grid-template-columns 0.28s ease, gap 0.28s ease, max-width 0.28s ease;
}

.studio.panel-collapsed .stage,
.studio.is-spinning .stage {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 0fr;
  gap: 0;
  max-width: none;
}

.wheel-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

/* Wheel + result banner must fit a 982px-tall screen; grows with taller viewports. */
.wheel-stage {
  position: relative;
  width: min(100%, calc(100vh - 22rem), 980px);
  aspect-ratio: 1;
  filter: drop-shadow(var(--wheel-shadow));
  transition: width 0.28s ease;
}

.studio.panel-collapsed .wheel-stage,
.studio.is-spinning .wheel-stage {
  width: min(100%, calc(100vh - 22rem), 980px);
}

.studio.panel-collapsed .wheel-panel,
.studio.is-spinning .wheel-panel {
  width: 100%;
}

.studio.is-spinning .panel-column {
  visibility: hidden;
  pointer-events: none;
}

.studio.is-spinning .join-cta {
  display: none;
}

/* Sits in the header band (above the wheel) so it never overlaps the canvas. */
.join-cta {
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  z-index: 20;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  /* Wide enough for "Add your name" on one line, narrow enough to clear
     the panel Hide toggle on large screens. Kept short (see .join-qr cap)
     so its bottom edge stays above the Hide toggle at every width. */
  width: 190px;
  padding: 0.5rem 0.6rem 0.45rem;
  text-align: center;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--tqa-paper);
  box-shadow: var(--shadow);
}

/* Capped so the card stays short enough to clear the settings panel. */
.join-qr {
  flex-shrink: 0;
  width: min(100%, 92px);
  height: auto;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) * 0.6);
  background: #fff;
  image-rendering: pixelated;
}

.join-qr[hidden] {
  display: none;
}

.join-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--brand-primary, var(--tqa-ember-deep));
}

.colour-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.colour-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body);
}

.colour-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.colour-field input[type="color"] {
  width: 2.5rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.colour-hex {
  width: 5.75rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.colour-hex:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.colour-hex.is-invalid {
  border-color: #e07070;
}

.join-url {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--tqa-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  word-break: break-all;
}

.join-url:hover {
  color: var(--tqa-ember);
}

@media (max-width: 960px) {
  .masthead {
    padding-inline: 0;
  }

  .join-cta {
    position: static;
    width: min(100%, 200px);
    margin: 0 auto 1rem;
  }

  /* Inline card has no overlap constraint, so the QR can be bigger. */
  .join-qr {
    width: min(100%, 140px);
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .control-panel {
    max-height: none;
  }

  .wheel-stage {
    width: min(100%, calc(100vh - 22rem), 520px);
  }

  .studio.panel-collapsed .wheel-stage {
    width: min(100%, calc(100vh - 22rem), 720px);
  }

  .studio.panel-collapsed .control-panel {
    transform: translateX(100%);
  }
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  width: 42px;
  height: 58px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.pointer-tip {
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 42px solid var(--pointer);
}

.pointer-base {
  width: 28px;
  height: 14px;
  margin: -6px auto 0;
  border-radius: var(--radius);
  background: var(--rim);
  border: 1px solid var(--rim-edge);
}

.hub-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 100px;
  height: 100px;
  margin: 0;
  padding: 0;
  border: 3px solid #fff6d0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  background: var(--tqa-sunrise-soft);
  color: var(--tqa-ember-deep);
  box-shadow:
    0 0 0 5px var(--tqa-sunrise),
    0 0 0 9px rgba(245, 200, 75, 0.35),
    0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hub-spin:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.04);
  filter: brightness(1.06);
}

.hub-spin:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.97);
}

.hub-spin:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hub-spin-label {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tqa-ember-deep);
}

.result-banner {
  width: min(100%, 760px);
  padding: 0.7rem 1.1rem 0.8rem;
  text-align: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease;
}

.result-banner.is-preview {
  border: 2px solid #5eb0e0;
  background: #1e5aa8;
  color: #f5f0d3;
}

.result-banner.is-winner {
  border: 2px solid var(--tqa-sunrise-soft);
  background: #c9920a;
  color: #1a1a3a;
  animation: pop-in 0.45s ease;
  box-shadow:
    0 0 0 4px rgba(245, 200, 75, 0.28),
    var(--shadow);
}

.result-banner[hidden] {
  display: none;
}

.result-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-banner.is-preview .result-label {
  color: #b8ddf5;
}

.result-banner.is-winner .result-label {
  color: #fff6d0;
}

.result-name {
  margin: 0.2rem 0 0.1rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.result-banner.is-preview .result-name {
  color: #ffffff;
}

.result-banner.is-winner .result-name {
  color: #1a1a3a;
}

.result-note {
  margin: 0;
  font-size: 0.85rem;
}

.result-banner.is-preview .result-note,
.result-banner.is-preview .result-meta {
  color: rgba(245, 240, 211, 0.78);
}

.result-banner.is-winner .result-note,
.result-banner.is-winner .result-meta {
  color: rgba(26, 26, 58, 0.78);
}

.result-banner.is-preview .result-links a {
  color: #b8ddf5;
}

.result-banner.is-winner .result-links a {
  color: #1a1a3a;
  font-weight: 700;
}

.panel-column {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.panel-toggle {
  align-self: flex-end;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.panel-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.panel-toggle-icon {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.studio.panel-collapsed .panel-column {
  position: relative;
  z-index: 30;
  width: 0;
  height: 0;
  min-height: 0;
  overflow: visible;
  gap: 0;
}

.studio.panel-collapsed .control-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 92vw);
  max-height: 100vh;
  padding: 1rem;
  background: var(--bg);
  border-left: 1px solid var(--panel-border);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.28);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.studio.panel-collapsed .panel-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  align-self: auto;
  transform: translateY(-50%);
  border-radius: var(--radius) 0 0 var(--radius);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 0.9rem 0.5rem;
  gap: 0.55rem;
}

.studio.panel-collapsed .panel-toggle-icon {
  transform: rotate(135deg);
}

.studio.panel-collapsed .panel-toggle-label {
  letter-spacing: 0.12em;
}

.panel-card {
  padding: 1rem 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--heading);
}

.field-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: var(--count-fg);
  background: var(--count-bg);
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--input-bg);
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.btn-row,
.inline-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.filter-status {
  margin-top: 0.35rem;
}

#nameFilter {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  line-height: 1.35;
  min-height: 3rem;
}

.entry-meta {
  margin-top: 0.15rem;
  font-family: var(--font-reading);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.result-meta {
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--result-fg) 78%, transparent);
}

.result-links a {
  color: var(--result-accent);
  font-weight: 600;
}

.form-grid-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1;
}

.badge-source-signup {
  color: var(--tqa-paper);
  background: var(--tqa-ember);
}

.badge-source-manual {
  color: var(--tqa-paper);
  background: rgba(245, 240, 211, 0.22);
}

.badge-li {
  color: #fff;
  background: #0a66c2;
}

.badge-email {
  color: var(--tqa-ink-deep);
  background: var(--tqa-sunrise);
}

.name-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.name-list li.entry-signup {
  border-left: 3px solid var(--tqa-ember);
  padding-left: 0.45rem;
  background: var(--accent-soft);
}

.name-list li.entry-manual {
  border-left: 3px dashed var(--panel-border);
  padding-left: 0.45rem;
}

.winner-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.winner-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.winner-meta a {
  color: var(--accent);
}

.result-contact {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.9rem;
}

.result-contact a {
  color: var(--result-accent);
  font-weight: 600;
}

.inline-row input {
  flex: 1;
  min-width: 0;
}

.add-one {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-border);
}

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--tqa-ember-deep);
  background: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  color: var(--tqa-ember-deep);
  background: var(--tqa-paper);
}

.btn-secondary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-danger {
  color: var(--tqa-ember-deep);
  background: var(--tqa-sunrise-soft);
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--panel-border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--heading);
  border-color: var(--accent);
}

.btn-block {
  width: 100%;
  margin-top: 0.75rem;
}

.list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.list-header h2 {
  margin: 0;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.list-actions .btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
}

.name-list,
.winner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.name-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
}

.name-list li:last-child {
  border-bottom: none;
}

.name-list label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.name-list input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

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

.delete-one {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.delete-one:hover {
  color: var(--danger);
  background: var(--accent-soft);
}

.winner-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
}

.winner-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  width: 1.6rem;
}

.winner-rank {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--count-fg);
  background: var(--count-bg);
}

.restore-one {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.restore-one:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-soft);
}

.restore-one:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.restore-one svg {
  display: block;
}

.empty-hint {
  margin: 0.35rem 0 0;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.empty-hint[hidden],
.name-list:not(:empty) + .empty-hint,
.winner-list:not(:empty) + .empty-hint {
  display: none;
}

.slider-field {
  margin-bottom: 1rem;
}

.slider-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.slider-top span {
  color: var(--accent);
  letter-spacing: 0.04em;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-hints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.confetti span {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0.2;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 520px) {
  .studio {
    padding: 1rem 0.85rem 2rem;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid-admin {
    grid-template-columns: 1fr;
  }
}

/* --- Cinematic spin ---------------------------------------------------- */
/* While `.is-cinematic` is on (spin start → wheel stop) the page fades to
   black and all non-wheel chrome fades away, except the preview banner that
   tracks the name under the marker; removing the class fades everything back
   to the current brand colours. */

body,
.studio {
  transition: background 1.4s ease;
}

body.is-cinematic,
.studio.is-cinematic {
  background: #000;
}

.studio .masthead,
.studio .join-cta {
  transition: opacity 1.2s ease;
}

.studio.is-cinematic .masthead,
.studio.is-cinematic .join-cta {
  opacity: 0;
  pointer-events: none;
}

/* `.is-spinning` hides these instantly; keep them rendered during the
   cinematic fade so the slow fade-out is visible. */
.studio.is-cinematic.is-spinning .join-cta {
  display: flex;
}

.studio .panel-column {
  transition: opacity 0.45s ease;
}

.studio.is-cinematic .panel-column {
  opacity: 0;
  pointer-events: none;
}

.studio.is-cinematic.is-spinning .panel-column {
  visibility: visible;
}

/* Winner banner must stay readable against the blackout. */
.studio.is-cinematic .result-banner.is-winner {
  opacity: 1;
}
