/* ==================== CSS Variables ==================== */
:root {
  --primary: #c9a96e;
  --primary-dark: #a88a4e;
  --primary-light: #e8d5a8;
  --bg-dark: #0a0a1a;
  --bg-card: #141428;
  --bg-input: #1a1a35;
  --text-primary: #f0e8d8;
  --text-secondary: #8a8a9a;
  --text-muted: #5a5a6a;
  --danger: #e74c3c;
  --success: #2ecc71;
  --border: #2a2a4a;
  --shadow: rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-lg: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(rgba(10,10,20,0.78), rgba(10,10,20,0.88)), url('/jpg/luoyupan2.jpg') center/cover fixed no-repeat;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

input {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
  background: none;
  color: var(--text-primary);
}

button {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
  cursor: pointer;
  background: none;
  color: inherit;
  -webkit-user-select: none;
  user-select: none;
}

/* ==================== App Container ==================== */
#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* ==================== Screens ==================== */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  padding-top: calc(44px + var(--safe-top));
}

.screen.active {
  display: flex;
}

.screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
}

/* ==================== Loading Screen ==================== */
#loading-screen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a3a 100%);
}

.loading-content {
  text-align: center;
}

.loading-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

.loading-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==================== Brand Header ==================== */
.brand-header {
  text-align: center;
  padding: 40px 0 30px;
}

.brand-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.brand-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==================== Form Card ==================== */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  border: 1px solid var(--border);
}

.form-title {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.form-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ==================== Input Group ==================== */
.input-group {
  margin-bottom: 1.2rem;
}

.input-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
}

.input-prefix {
  padding: 0 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-right: 1px solid var(--border);
  line-height: 48px;
}

.input-wrapper input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1rem;
  width: 100%;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color 0.3s;
}

input:focus {
  border-color: var(--primary);
}

input::placeholder {
  color: var(--text-muted);
}

/* ==================== Buttons ==================== */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s;
  margin-top: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #1a1a1a;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-secondary {
  background: var(--bg-card, #2a2a2a);
  color: var(--text-secondary, #aaa);
  border: 1px solid var(--border, #444);
}

.btn-secondary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-sm {
  width: auto;
  padding: 10px 20px;
  margin: 0;
}

.btn-link {
  color: var(--primary);
  font-size: 0.85rem;
  padding: 4px 0;
}

.btn-back {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 16px;
  padding: 8px;
  color: var(--text-secondary);
  z-index: 10;
  border-radius: 50%;
  transition: background 0.3s;
}

.btn-back:active {
  background: var(--bg-input);
}

/* ==================== Error Message ==================== */
.error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-align: center;
  min-height: 1.2em;
}

/* ==================== Code Timer ==================== */
.code-timer {
  text-align: center;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ==================== Top Banner ==================== */
.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 2px 8px var(--shadow);
}

.banner-date {
  flex-shrink: 0;
}

.banner-location {
  flex-shrink: 0;
  text-align: right;
}

/* ==================== Main Header ==================== */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-top: calc(56px + var(--safe-top));
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: calc(40px + var(--safe-top));
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.user-phone {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.coin-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.coin-icon {
  font-size: 1.2rem;
}

.coin-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

/* ==================== Main Content ==================== */
.main-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.welcome-card {
  background: linear-gradient(135deg, #1a1a3a 0%, #2a1a3a 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
}

.welcome-text h2 {
  font-size: 1.1rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.welcome-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.welcome-decoration {
  font-size: 2.5rem;
  opacity: 0.8;
}

/* ==================== Action Grid ==================== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}

.action-card:active {
  transform: scale(0.96);
  border-color: var(--primary);
  background: var(--bg-input);
}

.action-icon {
  color: var(--primary);
}

.action-label {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
}

/* ==================== Stats Card ==================== */
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stats-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==================== Scanner ==================== */
.scanner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  padding-top: calc(16px + var(--safe-top));
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.scanner-header h2 {
  font-size: 1.1rem;
  color: var(--primary);
}

/* ==================== 行笺探索 ==================== */
.explore-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  overflow-y: auto;
}

.explore-intro {
  background: linear-gradient(135deg, rgba(212,168,76,0.12), rgba(212,168,76,0.04));
  border: 1px solid rgba(212,168,76,0.25);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
}

.explore-subtitle {
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: 4px;
  margin-bottom: 14px;
  font-weight: 500;
}

.explore-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.explore-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.explore-stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.explore-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.explore-stat-sep {
  width: 1px;
  height: 30px;
  background: var(--border);
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.explore-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.explore-card:active {
  transform: scale(0.97);
}

.explore-card.unlocked {
  border-color: rgba(212,168,76,0.35);
}

.explore-card.unlocked:active {
  box-shadow: 0 0 12px rgba(212,168,76,0.3);
}

.explore-card-cover {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}

.explore-card.unlocked .explore-card-cover {
  filter: none;
}

.explore-card.locked .explore-card-cover {
  filter: grayscale(1) brightness(0.45);
}

.explore-card-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
}

.explore-card-badge {
  background: rgba(212,168,76,0.85);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.explore-card-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,0.35);
}

.explore-card-lock {
  font-size: 2rem;
}

.explore-card-lock-text {
  font-size: 0.7rem;
  color: #ddd;
  text-align: center;
  padding: 0 6px;
}

.explore-card-info {
  padding: 10px 12px;
}

.explore-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.explore-card-floor {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.explore-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
}

.explore-manual {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.explore-manual-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.explore-manual-row {
  display: flex;
  gap: 8px;
}

.explore-manual-row input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* Scene Detail Modal */
.scene-detail-modal {
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.scene-detail-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -24px -24px 14px;
  width: calc(100% + 48px);
}

.scene-detail-name {
  font-size: 1.3rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 4px;
}

.scene-detail-floor {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scene-detail-coins {
  text-align: center;
  font-size: 0.9rem;
  color: var(--success, #4ade80);
  margin: 8px 0 12px;
}

.scene-detail-story-wrap {
  background: rgba(212,168,76,0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.scene-detail-blur-hint {
  background: rgba(239, 68, 68, 0.1);
  border: 1px dashed rgba(239, 68, 68, 0.4);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #f87171;
  text-align: center;
  letter-spacing: 0.3px;
}

.scene-detail-story {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text-primary);
  text-indent: 2em;
}

/* Play Desc / Area */
.scene-play-desc {
  background: rgba(212,168,76,0.08);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--primary);
  text-align: center;
  border: 1px solid rgba(212,168,76,0.25);
}

.scene-play-area {
  margin-bottom: 14px;
}

.play-result {
  font-size: 0.85rem;
  color: var(--primary);
  margin-top: 10px;
  text-align: center;
  min-height: 1.2em;
}

.play-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 6px 0;
}

.play-input, .play-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input, #1e1e1e);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius);
  color: var(--text-primary, #eee);
  font-size: 0.85rem;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.play-textarea { resize: none; min-height: 60px; }

/* Quiz (红欧解谜) */
.play-quiz-q {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.play-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.play-quiz-opt {
  padding: 10px 14px;
  background: var(--bg-input, #1e1e1e);
  border: 1px solid var(--border, #333);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.play-quiz-opt:active { transform: scale(0.98); }
.play-quiz-opt.right { border-color: #4ade80; color: #4ade80; background: rgba(74,222,128,0.08); }
.play-quiz-opt.wrong { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }

/* Gacha (游乐园娃娃机) */
.play-gacha { text-align: center; }
.gacha-display {
  font-size: 3rem;
  padding: 20px;
  background: rgba(212,168,76,0.08);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: all .3s;
}

/* QRBar (工业酒吧扫码随机) */
.play-qrbar { text-align: center; }
.play-card-list { text-align: center; }
.play-card-scan-btn-wrap { margin-bottom: 14px; }
.play-card-scan-btn { width: 100%; background: linear-gradient(135deg, #10b981, #059669); border: none; }
.play-card-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.play-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border-left: 2px solid #10b981;
  font-size: 0.88rem;
  transition: all .2s;
}
.play-card-row.scanned {
  opacity: 0.55;
  border-left-color: #555;
}
.pc-icon { font-size: 1.3rem; width: 28px; text-align: center; }
.pc-label { flex: 1; color: var(--text-primary); }
.pc-amt { font-family: monospace; font-weight: 700; min-width: 52px; text-align: right; }
.pc-amt.pos { color: #10b981; }
.pc-amt.neg { color: #ef4444; }
.pc-amt.zero { color: var(--text-muted); }
.pc-done { color: #10b981; font-weight: 700; }

/* Cast (赛博投屏) */
.play-cast { text-align: center; }
.cast-screen {
  padding: 22px 14px;
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(212,168,76,0.25));
  border: 1px solid rgba(212,168,76,0.3);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 0.9rem;
  min-height: 60px;
}
.cast-history {
  margin-top: 18px;
  text-align: left;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.cast-history-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-align: center;
}
.cast-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.cast-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.03);
  padding: 7px 12px;
  border-radius: 8px;
  border-left: 2px solid rgba(139,92,246,0.6);
}
.ch-index { color: var(--text-muted); font-family: monospace; min-width: 36px; }
.ch-time { color: var(--text-secondary); flex: 1; text-align: center; }
.ch-cost { color: var(--danger); font-weight: 600; }

/* Wall (万圣无料墙) */
.play-wall { text-align: center; }

/* NFC 音频收集 */
.play-nfc { padding: 4px 0; }
.nfc-progress { margin-bottom: 12px; text-align: left; }
.nfc-progress-bar {
  height: 8px; background: rgba(255,255,255,0.08);
  border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(59,130,246,0.25);
}
.nfc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.nfc-progress-text {
  text-align: center; margin-top: 6px;
  font-size: 0.85rem; color: #c8c8d8;
}
.nfc-progress-text strong { color: #3b82f6; font-size: 1rem; }

.nfc-list { display: flex; flex-direction: column; gap: 8px; }
.nfc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  opacity: 0.55;
  transition: all 0.3s;
}
.nfc-item.collected {
  opacity: 1;
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.35);
}
.nfc-item-idx {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.75rem;
  background: rgba(255,255,255,0.08);
  color: #a8a8b8; font-weight: 600;
}
.nfc-item.collected .nfc-item-idx {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
}
.nfc-item-info { flex: 1; min-width: 0; }
.nfc-item-title {
  font-size: 0.88rem; font-weight: 600;
  color: #c8c8d8; margin-bottom: 2px;
}
.nfc-item.collected .nfc-item-title { color: #fff; }
.nfc-item-desc {
  font-size: 0.72rem; color: #8a8a9a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nfc-item.collected .nfc-item-desc { color: #b0b0c0; }
.nfc-play-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nfc-play-btn:active { transform: scale(0.92); box-shadow: 0 0 12px rgba(59,130,246,0.5); }

/* None */
.play-none { text-align: center; color: var(--text-muted); }

/* ==================== 游戏会场 ==================== */
.games-body {
  padding: 14px 16px 100px;
}
.games-subtitle {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted, #999);
  margin: 4px 0 14px;
}
.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.game-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.15));
  border: 1px solid rgba(212,168,76,0.18);
  border-radius: 14px;
  padding: 14px 12px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
  cursor: pointer;
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--theme, #d4a84c);
  opacity: 0.8;
}
.game-card:active { transform: scale(0.97); }
.game-card-emoji {
  font-size: 2rem;
  margin-bottom: 6px;
}
.game-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.game-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.game-card-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted, #999);
  margin: 3px 0 10px;
  line-height: 1.3;
}
.game-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(139,180,255,0.15);
  color: #8bb4ff;
  white-space: nowrap;
  flex-shrink: 0;
}
.game-tag-pos { background: rgba(74,222,128,0.15); color: #4ade80; }
.game-tag-neg { background: rgba(239,68,68,0.15); color: #ef4444; }
.game-play-btn {
  width: 100%;
  padding: 7px 0;
  font-size: 0.8rem;
  border-radius: 8px;
}
.games-tip {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted, #777);
  margin: 18px 0 10px;
  line-height: 1.5;
}
.loading-hint, .error-hint {
  text-align: center;
  padding: 30px;
  color: var(--text-muted, #888);
  font-size: 0.85rem;
  grid-column: 1 / -1;
}

/* ==================== Modals ==================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border);
  animation: modalIn 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 1.2rem;
  color: var(--primary);
}

.modal-close {
  font-size: 1.5rem;
  color: var(--text-secondary);
  padding: 4px 8px;
  line-height: 1;
}

/* ==================== Congratulations Modal ==================== */
.congr-modal {
  text-align: center;
}

.congr-fireworks {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.1); }
}

.congr-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.congr-text {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.congr-coins-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.congr-qr-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.congr-decoration {
  font-size: 1.5rem;
  margin: 1rem 0;
  letter-spacing: 0.5em;
}

/* ==================== History Modal ==================== */
.history-list {
  list-style: none;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item-name {
  font-size: 0.9rem;
}

.history-item-coins {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

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

/* ==================== Demo QR Grid ==================== */
.demo-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.demo-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.demo-item:active {
  border-color: var(--primary);
  transform: scale(0.96);
}

.demo-item-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.demo-item-coins {
  font-size: 0.75rem;
  color: var(--primary);
}

.demo-item-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  bottom: calc(30px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  z-index: 2000;
  transition: transform 0.3s ease;
  pointer-events: none;
  text-align: center;
  max-width: 80%;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: var(--danger);
}

.toast.success {
  border-color: var(--success);
}

/* ==================== Responsive ==================== */
@media (max-width: 360px) {
  .brand-title {
    font-size: 1.5rem;
  }

  .form-card {
    padding: 24px 16px;
  }

  .action-grid {
    gap: 12px;
  }

  .action-card {
    padding: 20px 12px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-value {
    font-size: 1.2rem;
  }
}

@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (max-height: 600px) {
  .brand-header {
    padding: 20px 0 15px;
  }

  .brand-icon {
    font-size: 2.5rem;
  }

  .brand-title {
    font-size: 1.4rem;
  }

  .form-card {
    padding: 20px 16px;
  }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.screen.active {
  animation: fadeIn 0.3s ease;
}

.form-card {
  animation: slideUp 0.4s ease;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ==================== Selection ==================== */
::selection {
  background: var(--primary);
  color: var(--bg-dark);
}

/* ==================== Auction ==================== */
.auction-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.auction-intro {
  margin-bottom: 24px;
}

.auction-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.user-coins-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.auction-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auction-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all 0.3s;
}

.auction-item:hover {
  border-color: var(--primary);
}

.auction-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auction-item-icon {
  font-size: 2.5rem;
}

.auction-item-info {
  flex: 1;
}

.auction-item-name {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.auction-item-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auction-item-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auction-price-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.price-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

.btn-bid {
  width: 100%;
  margin-top: 0;
}

.btn-bid:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-card-wide {
  grid-column: span 2;
}

/* ==================== Page Footer ==================== */
.page-footer {
  text-align: center;
  padding: 24px 16px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.page-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0;
}

/* ==================== Quiz ==================== */
.quiz-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

#quiz-progress-text {
  color: var(--primary);
  font-weight: 600;
}

#quiz-coins-hint {
  color: var(--text-secondary);
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}

.quiz-question {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  transition: all 0.3s;
  cursor: pointer;
}

.quiz-option:active {
  transform: scale(0.98);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(212, 168, 83, 0.15);
  box-shadow: 0 0 0 2px rgba(212, 168, 83, 0.3);
}

.quiz-option.selected .quiz-option-letter {
  background: var(--primary-light);
  color: #1a1a1a;
}

.quiz-option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

.quiz-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.quiz-option.correct .quiz-option-letter {
  background: var(--success);
  color: white;
}

.quiz-option.wrong .quiz-option-letter {
  background: var(--danger);
  color: white;
}

.quiz-option-text {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.quiz-feedback {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.quiz-feedback.correct {
  background: rgba(46, 204, 113, 0.1);
  color: var(--success);
}

.quiz-feedback.wrong {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
}

.quiz-result {
  text-align: center;
  padding: 30px 20px;
}

.quiz-result-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.quiz-result-rate {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.quiz-result-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.quiz-result-img-wrap {
  margin: 1rem auto;
  max-width: 240px;
}

.quiz-result-img {
  width: 100%;
  border-radius: var(--radius);
  border: 2px solid var(--border);
}

.quiz-result-bonus {
  font-size: 1rem;
  color: var(--success);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quiz-result-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.quiz-restart-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.6rem;
  opacity: 0.8;
}

/* ==================== Gallery ==================== */
.gallery-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.gallery-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s;
}

.gallery-item:active {
  transform: scale(0.98);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

@media (min-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== 无料展示墙（wall showcase） ==================== */
.wall-body {
  padding: 16px;
  padding-bottom: 32px;
}
.wall-rule-card {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.12));
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.wall-rule-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.wall-rule-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.wall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.wall-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s;
}
.wall-item:active { transform: scale(0.97); }
.wall-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #1a1a35;
}
.wall-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.wall-item-user { color: var(--primary); font-weight: 600; }
.wall-item-time { opacity: 0.7; }
.wall-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* wall 场景内的上传区 */
.play-wall { text-align: center; }
.wall-upload-area { width: 100%; }
.wall-upload-btn {
  width: 100%;
  padding: 22px 16px;
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(236,72,153,0.10));
  border: 2px dashed rgba(168,85,247,0.5);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all .2s;
}
.wall-upload-btn:active { transform: scale(0.98); border-color: var(--primary); }
.wall-preview {
  margin-top: 12px;
  text-align: center;
}
.wall-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.wall-preview-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

@media (min-width: 480px) {
  .wall-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 万圣景已上传提示 */
.wall-already {
  text-align: center;
  padding: 18px 14px;
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(168,85,247,0.12));
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: var(--radius);
}
.wall-already-icon { font-size: 1.8rem; margin-bottom: 6px; }
.wall-already-title { font-weight: 700; color: var(--primary); font-size: 0.95rem; margin-bottom: 4px; }
.wall-already-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6; }
.wall-already-coins { font-size: 0.9rem; color: #10b981; font-weight: 700; margin-top: 8px; }

/* 投壶 pot */
.play-pot { text-align: center; }
.pot-cost { font-size: 0.88rem; color: #ef4444; font-weight: 600; margin-bottom: 8px; }
.pot-prizes { text-align: left; background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.pot-prize { font-size: 0.82rem; color: var(--text-secondary); padding: 2px 0; }
.pot-result { margin-top: 8px; padding: 10px; border-radius: 8px; background: rgba(217,119,6,0.12); border: 1px solid rgba(217,119,6,0.3); }
.pot-r-msg { font-size: 0.88rem; color: var(--primary); font-weight: 600; }
.pot-history { margin-top: 12px; text-align: left; border-top: 1px solid var(--border); padding-top: 10px; }
.pot-history-title { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 6px; }
.pot-history-item { font-size: 0.72rem; color: var(--text-secondary); padding: 2px 0; }

/* normal + photoHint（水池/爱豆景线下拍摄场地） */
.play-normal-photo { text-align: center; padding: 8px; }
.play-photo-hint {
  background: linear-gradient(135deg, rgba(212,168,76,0.12), rgba(16,185,129,0.12));
  border: 1px solid rgba(212,168,76,0.3);
  padding: 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--primary);
}

/* hidden 隐藏花房 */
.play-hidden { text-align: center; padding: 20px 10px; }
.hidden-icon { font-size: 3rem; margin-bottom: 10px; }
.hidden-title { font-size: 1.05rem; font-weight: 700; color: #a855f7; margin-bottom: 6px; }
.hidden-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }
.hidden-coins { font-size: 0.95rem; color: #10b981; font-weight: 700; margin-top: 10px; }

/* 图片墙（详情弹窗内） */
.sub-wall-title {
  font-size: 0.82rem; font-weight: 600; color: var(--primary);
  margin: 14px 0 8px; padding-top: 12px;
  border-top: 1px dashed rgba(201,169,110,0.3);
}
.sub-wall-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.sub-wall-item {
  background: var(--bg-card); border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
}
.sub-wall-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: #1a1a35;
}
.sub-wall-meta {
  font-size: 0.65rem; color: var(--text-secondary);
  padding: 4px 6px; text-align: center;
}
/* pot 剩余次数 */
.pot-remaining {
  font-size: 0.85rem; color: var(--primary); margin-bottom: 8px;
}
.pot-remaining strong { color: #d97706; font-size: 1rem; }
.pot-remaining-sub {
  font-size: 0.72rem; color: var(--text-secondary); margin-top: 4px;
}

/* ==================== 幸运扭蛋 ==================== */
.lucky-body { padding: 20px; text-align: center; }
.lucky-coins { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px; }
.lucky-coins strong { color: var(--primary); font-size: 1.2rem; }

/* 扭蛋机容器 */
.gacha-wrap {
  position: relative; width: 260px; margin: 0 auto 20px;
}
/* 上半部分：圆球 */
.gacha-top {
  width: 260px; height: 260px;
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  border-radius: 50% 50% 8px 8px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 25px rgba(196,69,105,0.4), inset 0 0 30px rgba(0,0,0,0.2);
}
.gacha-ball {
  position: absolute; top: 15px; left: 15px; right: 15px; bottom: 15px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4) 0%, transparent 40%),
              radial-gradient(ellipse at 70% 80%, rgba(255,255,255,0.2) 0%, transparent 30%),
              linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  border-radius: 50%;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  animation: ball-idle 4s ease-in-out infinite;
}
@keyframes ball-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.gacha-ball.ball-shake { animation: ball-shake 0.12s linear infinite; }
@keyframes ball-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-2px, -1px) rotate(-2deg); }
  50% { transform: translate(2px, 1px) rotate(2deg); }
  75% { transform: translate(-1px, 2px) rotate(-1deg); }
}
/* 扭蛋 emoji */
.gg {
  position: absolute; width: 42px; height: 42px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gg1 { top: 35px; left: 40px; transform: rotate(-15deg); }
.gg2 { top: 55px; right: 45px; transform: rotate(20deg); }
.gg3 { top: 110px; left: 25px; transform: rotate(10deg); }
.gg4 { top: 130px; right: 30px; transform: rotate(-10deg); }
.gg5 { top: 180px; left: 50px; transform: rotate(25deg); }
.gg6 { top: 200px; right: 55px; transform: rotate(-5deg); }
.gg7 { top: 80px; left: 105px; transform: rotate(-20deg); }
.gg8 { bottom: 35px; left: 95px; transform: rotate(15deg); }

/* 中间层：旋钮 */
.gacha-middle {
  width: 100%; height: 80px;
  background: linear-gradient(180deg, #2d3436, #1a1a2e);
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 0 4px 4px;
}
.gacha-knob {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #74b9ff, #0984e3);
  box-shadow: 0 4px 12px rgba(9,132,227,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s linear;
}
.knob-inner {
  width: 30px; height: 6px; background: rgba(255,255,255,0.8);
  border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 出口滑道 */
.gacha-chute {
  width: 70%; margin: 15px auto 0; height: 65px;
  background: linear-gradient(180deg, #1a1a2e, #0a0a1a);
  border-radius: 0 0 15px 15px;
  border: 2px solid #2d3436; border-top: none;
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: center;
}
.gacha-capsule {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(138,138,154,0.2);
  border: 2px solid #8a8a9a;
  display: flex; align-items: center; justify-content: center;
  margin-top: -10px;
  opacity: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.gacha-capsule.capsule-drop {
  animation: capsule-drop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes capsule-drop {
  0% { transform: translateY(-50px) scale(0.5); opacity: 0; }
  50% { transform: translateY(20px) scale(1.15); opacity: 1; }
  70% { transform: translateY(-8px) scale(0.95); }
  85% { transform: translateY(4px) scale(1.05); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 底部 */
.gacha-base {
  width: 100%; padding: 8px 0;
  background: linear-gradient(180deg, #0a0a1a, #1a1a35);
  border-radius: 8px;
  text-align: center; font-size: 0.7rem; font-weight: 700;
  color: var(--primary); letter-spacing: 2px;
}

.lucky-draw-btn { margin-top: 10px; }
.lucky-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 8px; }

/* 结果弹窗 */
.lucky-result {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; animation: fadeIn 0.25s ease;
}
.lucky-popup {
  background: var(--bg-card); border: 2px solid var(--primary);
  border-radius: 20px; padding: 30px 28px; min-width: 280px; max-width: 90vw;
  text-align: center; box-shadow: 0 10px 40px rgba(201,169,110,0.3);
  animation: popIn 0.35s cubic-bezier(0.17,0.67,0.12,1);
}
@keyframes popIn { 0% { transform: scale(0.6); opacity: 0;} 100% { transform: scale(1); opacity:1;} }
@keyframes fadeIn { 0% { opacity: 0;} 100% { opacity:1;} }
.lucky-popup-icon { font-size: 4rem; margin-bottom: 8px; }
.lucky-popup-level { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }
.lucky-popup-reward { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 20px; }

/* 历史记录 */
.lucky-history { margin-top: 20px; text-align: left; }
.lucky-history-title { font-size: 0.82rem; color: var(--primary); margin-bottom: 8px; padding-top: 12px; border-top: 1px dashed rgba(201,169,110,0.3); }
.lucky-history-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--bg-card); border-radius: 8px; margin-bottom: 6px;
  border: 1px solid var(--border); font-size: 0.82rem;
}
.lucky-history-item .lh-icon { font-size: 1.2rem; }
.lucky-history-item .lh-name { flex: 1; font-weight: 600; color: var(--text-primary); }
.lucky-history-item .lh-reward { font-weight: 700; }
.lucky-history-item .lh-time { color: var(--text-muted); font-size: 0.68rem; }

/* ==================== 奖品兑换 ==================== */
.redeem-body { padding: 20px; }
.redeem-coins {
  text-align: center; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 10px;
}
.redeem-coins strong { color: var(--primary); font-size: 1.2rem; }
.redeem-rule {
  text-align: center; font-size: 0.72rem; color: var(--text-muted);
  background: var(--bg-card); border-radius: 8px; padding: 8px 12px;
  margin-bottom: 16px; border: 1px dashed rgba(201,169,110,0.3);
}
.redeem-list { display: flex; flex-direction: column; gap: 10px; }
.redeem-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
  transition: all 0.2s;
}
.redeem-item.redeem-disabled { opacity: 0.55; }
.redeem-item-icon {
  width: 56px; height: 56px; border-radius: 12px;
  background: linear-gradient(135deg, #c9a96e, #a88a4e);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.redeem-item-info { flex: 1; min-width: 0; }
.redeem-item-level {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; margin-bottom: 4px;
  background: rgba(201,169,110,0.2); color: var(--primary);
}
.redeem-item-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.redeem-item-desc { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }
.redeem-item-right { text-align: right; flex-shrink: 0; }
.redeem-item-cost { font-size: 0.9rem; font-weight: 700; color: #c9a96e; margin-bottom: 6px; }
.redeem-btn { padding: 6px 14px; font-size: 0.8rem; }
/* 兑换记录 */
.redeem-history { margin-top: 20px; }
.redeem-history-title {
  font-size: 0.82rem; color: var(--primary); margin-bottom: 8px;
  padding-top: 12px; border-top: 1px dashed rgba(201,169,110,0.3);
}
.redeem-history-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--bg-card); border-radius: 8px; margin-bottom: 6px;
  border: 1px solid var(--border); font-size: 0.8rem;
}
.redeem-history-item .rh-icon { font-size: 1.2rem; }
.redeem-history-item .rh-name { flex: 1; font-weight: 600; color: var(--text-primary); }
.redeem-history-item .rh-cost { font-weight: 700; }
.redeem-history-item .rh-time { color: var(--text-muted); font-size: 0.65rem; }
