:root {
  --ink: #1f2821;
  --ink-soft: #364039;
  --paper: #f4f0e7;
  --paper-deep: #eae5da;
  --card: #fffdf8;
  --line: rgba(31, 40, 33, 0.14);
  --line-strong: rgba(31, 40, 33, 0.27);
  --lime: #d8f25b;
  --lime-dark: #5f7118;
  --orange: #ff8c5a;
  --muted: #6c756e;
  --danger: #a8453b;
  --shadow: 0 24px 70px rgba(45, 48, 34, 0.09);
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 2%, rgba(216, 242, 91, 0.28), transparent 28rem),
    radial-gradient(circle at 92% 24%, rgba(255, 140, 90, 0.1), transparent 24rem),
    var(--paper);
}

body.modal-open { overflow: hidden; }

.name-settings[hidden],
.order-settings[hidden],
.draw-progress[hidden],
.winner-board[hidden],
.quiet-button[hidden],
.toast[hidden],
.binary-stats[hidden],
.locked-notice[hidden],
.choice-actions[hidden],
.list-tools[hidden],
.template-empty[hidden],
.template-search-clear[hidden],
[data-app-view][hidden],
.home-wheel-result[hidden],
.home-open-result[hidden] { display: none !important; }

button,
input,
textarea,
select { font: inherit; }

button,
select { color: inherit; }

button { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(113, 133, 28, 0.38);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 2px 20px;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.brand-name {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
}

.brand-name strong { font-size: 17px; letter-spacing: -0.035em; }
.brand-name small { color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: 0.015em; }

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

.home-hub { padding: 53px 2px 0; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  gap: 62px;
  align-items: end;
  margin-bottom: 38px;
}

.home-hero .eyebrow { max-width: none; margin: 0 0 16px; }
.home-hero h1 { max-width: 820px; }

.home-hero > p {
  max-width: 360px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(300px, 0.72fr);
  grid-template-areas:
    "picker ai"
    "manual continue";
  gap: 14px;
  align-items: start;
}

.home-start-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; }
.home-start-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf7; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 750; }
.home-start-actions a:nth-child(1) { background: #d8f25b; }
.home-start-actions a:nth-child(2) { background: #ffac81; }
#homeGiftEntry { position: relative; gap: 9px; overflow: hidden; padding-top: 20px; padding-bottom: 10px; border-color: #bc7961; background: #fff0dc; box-shadow: 0 4px 14px #9b513218; }
#homeGiftEntry::before { content: ""; position: absolute; top: -8px; left: 4px; right: 4px; height: 27px; background: url("/festive-lights.svg?v=20261019.3") center top / 160px 27px no-repeat; pointer-events: none; }
#homeGiftEntry::after { content: ""; flex-shrink: 0; width: 22px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h18v4H3zM5 13h14v9H5z' fill='%23b95f49'/%3E%3Cpath d='M11 9h2v13h-2zM3 11h18v2H3z' fill='%23e6ba66'/%3E%3Cpath d='M12 9C3 9 5 1 9 4l3 5Zm0 0c9 0 7-8 3-5l-3 5Z' fill='none' stroke='%23b95f49' stroke-width='1.7'/%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
#homeGiftEntry:hover { background-color: #ffe7c7; border-color: #9e503e; }
.home-start-actions a:focus-visible { outline: 3px solid #496526; outline-offset: 3px; }
.result-image-entry { margin-top: 12px; min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #e9efda; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }

.home-picker-card,
.ai-preview-card,
.manual-create-card,
.continue-card {
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: var(--shadow);
}

.home-picker-card {
  grid-area: picker;
  min-width: 0;
  padding: 27px 30px 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 45%, rgba(216, 242, 91, 0.1), transparent 19rem),
    var(--ink);
  color: white;
}

.home-card-heading {
  display: flex;
  gap: 20px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 21px;
}

.home-card-heading > div > span,
.continue-card > span,
.home-wheel-result > span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.home-card-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: -0.045em;
}

.home-heading-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.home-count {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  font-weight: 750;
}

.home-sound-toggle { border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.72); }
.home-sound-toggle:hover { border-color: rgba(255, 255, 255, 0.34); background: rgba(255, 255, 255, 0.14); color: white; }
.home-sound-toggle.is-on { border-color: rgba(216, 242, 91, 0.62); background: rgba(216, 242, 91, 0.2); color: var(--lime); }

.home-wheel-layout {
  display: grid;
  grid-template-columns: minmax(290px, 1fr) minmax(210px, 0.66fr);
  gap: clamp(25px, 4vw, 55px);
  align-items: center;
}

.home-wheel-wrap {
  position: relative;
  width: min(100%, 500px);
  margin-inline: auto;
  aspect-ratio: 1;
}

#homeWheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
}

.home-wheel-pointer {
  position: absolute;
  z-index: 3;
  top: -5px;
  left: 50%;
  width: 34px;
  height: 45px;
  border-radius: 7px 7px 16px 16px;
  background: white;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.28));
  transform: translateX(-50%);
  transform-origin: 50% 7px;
}

.home-spin-center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 23%;
  min-width: 72px;
  aspect-ratio: 1;
  padding: 0;
  place-items: center;
  border: clamp(5px, 0.7vw, 8px) solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 0.18s ease, transform 0.18s ease;
}

.home-spin-center:hover { background: #e6fa7a; transform: translate(-50%, -50%) scale(1.04); }
.home-spin-center:disabled { cursor: wait; opacity: 0.78; }
.home-spin-center.is-cancel-action { background: #f08c72; }
.home-spin-center.is-cancel-action:hover { background: #f5a088; }
.home-spin-center span { font-size: clamp(10px, 1.2vw, 14px); font-weight: 900; letter-spacing: 0.06em; }

.home-wheel-actions { min-width: 0; }

.home-wheel-actions > p {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.65;
}

.home-wheel-result {
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid rgba(216, 242, 91, 0.24);
  border-radius: 14px;
  background: rgba(216, 242, 91, 0.08);
}

.home-wheel-result > span { color: rgba(216, 242, 91, 0.68); }
.home-wheel-result strong,
.home-wheel-result small { display: block; }
.home-wheel-result strong { margin-top: 7px; font-size: 20px; letter-spacing: -0.035em; }
.home-wheel-result small { margin-top: 5px; color: rgba(255, 255, 255, 0.62); line-height: 1.45; }

.home-spin-wide { width: 100%; margin-top: 0; }
.home-spin-wide.is-cancel-action { background: #f08c72; }
.home-spin-wide.is-cancel-action:hover { background: #f5a088; }

.home-open-result {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 15px;
  border: 1px solid rgba(255, 140, 90, 0.7);
  border-radius: 13px;
  background: var(--orange);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.home-open-result:hover { background: #ff9d72; }

.home-side-stack {
  display: contents;
}

.ai-preview-card,
.manual-create-card,
.continue-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px;
}

.ai-preview-card {
  grid-area: ai;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.4), transparent 12rem),
    var(--orange);
}

.manual-create-card {
  grid-area: manual;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.55), transparent 11rem),
    #dcece7;
}

.ai-card-topline,
.manual-card-topline { display: flex; align-items: center; justify-content: space-between; }

.ai-card-topline span,
.manual-card-topline span {
  padding: 6px 9px;
  border: 1px solid rgba(31, 40, 33, 0.25);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ai-card-topline b { font-family: Georgia, serif; font-size: 30px; font-style: italic; }
.manual-card-topline b { font-size: 26px; font-weight: 500; line-height: 1; }
.ai-preview-card h2,
.manual-create-card h2,
.continue-card h2 { margin: 25px 0 9px; font-size: clamp(22px, 2.4vw, 31px); line-height: 1.02; letter-spacing: -0.05em; }
.ai-preview-card p,
.manual-create-card p,
.continue-card p { margin: 0; color: rgba(31, 40, 33, 0.72); font-size: 11px; line-height: 1.55; }

.tool-route-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  align-self: flex-start;
  margin-top: 8px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  text-decoration-color: rgba(31, 40, 33, 0.35);
  text-underline-offset: 3px;
}

.tool-route-link:hover { text-decoration-color: currentColor; }

.ai-wheel-form {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
}

.ai-wheel-form > label,
.ai-form-row label {
  display: grid;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
}

.ai-wheel-form textarea,
.ai-wheel-form input {
  width: 100%;
  border: 1px solid rgba(31, 40, 33, 0.2);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.62);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.ai-wheel-form textarea {
  min-height: 52px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.35;
}

.ai-wheel-form input { height: 42px; padding: 0 10px; }
.ai-wheel-form textarea::placeholder { color: rgba(31, 40, 33, 0.72); }

.ai-data-notice {
  padding: 10px 11px;
  border: 1px solid rgba(31, 40, 33, 0.18);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.48);
  color: rgba(31, 40, 33, 0.74);
}

.ai-data-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.ai-preview-card .ai-data-notice p {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
}

.ai-data-notice a {
  display: inline-block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  text-underline-offset: 2px;
}

.ai-form-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.ai-form-row button,
.continue-card > button {
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.ai-form-row button { cursor: pointer; }
.ai-form-row button:hover { background: #303b32; }
.ai-form-row button:disabled { cursor: wait; opacity: 0.62; }

.ai-form-status {
  min-height: 2.6em;
  margin: 0 !important;
  color: rgba(31, 40, 33, 0.82) !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
}

.ai-form-status.is-error { color: #7e2f29 !important; font-weight: 750; }
.ai-form-status.is-success { color: #344514 !important; font-weight: 750; }

.manual-wheel-form {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 9px;
  margin-top: 16px;
}

.manual-wheel-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.manual-wheel-form input,
.manual-wheel-form textarea {
  width: 100%;
  border: 1px solid rgba(31, 40, 33, 0.18);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 253, 248, 0.7);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.manual-wheel-form input { height: 40px; padding: 0 11px; }
.manual-wheel-form textarea { min-height: 78px; padding: 10px 11px; resize: vertical; line-height: 1.4; }
.manual-wheel-form input:focus,
.manual-wheel-form textarea:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(119, 138, 36, 0.12); }
.manual-wheel-form input::placeholder,
.manual-wheel-form textarea::placeholder { color: rgba(31, 40, 33, 0.72); }

.manual-form-footer {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.manual-form-footer > span {
  color: rgba(31, 40, 33, 0.76);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.manual-form-footer button {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.manual-form-footer button:hover { background: #303b32; }

.manual-form-status {
  grid-column: 1 / -1;
  min-height: 1.4em;
  color: rgba(31, 40, 33, 0.78) !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
}

.manual-form-status.is-error { color: #7e2f29 !important; font-weight: 750; }

.continue-card {
  grid-area: continue;
  background:
    radial-gradient(circle at 90% 110%, rgba(216, 242, 91, 0.52), transparent 13rem),
    var(--card);
}

.continue-card > span { color: var(--muted); }
.continue-card h2 { margin-top: auto; overflow-wrap: anywhere; }
.continue-card > button { cursor: pointer; }
.continue-card > button:hover { background: #303b32; }

.status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69a940;
  box-shadow: 0 0 0 4px rgba(105, 169, 64, 0.14);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.65fr);
  gap: 60px;
  align-items: end;
  padding: 54px 4px 38px;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(145px, 0.45fr) minmax(0, 1.55fr);
  gap: 24px;
  align-items: start;
}

.eyebrow {
  max-width: 175px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1 {
  max-width: 730px;
  margin: 0;
  font-size: clamp(48px, 6.2vw, 88px);
  font-weight: 620;
  line-height: 0.9;
  letter-spacing: -0.068em;
}

h1 em {
  display: inline-block;
  color: var(--lime-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.intro {
  max-width: 340px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 930px);
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.66);
}

.mode-button {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 15px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.mode-button:is(:hover, :focus-visible) { z-index: 20; }

.mode-button.is-active {
  background: var(--card);
  box-shadow: 0 6px 20px rgba(31, 40, 33, 0.08);
}

.mode-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--paper-deep);
  font-size: 19px;
}

.mode-button.is-active .mode-icon { background: var(--lime); }
.mode-button strong,
.mode-button small { display: block; }
.mode-button strong { font-size: 13px; letter-spacing: -0.01em; }
.mode-button small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.mode-tooltip {
  position: absolute;
  z-index: 30;
  top: calc(100% + 11px);
  left: 50%;
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(31, 40, 33, 0.16);
  border-radius: 11px;
  background: #1f2821;
  box-shadow: 0 12px 28px rgba(31, 40, 33, 0.18);
  color: #fffdf8;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.mode-button:first-child .mode-tooltip {
  left: 0;
  transform: translate(0, -4px);
}

.mode-button:last-child .mode-tooltip {
  right: 0;
  left: auto;
  transform: translate(0, -4px);
}

@media (hover: hover) and (pointer: fine) {
  .mode-button:hover .mode-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .mode-button:first-child:hover .mode-tooltip,
  .mode-button:last-child:hover .mode-tooltip {
    transform: translate(0, 0);
  }
}

.mode-button:focus-visible .mode-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.mode-button:first-child:focus-visible .mode-tooltip,
.mode-button:last-child:focus-visible .mode-tooltip {
  transform: translate(0, 0);
}

.mode-explanation {
  display: none;
  gap: 9px;
  align-items: flex-start;
  margin: -8px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 40, 33, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.mode-explanation-icon {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--card);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
}

@media (hover: none), (pointer: coarse) {
  .mode-explanation { display: flex; }
}

.secret-draw-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  width: min(100%, 930px);
  margin: 0 0 18px;
  padding: 10px 11px;
  border: 1px solid rgba(31, 40, 33, 0.14);
  border-radius: 15px;
  background: linear-gradient(105deg, rgba(216, 242, 91, 0.19), rgba(255, 253, 248, 0.72) 62%);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.secret-draw-entry:hover {
  border-color: rgba(31, 40, 33, 0.28);
  box-shadow: 0 9px 24px rgba(31, 40, 33, 0.08);
  transform: translateY(-1px);
}

.secret-draw-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--lime);
}

.secret-draw-icon svg { width: 28px; height: 28px; }
.secret-draw-icon path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.secret-draw-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.secret-draw-copy > small {
  color: var(--lime-dark);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.secret-draw-copy > strong { font-size: 13px; letter-spacing: -0.01em; }
.secret-draw-copy > span { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }

.secret-draw-action {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.secret-draw-action b { color: var(--lime-dark); font-size: 14px; }

.wheel-manager {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.manager-navigation {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.back-to-templates {
  display: inline-flex;
  min-height: 42px;
  gap: 8px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(119, 138, 36, 0.34);
  border-radius: 11px;
  background: rgba(216, 242, 91, 0.2);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.back-to-templates:hover {
  border-color: rgba(119, 138, 36, 0.62);
  background: rgba(216, 242, 91, 0.42);
  transform: translateY(-1px);
}

.back-to-templates span:first-child { font-size: 17px; line-height: 1; }

.saved-picker {
  position: relative;
  min-width: min(300px, 38vw);
}

.saved-picker::after {
  position: absolute;
  top: 50%;
  right: 13px;
  content: "⌄";
  pointer-events: none;
  transform: translateY(-58%);
}

.saved-picker select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 13px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.76);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.quiet-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.7);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.quiet-button:hover { border-color: var(--line-strong); background: var(--card); transform: translateY(-1px); }
.quiet-button.accent-button { border-color: transparent; background: var(--ink); color: white; }
.quiet-button.ai-manager-button { border-color: rgba(119, 138, 36, 0.34); background: rgba(216, 242, 91, 0.28); }
.quiet-button.ai-manager-button:hover { border-color: rgba(119, 138, 36, 0.58); background: rgba(216, 242, 91, 0.48); }
.quiet-button.danger-button { color: var(--danger); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(350px, 0.78fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.ai-source-bar {
  grid-column: 1 / -1;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border-bottom: 1px solid rgba(31, 40, 33, 0.13);
  background: linear-gradient(100deg, rgba(216, 242, 91, 0.3), rgba(255, 140, 90, 0.12));
}

.ai-source-bar[hidden] { display: none; }

.ai-source-copy {
  display: grid;
  min-width: 0;
}

.ai-source-copy > span {
  color: var(--lime-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ai-source-copy > strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-source-copy > small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.ai-source-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.ai-source-actions button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(31, 40, 33, 0.17);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.75);
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 780;
}

.ai-source-actions button:last-child {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border-color: transparent;
  background: var(--ink);
  color: white;
}

.ai-source-actions button:hover { transform: translateY(-1px); }
.ai-source-actions button:disabled { cursor: wait; opacity: 0.55; transform: none; }

.wheel-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 705px;
  padding: 36px 50px 42px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.36)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(30, 38, 32, 0.035) 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(30, 38, 32, 0.035) 40px),
    #ebe8de;
}

.active-wheel-heading {
  display: grid;
  width: min(100%, 515px);
  gap: 10px;
  justify-items: center;
  margin-bottom: 9px;
  text-align: center;
}

.active-wheel-heading .back-to-templates { justify-self: start; }

.active-wheel-copy { width: 100%; }

.active-wheel-copy > span {
  display: block;
  margin-bottom: 4px;
  color: var(--lime-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.active-wheel-copy h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.wheel-heading {
  display: flex;
  width: min(100%, 515px);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wheel-heading strong { color: var(--ink-soft); }

.wheel-heading-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sound-toggle {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(31, 40, 33, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font: inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sound-toggle:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.82); transform: translateY(-1px); }
.sound-toggle:focus-visible { outline: 3px solid rgba(119, 138, 36, 0.22); outline-offset: 2px; }
.sound-toggle.is-on { border-color: rgba(119, 138, 36, 0.48); background: rgba(216, 242, 91, 0.28); color: var(--ink); }
.sound-toggle:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.sound-toggle svg { width: 15px; height: 15px; overflow: visible; }
.sound-toggle .sound-speaker { fill: currentColor; }
.sound-toggle .sound-wave,
.sound-toggle .sound-slash { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle:not(.is-on) .sound-wave { display: none; }
.sound-toggle.is-on .sound-slash { display: none; }

.wheel-wrap {
  position: relative;
  width: min(100%, 515px);
  aspect-ratio: 1;
  filter: drop-shadow(0 22px 24px rgba(39, 45, 35, 0.17));
}

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

.pointer {
  position: absolute;
  z-index: 3;
  top: -8px;
  left: 50%;
  width: 38px;
  height: 49px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.2));
  transform: translateX(-50%);
  transform-origin: 50% 0;
  will-change: transform;
}

.spin-center {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  width: clamp(86px, 22%, 114px);
  aspect-ratio: 1;
  border: 8px solid var(--card);
  border-radius: 50%;
  background: var(--ink);
  color: white;
  cursor: pointer;
  box-shadow: 0 7px 25px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.spin-center:hover { background: #2d382f; transform: translate(-50%, -50%) scale(1.05); }
.spin-center:active { transform: translate(-50%, -50%) scale(0.98); }
.spin-center:disabled { cursor: not-allowed; opacity: 0.58; transform: translate(-50%, -50%); }
.spin-center.is-cancel-action { background: #a8453b; }
.spin-center.is-cancel-action:hover { background: #bd5146; }
.spin-center span { display: block; font-size: 15px; font-weight: 800; letter-spacing: 0.08em; }
.spin-center small { display: block; margin-top: 2px; color: var(--lime); font-size: 20px; }

.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 515px);
  min-height: 54px;
  margin-top: 26px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--lime);
  font-weight: 780;
}

.primary-button:hover { background: #e2fa73; transform: translateY(-2px); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.48; transform: none; }
.wheel-panel > .primary-button.is-cancel-action { background: #f0a17d; }
.wheel-panel > .primary-button.is-cancel-action:hover { background: #f5ae8c; }

.hint {
  min-height: 18px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.binary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: stretch;
  width: min(100%, 515px);
  margin-top: 15px;
}

.binary-stats > span,
.binary-stats > em {
  display: flex;
  min-width: 0;
  min-height: 51px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid rgba(31, 40, 33, 0.1);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.78);
}

.binary-stats small { color: var(--muted); font-size: 9px; }
.binary-stats strong { margin-top: 3px; font-size: 13px; }
.binary-stats em { color: var(--lime-dark); font-size: 10px; font-style: normal; font-weight: 750; line-height: 1.35; }

.draw-progress {
  width: min(100%, 515px);
  margin-top: 17px;
  padding: 14px 15px;
  border: 1px solid rgba(31, 40, 33, 0.1);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.76);
}

.draw-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.draw-progress span { color: var(--muted); }
.progress-track { height: 6px; margin: 9px 0; overflow: hidden; border-radius: 99px; background: rgba(31, 40, 33, 0.1); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--lime-dark); transition: width 0.3s ease; }
.draw-progress button { padding: 0; border: 0; background: transparent; color: var(--lime-dark); font-size: 11px; font-weight: 750; cursor: pointer; }
.draw-progress button:disabled { color: var(--muted); cursor: not-allowed; opacity: 0.55; }
.draw-progress-actions { display: flex; gap: 16px; align-items: center; justify-content: space-between; }

.control-panel {
  min-width: 0;
  padding: 31px 30px 34px;
  border-left: 1px solid var(--line);
  background: var(--card);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-heading label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.choice-count { color: var(--muted); font-size: 11px; }

.title-input {
  width: 100%;
  padding: 4px 0 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.title-input:focus { border-bottom-color: var(--lime-dark); }
.title-input[readonly] { color: var(--ink); cursor: default; }

.panel-tabs {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.86fr;
  gap: 4px;
  margin: 20px 0 18px;
  padding: 4px;
  border-radius: 11px;
  background: #efebe2;
}

.tab-button {
  min-width: 0;
  padding: 9px 6px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.tab-button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 3px 12px rgba(31, 40, 33, 0.07); }
.tab-button span { margin-left: 2px; color: var(--lime-dark); }
.tab-panel[hidden] { display: none; }

.name-settings {
  display: grid;
  grid-template-columns: 0.58fr 1.42fr;
  gap: 9px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.order-settings {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid rgba(119, 138, 36, 0.24);
  border-radius: 11px;
  background: rgba(216, 242, 91, 0.13);
}

.order-settings > span {
  color: var(--lime-dark);
  font-size: 20px;
  line-height: 1;
}

.order-settings p { margin: 0; }
.order-settings strong,
.order-settings small { display: block; }
.order-settings strong { font-size: 11px; }
.order-settings small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.locked-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid rgba(119, 138, 36, 0.24);
  border-radius: 11px;
  background: rgba(216, 242, 91, 0.13);
  color: var(--lime-dark);
}

.locked-notice > span { font-size: 18px; line-height: 1; }
.locked-notice p { margin: 0; }
.locked-notice strong,
.locked-notice small { display: block; }
.locked-notice strong { color: var(--ink); font-size: 11px; }
.locked-notice small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.name-settings > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.name-settings input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.name-settings .check-setting {
  flex-direction: row;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
}

.check-setting input { width: 17px; height: 17px; accent-color: var(--lime-dark); }
.check-setting span { min-width: 0; }
.check-setting strong,
.check-setting small { display: block; }
.check-setting strong { color: var(--ink); font-size: 11px; }
.check-setting small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 550; line-height: 1.25; }

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 355px;
  padding: 1px 4px 1px 1px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 40, 33, 0.24) transparent;
}

.choice-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 6px 4px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.choice-row.is-excluded { opacity: 0.46; background: #f2efe8; }
.choice-row:focus-within { border-color: #96a83a; box-shadow: 0 0 0 3px rgba(150, 168, 58, 0.12); }
.color-dot { width: 9px; height: 9px; border-radius: 50%; }
.choice-number { width: 18px; color: #9a9f99; font-size: 9px; text-align: right; }

.choice-row input {
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.remove-choice,
.close-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.remove-choice {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  color: #92988f;
  font-size: 19px;
}

.remove-choice:hover { background: #f3eee5; color: var(--ink); }
.remove-choice:disabled { cursor: not-allowed; opacity: 0.3; }

.choice-actions {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 8px;
  margin-top: 12px;
}

.secondary-button {
  min-height: 42px;
  padding: 0 10px;
  border: 1px dashed rgba(30, 38, 32, 0.3);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.secondary-button:hover { border-color: var(--ink); background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.secondary-button:disabled { cursor: not-allowed; opacity: 0.4; }

.list-tools {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 12px;
}

.list-tools button,
.section-heading button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.list-tools button:hover,
.section-heading button:hover { color: var(--ink); }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.025em;
}

.winner-board {
  margin-bottom: 23px;
  padding: 15px;
  border: 1px solid rgba(119, 138, 36, 0.24);
  border-radius: 13px;
  background: rgba(216, 242, 91, 0.12);
}

.winner-board ol {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  counter-reset: winners;
}

.winner-board li {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 680;
  counter-increment: winners;
}

.winner-board li::before {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  content: counter(winners);
  font-size: 9px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border-radius: 9px;
  background: #f1ede5;
  font-size: 12px;
  font-weight: 650;
}

.history-item time { color: var(--muted); font-size: 9px; font-weight: 550; }
.empty-state { margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.stat-cards article {
  min-width: 0;
  padding: 12px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.stat-cards span,
.stat-cards strong { display: block; }
.stat-cards span { min-height: 25px; color: var(--muted); font-size: 9px; line-height: 1.25; }
.stat-cards strong { margin-top: 6px; overflow: hidden; font-size: 20px; letter-spacing: -0.04em; text-overflow: ellipsis; }
.stats-heading { margin-top: 23px; }
.stats-list { display: flex; flex-direction: column; gap: 11px; max-height: 310px; overflow: auto; }

.stat-row-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 11px;
}

.stat-row-head strong { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row-head span { color: var(--muted); font-size: 9px; }
.stat-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #eeeae1; }
.stat-bar i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--lime-dark); }

.privacy-note {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 20px 0 0;
  padding: 11px;
  border-radius: 9px;
  background: #f2efe8;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.templates-section { padding: 76px 2px 36px; }

.templates-heading {
  display: flex;
  gap: 30px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 25px;
}

.templates-heading .eyebrow { margin: 0 0 10px; }
.templates-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.055em; }

.surprise-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.surprise-button:hover { background: #303b32; transform: translateY(-1px); }
.surprise-button span { color: var(--lime); font-size: 16px; }

.template-discovery {
  display: grid;
  grid-template-columns: minmax(260px, 570px) auto;
  gap: 13px;
  align-items: center;
  margin-bottom: 13px;
}

.template-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 8px 24px rgba(31, 40, 33, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.template-search:focus-within {
  border-color: rgba(119, 138, 36, 0.68);
  box-shadow: 0 0 0 4px rgba(216, 242, 91, 0.18);
}

.template-search-icon { color: var(--muted); font-size: 22px; line-height: 1; }

.template-search input {
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.template-search input::-webkit-search-cancel-button { display: none; }
.template-search input::placeholder { color: #8c938d; }

.template-search-clear {
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.template-result-count { color: var(--muted); font-size: 11px; font-weight: 680; white-space: nowrap; }

.template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.template-filter {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.template-filter.is-active { border-color: var(--ink); background: var(--ink); color: white; }

.template-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin: -4px 0 18px;
}

.template-sort {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.template-sort select {
  min-height: 38px;
  padding: 0 31px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.template-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.72);
}

.template-view-switch button {
  display: inline-flex;
  gap: 6px;
  min-height: 31px;
  align-items: center;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.template-view-switch button.is-active { background: var(--ink); color: white; }
.template-view-switch button span { font-size: 14px; line-height: 1; }
.template-view-switch button strong { font-size: 10px; }

.template-empty {
  margin: 24px 0 8px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.template-card {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.72);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.template-card:hover { border-color: var(--line-strong); box-shadow: 0 14px 32px rgba(31, 40, 33, 0.08); transform: translateY(-3px); }
.template-open {
  display: flex;
  width: 100%;
  min-height: 185px;
  flex-direction: column;
  padding: 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.template-open::after { position: absolute; right: 16px; bottom: 14px; content: "→"; font-size: 19px; }

.favorite-toggle {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(31, 40, 33, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--muted);
  font-size: 19px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.favorite-toggle:hover { background: white; color: var(--ink); transform: scale(1.05); }
.favorite-toggle.is-favorite { background: var(--lime); color: var(--ink); }
.template-card .template-icon { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: auto; border-radius: 11px; background: var(--template-color, var(--lime)); font-size: 18px; }
.template-card small { margin: 15px 0 5px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.template-card strong { max-width: 85%; font-size: 17px; letter-spacing: -0.025em; }
.template-card .template-description { margin-top: 6px; padding-right: 21px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.template-grid.is-list { grid-template-columns: 1fr; }
.template-grid.is-list .template-card,
.template-grid.is-list .template-open { min-height: 0; }
.template-grid.is-list .template-card:hover { transform: translateY(-1px); }
.template-grid.is-list .template-open {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas:
    "icon category"
    "icon title"
    "icon description";
  gap: 2px 15px;
  align-items: center;
  min-height: 92px;
  padding: 15px 58px 15px 16px;
}
.template-grid.is-list .template-icon { grid-area: icon; width: 44px; height: 44px; margin: 0; }
.template-grid.is-list small { grid-area: category; margin: 0; }
.template-grid.is-list strong { grid-area: title; max-width: none; font-size: 18px; }
.template-grid.is-list .template-description { grid-area: description; margin: 1px 0 0; padding: 0; }
.template-grid.is-list .template-open::after { top: 50%; bottom: auto; transform: translateY(-50%); }

.how-section {
  padding: 78px 2px 56px;
  border-top: 1px solid var(--line);
}

.how-heading {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 70px;
  align-items: end;
}

.how-heading .eyebrow,
.faq-heading .eyebrow { margin: 0 0 11px; }

.how-heading h2,
.faq-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4.1vw, 57px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.how-heading > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.how-steps article {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.68);
}

.how-steps article > span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  font-size: 10px;
  font-weight: 820;
}

.how-steps h3 {
  margin: 31px 0 7px;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.how-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.faq-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(420px, 1.28fr);
  gap: 70px;
  align-items: start;
  margin-top: 72px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}

.faq-heading h2 { font-size: clamp(28px, 3.5vw, 46px); }

.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }

.faq-list summary {
  position: relative;
  padding: 19px 42px 19px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.015em;
  list-style: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  position: absolute;
  top: 50%;
  right: 4px;
  color: var(--lime-dark);
  content: "+";
  font-size: 21px;
  font-weight: 500;
  transform: translateY(-50%);
}

.faq-list details[open] summary::after { content: "−"; }

.faq-list details p {
  max-width: 650px;
  margin: -4px 42px 18px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.faq-list details:target {
  scroll-margin-top: 24px;
}

footer {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.footer-tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  justify-content: center;
}

.footer-tool-links a {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.footer-tool-links a:hover { text-decoration: underline; }
.template-card.template-games-club {
  background: linear-gradient(145deg, #272340, #17172c);
  border-color: #b7a4ff70;
  color: #f4f1ff;
}
.template-games-club .template-icon { background: #b7a4ff; color: #17172c; }
.template-games-club .template-description,
.template-games-club small { color: #c8bfe3; }
.template-games-club .favorite-toggle { color: #b7a4ff; }
.template-games-club .template-open { color: #f4f1ff; }

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
  place-items: center;
}

.modal-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  border: 0;
  background: rgba(25, 31, 26, 0.68);
  backdrop-filter: blur(5px);
  cursor: default;
}

.result-card,
.import-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
  animation: reveal 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-card { padding: 49px 40px 36px; text-align: center; }
.import-card { width: min(100%, 590px); padding: 38px 36px 32px; }
.ai-quick-card { width: min(100%, 560px); }
.ai-quick-card .ai-wheel-form { margin-top: 20px; padding-top: 0; }
.ai-quick-card .ai-data-notice p { margin: 0; font-size: 9px; line-height: 1.45; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
}

.close-button {
  position: absolute;
  top: 12px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 25px;
}

.close-button:hover { background: #f1ede5; color: var(--ink); }
.result-label { color: var(--lime-dark); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.result-card h2 { margin: 14px 0 0; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 9vw, 54px); font-style: italic; letter-spacing: -0.04em; }
.result-card p { color: var(--muted); line-height: 1.55; }
.result-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 9px;
  margin-top: 24px;
}

.result-actions .primary-button { width: 100%; margin: 0; }

.home-result-dialog-card h2 { font-size: clamp(34px, 8vw, 48px); }

.home-result-dialog-actions {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.home-result-dialog-actions .primary-button,
.home-result-dialog-actions .result-finish-button {
  width: 100%;
  margin: 0;
}

.home-dialog-again-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(31, 40, 33, 0.18);
  border-radius: 14px;
  background: rgba(31, 40, 33, 0.07);
  color: var(--ink);
  cursor: pointer;
  font-weight: 780;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.home-dialog-again-button:hover {
  border-color: rgba(31, 40, 33, 0.34);
  background: rgba(31, 40, 33, 0.12);
  transform: translateY(-2px);
}

.result-finish-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(255, 140, 90, 0.38);
  border-radius: 14px;
  background: rgba(255, 140, 90, 0.2);
  color: var(--ink);
  cursor: pointer;
  font-weight: 780;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.result-finish-button:hover {
  border-color: rgba(255, 140, 90, 0.6);
  background: rgba(255, 140, 90, 0.34);
  transform: translateY(-2px);
}

.import-card h2 { margin: 10px 0 8px; font-size: 31px; letter-spacing: -0.045em; }
.import-card > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.import-card > label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: 0.08em; }
.import-card textarea { width: 100%; min-height: 190px; padding: 13px; resize: vertical; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: white; color: var(--ink); font-size: 13px; line-height: 1.5; }
.import-card textarea:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(119, 138, 36, 0.12); }
.import-summary { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 10px; }
.import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 19px; }
.import-actions .primary-button { width: 100%; margin: 0; }

.share-card { width: min(100%, 520px); text-align: center; }
.share-card > p { margin-inline: auto; max-width: 390px; }
.share-card > label { text-align: left; }
.share-qr {
  display: grid;
  width: min(100%, 270px);
  aspect-ratio: 1;
  margin: 20px auto;
  padding: 12px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.share-qr svg { display: block; width: 100%; height: 100%; }
.share-url {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}
.share-url:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(119, 138, 36, 0.12); outline: 0; }
.share-status { min-height: 20px; margin: 8px 0 0 !important; color: var(--lime-dark) !important; font-size: 10px !important; font-weight: 750; }
.share-actions { display: grid; grid-template-columns: 1.4fr 0.8fr 0.9fr; gap: 9px; margin-top: 14px; }
.share-actions .primary-button,
.share-actions .secondary-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  margin: 0;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 540px) {
  .share-actions { grid-template-columns: 1fr 1fr; }
  .share-actions .primary-button { grid-column: 1 / -1; }
  .share-qr { width: min(100%, 235px); }
}

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  gap: 13px;
  align-items: center;
  max-width: min(390px, calc(100% - 40px));
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  font-weight: 650;
  animation: toast-in 0.24s ease;
}

.toast-message { flex: 1; min-width: 0; line-height: 1.45; }

.toast-action {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--lime);
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}

.toast-action:hover { background: #e2f879; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1020px) {
  .home-hero { grid-template-columns: 1fr; gap: 20px; }
  .home-hero > p { max-width: 620px; }
  .home-dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "picker"
      "ai"
      "manual"
      "continue";
  }
  .ai-preview-card,
  .manual-create-card,
  .continue-card { min-height: 280px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .intro { max-width: 580px; }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr); }
  .wheel-panel { min-height: 660px; padding-inline: 30px; }
  .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .home-wheel-layout { grid-template-columns: minmax(280px, 1fr) minmax(190px, 0.62fr); gap: 25px; }
  .home-wheel-wrap { width: min(100%, 430px); }
  .hero-copy { grid-template-columns: 145px 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .wheel-panel { min-height: auto; padding: 35px 54px 38px; }
  .wheel-wrap { width: min(100%, 540px); }
  .wheel-heading,
  .active-wheel-heading,
  .wheel-panel > .primary-button,
  .draw-progress { width: min(100%, 540px); }
  .control-panel { border-top: 1px solid var(--line); border-left: 0; }
  .choice-list { max-height: 420px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-heading,
  .faq-layout { grid-template-columns: 1fr; gap: 25px; }
  .how-heading > p { max-width: 630px; }
  .faq-layout { margin-top: 55px; padding-top: 45px; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 22px, 520px); }
  .toast { right: 11px; bottom: max(11px, env(safe-area-inset-bottom)); max-width: calc(100% - 22px); }
  .topbar { padding: 17px 1px; }
  .topbar-actions { gap: 6px; }
  .status { padding: 7px 9px; font-size: 9px; }
  .home-hub { padding: 34px 1px 0; }
  .home-hero { margin-bottom: 26px; }
  .home-hero .eyebrow { margin-bottom: 14px; }
  .home-hero > p { font-size: 13px; }
  .home-dashboard { gap: 10px; }
  .home-picker-card { padding: 22px 15px 18px; border-radius: 20px; }
  .home-card-heading { margin-inline: 4px; }
  .home-card-heading h2 { font-size: 24px; }
  .home-wheel-layout { grid-template-columns: 1fr; gap: 19px; }
  .home-wheel-wrap { width: min(100%, 400px); }
  .home-wheel-actions > p { margin-bottom: 13px; }
  .ai-preview-card,
  .manual-create-card,
  .continue-card { min-height: 270px; padding: 21px; border-radius: 20px; }
  .manual-create-card { min-height: 0; }
  .manual-wheel-form { grid-template-columns: 1fr; }
  .manual-form-footer,
  .manual-form-status { grid-column: auto; }
  .continue-card { min-height: 225px; }
  .hero { padding: 34px 3px 27px; }
  .hero-copy { display: block; }
  .hero .eyebrow { max-width: none; margin: 0 0 17px; }
  h1 { font-size: clamp(46px, 15.3vw, 74px); }
  .intro { margin-top: 18px; font-size: 13px; }
  .mode-switch { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-radius: 15px; }
  .mode-button { gap: 8px; padding: 10px; }
  .mode-icon { width: 31px; height: 31px; }
  .mode-button strong { font-size: 11px; }
  .mode-button small { display: none; }
  .mode-explanation { display: flex; }
  .secret-draw-entry { grid-template-columns: 39px minmax(0, 1fr) auto; gap: 10px; padding: 9px; }
  .secret-draw-icon { width: 39px; height: 39px; border-radius: 10px; }
  .secret-draw-icon svg { width: 25px; height: 25px; }
  .wheel-manager { display: grid; grid-template-columns: 1fr; }
  .manager-navigation { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .saved-picker { width: 100%; min-width: 0; }
  .manager-actions { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .ai-source-bar { display: grid; gap: 11px; }
  .ai-source-actions { display: grid; grid-template-columns: 0.86fr 1.14fr; }
  .ai-source-actions button { width: 100%; }
  .quiet-button { min-width: 0; padding-inline: 7px; }
  .workspace { border-radius: 20px; }
  .wheel-panel { padding: 27px 16px 29px; }
  .active-wheel-heading { gap: 9px; margin-bottom: 7px; padding-inline: 8px; }
  .active-wheel-heading .back-to-templates { min-height: 36px; padding-inline: 11px; font-size: 11px; }
  .active-wheel-heading h2 { font-size: clamp(23px, 7vw, 31px); }
  .wheel-heading { margin-bottom: 19px; padding-inline: 2px; }
  .wheel-wrap { width: min(100%, 430px); }
  .pointer { top: -6px; width: 30px; height: 39px; }
  .spin-center { border-width: 6px; }
  .spin-center span { font-size: 12px; }
  .spin-center small { font-size: 17px; }
  .wheel-panel > .primary-button { min-height: 51px; margin-top: 22px; }
  .binary-stats { grid-template-columns: repeat(3, 1fr); }
  .binary-stats > em { grid-column: 1 / -1; min-height: 38px; text-align: center; }
  .control-panel { padding: 27px 18px 30px; }
  .title-input { font-size: 23px; }
  .panel-tabs { margin-top: 17px; }
  .name-settings { grid-template-columns: 0.65fr 1.35fr; }
  .choice-list { max-height: 355px; }
  .choice-row { gap: 6px; }
  .choice-number { display: none; }
  .choice-actions { grid-template-columns: 0.8fr 1.2fr; }
  .templates-section { padding-top: 57px; }
  .templates-heading { display: block; }
  .surprise-button { width: 100%; justify-content: center; margin-top: 18px; }
  .template-discovery { grid-template-columns: 1fr; gap: 7px; margin-top: 17px; }
  .template-result-count { padding-left: 3px; }
  .template-filters {
    width: calc(100% + 22px);
    flex-wrap: nowrap;
    margin: 14px -11px 17px;
    padding: 0 11px 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .template-filters::-webkit-scrollbar { display: none; }
  .template-filter { flex: 0 0 auto; }
  .template-toolbar { align-items: stretch; justify-content: space-between; margin-top: -3px; }
  .template-sort { flex: 1 1 auto; }
  .template-sort > span { display: none; }
  .template-sort select { width: 100%; }
  .template-view-switch { flex: 0 0 auto; }
  .template-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .template-card,
  .template-open { min-height: 167px; }
  .template-open { padding: 15px; }
  .favorite-toggle { top: 10px; right: 10px; }
  .template-card strong { max-width: 100%; font-size: 15px; }
  .how-section { padding: 58px 3px 43px; }
  .how-heading h2 { font-size: 39px; }
  .how-heading > p { font-size: 12px; }
  .how-steps { grid-template-columns: 1fr; gap: 9px; margin-top: 25px; }
  .how-steps article { min-height: 0; padding: 18px; }
  .how-steps h3 { margin-top: 22px; }
  .faq-heading h2 { font-size: 34px; }
  .faq-list summary { padding-block: 17px; font-size: 12px; }
  footer { flex-direction: column; gap: 15px; text-align: center; }
  .result-card { padding: 45px 24px 28px; }
  .result-actions { gap: 7px; }
  .result-actions .primary-button,
  .result-finish-button { padding-inline: 13px; }
  .import-card { padding: 35px 20px 23px; }
  .ai-quick-card { padding-top: 42px; }
  .import-actions { grid-template-columns: 1fr; }
  .import-actions .secondary-button { order: 2; }
}

@media (max-width: 390px) {
  .brand-name small { display: none; }
  .status { display: none; }
  .home-card-heading { display: block; }
  .home-heading-tools { margin-top: 11px; }
  .home-count { display: inline-block; }
  .home-spin-center { min-width: 67px; }
  .mode-button { padding-inline: 8px; }
  .secret-draw-copy > span { display: none; }
  .secret-draw-action { padding-inline: 9px; }
  #secretDrawAction { display: none; }
  .mode-icon { display: none; }
  .manager-actions { grid-template-columns: repeat(2, 1fr); }
  .quiet-button span { display: none; }
  .wheel-heading { font-size: 9px; }
  .wheel-heading-tools { gap: 6px; }
  .sound-toggle { min-height: 27px; padding-inline: 6px; }
  #soundToggleText,
  #homeSoundToggleText { display: none; }
  .panel-tabs { grid-template-columns: 1fr 1fr 0.82fr; }
  .tab-button { font-size: 10px; }
  .name-settings { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .template-view-switch button strong { display: none; }
  .template-view-switch button { width: 34px; justify-content: center; padding: 0; }
  .template-card,
  .template-open { min-height: 150px; }
  .manager-navigation { grid-template-columns: 1fr; }
  .back-to-templates { justify-content: center; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-cards article:last-child { grid-column: 1 / -1; }
}

@media (orientation: landscape) and (max-height: 560px) and (min-width: 621px) {
  .hero { padding-block: 28px; }
  .wheel-panel { min-height: 560px; }
  .wheel-wrap { width: min(62vh, 430px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Static topic links remain crawlable even without JavaScript. */
.seo-catalog { margin-top: 1.5rem; color: var(--muted, #626a60); }
.seo-catalog summary { cursor: pointer; padding-block: .8rem; }
.seo-catalog nav { display: flex; flex-wrap: wrap; gap: .6rem 1rem; padding-block: .6rem; }
.seo-catalog a { color: inherit; text-underline-offset: .2em; }
html[lang="lt"] .seo-catalog-en, html[lang="en"] .seo-catalog-lt { display: none; }
/* Secondary, device-local utilities stay below the main wheel actions. */
.backup-tools {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--line, #d8d9cf);
  border-radius: 20px;
}
.backup-tools > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: list-item; }
.backup-tools p, .backup-help { max-width: 72ch; line-height: 1.6; }
.backup-help { padding-left: 24px; }
.backup-help li + li { margin-top: 8px; }
.backup-tools-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.backup-tools-actions button { min-height: 44px; }

/* Direct, user-initiated game result navigation. */
.game-result-link { display: flex; justify-content: center; align-items: center; color: var(--ink); text-decoration: none; width: 100%; margin: 16px 0; min-height: 52px; overflow-wrap: anywhere; }
.game-result-link:visited { color: var(--ink); }
.game-result-link[hidden] { display: none; }
