:root {
  --bg: #f5ede0;
  --surface: #fffaf1;
  --surface-2: #fbf2e3;
  --ink: #2b2119;
  --muted: #7c6a57;
  --line: #e7d8c1;
  --accent: #c8402e;
  --accent-dark: #8f2a1d;
  --accent-ink: #ffffff;
  --accent-soft: #f7ddd4;
  --indigo: #22395b;
  --indigo-ink: #f3ede2;
  --wood: #c48a52;
  --wood-2: #a86f3a;
  --wood-3: #7f5128;
  --steel: #a3a9b2;
  --belt: #3a3f47;
  --belt-slat: #565d68;
  --gold: #e5b53a;
  --plate-white: #ffffff;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 10px 28px rgba(60, 40, 20, .10);
  --radius: 18px;
  --font-display: "Iansui", system-ui, sans-serif;
  --font-body: "Iansui", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18140f;
    --surface: #231d17;
    --surface-2: #2b241d;
    --ink: #f1e8da;
    --muted: #b6a48e;
    --line: #3b3129;
    --accent: #df5a44;
    --accent-dark: #93301f;
    --accent-soft: #4a2a22;
    --indigo: #2e4b77;
    --wood: #8a5c38;
    --wood-2: #6f4729;
    --wood-3: #4e321d;
    --steel: #5b626c;
    --belt: #2a2e34;
    --belt-slat: #3f454e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #18140f; --surface: #231d17; --surface-2: #2b241d; --ink: #f1e8da; --muted: #b6a48e;
  --line: #3b3129; --accent: #df5a44; --accent-dark: #93301f; --accent-soft: #4a2a22; --indigo: #2e4b77;
  --wood: #8a5c38; --wood-2: #6f4729; --wood-3: #4e321d; --steel: #5b626c; --belt: #2a2e34; --belt-slat: #3f454e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* 加到主畫面當 App 開時，避開瀏海和底部橫條 */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.35);
}
.brand h1 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 1.15; letter-spacing: .02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 48px; display: grid; gap: 18px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background-color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-dark); }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--line); color: var(--accent); }
.btn.danger:hover { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.search-panel form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field-label { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 12px; font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.limit-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.limit-pick:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.limit-pick select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.limit-pick select:focus { outline: none; }
.limit-pick option { color: #2b2119; background: #fffaf1; }
.location-row { display: flex; gap: 8px; }
.location-row input {
  flex: 1; min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.location-row input.geo { color: var(--indigo); font-weight: 700; }
:root[data-theme="dark"] .location-row input.geo { color: #9db8e6; }

.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mode {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 700;
  cursor: pointer;
}
.mode-ico { font-size: 20px; }
.mode[aria-checked="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); }
.prices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}
.price b { color: var(--accent); font-size: 15px; letter-spacing: .05em; }
.price small { font-weight: 400; font-size: 11px; color: var(--muted); }
.price[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.price[aria-pressed="true"] b { color: var(--gold); }
.price[aria-pressed="true"] small { color: var(--indigo-ink); opacity: .8; }
@media (max-width: 600px) { .prices { grid-template-columns: repeat(2, 1fr); } }
.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rating {
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.rating[aria-checked="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
@media (max-width: 600px) { .ratings { grid-template-columns: repeat(2, 1fr); } }
.ride-sub { display: flex; gap: 16px; padding-left: 2px; font-size: 14px; }
.ride-sub label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.search-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input, .ride-sub input { accent-color: var(--accent); width: 16px; height: 16px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.quota { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; cursor: help; }
.quota.warn { color: #8a5a00; background: #fff1c9; border-color: #e8c66a; }
.quota.stop { color: #fff; background: var(--accent); border-color: var(--accent); }
.quota-banner { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.quota-banner.warn { background: #fff1c9; color: #6b4600; }
.quota-banner.stop { background: var(--accent-soft); color: var(--accent-dark); }
.status { margin: 12px 0 0; min-height: 1.5em; color: var(--muted); font-size: 14px; }
.status.error { color: var(--accent); font-weight: 500; }
.status.ok { color: var(--ink); }
.status .linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- source tabs ---------- */
.source-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.source-tabs [role="tab"] {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}
.source-tabs [aria-selected="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.tab-count:not(:empty) {
  display: inline-block;
  min-width: 20px;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #2b2119;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

/* ---------- saved places ---------- */
.places-row { display: flex; flex-wrap: wrap; gap: 6px; }
.place-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.place-chip:has(.place-pick[aria-pressed="true"]) { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.place-pick { border: 0; background: none; padding: 5px 4px 5px 12px; font-weight: 700; cursor: pointer; }
.place-del { border: 0; background: none; padding: 5px 10px 5px 6px; opacity: .5; cursor: pointer; }
.place-del:hover { opacity: 1; color: var(--accent); }
.place-chip:has(.place-pick[aria-pressed="true"]) .place-del:hover { color: var(--indigo-ink); }
.place-add {
  border: 1px dashed var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  background: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.place-add:hover { color: var(--ink); border-color: var(--ink); }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-row [aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.dlg-label { font-weight: 700; font-size: 14px; margin-top: 4px; }
.place-edit { border: 0; background: none; padding: 5px 2px 5px 4px; opacity: .55; cursor: pointer; }
.place-edit:hover { opacity: 1; }
.small-note { font-size: 13px; min-height: 0; }
.small-note.error { color: var(--accent); }
.small-note:empty { display: none; }

/* ---------- favorites ---------- */
.floc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.floc-tabs [role="tab"] {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.floc-tabs [aria-selected="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.floc-tabs .n { font-weight: 500; opacity: .75; margin-left: 2px; }
.belt-locs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -2px 0 10px; }
.belt-locs .floc-tabs { margin: 0; }
.belt-locs-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.belt-locs-hint { font-size: 13px; color: var(--muted); }
.save-wheel:not([hidden]) { animation: nudge 1.6s ease-in-out 2; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 64, 46, .0); } 50% { box-shadow: 0 0 0 6px rgba(200, 64, 46, .25); } }
.wheel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wheel-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.wheel-chip.on { background: var(--indigo); border-color: var(--indigo); color: var(--indigo-ink); }
.wheel-chip button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.wheel-load { padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 700; }
.wheel-load small { font-weight: 500; opacity: .75; margin-left: 4px; }
.wheel-x { width: 26px; height: 26px; border-radius: 50%; opacity: .7; }
.wheel-x:hover { opacity: 1; background: rgba(127,127,127,.18); }
.list-search {
  width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.list-search:focus { outline: 2px solid var(--indigo); outline-offset: 1px; }
.floc-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.fav-chip .floc-tag {
  width: auto; height: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.fav-chip .floc-tag:hover { color: var(--ink); background: var(--line); }
.fav-add { display: flex; gap: 8px; margin-bottom: 12px; }
.fav-add input {
  flex: 1; min-width: 0;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.fav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 3px 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.fav-chip a { min-width: 0; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-chip a:hover { text-decoration: underline; }
.fav-chip button {
  flex: none;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.fav-chip button:hover { color: var(--accent); background: var(--accent-soft); }
.fav-empty { color: var(--muted); font-size: 14px; }

/* ---------- conveyor stage ---------- */
.stage {
  position: relative;
  height: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 35%, var(--surface) 0%, var(--surface-2) 70%);
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
}
.belt-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.belt-svg path { fill: none; stroke-linejoin: round; }
.belt-edge { stroke: var(--steel); }
.belt-base { stroke: var(--belt); }
.belt-slats { stroke: var(--belt-slat); }
.pick-ring { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 7 6; }
.plates { position: absolute; inset: 0; z-index: 1; }

.plate {
  --rim: #d64933;
  position: absolute;
  left: 0; top: 0;
  width: var(--plate, 84px);
  height: var(--plate, 84px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, var(--plate-white) 0 50%, #ece5da 51% 55%, var(--plate-white) 56%);
  border: calc(var(--plate, 84px) * .075) solid var(--rim);
  box-shadow: 0 3px 0 rgba(0,0,0,.18), 0 7px 14px rgba(0,0,0,.28);
  will-change: transform;
}
.dish {
  font-size: calc(var(--plate, 84px) * .44);
  line-height: 1;
  transform: translateY(-6%);
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.22));
}
.plate-name {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  max-width: 120%;
  padding: 0 5px;
  border-radius: 4px;
  background: #fffaf1;
  color: #3b2a1d;
  font-size: max(10px, calc(var(--plate, 84px) * .13));
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.plate.empty .plate-name { display: none; }
.plate.deco .plate-name { background: #f0e7da; color: #7c6a57; }
/* 停下時不放大、不彈跳，只亮金框 */
.plate.winner {
  z-index: 5;
  box-shadow: 0 0 0 4px var(--gold), 0 0 24px 6px rgba(229, 181, 58, .7);
}

.noren {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  border-radius: 0 0 10px 10px;
  color: var(--indigo-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .3em;
  background:
    linear-gradient(90deg, transparent calc(33.3% - 1px), rgba(0,0,0,.28) calc(33.3% - 1px) calc(33.3% + 1px), transparent calc(33.3% + 1px) calc(66.6% - 1px), rgba(0,0,0,.28) calc(66.6% - 1px) calc(66.6% + 1px), transparent calc(66.6% + 1px)),
    var(--indigo);
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.noren::before {
  content: "";
  position: absolute;
  left: -8px; right: -8px; top: 0;
  height: 8px;
  border-radius: 4px;
  background: var(--wood-3);
}
.noren span { padding-left: .3em; }

.pick-marker {
  position: absolute;
  z-index: 3;
  transform: translateX(-50%);
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--accent-dark);
}

.island {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  text-align: center;
  background:
    repeating-linear-gradient(92deg, rgba(255,255,255,.06) 0 2px, transparent 2px 11px, rgba(0,0,0,.05) 11px 13px, transparent 13px 23px),
    linear-gradient(180deg, var(--wood), var(--wood-2));
  box-shadow: inset 0 2px 10px rgba(0,0,0,.28), 0 1px 0 rgba(255,255,255,.2);
}
.pool-count { color: #fff6e6; font-size: 13px; font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.spin-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 34px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--accent-dark), 0 10px 20px rgba(0,0,0,.25);
  transition: transform .1s, box-shadow .1s;
}
.spin-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-dark), 0 6px 12px rgba(0,0,0,.25); }
.spin-btn:disabled { opacity: .5; cursor: default; }
.stage.spinning .spin-btn { animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(.96); } }
.island-link { background: none; border: 0; color: #fff6e6; font-size: 13px; text-decoration: underline; cursor: pointer; }
.stage.final .island { box-shadow: inset 0 0 0 3px var(--gold), inset 0 2px 10px rgba(0,0,0,.28); }

/* ---------- result overlay ---------- */
.result {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(25, 15, 8, .45);
  animation: fade .2s ease-out;
}
.result-card {
  width: min(380px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 22px 20px 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.result.leaving { animation: fade .2s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.result-kicker { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .15em; }
.plate.big { position: relative; --plate: 104px; margin: 10px auto 8px; }
.result-card h3 { margin: 6px 0 4px; font-family: var(--font-display); font-size: 26px; line-height: 1.25; }
.result-meta { margin: 0; font-size: 14px; color: var(--ink); }
.result-addr { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 10px; }
.result-link { font-size: 13px; color: var(--muted); }
.plate.toss { animation: toss .55s ease-in forwards; }
@keyframes toss { to { transform: translate(140px, 260px) rotate(200deg); opacity: 0; } }

.plate.flying { position: fixed; margin: 0; z-index: 100; pointer-events: none; transform-origin: center; }

/* ---------- candidate table ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.section-actions { display: flex; gap: 8px; }
.count { font-family: var(--font-body); font-size: 14px; color: var(--muted); font-weight: 500; }
.table {
  min-height: 170px;
  padding: 22px 18px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px 14px;
  align-items: start;
  background:
    repeating-linear-gradient(178deg, rgba(255,255,255,.05) 0 3px, transparent 3px 14px, rgba(0,0,0,.06) 14px 16px, transparent 16px 31px),
    linear-gradient(180deg, var(--wood-2), var(--wood-3));
  box-shadow: inset 0 3px 14px rgba(0,0,0,.3), var(--shadow);
}
.table-empty { grid-column: 1 / -1; align-self: center; margin: 0; text-align: center; color: #fff1dc; opacity: .9; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.seat .plate { position: relative; --plate: 78px; }
.seat-name {
  max-width: 100%;
  padding: 2px 10px;
  border-radius: 6px;
  background: #fffaf1;
  color: #2b2119;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.seat-meta { color: #fff3e0; font-size: 12px; }
.seat-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.seat-actions > * { white-space: nowrap; }
.seat-actions [aria-pressed="true"] { color: var(--gold); }
.seat-actions a, .seat-actions button {
  border: 0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,250,241,.18);
  color: #fff6e6;
  text-decoration: none;
  cursor: pointer;
}
.seat-actions a:hover, .seat-actions button:hover { background: rgba(255,250,241,.32); }
.seat.incoming { visibility: hidden; }
.seat.leaving { animation: leave .3s ease-in forwards; }
@keyframes leave { to { opacity: 0; scale: .6; } }
.seat.chosen .plate { box-shadow: 0 0 0 4px var(--gold), 0 0 24px 6px rgba(229,181,58,.7); }

/* ---------- list + map ---------- */
.lower { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sorts { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.sorts button { border: 0; border-radius: 999px; padding: 4px 12px; background: transparent; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.sorts button[aria-checked="true"] { background: var(--indigo); color: var(--indigo-ink); }
.list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }
.list li {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: 0; }
.li-emoji { font-size: 24px; text-align: center; }
.li-name { font-weight: 700; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-name:hover { text-decoration: underline; }
.li-meta { color: var(--muted); font-size: 12px; }
.li-del {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.li-del:hover { color: var(--accent); border-color: var(--accent); }
.li-fav {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.li-fav[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.li-fav:hover { border-color: var(--gold); }
.list li.list-empty { display: block; color: var(--muted); font-size: 14px; padding: 8px 0; border-bottom: 0; }
.map-panel { position: relative; padding: 0; overflow: hidden; min-height: 320px; }
#map { position: absolute; inset: 0; }
.map-msg {
  position: absolute; inset: 0;
  margin: 0;
  display: grid; place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--surface) 0 12px, var(--surface-2) 12px 24px);
}

/* ---------- settings dialog ---------- */
dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(25, 15, 8, .45); }
.settings { padding: 20px; display: grid; gap: 10px; }
.settings h2 { margin: 0; font-family: var(--font-display); }
.settings p, .settings ul { margin: 0; font-size: 14px; }
.settings ul { padding-left: 20px; }
.muted { color: var(--muted); }
.settings input { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.spacer { flex: 1; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .lower { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .brand h1 { font-size: 22px; }
  .brand-mark { width: 40px; height: 40px; font-size: 21px; }
  .modes { grid-template-columns: repeat(2, 1fr); }
  .location-row { flex-direction: column; }
  .search-foot .btn.primary { width: 100%; }
  .stage { height: 340px; border-radius: 20px; }
  .spin-btn { font-size: 20px; padding: 8px 26px; }
  .pool-count { font-size: 12px; }
  .noren { font-size: 13px; padding-bottom: 8px; }
  .table { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); padding: 18px 12px; }
  .seat .plate { --plate: 64px; }
  .seat-name { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage.spinning .spin-btn, .save-wheel:not([hidden]) { animation: none; }
}
