/* ==========================================================================
   Event Raffle — stylesheet
   "Vibrant & Block-based" style, adapted to a dark, high-contrast dashboard
   theme designed to be readable from a distance when projected on a large
   screen. Duotone accent pair (violet/cyan) + gold reveal + rose destructive.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Source+Sans+3:wght@400;500;600;700;800&display=swap');

:root {
  --bg-deep: #0b0d14;
  --bg-panel: #14162b;
  --bg-panel-alt: #1b1e3a;

  /* Duotone accent pair (Vibrant & Block-based style) */
  --accent-violet: #7c3aed;
  --accent-violet-bright: #a855f7;
  --accent-cyan: #22d3ee;
  --accent-cyan-bright: #67e8f9;

  /* Reveal + status accents */
  --accent-gold: #f59e0b;
  --accent-gold-bright: #fbbf24;
  --accent-rose: #fb7185;
  --accent-rose-bright: #fda4af;
  --success: #4ade80;

  --text-main: #f8fafc;
  --text-dim: #b4bcd9;
  --danger: #fb7185;

  --radius-lg: 24px;
  --radius-md: 14px;
  --block-gap: clamp(24px, 5vw, 48px);
  --motion-fast: 200ms;
  --motion-base: 250ms;
  --motion-slow: 300ms;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(5, 6, 12, 0.55) 0%, rgba(5, 6, 12, 0.75) 55%, rgba(5, 6, 12, 0.92) 100%),
    url("bg-banner.jpg") center center / cover no-repeat fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  max-width: 1200px;
  /* Left-anchored, not centered: on wide/projector screens this leaves the
     event background image visible and uncovered on the right side. Below
     max-width the right margin has no extra space to absorb, so it's
     identical to a centered layout — full width either way. */
  margin: 0 auto 0 0;
  padding: clamp(16px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
  min-height: 100vh;
}

/* The registration page is a working tool, not a projector display — unlike
   the raffle dashboard above, it should use the full window instead of
   leaving background visible on wide screens. */
.app.app-wide {
  max-width: none;
}

/* Visible, on-brand focus ring for keyboard navigation everywhere. */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-cyan-bright);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

/* ---------- Header ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.event-title {
  font-family: "Bebas Neue", Impact, "Arial Narrow Bold", sans-serif;
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  margin: 0;
  background: linear-gradient(90deg, var(--accent-violet-bright), var(--accent-cyan-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-controls {
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-panel);
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.icon-btn:hover {
  background: var(--bg-panel-alt);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn.is-muted {
  color: var(--danger);
  border-color: var(--danger);
}

.auth-status {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- Remaining counter ---------- */

.remaining-count {
  text-align: center;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-weight: 600;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: 0.04em;
}

.remaining-count .count-warning {
  color: var(--danger);
}

/* ---------- Main layout ---------- */

.raffle-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
  gap: var(--block-gap);
  align-items: start;
}

@media (max-width: 860px) {
  .raffle-main {
    grid-template-columns: 1fr;
  }
}

/* ---------- Winner stage (block panel) ---------- */

.winner-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
  background: linear-gradient(160deg, var(--bg-panel) 0%, var(--bg-panel-alt) 100%);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 40px);
  border: 2px solid var(--accent-violet);
  box-shadow: 10px 10px 0 rgba(124, 58, 237, 0.18);
  position: relative;
  overflow: hidden;
}

.winner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.winner-label {
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  letter-spacing: 0.3em;
  font-weight: 700;
  color: var(--text-dim);
}

.winning-name {
  font-family: "Bebas Neue", Impact, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--accent-gold-bright);
  text-shadow: 0 0 40px rgba(251, 191, 36, 0.55);
  transition: color var(--motion-fast) ease;
  text-align: center;
  max-width: 100%;
  overflow-wrap: break-word;
}

.winning-name.rolling {
  color: var(--accent-cyan-bright);
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.6);
}

.winning-name.reveal {
  animation: winnerPop 0.6s cubic-bezier(0.22, 1, 0.36, 1), winnerGlow 1.8s ease-in-out 0.6s infinite;
}

@keyframes winnerPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes winnerGlow {
  0%, 100% { text-shadow: 0 0 40px rgba(251, 191, 36, 0.55); }
  50%      { text-shadow: 0 0 80px rgba(251, 191, 36, 0.95); }
}

/* ---------- Draw button ---------- */

.draw-btn {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  min-height: 44px;
  padding: clamp(16px, 2.5vw, 22px) clamp(36px, 8vw, 72px);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-violet-bright), var(--accent-violet));
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
  transition: transform var(--motion-base) ease, box-shadow var(--motion-base) ease,
    background var(--motion-base) ease, color var(--motion-base) ease;
}

.draw-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--accent-cyan-bright), var(--accent-cyan));
  color: #04222b;
  box-shadow: 0 16px 36px rgba(34, 211, 238, 0.45);
}

.draw-btn:active:not(:disabled) {
  transform: translateY(0);
}

.draw-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.55;
  box-shadow: none;
}

.draw-btn.is-drawing {
  animation: pulseDraw 0.9s ease-in-out infinite;
}

@keyframes pulseDraw {
  0%, 100% { box-shadow: 0 10px 30px rgba(34, 211, 238, 0.35); }
  50%      { box-shadow: 0 10px 46px rgba(34, 211, 238, 0.65); }
}

.status-message {
  min-height: 1.4em;
  text-align: center;
  font-weight: 700;
  color: var(--danger);
  margin: 0;
}

/* ---------- History panel (block panel) ---------- */

.history-panel {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
  border: 2px solid var(--accent-cyan);
  box-shadow: 10px 10px 0 rgba(34, 211, 238, 0.14);
  max-height: 640px;
  display: flex;
  flex-direction: column;
}

.history-panel h2 {
  margin: 0 0 14px;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-panel-alt);
  border-radius: var(--radius-md);
  padding: 10px 34px 10px 14px;
  font-size: 1rem;
  animation: historySlideIn 0.35s ease;
}

.history-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.history-remove-btn:hover {
  background: rgba(251, 113, 133, 0.18);
  border-color: var(--accent-rose);
  color: var(--accent-rose-bright);
}

.history-item-name {
  color: var(--text-main);
  font-weight: 700;
  font-size: 1rem;
}

.history-item-store {
  color: var(--accent-cyan-bright);
  font-weight: 600;
  font-size: 0.85rem;
}

.history-item-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin-top: 2px;
}

@keyframes historySlideIn {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.history-time {
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

.history-empty {
  color: var(--text-dim);
  font-style: italic;
  padding: 10px 14px;
}

/* ---------- Footer ---------- */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.reset-btn {
  font-size: 1rem;
  font-weight: 700;
  min-height: 44px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid var(--accent-rose);
  background: rgba(251, 113, 133, 0.08);
  color: var(--accent-rose-bright);
  cursor: pointer;
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.reset-btn:hover {
  background: rgba(251, 113, 133, 0.2);
  transform: translateY(-2px);
}

.hint {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

.hint kbd {
  background: var(--bg-panel-alt);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85rem;
}

/* ---------- Confetti (duotone + gold + rose + success accents) ---------- */

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 999;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  opacity: 0.9;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0.4;
  }
}

/* ---------- Fullscreen tweaks ---------- */

:fullscreen .app,
:-webkit-full-screen .app {
  max-width: none;
  justify-content: center;
}

/* ---------- Navigation pill (link between raffle and registration) ---------- */

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent-cyan-bright);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

/* Same reason as .modal-overlay[hidden] below: the display:inline-flex above
   is an author rule, so it beats the UA stylesheet's `[hidden] { display:
   none }` regardless of specificity. Without this override the Sign In /
   Sign Out buttons would stay visible even while `hidden` is set. */
.nav-pill[hidden] {
  display: none;
}

.nav-pill:hover {
  background: rgba(34, 211, 238, 0.2);
  transform: translateY(-2px);
}

/* ---------- Stats row (raffle dashboard) ---------- */

.stats-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-chip {
  margin: 0;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 2px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  color: var(--text-dim);
}

.stat-chip.stat-eligible {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.stat-chip.stat-winners {
  border-color: var(--accent-gold);
  color: var(--text-main);
}

/* ---------- Winner store (BU/Store shown under the winning name) ---------- */

.winner-store {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 600;
  color: var(--accent-cyan-bright);
  min-height: 1.4em;
}

/* ---------- Strong reset button (Reset Everything) ---------- */

.reset-btn-strong {
  border-color: var(--danger);
  background: var(--danger);
  color: #2a0a10;
}

.reset-btn-strong:hover {
  background: var(--accent-rose-bright);
}

/* ---------- Registration form ---------- */

.reg-form-panel {
  background: linear-gradient(160deg, var(--bg-panel) 0%, var(--bg-panel-alt) 100%);
  border: 2px solid var(--accent-violet);
  box-shadow: 10px 10px 0 rgba(124, 58, 237, 0.18);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reg-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
}

.reg-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.reg-field input {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-deep);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--motion-fast) ease;
}

.reg-field input:focus-visible {
  outline: 3px solid var(--accent-cyan-bright);
  outline-offset: 2px;
  border-color: var(--accent-cyan);
}

.reg-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reg-submit-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 12px 32px;
  font-size: 1.1rem;
}

.reg-submit-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.55;
}

.form-message {
  min-height: 1.4em;
  margin: 0;
  font-weight: 700;
}

.form-message.is-success {
  color: var(--success);
}

.form-message.is-error {
  color: var(--danger);
}

/* ---------- Registration table ---------- */

.reg-table-panel {
  background: var(--bg-panel);
  border: 2px solid var(--accent-cyan);
  box-shadow: 10px 10px 0 rgba(34, 211, 238, 0.14);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reg-table-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reg-table-header h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.search-input {
  min-height: 44px;
  flex: 1 1 240px;
  max-width: 380px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-deep);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
}

.search-input:focus-visible {
  outline: 3px solid var(--accent-cyan-bright);
  outline-offset: 2px;
  border-color: var(--accent-cyan);
}

.reg-table-scroll {
  overflow-x: auto;
}

.reg-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.reg-table th {
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 10px 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

.reg-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  vertical-align: middle;
}

.reg-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cell-number {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent-gold-bright);
  white-space: nowrap;
}

.cell-actions {
  white-space: nowrap;
  display: flex;
  gap: 8px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-eligible {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan-bright);
}

.status-winner {
  background: rgba(251, 191, 36, 0.18);
  color: var(--accent-gold-bright);
}

.row-btn {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--bg-panel-alt);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.row-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.row-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.row-btn-primary {
  border-color: var(--accent-violet);
  background: var(--accent-violet);
  color: #ffffff;
}

.row-btn-danger {
  border-color: var(--accent-rose);
  color: var(--accent-rose-bright);
}

.row-input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-cyan);
  background: var(--bg-deep);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
}

.row-input:focus-visible {
  outline: 3px solid var(--accent-cyan-bright);
  outline-offset: 2px;
}

/* ---------- Seating: stats row + warning ---------- */

.seating-stats-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Seating: two-column layout (left: form/list, right: visual) ---------- */

.reg-layout {
  display: grid;
  /* The form has a fixed, small amount of content — it stays compact so the
     Table Seating column absorbs all of the page's extra width instead. */
  grid-template-columns: minmax(320px, 480px) minmax(320px, 1fr);
  gap: var(--block-gap);
  align-items: start;
}

@media (max-width: 960px) {
  .reg-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Seating: attendee table controls (filter + search) ---------- */

.reg-table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-filter-select {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-deep);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
}

.table-filter-select:focus-visible {
  outline: 3px solid var(--accent-cyan-bright);
  outline-offset: 2px;
  border-color: var(--accent-cyan);
}

/* ---------- Seating: Table column in the attendee table ---------- */

.cell-table {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-select {
  min-height: 36px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--bg-panel-alt);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  max-width: 160px;
}

.table-select:focus-visible {
  outline: 3px solid var(--accent-cyan-bright);
  outline-offset: 2px;
}

.table-auto-btn {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan-bright);
}

/* ---------- Seating: visual panel (right column) ---------- */

.seating-visual-panel {
  background: linear-gradient(160deg, var(--bg-panel) 0%, var(--bg-panel-alt) 100%);
  border: 2px solid var(--accent-cyan);
  box-shadow: 10px 10px 0 rgba(34, 211, 238, 0.14);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-height: 900px;
}

.seating-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.seating-visual-header h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.seating-grid {
  display: grid;
  /* auto-fit (not auto-fill) collapses empty tracks instead of reserving
     blank space for them, so cards actually grow to use the wider panel;
     the 240px cap keeps them from ballooning when there are only a few. */
  grid-template-columns: repeat(auto-fit, minmax(160px, 240px));
  gap: 18px;
  overflow-y: auto;
  padding: 4px;
}

/* ---------- Seating: round-table visualization ---------- */

.table-card {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  border-radius: 50%;
  transition: transform var(--motion-base) ease;
}

.table-card:hover {
  transform: translateY(-3px);
}

.table-seats-ring {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid rgba(255, 255, 255, 0.12);
  transition: border-color var(--motion-slow) ease, box-shadow var(--motion-slow) ease;
}

.table-card.is-green .table-seats-ring {
  border-color: var(--success);
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.28);
}

.table-card.is-red .table-seats-ring {
  border-color: var(--danger);
  box-shadow: 0 0 22px rgba(251, 113, 133, 0.32);
}

.seat {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px;
  border-radius: 50%;
  transform: rotate(var(--angle)) translateY(-63px);
  transition: background var(--motion-base) ease, box-shadow var(--motion-base) ease, transform var(--motion-base) ease;
}

.seat-empty {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.seat-occupied {
  background: var(--accent-gold-bright);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.65);
}

.table-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  padding: 0 12px;
}

.table-center-number {
  font-family: "Bebas Neue", Impact, "Arial Narrow Bold", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.table-center-occupancy {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- Seating: modals (Table Setup / Table Detail) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

/* The [hidden] attribute is how registration.js opens/closes these modals —
   author rules normally beat the UA stylesheet's `[hidden] { display: none }`
   regardless of specificity, so without this override display:flex above
   would always win and the modal would stay visible even while hidden. */
.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(160deg, var(--bg-panel) 0%, var(--bg-panel-alt) 100%);
  border: 2px solid var(--accent-violet);
  box-shadow: 10px 10px 0 rgba(124, 58, 237, 0.18);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px);
  animation: modalPopIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-panel-narrow {
  width: min(480px, 100%);
}

@keyframes modalPopIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.modal-close-btn {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.modal-field-row input {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-deep);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  width: 140px;
}

.modal-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.modal-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 4px 0;
}

.table-config-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-config-list-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.table-config-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.table-config-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel-alt);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.table-config-label {
  flex: 1 1 160px;
  font-weight: 600;
  font-size: 0.95rem;
}

.table-config-cap-input {
  width: 80px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: inherit;
}

/* ---------- Seating: Table Detail modal content ---------- */

.table-detail-occupancy {
  margin: 0;
  font-weight: 700;
  color: var(--accent-gold-bright);
  font-size: 1.1rem;
}

.table-detail-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.table-detail-available {
  margin: 0;
  font-weight: 700;
  color: var(--accent-cyan-bright);
}

/* ---------- Seating: winner table (raffle dashboard) ---------- */

.winner-table {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  font-weight: 700;
  color: var(--accent-gold-bright);
  letter-spacing: 0.06em;
  min-height: 1.4em;
}

/* ---------- Reduced motion ---------- */
/* Silence decorative animation/transitions for users who request it; the
   raffle's real state changes (button disabled, text, history) still update
   instantly without relying on motion to communicate them. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
