/* ================================================================
   🍜 转盘选餐 — Design System
   深色主题 · 毛玻璃 · 金色筹码风 · Nunito + Inter
   ================================================================ */

/* ---------- Google Fonts ---------- */
/* Use system fonts: no render-blocking third-party font request. */

/* ---------- CSS Variables ---------- */
:root {
  /* Background */
  --bg-deep: #0a0a10;
  --bg-base: #0f0f1a;
  --bg-elevated: #151525;
  --bg-surface: #1a1a2e;

  /* Primary — warm gold (champagne) */
  --gold-100: #fdf6e8;
  --gold-300: #e8c978;
  --gold-400: #d4a843;
  --gold-500: #c9952e;
  --gold-600: #a87a1f;
  --gold-700: #7a5812;

  /* Accent — amber (replaces orange) */
  --amber: #d97706;
  --amber-light: #f59e0b;

  /* Accent — cyan (contrast, reduced use) */
  --cyan: #00d2ff;
  --cyan-dark: #0099bb;

  /* Semantic */
  --green: #4caf50;
  --green-bg: rgba(76, 175, 80, 0.15);
  --red: #f44336;
  --red-bg: rgba(244, 67, 54, 0.15);
  --yellow: #ffc107;

  /* Text */
  --text-primary: #efeff5;
  --text-secondary: #a8a8b8;
  --text-muted: #6e6e82;
  --text-white: #ffffff;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-bg-hover: rgba(255, 255, 255, 0.10);
  --glass-bg-active: rgba(255, 255, 255, 0.02);

  /* Warm accents */
  --warm-glow: rgba(201, 149, 46, 0.08);
  --warm-border: rgba(201, 149, 46, 0.2);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(201, 149, 46, 0.12);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Fonts */
  --font-display: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

img, canvas, svg, video {
  max-width: 100%;
}

button, input, select, textarea {
  max-width: 100%;
}

/* Animated background gradient — subtle radial */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(201, 149, 46, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 149, 46, 0.04) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 90%, rgba(0, 210, 255, 0.03) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(10, 10, 16, 1) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

/* Top warm glow accent line */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 149, 46, 0.3), transparent);
  z-index: 101;
  pointer-events: none;
}

a { color: var(--gold-400); text-decoration: none; }
a:hover { color: var(--gold-300); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

/* ---------- Glass Card ---------- */
.glass {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
/* Inner highlight line (Mac-like glass rim) — Firefox fallback: no highlight, native border only */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 40%, rgba(255,255,255,0.0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-sm { border-radius: var(--radius-md); }
.glass-lg { border-radius: var(--radius-xl); }

.glass-hover {
  transition: all var(--transition-normal);
}
.glass-hover:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Primary — gold gradient */
.btn-primary {
  background: linear-gradient(135deg, #d4a843, #b8932e, #c9952e);
  color: #1a1200;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 20px rgba(201, 149, 46, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(201, 149, 46, 0.40);
  transform: translateY(-2px);
}

/* Secondary — glass */
.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, var(--red), #d32f2f);
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 67, 54, 0.25);
}
.btn-danger:hover {
  box-shadow: 0 6px 24px rgba(244, 67, 54, 0.4);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.75);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  color: #fff;
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

/* Sizes */
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-xl { padding: 16px 36px; font-size: 1.15rem; border-radius: var(--radius-lg); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ---------- Inputs ---------- */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.input {
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: #c9952e;
  box-shadow: 0 0 0 3px rgba(201,149,46,0.12);
  background: rgba(255, 255, 255, 0.09);
}
.input-sm { padding: 6px 10px; font-size: 0.85rem; }

/* Number input styling */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* ---------- Select ---------- */
.select {
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.select:focus {
  border-color: var(--gold-500);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-gold {
  background: linear-gradient(135deg, rgba(201,149,46,0.15), rgba(201,149,46,0.05));
  color: var(--gold-400);
  border: 1px solid rgba(201,149,46,0.25);
}
.badge-green {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.badge-red {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(244, 67, 54, 0.3);
}
.badge-cyan {
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

/* ---------- Chip Display ---------- */
.chip-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(201,149,46,0.2), rgba(201,149,46,0.08));
  border: 1px solid rgba(201,149,46,0.3);
  border-radius: var(--radius-full);
  font-weight: 700;
  color: var(--gold-300);
  font-size: 0.9rem;
}
[data-icon="coin"]::before {
  content: '🪙';
  font-size: 0.85rem;
}

/* ---------- Navbar ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(10, 10, 16, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(201, 149, 46, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-400);
  letter-spacing: 0.5px;
}
.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #d4a843, #a87a1f);
  border-radius: var(--radius-sm);
  color: #1a1200;
}
.navbar-center {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
  overflow: hidden;
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
/* Navbar round icon buttons */
.navbar-right .btn-ghost {
  width: 36px; height: 36px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  transition: all var(--transition-fast);
}
.navbar-right .btn-ghost:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
  color: #fff;
}

/* Game page navbar buttons with text labels — override circle shape */
.navbar-right .btn-ghost.btn-sm {
  width: auto; height: auto; padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 0.9rem; gap: 4px;
}

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-content {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* Three-column grid */
.grid-3 {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.2fr) minmax(260px, 0.9fr);
  gap: var(--space-lg);
  align-items: start;
  height: calc(100vh - 90px);
  min-width: 0;
}

.grid-3 > * {
  max-height: 100%;
  overflow-y: auto;
  min-width: 0;
  max-width: 100%;
}

/* Panel scrollbar */
.panel-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 4px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* ---------- Panel Headers ---------- */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}
.panel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.panel-body {
  padding: var(--space-md) var(--space-lg);
}

/* ---------- Spinner (Center) ---------- */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-lg);
  padding: var(--space-lg);
}
.spinner-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid var(--gold-500);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  z-index: 10;
}
.spin-result {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-300);
  text-align: center;
  min-height: 2rem;
}

/* ---------- Restaurant List ---------- */
.restaurant-item:hover {
  background: var(--glass-bg-hover);
}
.restaurant-item.selected {
  background: rgba(240, 165, 0, 0.08);
  border-color: rgba(240, 165, 0, 0.2);
}
.restaurant-weight {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 50px;
  text-align: right;
}
.chip-input {
  width: 50px;
  text-align: center;
}

/* ---------- Activity Info ---------- */
.activity-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}
.activity-status.active {
  background: var(--green-bg);
  color: var(--green);
}
.activity-status.active::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
.activity-status.none {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- Participant List ---------- */
.participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.participant-item:last-child { border-bottom: none; }
.participant-name {
  font-weight: 500;
  font-size: 0.85rem;
}
.participant-chips {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- History Item ---------- */
.history-item {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}
.history-item:hover { background: var(--glass-bg-hover); }
.history-item.clickable {
  cursor: pointer;
}
.history-item.active-history {
  background: rgba(201,149,46,0.08);
  border-left-color: var(--gold-500);
}
.history-item .winner-name {
  font-weight: 700;
  color: var(--gold-400);
}
.history-item .history-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Bottom Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  bottom: 0;
  z-index: 100;
  flex-wrap: wrap;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: 3px;
}
.tab {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}
.tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.tab:hover:not(.active) { color: var(--text-primary); }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s var(--ease-out);
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  min-width: 0;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease-out);
}
.modal h3 {
  margin-bottom: var(--space-md);
}
.modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  animation: slideInRight 0.3s var(--ease-out);
  box-shadow: var(--shadow-md);
  max-width: 360px;
}
.toast-success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #81c784;
}
.toast-error {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #ef9a9a;
}
.toast-info {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #80deea;
}
.toast-warning {
  background: rgba(255, 152, 0, 0.2);
  border: 1px solid rgba(255, 152, 0, 0.4);
  color: #ffcc80;
}
.toast-close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1rem; padding: 0 0 0 6px; margin-left: 8px;
  opacity: 0.7; flex-shrink: 0; line-height: 1;
}
.toast-close:hover { opacity: 1; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
.empty-state p {
  font-size: 0.9rem;
  max-width: 240px;
}

/* ---------- Login Page Specific ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-2xl);
  text-align: center;
}
.login-logo {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #d4a843, #a87a1f);
  border-radius: var(--radius-lg);
  margin: 0 auto var(--space-md);
  box-shadow: 0 8px 32px rgba(201, 149, 46, 0.25);
}
.login-card h1 {
  font-size: 1.8rem;
  margin-bottom: var(--space-xs);
}
.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}
.login-card .input-group {
  text-align: left;
  margin-bottom: var(--space-md);
}
.login-card .error-msg {
  color: var(--red);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  min-height: 1.2rem;
}
.login-card .switch-hint {
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.login-card .switch-hint a {
  color: var(--gold-400);
  cursor: pointer;
  font-weight: 600;
}
.login-card .switch-hint a:hover {
  text-decoration: underline;
}

/* ---------- Admin Page ---------- */
.admin-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}
.data-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table tr:hover td {
  background: var(--glass-bg-hover);
}


/* ---- Admin overrides (scoped to admin container) ---- */
.admin-container { max-width: 1100px; margin: 0 auto; padding: 12px; }
.admin-container .admin-tabs { gap: 4px; margin-bottom: 14px; }
.admin-container .admin-tabs button { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-secondary); cursor: pointer; font-size: 0.82rem; }
.admin-container .admin-tabs button.active { background: var(--gold-500); color: #000; border-color: var(--gold-500); font-weight: 700; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th, .admin-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--glass-border); }
.admin-table th { color: var(--text-muted); font-weight: 600; }
.admin-container .btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.admin-container .input-sm { padding: 4px 8px; font-size: 0.8rem; border-radius: 6px; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary); width: 100px; }
.admin-container .modal-overlay { z-index: 500; }
.modal-box { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px; padding: 18px; min-width: 320px; max-width: 500px; }
.modal-box h3 { margin-top: 0; }
.modal-box .row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.modal-box input, .modal-box select { flex: 1; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; }
.tag-active { background: rgba(16,185,129,0.2); color: #34d399; }
.tag-disabled { background: rgba(239,68,68,0.2); color: #f87171; }
.tag-admin { background: rgba(240,165,0,0.2); color: var(--gold-400); }

/* ---------- Game Center Placeholder ---------- */
.game-center-btn {
  position: relative;
  overflow: hidden;
}
.game-center-btn::after {
  content: 'NEW';
  position: absolute;
  top: -4px;
  right: -4px;
  padding: 2px 6px;
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-full);
}

/* ---------- Utility ---------- */
.text-gold { color: var(--gold-400); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.font-display { font-family: var(--font-display); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.p-md { padding: var(--space-md); }
.hidden { display: none !important; }



/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Toolbar divider ---------- */
.toolbar-divider { width: 1px; height: 24px; background: var(--glass-border); margin: 0 var(--space-sm); }

/* ---------- Preset dot ---------- */
.preset-btn { position: relative; }
.preset-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); margin-right: 2px; vertical-align: middle; transition: background var(--transition-fast); }
.preset-dot.saved { background: var(--gold-500); box-shadow: 0 0 8px rgba(201,149,46,0.5); }
.preset-scroll-group { display: flex; gap: var(--space-sm); align-items: center; }

/* ---------- Section / Game center ---------- */
.game-center-entry { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--glass-border); }
.section-label { margin-bottom: var(--space-sm); }

/* ---------- Vote status bar ---------- */
.vote-status-bar { padding: 8px var(--space-lg); font-size: 0.85rem; font-weight: 600; text-align: center; }
.vote-status-bar.voted { background: var(--green-bg); color: var(--green); border-top: 1px solid rgba(76,175,80,0.2); }

/* ---------- Desktop / mobile visibility ---------- */
.mobile-panels { display: none; }
.bottom-nav { display: none; }

/* ---------- Navbar username ---------- */
.nav-username { font-weight: 600; font-size: 0.9rem; }

/* ---------- Modal variants ---------- */
.modal-dialog { min-width: 320px; max-width: 440px; }
.modal-icon { font-size: 3rem; margin-bottom: var(--space-md); }
.modal-sheet { min-width: 340px; max-width: 500px; max-height: 80vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal-sheet-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-lg) var(--space-lg) var(--space-md); border-bottom: 1px solid var(--glass-border); }
.modal-sheet-header h3 { margin-bottom: 0; }
.modal-sheet-body { padding: var(--space-lg); overflow-y: auto; flex: 1; }
.modal-sheet-body .preset-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-md); }
.modal-sheet-body .preset-card:last-child { margin-bottom: 0; }
.preset-card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.preset-card-header input { flex:1; padding: 6px 10px; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); outline: none; font-family: var(--font-body); }
.preset-card-header input:focus { border-color: var(--gold-500); }
.preset-card-preview { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.preset-card-empty { color: var(--text-muted); font-style: italic; }

/* ---------- Help content ---------- */
.help-content h4 { margin-bottom: var(--space-md); text-align: center; }
.help-content h5 { margin: var(--space-md) 0 var(--space-sm); color: var(--gold-400); font-size: 0.95rem; }
.help-content ul { padding-left: 1.2em; margin-bottom: var(--space-md); }
.help-content li { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.8; }

/* ========== Rankings (leaderboard) ========== */
.ranking-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ranking-medal { width: 28px; text-align: center; flex-shrink: 0; font-size: 1rem; }
.rank-num { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.ranking-name { flex: 1; font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-count { font-size: 0.85rem; font-weight: 700; color: var(--gold-400); flex-shrink: 0; }
.ranking-bar-track { width: 50px; height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; flex-shrink: 0; }
.ranking-bar-fill { height: 100%; background: var(--gold-500); border-radius: 2px; transition: width 0.5s ease; }
.stats-tabs .tab { padding: 6px 14px; font-size: 0.85rem; }

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Mobile: all single-column */
@media (max-width: 768px) {
  /* ---- Global ---- */
  .page-content { padding: 0 0 80px 0; max-width: 100%; }

  /* ---- Top Navbar ---- */
  .navbar { padding: 0 12px; min-height: 56px; }
  .navbar-brand { font-size: 0.95rem; gap: 6px; }
  .brand-text { display: none; }
  .navbar-center { gap: 6px; }
  .nav-username { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; }
  .chip-count { font-size: 14px; padding: 3px 8px; flex-shrink: 0; }
  .navbar-right { gap: 4px; }
  .navbar-right .btn-ghost { width: 32px; height: 32px; font-size: 1rem; }
  .navbar-right .btn-ghost.btn-sm { width: auto; height: auto; padding: 3px 8px; font-size: 0.85rem; }

  /* ---- Dashboard Shell ---- */
  .dashboard-shell { padding: 10px; width: 100%; }
  .hero-panel { padding: 16px; }
  .hero-panel h1 { font-size: 1.3rem; }

  /* ---- Primary Actions ---- */
  .primary-actions { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .primary-action-card { padding: 12px 8px; }
  .primary-action-card .pa-icon { width: 40px; height: 40px; font-size: 1.3rem; }
  .primary-action-card .pa-label { font-size: 0.85rem; }

  /* ---- Game Features ---- */
  .game-feature-grid { grid-template-columns: 1fr; gap: 10px; }

  /* ---- Dashboard Vote-Spinner ---- */
  .dashboard-vote-spinner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dashboard-vote-spinner > * {
    min-width: 0;
    max-width: 100%;
  }

  /* ---- Restaurant Items ---- */
  .restaurant-item {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
    min-height: auto;
  }
  .restaurant-item .restaurant-name {
    flex: 1 1 100%;
    min-width: 0;
  }
  .restaurant-item .restaurant-name > div:first-child {
    font-size: 1rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.3;
  }
  .rest-item-status { font-size: 0.85rem; }
  .chip-input {
    width: 64px !important;
    height: 40px;
    font-size: 17px !important;
    flex-shrink: 0;
  }
  .want-btn, .dont-btn {
    width: 48px; height: 48px;
    min-width: 48px;
    font-size: 20px;
    flex-shrink: 0;
  }

  /* ---- Spinner / Canvas ---- */
  .spinner-container { padding: 8px; min-height: auto; }
  .spinner-canvas-wrapper { width: 100%; max-width: min(100%, 360px); margin: 0 auto; }
  #spinnerCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
  }

  /* ---- Details / History / Rankings ---- */
  .ranking-row { padding: 8px 4px; font-size: 14px; }
  .ranking-name { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ranking-count { font-size: 14px; }
  .ranking-medal { font-size: 1rem; width: 24px; }
  .ranking-bar-track { width: 40px; }
  .history-item { padding: 10px 4px; font-size: 13px; }
  .participant-item { padding: 8px 0; font-size: 13px; }
  .stats-tabs .tab { padding: 8px 12px; font-size: 14px; }
  .section-label { font-size: 13px; }

  /* ---- Summary Grid ---- */
  .summary-grid { grid-template-columns: 1fr; gap: 12px; }

  /* ---- Buttons ---- */
  .btn { min-height: 44px; padding: 10px 16px; font-size: 16px; }
  .btn-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
  .btn-icon.btn-sm { min-height: 40px; min-width: 40px; }
  input[type="text"], input[type="password"], input[type="number"], .input { font-size: 16px !important; }

  /* ---- Modals ---- */
  .modal-overlay { align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; min-width: 0; border-radius: 20px 20px 0 0; padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0)); max-height: 85vh; overflow-y: auto; }
  .modal-sheet { border-radius: 20px 20px 0 0; max-height: 85vh; min-width: 0; }
  .modal-dialog { min-width: 0; }

  /* ---- Preset Row (scrollable) ---- */
  .preset-scroll-group { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .preset-scroll-group::-webkit-scrollbar { display: none; }
}

/* ================================================================
   通用规则弹窗
   ================================================================ */
.rules-mask {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.58);
  display: flex; align-items: flex-end; justify-content: center;
  animation: maskFadeIn 0.18s ease-out;
}
.rules-sheet {
  width: min(100%, 640px); max-height: 82vh; overflow-y: auto;
  background: var(--bg-card, #12121f);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.06));
  border-radius: 26px 26px 0 0;
  padding: 26px 22px 28px; position: relative;
  box-shadow: 0 -16px 48px rgba(0,0,0,0.45);
  animation: slideUp 0.24s ease-out;
}
.rules-icon { font-size: 42px; text-align: center; margin-bottom: 8px; }
.rules-sheet h2 { text-align: center; margin-bottom: 16px; font-size: 1.3rem; }
.rules-list { margin: 0 0 20px; padding-left: 22px; color: var(--text-secondary); line-height: 1.8; }
.rules-list li { margin-bottom: 4px; }
.rules-close {
  position: absolute; right: 16px; top: 12px;
  border: 0; background: transparent; color: var(--text-muted);
  font-size: 22px; cursor: pointer;
}
.rules-ok { display: block; margin: 0 auto; }

@media (min-width: 769px) {
  .rules-mask { align-items: center; }
  .rules-sheet { border-radius: 26px; max-height: 76vh; }
}

/* ================================================================
   首页仪表盘统一布局
   ================================================================ */
/* Dashboard shell — card entrance animation */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-shell {
  width: min(1180px, 100%); margin: 0 auto; padding: var(--space-md);
}
.hero-panel {
  animation: cardFadeIn 0.6s ease-out both;
  background: linear-gradient(135deg, rgba(201,149,46,0.08) 0%, rgba(15,15,22,0.95) 40%, rgba(15,15,22,0.95) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl, 24px); padding: 24px; margin-bottom: var(--space-lg);
}
.hero-panel h1 { font-size: 1.8rem; margin: 0 0 4px; }
.hero-panel h1 span {
  background: linear-gradient(135deg, #f5e6c8, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-panel .hero-sub { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 12px; }
.hero-panel .hero-chips { display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(201,149,46,0.15), rgba(201,149,46,0.05));
  border: 1px solid rgba(201,149,46,0.25);
  box-shadow: 0 0 20px rgba(201,149,46,0.08);
  color: var(--gold-400); padding: 6px 16px;
  border-radius: 20px; font-weight: 700; font-size: 0.95rem; }

.primary-actions {
  animation: cardFadeIn 0.5s 0.1s ease-out both;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: var(--space-lg);
}
.primary-action-card {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg, 18px); padding: 22px 12px 18px;
  text-align: center; cursor: pointer; transition: all var(--transition-normal);
  text-decoration: none; color: inherit; display: block;
}
.primary-action-card::before {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,149,46,0.25), transparent);
  border-radius: 1px;
  transition: all var(--transition-normal);
  pointer-events: none;
}
.primary-action-card:hover::before {
  left: 10%; right: 10%;
  background: linear-gradient(90deg, transparent, rgba(201,149,46,0.5), transparent);
}
.primary-action-card:hover { background: rgba(255,255,255,0.06); border-color: var(--gold-500); }
.primary-action-card .pa-icon {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; margin-bottom: 10px;
  transition: all var(--transition-normal);
}
.primary-action-card:hover .pa-icon {
  background: rgba(201,149,46,0.12);
  border-color: rgba(201,149,46,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,149,46,0.12);
}
.primary-action-card .pa-label { font-weight: 700; font-size: 0.9rem; }
.primary-action-card .pa-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.dashboard-section {
  animation: cardFadeIn 0.5s 0.15s ease-out both;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg, 22px); padding: 18px; margin-bottom: var(--space-lg);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.dashboard-section:hover {
  border-color: rgba(201, 149, 46, 0.15);
  box-shadow: 0 0 30px rgba(201, 149, 46, 0.06);
}
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.15rem; position: relative; padding-left: 14px; }
.section-head h2::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: linear-gradient(180deg, #d4a843, rgba(201,149,46,0.2));
  border-radius: 2px;
}
.section-head p { color: var(--text-muted); font-size: 0.85rem; margin: 2px 0 0; }

.game-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.game-feature-card {
  border-radius: 18px; padding: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 10px;
}
.game-feature-card .gf-icon { font-size: 2.5rem; }
.game-feature-card h3 { margin: 0; font-size: 1.1rem; }
.game-feature-card .gf-desc { color: var(--text-secondary); font-size: 0.85rem; }
.game-feature-card .gf-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.game-feature-card .gf-tags span {
  font-size: 0.72rem; padding: 2px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.game-feature-card .gf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.summary-list { display: flex; flex-direction: column; gap: 6px; }
.summary-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03); font-size: 0.85rem;
}
.summary-item .s-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-item .s-val { font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
.summary-item .s-meta { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }

.empty-card {
  text-align: center; padding: 24px; color: var(--text-muted); font-size: 0.9rem;
}

/* Dashboard 3-col area */
.dashboard-vote-spinner {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1.2fr) minmax(280px, 0.85fr);
  gap: var(--space-md);
  align-items: start;
  min-width: 0;
  margin-bottom: var(--space-lg);
}
.dashboard-vote-spinner > * {
  min-width: 0;
  max-width: 100%;
}
.dashboard-vote-spinner .glass { min-height: auto; }
.dashboard-vote-spinner .panel-scroll { max-height: 60vh; overflow-y: auto; min-width: 0; }

/* Spinner canvas: fill container, never overflow */
.spinner-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-width: 0;
}
#spinnerCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 0 30px rgba(201,149,46,0.15));
  transition: filter var(--transition-slow);
}
#spinnerCanvas.spinning {
  filter: drop-shadow(0 0 50px rgba(201,149,46,0.4));
}

/* Restaurant items — never let names go vertical */
.restaurant-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  min-width: 0;
  max-width: 100%;
}
.restaurant-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
}
.restaurant-name > div:first-child {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
}

/* PHONE: additional mobile selectors */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* ---- Mobile Panel ---- */
  .mobile-panel { min-height: calc(100vh - 48px - 56px); }
  .mobile-panel-header { height: 44px; padding: 0 16px; }
  .mobile-panel-chip { font-size: 14px; }

  /* ---- Vote status bar ---- */
  .vote-status-bar { height: 44px; padding: 0 16px; font-size: 14px; }

  /* ---- Mobile spinner ---- */
  #spinnerCanvasMobile { max-width: 340px; }
  .spin-result { font-size: 16px; }
  .mobile-spin-actions { gap: 8px; padding: var(--space-sm); }
  .mobile-spin-btn { min-height: 44px; font-size: 15px; border-radius: 12px; }
  .mobile-spin-start { min-height: 44px; font-size: 15px; border-radius: 12px; }
  .mobile-spinner-weights .section-label { font-size: 13px; }
  .mobile-spinner-weights .restaurant-item { min-height: 40px; }
  .mobile-spinner-weights .restaurant-name { font-size: 13px; }
  .mobile-spinner-weights .restaurant-weight { font-size: 12px; }
  .mobile-preset-row .btn { min-height: 40px; font-size: 14px; border-radius: 12px; }

  /* ---- Details panel ---- */
  .ranking-row { padding: 10px 4px; min-height: 44px; font-size: 14px; }
  .ranking-name { font-size: 14px; }
  .ranking-count { font-size: 13px; }
  .ranking-medal { font-size: 1rem; width: 28px; }
  .rank-num { font-size: 0.8rem; }
  .ranking-bar-track { width: 48px; height: 4px; }
  .stats-tabs .tab { padding: 8px 14px; font-size: 13px; }
  .history-item { padding: 10px 4px; min-height: 44px; font-size: 13px; }
  .history-item .winner-name { font-size: 14px; }
  .history-item .history-meta { font-size: 12px; }
  .participant-item { padding: 8px 0; font-size: 13px; }
  .section-label { font-size: 13px; margin-bottom: 6px; }
  .game-center-btn { min-height: 44px; font-size: 14px; }

  /* ---- Me panel ---- */
  .me-avatar { width: 60px; height: 60px; font-size: 2rem; }
  .me-name { font-size: 1.1rem; }
  .me-chips { font-size: 28px; }
  .me-role { font-size: 0.85rem; }
  .me-stats { gap: var(--space-sm); }
  .me-stat-item { padding: var(--space-sm); }
  .me-stat-label { font-size: 0.75rem; }
  .me-stat-val { font-size: 1.2rem; }
  .me-actions .btn { min-height: 48px; font-size: 15px; }
  .me-profile { padding: var(--space-lg) 0 var(--space-sm); }

  /* ---- Bottom Navigation ---- */
  .bottom-nav { height: 56px; }
  .bottom-nav-icon { font-size: 22px; }
  .bottom-nav-label { font-size: 11px; }
  .bottom-nav-btn { gap: 2px; }

  /* ---- Section Head ---- */
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-head h2 { font-size: 1.2rem; }

  /* ---- Modal refinements ---- */
  .modal { border-radius: 18px 18px 0 0; }
  .modal h3 { font-size: 16px; }
  .modal .input-group label { font-size: 14px; }
  .modal .input, .modal select { font-size: 14px; }
  .modal-sheet { border-radius: 18px 18px 0 0; }
  .modal-dialog .btn { min-height: 48px; font-size: 15px; }
  .modal-actions { margin-top: var(--space-md); }

  /* ---- Admin ---- */
  .admin-tabs .tab { padding: 8px 12px; font-size: 13px; }
  .data-table td { font-size: 14px; }
  .data-table td::before { font-size: 13px; }
  .tab { padding: 8px 14px; font-size: 13px; }

  /* ---- Login ---- */
  .login-card { padding: var(--space-lg) var(--space-md); }
}

/* Narrow desktop / tablet → single column */
@media (max-width: 1200px) {
  .dashboard-vote-spinner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .dashboard-vote-spinner > * {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
  }
  #panelVoteDesktop { order: 1; max-height: 520px; overflow-y: auto; }
  #panelSpinnerDesktop { order: 2; }
  #panelDetailsDesktop { order: 3; max-height: 520px; overflow-y: auto; }
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Desktop: constrain tall panels */
@media (min-width: 769px) {
  #panelVoteDesktop,
  #panelDetailsDesktop {
    max-height: min(680px, 70vh);
    overflow-y: auto;
  }
  #panelSpinnerDesktop {
    align-self: start;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .dashboard-shell { padding-inline: 8px; }
  .spinner-canvas-wrapper {
    width: min(100%, 300px);
    max-width: calc(100vw - 44px);
  }
  .primary-actions { gap: 8px; }
  .primary-action-card { padding: 12px 8px; }
  .admin-tabs button { font-size: 0.72rem; padding: 4px 8px; }
  .admin-table { font-size: 0.7rem; }
}

/* ================================================================
   转让筹码用户选择器
   ================================================================ */
.transfer-user-list {
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}
.transfer-user-option {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  transition: background 0.15s;
}
.transfer-user-option:hover { background: rgba(255,255,255,0.10); }
.transfer-user-option.selected {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.16);
}
.transfer-user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  color: #111827;
  font-weight: 900;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.transfer-user-empty {
  color: var(--text-muted);
  padding: 10px;
  text-align: center;
  font-size: 0.8rem;
}


/* ---------- Spinner pointer pulse animation ---------- */
.spinner-pointer {
  animation: pointerPulse 2s ease-in-out infinite;
}

@keyframes pointerPulse {
  0%, 100% { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
  50% { filter: drop-shadow(0 2px 12px rgba(240, 165, 0, 0.8)); }
}

/* ---------- Toast slide-out ---------- */
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* ---------- Reduced Motion ---------- */
@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;
  }
}
