:root {
  --red: #ff4d4f;
  --red-deep: #e03a3c;
  --red-soft: #fff1f0;
  --gold: #f5c542;
  --gold-deep: #d4a017;
  --ink: #1f2937;
  --muted: #8c8c8c;
  --line: #f0f0f0;
  --panel: #ffffff;
  --bg: #f8f8f8;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
          "Noto Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 28px;
  --btn-h: 36px;
  --btn-h-lg: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* Hide scrollbars system-wide; scrolling still works */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.muted { color: var(--muted); font-size: var(--fs-sm); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  border: none; border-radius: 8px; height: var(--btn-h); padding: 0 16px;
  cursor: pointer; font-size: var(--fs-md); font-weight: 600;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(255, 77, 79, 0.28); }
.btn--primary:hover { background: var(--red-deep); }
.btn--secondary { background: #fff; color: var(--ink); border: 1px solid #e8e8e8; }
.btn--ghost { background: #fafafa; color: #595959; border: 1px dashed #d9d9d9; }
.btn--block { width: 100%; }
.btn--sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.btn--save { height: 32px; padding: 0 14px; font-weight: 600; border-radius: 8px; font-size: var(--fs-sm); }
.btn__icon { flex-shrink: 0; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.input {
  width: 100%; border: 1px solid #e8e8e8; border-radius: 8px;
  padding: 0.75rem 1rem; background: #fff; outline: none;
}
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,77,79,.12); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.brand__icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; overflow: hidden;
  flex-shrink: 0;
}
.brand__icon img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.brand__name { font-size: var(--fs-lg); letter-spacing: 0.01em; font-weight: 900; }

/* Topbar — brand + tabs left, actions right */
.topbar {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  padding: 0 1.75rem;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { align-self: center; flex-shrink: 0; }
.topbar__right {
  margin-left: auto; display: flex; align-items: center; gap: 0.85rem; align-self: center; flex-shrink: 0;
}
.tabs { display: flex; align-items: stretch; height: 100%; gap: 0.15rem; }
.tabs__item {
  display: inline-flex; align-items: center;
  padding: 0 14px; font-weight: 500; font-size: var(--fs-md); color: #595959;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs__item.is-active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.tabs__item:hover { color: var(--red); }

.lang-dropdown { position: relative; }
.lang-dropdown__btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 1px solid #f0f0f0; border-radius: 8px;
  height: 32px; padding: 0 10px; cursor: pointer; color: #595959; font-weight: 500; font-size: var(--fs-sm);
  line-height: 1;
}
.lang-dropdown__btn:hover { border-color: #ffccc7; color: var(--red); }
.lang-globe,
.lang-caret {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; height: 1em; line-height: 0;
}
.lang-caret { opacity: 0.75; }
.lang-caret svg {
  display: block; width: 10px; height: 10px;
  /* optical vertical align with label across engines */
  transform: translateY(0.08em);
}
#lang-label { line-height: 1; display: inline-block; }
.lang-dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 0.35rem;
  list-style: none; background: #fff; border: 1px solid #f0f0f0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 120px; z-index: 30;
}
.lang-option {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 0.5rem 0.75rem; border-radius: 6px; cursor: pointer; font-weight: 600; color: #595959;
}
.lang-option:hover, .lang-option.is-active { background: var(--red-soft); color: var(--red); }

/* Console */
.console {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.5rem;
  min-height: calc(100vh - 60px);
  background: var(--bg);
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel--left {
  padding: 1.1rem 1.1rem 1.15rem;
  min-height: calc(100vh - 60px - 2.5rem);
  max-height: calc(100vh - 60px - 2.5rem);
}
.panel--right {
  padding: 1.15rem 1.1rem;
  min-height: calc(100vh - 60px - 2.5rem);
  max-height: calc(100vh - 60px - 2.5rem);
}

.left-title-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.75rem; gap: 0.5rem;
}
.left-title { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.left-count { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; font-weight: 400; }
.left-count strong { color: var(--red); font-weight: 600; }

.panel__head {
  display: flex; gap: 0; margin-bottom: 0.85rem;
  padding: 3px; background: #f0f0f0; border-radius: 999px;
}
.seg-tab {
  flex: 1; border: none; background: transparent; padding: 0.5rem 0.35rem;
  font-weight: 500; font-size: var(--fs-sm); color: #8c8c8c; cursor: pointer;
  border-radius: 999px; line-height: 1.2;
}
.seg-tab:hover:not(.is-active) { color: #595959; }
.seg-tab.is-active {
  color: #fff; background: var(--red); font-weight: 600;
  box-shadow: 0 2px 8px rgba(245, 34, 45, 0.28);
}

.left-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.left-pane[hidden] { display: none !important; }
.names-input {
  width: 100%; flex: 1 1 auto; min-height: 140px; max-height: none; resize: none;
  border: 1px solid #f0f0f0; border-radius: 8px; padding: 12px;
  background: #fafafa; outline: none; line-height: 1.6;
  color: #595959; font-size: var(--fs-md); font-weight: 400;
}
.names-input:focus { border-color: #ffccc7; background: #fff; }
.names-wrap { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.names-wrap .names-input { flex: 1 1 auto; padding-bottom: 36px; }
.names-upload-fab {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  background: rgba(255,255,255,0.95); border: 1px solid #e8e8e8;
  color: #8c8c8c; font-size: var(--fs-xs); font-weight: 500; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.names-upload-fab:hover { color: var(--red); border-color: #ffccc7; background: var(--red-soft); }
.left-hint { margin: 0.45rem 0 0; font-size: var(--fs-xs); color: #bfbfbf; text-align: left; font-weight: 400; flex-shrink: 0; }
.btn--confirm {
  margin-top: 0.7rem; height: var(--btn-h-lg); padding: 0 16px; border-radius: 8px;
  font-size: var(--fs-md); font-weight: 600; flex-shrink: 0;
}
#btn-confirm-list[hidden] { display: none !important; }

.qr-panel {
  flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 0.55rem;
}
.qr-panel__draft {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; text-align: center; padding: 1.25rem 0.5rem;
  background: #fff; border: 1px dashed #ffccc7; border-radius: 12px;
  color: #8c8c8c; font-size: var(--fs-sm); flex-shrink: 0;
}
.qr-panel__draft[hidden], .qr-panel__live[hidden] { display: none !important; }
.qr-panel__live { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.qr-panel__code-wrap {
  position: relative; width: 112px; height: 112px;
  background: #fff; border-radius: 10px; border: 1px solid #f0f0f0;
  display: grid; place-items: center; overflow: hidden;
}
.qr-panel__code { width: 96px; height: 96px; }
.qr-panel__code svg, .qr-panel__code img { width: 100%; height: 100%; display: block; }
.qr-panel__closed {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.82); color: var(--red); font-weight: 700; font-size: var(--fs-sm);
  z-index: 2; pointer-events: none;
}
.qr-panel__closed[hidden] { display: none !important; }
.qr-panel__actions {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 0.35rem;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
}
.qr-panel__code-wrap:hover .qr-panel__actions {
  opacity: 1; pointer-events: auto;
}
/* Keyboard: only while focus ring is visible, not after a mouse click */
.qr-panel__code-wrap:has(.qr-panel__actions button:focus-visible) .qr-panel__actions {
  opacity: 1; pointer-events: auto;
}
.qr-panel__actions .btn {
  width: 100%; max-width: 96px; font-size: 11px; height: 26px; padding: 0 6px;
  white-space: nowrap;
}
.qr-panel__feed {
  flex: 1 1 auto; min-height: 140px; display: flex; flex-direction: column;
  background: #fff; border: 1px solid #f0f0f0; border-radius: 12px; padding: 0.55rem 0.65rem;
  overflow: hidden;
}
.qr-panel__feed-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.35rem;
  font-size: var(--fs-sm); font-weight: 700; color: #595959; margin-bottom: 0.4rem; flex-shrink: 0;
}
.qr-feed__refresh {
  width: 26px; height: 26px; border: none; border-radius: 8px;
  background: transparent; color: #bfbfbf; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
}
.qr-feed__refresh:hover { background: #fff1f0; color: var(--red); }
.qr-feed__refresh.is-spinning svg { animation: qr-refresh-spin .7s linear; }
@keyframes qr-refresh-spin { to { transform: rotate(360deg); } }
.qr-feed {
  list-style: none; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden;
  flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch;
}
.qr-feed:empty { display: none; }
.qr-feed__item {
  position: relative;
  display: grid; grid-template-columns: 28px 1fr auto; gap: 0.45rem; align-items: center;
  padding: 0.35rem 0; border-bottom: 1px solid #fafafa; font-size: var(--fs-sm);
}
.qr-feed__item:last-child { border-bottom: none; }
.qr-feed__item--enter { animation: recent-pop .36s cubic-bezier(.2, .9, .3, 1.15); }
.qr-feed__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--red-soft); color: var(--red);
  font-weight: 700; font-size: 12px;
}
.qr-feed__name { font-weight: 600; color: #262626; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-feed__time { color: #bfbfbf; font-size: var(--fs-xs); white-space: nowrap; }
.qr-feed__del {
  display: none; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; border-radius: 6px;
  background: transparent; color: #bfbfbf; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0;
}
.qr-feed__del:hover { color: var(--red); background: var(--red-soft); }
.qr-feed__item:hover .qr-feed__time { visibility: hidden; }
.qr-feed__item:hover .qr-feed__del { display: inline-flex; position: absolute; right: 0; }
.qr-feed__empty {
  flex: 1 1 auto; min-height: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: var(--fs-sm);
}
.qr-feed__loading {
  margin: 0; padding: 0.55rem 0; text-align: center; font-size: var(--fs-sm); flex-shrink: 0;
}
.qr-feed__empty[hidden], .qr-feed__loading[hidden] { display: none !important; }

.join-page {
  position: relative;
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(180deg, #fff7f6, #f5f5f5 40%);
}
.join-page__brand {
  position: absolute; top: 1rem; left: 1rem; z-index: 2; margin: 0;
}
.join-page > .join-lang {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
}
.join-card {
  width: min(420px, 100%); background: #fff; border-radius: 16px;
  padding: 1.75rem 1.5rem; box-shadow: var(--shadow); text-align: center;
}
.join-lang {
  display: inline-flex; padding: 2px; background: #f5f5f5; border-radius: 999px; gap: 2px; flex-shrink: 0;
}
.join-lang__btn {
  border: none; background: transparent; border-radius: 999px;
  padding: 0.25rem 0.55rem; font-size: 12px; font-weight: 600; color: #8c8c8c; cursor: pointer;
}
.join-lang__btn.is-active { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.join-card__title { margin: 0; font-size: 1.35rem; font-weight: 800; }
.join-card__lead { margin: 0.4rem 0 1.1rem; }
.join-hint { margin: 0.65rem 0 0; font-size: var(--fs-xs); }
.join-msg { margin: 1rem 0 0; font-weight: 600; color: var(--red); }
.join-msg.is-ok { color: #389e0d; }
.join-error { margin: 0.75rem 0 0; }
.join-done { margin-top: 0.25rem; }
.join-done[hidden] { display: none !important; }
.join-done__badge {
  margin: 0; font-size: var(--fs-sm); font-weight: 600; color: #389e0d;
}
.join-done__name {
  margin: 0.65rem 0 0; font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800; color: var(--red); word-break: break-word;
}
.join-done__hint { margin: 0.75rem 0 0; font-size: var(--fs-sm); line-height: 1.45; }

/* Stage — no panel background; sits on page bg */
.stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 0.5rem 0 1rem;
  background: transparent;
  border-radius: 0;
  min-height: calc(100vh - 60px - 2.5rem);
}
.btn--project {
  position: absolute; top: 0; right: 0; z-index: 3;
  border-radius: 999px; border: 1px solid #f0f0f0; color: #595959; gap: 0.3rem;
  background: #fff;
}
.btn--project:hover { border-color: #ffccc7; color: var(--red); background: var(--red-soft); }
.stage__hero { text-align: center; margin-bottom: 0.35rem; flex-shrink: 0; }
.stage__title {
  margin: 0; font-size: clamp(24px, 2.6vw, var(--fs-2xl)); font-weight: 900;
  letter-spacing: 0.04em; color: #1f2937; line-height: 1.25;
}
.stage__title-text {
  font-weight: 900;
  -webkit-text-stroke: 0.3px currentColor;
}
.stage__editable {
  position: relative;
  display: inline-block;
  outline: none;
  border-radius: 8px;
  cursor: text;
  padding: 0.1rem 1.55rem 0.1rem 0.4rem;
  transition: background .15s ease, box-shadow .15s ease;
}
.stage__editable:hover {
  background: rgba(0, 0, 0, 0.045);
}
.stage__editable::after {
  content: "";
  position: absolute;
  right: 0.3rem;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c8c8c' stroke-width='2'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}
.stage__editable:hover::after,
.stage__editable.is-editing::after { opacity: 1; }
.stage__editable.is-editing {
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.35);
  background: rgba(255,255,255,0.9);
}
.stage__sub { margin: 0.35rem 0 0; color: #d48806; font-weight: 400; font-size: var(--fs-md); line-height: 1.4; }

.wheel-wrap {
  position: relative; width: min(380px, 70vw); aspect-ratio: 1;
  display: grid; place-items: center;
  margin: 0.35rem 0 1rem;
  filter: drop-shadow(0 16px 28px rgba(120, 40, 20, 0.22));
  flex-shrink: 0;
}
#wheel-canvas { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 5;
  border-left: 20px solid transparent; border-right: 20px solid transparent;
  border-top: 44px solid var(--red);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.25));
}
.wheel-pointer::after {
  content: ""; position: absolute; left: -8px; top: -44px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3.5px solid var(--red);
}
.wheel-start {
  position: absolute; inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%;
  border: 5px solid #fff; z-index: 4;
  background: radial-gradient(circle at 35% 28%, #ff7875, var(--red) 55%, #c41d1f);
  color: #fff; font-weight: 800; font-size: var(--fs-xl); cursor: pointer;
  box-shadow: 0 8px 18px rgba(180, 20, 30, 0.45), inset 0 2px 0 rgba(255,255,255,.35);
}
.wheel-start.is-spinning { cursor: pointer; filter: none; opacity: 1; }
.wheel-start:hover { filter: brightness(1.05); }
.wheel-start.is-spinning:hover { filter: brightness(1.05); }

.stage__controls {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.35rem 0.75rem;
  background: #fff; border: 1px solid #f0f0f0; border-radius: 999px;
  padding: 0.4rem 0.85rem; box-shadow: var(--shadow);
  width: auto; max-width: 96%;
  margin-top: 0.25rem;
  flex-shrink: 0;
  z-index: 2;
}
.prize-chip {
  display: inline-flex; align-items: center; gap: 0.15rem;
  font-size: var(--fs-sm); color: #595959; white-space: nowrap; font-weight: 400;
}
.prize-chip__name {
  border: none; background: transparent; cursor: pointer; padding: 0.1rem 0.2rem;
  border-radius: 6px; line-height: 1.2;
}
.prize-chip__name:hover { background: var(--red-soft); }
.prize-chip__name strong,
#current-prize-label { color: var(--red); font-weight: 700; font-size: var(--fs-md); }
.qty-control { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--fs-sm); color: #595959; white-space: nowrap; flex-shrink: 0; font-weight: 400; }
.qty-colon { margin-right: 0.05rem; }
.qty-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid #ffccc7;
  background: #fff; cursor: pointer; font-size: 13px; line-height: 1; color: var(--red); font-weight: 600;
}
.qty-btn:hover { background: var(--red-soft); }
.qty-value {
  min-width: 1.1rem; text-align: center; font-weight: 700; color: var(--red); font-size: var(--fs-md);
}

/* Right */
.progress-card {
  position: relative;
  border: 1px solid #fff1f0; border-radius: 12px;
  padding: 1rem 2rem 1rem 1rem; margin-bottom: 1.1rem;
  background: linear-gradient(180deg, #fff7f6, #fff);
  transition: padding .2s ease;
}
.progress-card__toggle {
  position: absolute; top: 0.55rem; right: 0.45rem;
  width: 26px; height: 26px; border: none; border-radius: 8px;
  background: transparent; color: #bfbfbf; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.progress-card__toggle:hover { background: #fff1f0; color: var(--red); }
.progress-card__chevron { transition: transform .2s ease; }
.progress-card__summary {
  display: none;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--red);
  font-weight: 500;
  padding-right: 0.25rem;
}
.progress-card__summary strong { font-size: var(--fs-md); font-weight: 700; margin-left: 0.1rem; }
.progress-card.is-collapsed {
  padding: 0.55rem 2rem 0.55rem 1rem;
}
.progress-card.is-collapsed .progress-card__body { display: none; }
.progress-card.is-collapsed .progress-card__summary { display: flex; }
.progress-card.is-collapsed .progress-card__chevron { transform: rotate(-90deg); }
.progress-card__row { margin-bottom: 0.75rem; }
.progress-remain {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: var(--fs-md); color: var(--red); font-weight: 500;
}
.progress-remain strong { font-size: 22px; font-weight: 700; margin-left: 0.15rem; }
.progress-label-row {
  display: flex; justify-content: space-between; font-size: var(--fs-sm); color: #8c8c8c; margin-bottom: 0.4rem; font-weight: 400;
}
.progress-bar {
  height: 8px; background: #fff1f0; border-radius: 999px; overflow: hidden;
}
.progress-bar__fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #ff7875, var(--red));
  border-radius: 999px; transition: width .4s ease;
}

.recent__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.75rem;
}
.recent__head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.recent__count {
  font-size: var(--fs-sm); color: #8c8c8c; font-weight: 600;
  min-width: 1.25rem; text-align: right;
}
.recent__list { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: calc(100vh - 300px); }
.recent__item {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 0.6rem; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid #f5f5f5; position: relative;
}
.recent__item--enter {
  animation: recent-pop .36s cubic-bezier(.2, .9, .3, 1.15);
}
.recent__item--pending { opacity: 0; }
@keyframes recent-pop {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.winner-fly {
  position: fixed; z-index: 70; pointer-events: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  background: #fff; border-radius: 999px;
  box-shadow: 0 14px 32px rgba(180, 40, 30, 0.28), 0 2px 8px rgba(0,0,0,.08);
  border: 1px solid #ffe7e5;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  white-space: nowrap;
}
.winner-fly__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, #ffe7ba, #ffc53d);
  display: grid; place-items: center;
  font-weight: 700; color: #874d00; font-size: 14px; flex-shrink: 0;
}
.winner-fly__name { font-weight: 700; font-size: 15px; color: var(--ink); max-width: 7em; overflow: hidden; text-overflow: ellipsis; }
.recent__item .recent__del {
  display: none; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: #fff1f0; color: var(--red); cursor: pointer; font-size: 14px; font-weight: 700;
}
.recent__item:hover .recent__time { visibility: hidden; }
.recent__item:hover .recent__del { display: inline-flex; }
.recent__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(145deg, #ffe7ba, #ffc53d); display: grid; place-items: center;
  font-weight: 700; color: #874d00; font-size: var(--fs-md);
}
.recent__name { font-weight: 600; font-size: var(--fs-md); }
.recent__prize {
  font-size: var(--fs-xs); color: #8c8c8c; margin-top: 0.15rem;
  display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 400;
}
.recent__prize-img {
  width: 18px; height: 18px; border-radius: 4px; object-fit: cover;
  background: #fff1f0; flex-shrink: 0;
}
.recent__time { font-size: var(--fs-xs); color: #bfbfbf; white-space: nowrap; font-weight: 400; }
.recent__empty { color: #bfbfbf; font-size: var(--fs-sm); text-align: center; padding: 1.5rem 0; }

.project-brand {
  display: none;
  position: fixed; top: 1rem; left: 1rem; z-index: 60;
  pointer-events: none;
}
.project-exit {
  position: fixed; top: 1rem; right: 1rem; z-index: 60;
  border: none; background: rgba(0,0,0,.55); color: #fff;
  padding: 0.55rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 600;
  backdrop-filter: blur(6px);
}
.project-exit[hidden] { display: none !important; }

/* Projection mode */
body.is-projection .topbar,
body.is-projection .panel--left,
body.is-projection .panel--right,
body.is-projection .btn--project { display: none !important; }
body.is-projection .console {
  grid-template-columns: 1fr; padding: 0; min-height: 100vh; background:
    radial-gradient(ellipse 70% 50% at 50% 10%, rgba(255, 220, 180, 0.55), transparent 55%),
    linear-gradient(180deg, #fff7f0, #f5f5f5);
}
body.is-projection .stage {
  min-height: 100vh; justify-content: center; padding: 2rem 1rem 3rem;
  background: transparent;
}
body.is-projection .wheel-wrap {
  width: min(560px, 78vw); margin: 1rem 0 2rem;
}
body.is-projection .project-brand { display: inline-flex; }
body.is-projection .project-exit { display: inline-flex !important; }
body.is-projection .modal__panel--reveal {
  width: min(440px, 92vw); padding: 2.25rem 1.75rem 1.75rem;
}
body.is-projection .reveal-names { font-size: clamp(2rem, 5vw, 3rem); }

/* Subpages */
body.page-winners,
body.page-participants {
  background: var(--bg);
}
.subpage {
  padding: 1.5rem; max-width: 960px; margin: 0 auto;
  min-height: calc(100vh - 60px);
}
.events-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.events-card {
  border: 1px solid #f0f0f0; border-radius: 12px; padding: 1rem 1.1rem;
  background: #fafafa; display: flex; flex-wrap: wrap; gap: 0.75rem 1rem;
  align-items: center; justify-content: space-between;
}
.events-card__meta { min-width: 0; flex: 1 1 200px; }
.events-card__title { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.events-card__id { margin: 0.25rem 0 0; font-size: var(--fs-xs); color: #8c8c8c; word-break: break-all; }
.events-card__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.subpage__card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem 1.5rem 1.5rem;
}
.subpage__toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.subpage__toolbar h1 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.subpage__lead { margin: 0.35rem 0 0; font-size: 0.9rem; }
.subpage__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stats-row {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.15rem;
}
.stat-chip {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  background: linear-gradient(180deg, #fff7f6, #fff);
  border: 1px solid #fff1f0; border-radius: 12px;
  padding: 0.65rem 1rem; min-width: 110px;
}
.stat-chip__label { font-size: 0.82rem; color: #8c8c8c; }
.stat-chip__value { font-size: 1.35rem; font-weight: 900; color: var(--ink); }
.stat-chip__value--red { color: var(--red); }
.stat-chip__unit { font-size: 0.85rem; color: #8c8c8c; }

.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.85rem 0.5rem; border-bottom: 1px solid #f5f5f5; }
.table th { font-size: 0.85rem; color: #8c8c8c; font-weight: 600; }
.table--rich .cell-person {
  display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 700;
}
.table--rich .cell-prize {
  display: inline-flex; align-items: center; gap: 0.3rem; color: #595959;
}
.table--rich .cell-time { color: #8c8c8c; font-size: 0.9rem; }
.table .cell-actions { text-align: right; white-space: nowrap; width: 1%; }
.btn--row-del { color: var(--red); border-color: transparent; }
.btn--row-del:hover { background: #fff1f0; border-color: #ffccc7; }

.plist {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.55rem;
}
.plist li {
  padding: 0.7rem 0.85rem; border: 1px solid #f5f5f5; border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: #fafafa;
}
.plist__person { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; }
.plist .won {
  color: var(--red); font-size: 0.75rem; font-weight: 700;
  background: var(--red-soft); padding: 0.15rem 0.45rem; border-radius: 999px;
}

/* Modal */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem;
}
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal__panel {
  position: relative; background: #fff; border-radius: 14px; padding: 1.5rem;
  width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal__panel--wide { width: min(560px, 100%); }
.modal__panel h2 { margin: 0 0 0.75rem; }
.modal__warn { color: var(--red-deep); font-size: 0.92rem; line-height: 1.5; }
.modal__msg { margin: 0; color: #595959; font-size: 0.95rem; line-height: 1.55; }
.modal__panel--confirm { width: min(400px, 100%); }
.modal__actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.1rem; flex-wrap: wrap; }

.modal__panel--reveal {
  text-align: center;
  width: min(380px, 100%);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  animation: reveal-pop .38s cubic-bezier(.2, .9, .3, 1.15);
  z-index: 2;
}
@keyframes reveal-pop {
  from { opacity: 0; transform: scale(.88) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.reveal-gift {
  width: 72px; height: 72px; margin: 0 auto 0.85rem;
  animation: reveal-bounce 1.2s ease-in-out infinite;
}
.reveal-gift__img {
  width: 72px; height: 72px; object-fit: contain;
  border-radius: 14px; display: block;
  background: #fff7f6;
}
@keyframes reveal-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.reveal-title {
  margin: 0; font-size: 1.55rem; font-weight: 800; color: #262626; letter-spacing: 0.02em;
}
.reveal-names {
  margin: 0.85rem 0 0; font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800; color: var(--red); line-height: 1.25; word-break: break-word;
}
.reveal-prize {
  margin: 0.55rem 0 0; color: #595959; font-size: 1rem; font-weight: 500;
}
.btn--reveal-ok {
  width: 100%; margin-top: 1.5rem; height: 48px; border-radius: 999px;
  font-size: 1.05rem; font-weight: 700;
}
.celebrate-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

.prize-rows { display: flex; flex-direction: column; gap: 0.65rem; margin: 1rem 0; max-height: 50vh; overflow: auto; }
.prize-row {
  display: grid; grid-template-columns: auto auto 1fr 72px auto auto; gap: 0.4rem; align-items: center;
}
.prize-row input[type="radio"] { accent-color: var(--red); }
.prize-row input[type="text"], .prize-row input[type="number"] {
  border: 1px solid #e8e8e8; border-radius: 8px; padding: 0.55rem 0.7rem; width: 100%;
}
.prize-thumb {
  width: 36px; height: 36px; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid #f0f0f0; background: #fafafa; display: grid; place-items: center; flex-shrink: 0;
}
.prize-thumb__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prize-row .btn-img-clear {
  border: none; background: #f5f5f5; color: #8c8c8c; width: 28px; height: 28px;
  border-radius: 8px; cursor: pointer; font-size: 12px;
}
.prize-row .btn-img-clear:hover { color: var(--red); background: #fff1f0; }
.prize-row .btn-del {
  border: none; background: #fff1f0; color: var(--red); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-weight: 700;
}

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: #262626; color: #fff; padding: 0.75rem 1.2rem; border-radius: 999px;
  font-size: 0.92rem; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  max-width: min(90vw, 420px); text-align: center;
}
.toast[hidden] { display: none !important; }

/* Unauthorized simple */
.home {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background: linear-gradient(160deg, #fff7f0, #f5f5f5);
}
.home__card {
  width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 2rem;
  box-shadow: var(--shadow); text-align: center;
}
.home__lead { color: #666; line-height: 1.6; }

@media (max-width: 1100px) {
  .console { grid-template-columns: 1fr; }
  .panel--left, .panel--right { order: 2; }
  .stage { order: 1; }
  .plist { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 0.65rem 1rem; gap: 0.5rem; }
  .tabs { height: 40px; width: 100%; order: 3; }
  .topbar__right { margin-left: auto; }
}
