:root {
  --bg: #262624;
  --surface: #2e2e2c;
  --border: #45403c;
  --text: #f4f3f0;
  --muted: #b0a9a2;
  --accent: #d97757;
  --accent-hover: #e09070;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #3a322e;
  --entries-bg: #1c1a18;
  --btn-bg: #333330;
  --btn-hover-bg: #3d3d3a;
  --btn-primary-border: #d97757;
  --btn-primary-fg: #1a1412;
  --code-color: #e8b8a8;
  --btn-spin-grad-start: #423a36;
  --btn-spin-grad-end: #2e2e2c;
  --btn-spin-hover-start: #4d4540;
  --btn-spin-hover-end: #36322e;
  --wheel-size: min(88vw, 550px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: var(--font);
  --font-entries: var(--font);
  --pointer-outline: #fff0e8;
}

[data-theme="random"] {
  /* Background + menu chrome mirror the Rainbow theme; teal is the accent. */
  --bg: #0a0c12;
  --surface: #141a24;
  --border: #2d3a4d;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #50e2b7;
  --accent-hover: #74ecca;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #1a2440;
  --entries-bg: #0e121c;
  --btn-bg: #222e40;
  --btn-hover-bg: #2a3a50;
  --btn-primary-border: #50e2b7;
  --btn-primary-fg: #0a1624;
  --code-color: #a8c4e8;
  --btn-spin-grad-start: #2a3a52;
  --btn-spin-grad-end: var(--surface);
  --btn-spin-hover-start: #354a68;
  --btn-spin-hover-end: #243044;
  --pointer-outline: #ffffff;
}

[data-theme="rainbow"] {
  --bg: #0a0c12;
  --surface: #141a24;
  --border: #2d3a4d;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #5b9fd4;
  --accent-hover: #7ab3e0;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #1a2440;
  --entries-bg: #0e121c;
  --btn-bg: #222e40;
  --btn-hover-bg: #2a3a50;
  --btn-primary-border: #4a8ec4;
  --btn-primary-fg: #0a1624;
  --code-color: #a8c4e8;
  --btn-spin-grad-start: #2a3a52;
  --btn-spin-grad-end: var(--surface);
  --btn-spin-hover-start: #354a68;
  --btn-spin-hover-end: #243044;
  --pointer-outline: #ffffff;
}

[data-theme="bw"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #3a3a3a;
  --text: #f2f2f2;
  --muted: #8f8f8f;
  --accent: #d8d8d8;
  --accent-hover: #ececec;
  --danger: #9a9a9a;
  --danger-hover: #b0b0b0;
  --bg-gradient-mid: #1c1c1c;
  --entries-bg: #0c0c0c;
  --btn-bg: #1c1c1c;
  --btn-hover-bg: #262626;
  --btn-primary-border: #666666;
  --btn-primary-fg: #0a0a0a;
  --code-color: #c4c4c4;
  --btn-spin-grad-start: #2a2a2a;
  --btn-spin-grad-end: #141414;
  --btn-spin-hover-start: #333333;
  --btn-spin-hover-end: #1a1a1a;
  --pointer-outline: #ffffff;
}

[data-theme="st-patricks"] {
  --bg: #0a1410;
  --surface: #122a1c;
  --border: #2d6b45;
  --text: #e8f8ec;
  --muted: #7ab896;
  --accent: #34d399;
  --accent-hover: #6ee7b7;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #166534;
  --entries-bg: #0d1f14;
  --btn-bg: #1a3d28;
  --btn-hover-bg: #225c38;
  --btn-primary-border: #22c55e;
  --btn-primary-fg: #052e16;
  --code-color: #86efac;
  --btn-spin-grad-start: #1e5a38;
  --btn-spin-grad-end: #122a1c;
  --btn-spin-hover-start: #287a4a;
  --btn-spin-hover-end: #1a3420;
  --pointer-outline: #ecfccb;
}

[data-theme="christmas"] {
  --bg: #0c0a0a;
  --surface: #1a1412;
  --border: #5c3d32;
  --text: #f5ebe8;
  --muted: #c4a89a;
  --accent: #e63946;
  --accent-hover: #ff5c69;
  --danger: #b91c1c;
  --danger-hover: #dc2626;
  --bg-gradient-mid: #7f1d1d;
  --entries-bg: #120e0c;
  --btn-bg: #2a1c18;
  --btn-hover-bg: #3d2a22;
  --btn-primary-border: #c41e3a;
  --btn-primary-fg: #fff8f5;
  --code-color: #fca5a5;
  --btn-spin-grad-start: #5c1f1f;
  --btn-spin-grad-end: #1a1412;
  --btn-spin-hover-start: #7f2929;
  --btn-spin-hover-end: #241a18;
  --pointer-outline: #ffffff;
}

[data-theme="halloween"] {
  --bg: #0a0705;
  --surface: #14100c;
  --border: #5c3d24;
  --text: #fff5eb;
  --muted: #c48356;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --danger: #c2410c;
  --danger-hover: #ea580c;
  --bg-gradient-mid: #3d1500;
  --entries-bg: #0c0a08;
  --btn-bg: #1c1410;
  --btn-hover-bg: #2a1c14;
  --btn-primary-border: #ea580c;
  --btn-primary-fg: #1a0a00;
  --code-color: #fdba74;
  --btn-spin-grad-start: #7c2d12;
  --btn-spin-grad-end: #14100c;
  --btn-spin-hover-start: #c2410c;
  --btn-spin-hover-end: #1a1008;
  --pointer-outline: #ffedd5;
}

[data-theme="july4"] {
  --bg: #0a1628;
  --surface: #132045;
  --border: #2d4a7c;
  --text: #f0f9ff;
  --muted: #93c5fd;
  --accent: #ef4444;
  --accent-hover: #f87171;
  --danger: #b91c1c;
  --danger-hover: #dc2626;
  --bg-gradient-mid: #1e40af;
  --entries-bg: #0c182e;
  --btn-bg: #1e3a5f;
  --btn-hover-bg: #274a7a;
  --btn-primary-border: #3b82f6;
  --btn-primary-fg: #f8fafc;
  --code-color: #bfdbfe;
  --btn-spin-grad-start: #1d4ed8;
  --btn-spin-grad-end: #132045;
  --btn-spin-hover-start: #2563eb;
  --btn-spin-hover-end: #1a2850;
  --pointer-outline: #fef08a;
}

[data-theme="new-years"] {
  --bg: #0a0f1c;
  --surface: #141c2e;
  --border: #3d4a6a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #eabd37;
  --accent-hover: #fcd34d;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #1e3a5f;
  --entries-bg: #0c1018;
  --btn-bg: #1e293b;
  --btn-hover-bg: #293548;
  --btn-primary-border: #ca8a04;
  --btn-primary-fg: #1a1404;
  --code-color: #fde68a;
  --btn-spin-grad-start: #334155;
  --btn-spin-grad-end: #141c2e;
  --btn-spin-hover-start: #475569;
  --btn-spin-hover-end: #1a2235;
  --pointer-outline: #fff1a6;
}

[data-theme="spring"] {
  --bg: #121018;
  --surface: #1e1824;
  --border: #5c3d52;
  --text: #fdf2f8;
  --muted: #d4a5c4;
  --accent: #f472b6;
  --accent-hover: #f9a8d4;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #5b2744;
  --entries-bg: #161018;
  --btn-bg: #2a2030;
  --btn-hover-bg: #3a2c42;
  --btn-primary-border: #ec4899;
  --btn-primary-fg: #1a0a14;
  --code-color: #fbcfe8;
  --btn-spin-grad-start: #4a3048;
  --btn-spin-grad-end: #1e1824;
  --btn-spin-hover-start: #5c3c58;
  --btn-spin-hover-end: #2a2430;
  --pointer-outline: #fce7f3;
}

[data-theme="summer"] {
  --bg: #0a1624;
  --surface: #0f2844;
  --border: #1e5a7a;
  --text: #f0f9ff;
  --muted: #7dd3fc;
  --accent: #fbbf24;
  --accent-hover: #fcd34d;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #0369a1;
  --entries-bg: #0c1e32;
  --btn-bg: #155e75;
  --btn-hover-bg: #0e7490;
  --btn-primary-border: #38bdf8;
  --btn-primary-fg: #0a1624;
  --code-color: #bae6fd;
  --btn-spin-grad-start: #0284c7;
  --btn-spin-grad-end: #0f2844;
  --btn-spin-hover-start: #0ea5e9;
  --btn-spin-hover-end: #164e63;
  --pointer-outline: #fef08a;
}

[data-theme="autumn"] {
  --bg: #1a120c;
  --surface: #261a12;
  --border: #6b4428;
  --text: #fff7ed;
  --muted: #d4a574;
  --accent: #ea580c;
  --accent-hover: #fb923c;
  --danger: #b91c1c;
  --danger-hover: #dc2626;
  --bg-gradient-mid: #7c2d12;
  --entries-bg: #140e0a;
  --btn-bg: #3d2418;
  --btn-hover-bg: #4d2e1c;
  --btn-primary-border: #d97706;
  --btn-primary-fg: #1a0a04;
  --code-color: #fed7aa;
  --btn-spin-grad-start: #9a3412;
  --btn-spin-grad-end: #261a12;
  --btn-spin-hover-start: #c2410c;
  --btn-spin-hover-end: #301c14;
  --pointer-outline: #fef3c7;
}

[data-theme="winter"] {
  --bg: #0c1220;
  --surface: #111c2e;
  --border: #334e68;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --danger: #c45c5c;
  --danger-hover: #d97878;
  --bg-gradient-mid: #1e4976;
  --entries-bg: #0a101c;
  --btn-bg: #1e3a5f;
  --btn-hover-bg: #274a7a;
  --btn-primary-border: #7dd3fc;
  --btn-primary-fg: #0a1624;
  --code-color: #bae6fd;
  --btn-spin-grad-start: #2563eb;
  --btn-spin-grad-end: #111c2e;
  --btn-spin-hover-start: #3b82f6;
  --btn-spin-hover-end: #1e3a5f;
  --pointer-outline: #e0f2fe;
}

[data-theme="90s-retro"] {
  --bg: #05030f;
  --surface: #140a2a;
  --border: #7c3aed;
  --text: #f5e9ff;
  --muted: #a78bda;
  --accent: #d946ef;
  --accent-hover: #e879f9;
  --danger: #f43f5e;
  --danger-hover: #fb7185;
  --bg-gradient-mid: #3b0764;
  --entries-bg: #0c0718;
  --btn-bg: #241340;
  --btn-hover-bg: #351b5e;
  --btn-primary-border: #d946ef;
  --btn-primary-fg: #12061f;
  --code-color: #f0abfc;
  --btn-spin-grad-start: #5b21b6;
  --btn-spin-grad-end: #140a2a;
  --btn-spin-hover-start: #7c3aed;
  --btn-spin-hover-end: #1c1038;
  --pointer-outline: #22d3ee;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-gradient-mid) 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-theme="rainbow"] body,
html[data-theme="random"] body {
  background:
    linear-gradient(
      168deg,
      rgba(239, 68, 68, 0.15) 0%,
      rgba(249, 115, 22, 0.12) 15%,
      rgba(234, 179, 8, 0.11) 30%,
      rgba(34, 197, 94, 0.1) 45%,
      rgba(14, 165, 233, 0.11) 60%,
      rgba(99, 102, 241, 0.12) 75%,
      rgba(236, 72, 153, 0.12) 90%,
      rgba(239, 68, 68, 0.08) 100%
    ),
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-gradient-mid) 0%, var(--bg) 55%);
}

html[data-theme="90s-retro"] body {
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #ffffff 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 84% 12%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 26% 44%, #a5f3fc 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 68% 34%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 44% 66%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 92% 58%, #f0abfc 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 8% 76%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 58% 86%, #ffffff 50%, transparent 50%),
    radial-gradient(1px 1px at 36% 8%, #fde68a 50%, transparent 50%),
    radial-gradient(1px 1px at 76% 72%, #ffffff 50%, transparent 50%),
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--bg-gradient-mid) 0%, var(--bg) 55%);
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat,
    no-repeat;
  background-size: 320px 320px, 380px 380px, 300px 300px, 420px 420px, 260px 260px, 360px 360px,
    340px 340px, 400px 400px, 280px 280px, 300px 300px, cover;
}

.app {
  max-width: 1520px;
  margin: 0 auto;
  padding: 15px 1rem 1rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  align-self: start;
  justify-self: start;
  padding-top: 0.25rem;
  padding-left: 0.5rem;
}

.header {
  text-align: left;
  margin-bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}

.header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-entries);
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.theme-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.theme-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

[data-theme="default"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b0a9a2' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

.theme-select {
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--entries-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b9cb3' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

[data-theme="bw"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238f8f8f' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="st-patricks"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237ab896' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="christmas"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c4a89a' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="halloween"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fb923c' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="july4"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2393c5fd' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="new-years"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="spring"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a5c4' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="summer"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237dd3fc' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="autumn"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4a574' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="winter"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="90s-retro"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a78bda' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

[data-theme="random"] .theme-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b9cb3' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
}

.theme-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icebreaker-row {
  margin-top: 0.5rem;
}

.icebreaker-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.icebreaker-check input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.icebreaker-check:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.wheel-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}

.wheel-quote {
  margin: 1rem auto 0.25rem;
  padding: 0 1rem;
  width: 100%;
  max-width: min(36rem, calc(100vw - 2rem));
  text-align: center;
}

.wheel-quote__blockquote {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  font-size: clamp(0.8rem, 1.7vw, 0.95rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.wheel-quote__text {
  display: inline;
  margin: 0;
}

.wheel-quote__cite {
  display: inline;
  margin-left: 0.4rem;
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}


@media (min-width: 900px) {
  :root {
    --wheel-size: min(calc(100vw - 24rem), 750px);
  }

  .main {
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 1.75rem 2.5rem;
    align-items: start;
  }

  .sidebar {
    padding-left: 1.15rem;
  }

  .wheel-panel {
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: 100%;
    margin-top: -0.7em;
  }

  .sidebar .theme-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    flex-wrap: nowrap;
  }

  .sidebar .theme-label {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .sidebar .theme-select {
    flex: 1;
    min-width: 0;
  }

  .sidebar .theme-row.icebreaker-row {
    width: 100%;
  }
}

.wheel-wrap {
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  max-width: 100%;
  margin-top: -10px;
  transform: translateX(-0.65rem);
}

@media (min-width: 900px) {
  .wheel-wrap {
    transform: translateX(-1.35rem);
  }
}

.pointer-hit {
  position: absolute;
  left: -31px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  margin: 0;
  padding: 22px 25px 22px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 0;
}

.pointer-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.pointer-hit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pointer {
  display: block;
  width: 0;
  height: 0;
  border-top: 58.8px solid transparent;
  border-bottom: 58.8px solid transparent;
  border-left: 92.4px solid var(--text);
  /* Multi-layer outline so the triangle reads clearly on any slice color */
  filter:
    drop-shadow(1px 0 0 var(--pointer-outline))
    drop-shadow(-1px 0 0 var(--pointer-outline))
    drop-shadow(0 1px 0 var(--pointer-outline))
    drop-shadow(0 -1px 0 var(--pointer-outline))
    drop-shadow(1px 1px 0 var(--pointer-outline))
    drop-shadow(-1px -1px 0 var(--pointer-outline))
    drop-shadow(1px -1px 0 var(--pointer-outline))
    drop-shadow(-1px 1px 0 var(--pointer-outline))
    drop-shadow(4px 0 11px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.wheel-frame {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 4px var(--border),
    0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

#wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#wheel-svg text {
  font-family: var(--font);
}

.wheel-center-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 27%;
  min-width: 72px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: linear-gradient(145deg, var(--btn-spin-grad-start), var(--btn-spin-grad-end));
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0.15em;
  pointer-events: none;
  user-select: none;
}

.wheel-center-hub__emoji {
  font-size: clamp(1.75rem, 9vw, 3.25rem);
  line-height: 1;
}

.history {
  width: 100%;
  max-width: min(36rem, calc(100vw - 2rem));
  margin: 1.5rem auto 0;
  text-align: center;
}

.history[hidden] {
  display: none;
}

.history__title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.history__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.history__empty {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.75;
}

/* On wider (non-mobile) screens, place "Previously selected" to the right of the
   wheel. The history column is always reserved so the wheel keeps a constant size
   (it never resizes when a winner lands); smaller/mobile screens keep the history
   stacked below the wheel. */
@media (min-width: 1100px) {
  .wheel-panel {
    --wheel-size: min(calc(100vw - 47rem), 640px);
    display: grid;
    grid-template-columns: auto 220px;
    grid-template-areas:
      "quote   ."
      "wheel   history";
    align-items: center;
    justify-content: center;
    column-gap: 2rem;
  }

  .wheel-panel .wheel-quote {
    grid-area: quote;
    justify-self: center;
    /* Match the wheel's leftward shift so the quote sits centrally above it. */
    transform: translateX(-1.35rem);
  }

  .wheel-panel .wheel-wrap {
    grid-area: wheel;
  }

  .wheel-panel .history {
    grid-area: history;
    justify-self: start;
    align-self: center;
    width: 220px;
    margin: 0;
    text-align: left;
  }

  .wheel-panel .history__list {
    align-items: flex-start;
  }
}

.history__swatch {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.history__name {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
}

#entries {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--entries-bg);
  color: var(--text);
  font-family: var(--font-entries);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 200px;
}

#entries:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn {
  flex: 1;
  min-width: 120px;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

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

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

.btn.primary {
  background: var(--accent);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-fg);
  font-weight: 600;
}

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

.btn.danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: #a84848;
}

.footnote {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.footnote code {
  font-size: 0.85em;
  color: var(--code-color);
}

.winner-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.winner-modal[hidden] {
  display: none;
}

.winner-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.winner-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(46rem, calc(100vw - 2.5rem));
  margin: 0;
  padding: 2.75rem 2.5rem 2.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.winner-modal__title {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.winner-modal__name {
  margin: 0 0 2rem;
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
  color: var(--accent);
}

.winner-modal__dialog:has(#winner-modal-icebreaker-row:not([hidden])) .winner-modal__name {
  margin-bottom: 1rem;
}

.winner-modal__icebreaker-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0 0 2rem;
  text-align: center;
}

/* Author `display` on these classes overrides the [hidden] attribute otherwise. */
.winner-modal__icebreaker-row[hidden],
.winner-modal__icebreaker-refresh[hidden] {
  display: none !important;
}

.winner-modal__icebreaker {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.winner-modal__icebreaker-refresh {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.winner-modal__icebreaker-refresh svg {
  width: 24px;
  height: 24px;
}

.winner-modal__icebreaker-refresh:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-hover);
}

.winner-modal__icebreaker-refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.winner-modal__icebreaker-refresh:active {
  transform: scale(0.94);
}

.winner-modal__btn {
  min-width: 9rem;
  padding-block: 0.7rem;
  font-size: 1rem;
}

.winner-modal__btn--arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-block: 0.6rem;
}

.winner-modal__btn--arrow svg {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
}

.icebreaker-preview-modal__tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.icebreaker-preview-modal__tabs-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.icebreaker-tab--random {
  min-width: 12rem;
}

.icebreaker-tab {
  appearance: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icebreaker-tab:hover {
  background: var(--btn-hover-bg);
  color: var(--text);
}

.icebreaker-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-primary-fg);
}

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

.icebreaker-preview-modal__hint {
  margin: 0 0 2rem;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.icebreaker-preview-modal__hint[hidden] {
  display: none;
}

.icebreaker-preview-modal__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0 0 2rem;
  text-align: center;
}

.icebreaker-preview-modal__row[hidden] {
  display: none;
}

.icebreaker-preview-modal__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.page-clock {
  position: fixed;
  bottom: calc(0.75rem + 3px);
  left: 0.75rem;
  z-index: 10;
  margin: 0;
  font-family: var(--font);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  pointer-events: none;
}

.page-version {
  position: fixed;
  bottom: calc(0.75rem + 3px);
  left: 0.75rem;
  z-index: 10;
  margin: 0;
  transform: translateY(1.05rem);
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.75;
  pointer-events: none;
}
