/* ============================================================
   LUCKY ARENA — 公共样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #f0b429;
  --primary-dark: #c98a00;
  --bg: #0f0f1a;
  --bg2: #1a1a2e;
  --bg3: #16213e;
  --card: #1e1e35;
  --card2: #252545;
  --card3: #2a2a50;
  --text: #ffffff;
  --text2: #8888aa;
  --text3: #555575;
  --green: #00d4aa;
  --red: #ff4d6d;
  --blue: #4d9fff;
  --purple: #8b5cf6;
  --orange: #ff6b35;
  --border: rgba(255,255,255,0.07);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== TOP BAR ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: linear-gradient(180deg, var(--bg2) 0%, rgba(26,26,46,0.95) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240,180,41,0.12);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; z-index: 300;
}

.topbar-title {
  font-size: 17px; font-weight: 700;
}

.logo {
  font-size: 20px; font-weight: 900;
  background: linear-gradient(90deg, #f0b429, #ff6b35);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; text-decoration: none;
  transition: background 0.15s;
}
.back-btn:active { background: var(--card2); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.balance-chip {
  background: var(--card);
  border: 1px solid rgba(240,180,41,0.25);
  border-radius: 20px; padding: 6px 12px;
  font-size: 13px; display: flex; align-items: center; gap: 5px;
  cursor: pointer;
}
.balance-chip .coin { font-size: 14px; }
.balance-chip .amount { font-weight: 700; color: var(--primary); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #f0b429, #ff6b35);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; cursor: pointer;
  flex-shrink: 0;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--bg2);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px 0 10px; gap: 3px; cursor: pointer; transition: all 0.15s;
  border: none; background: none; color: var(--text2); font-size: 10px;
  text-decoration: none; position: relative;
}
.nav-item .n-icon { font-size: 22px; line-height: 1; }
.nav-item.active { color: var(--primary); }
.nav-item.active .n-icon { filter: drop-shadow(0 0 6px rgba(240,180,41,0.5)); }
.nav-badge {
  position: absolute; top: 5px; right: calc(50% - 18px);
  background: var(--red); color: #fff; font-size: 9px; font-weight: 800;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ===== PAGE WRAPPER ===== */
.page-body {
  padding-top: 56px;
  padding-bottom: 70px;
  min-height: 100vh;
}
.page-body-full { padding-top: 56px; min-height: 100vh; padding-bottom: 0; }

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 15px; font-weight: 700;
  padding: 16px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title-left { display: flex; align-items: center; gap: 8px; }
.section-title-left::before {
  content: ''; width: 3px; height: 15px;
  background: linear-gradient(180deg, var(--primary), var(--orange));
  border-radius: 2px;
}
.section-more { font-size: 12px; color: var(--text2); }

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ===== MARQUEE ===== */
.marquee-bar {
  background: var(--card); margin: 0 12px 12px;
  border-radius: 10px; padding: 8px 12px;
  font-size: 12px; display: flex; align-items: center; gap: 8px; overflow: hidden;
}
.marquee-label {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.marquee-wrap { overflow: hidden; flex: 1; }
.marquee-text { color: var(--text2); white-space: nowrap; display: inline-block; animation: marquee 25s linear infinite; }
@keyframes marquee { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }

/* ===== MATCH CARD ===== */
.match-card {
  margin: 0 12px 10px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.match-card:active { border-color: rgba(240,180,41,0.3); }
.match-header {
  padding: 9px 14px; background: var(--card2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text2);
}
.match-live { color: var(--red); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.live-dot { width: 6px; height: 6px; background: var(--red); border-radius: 50%; animation: pulse 1.2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.match-teams { display: flex; align-items: center; padding: 14px; gap: 6px; }
.team { flex: 1; text-align: center; }
.team-logo { font-size: 30px; margin-bottom: 5px; }
.team-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.score-box { text-align: center; min-width: 80px; }
.score { font-size: 26px; font-weight: 900; color: var(--primary); letter-spacing: 2px; }
.score-time { font-size: 11px; color: var(--text2); margin-top: 2px; }
.vs-text { font-size: 20px; color: var(--text3); font-weight: 900; }

/* ===== ODDS ===== */
.odds-row {
  display: grid; gap: 6px; padding: 0 12px 12px;
}
.odds-row-3 { grid-template-columns: repeat(3,1fr); }
.odds-row-2 { grid-template-columns: repeat(2,1fr); }
.odd-btn {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px; text-align: center;
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.odd-btn:active { transform: scale(0.97); }
.odd-btn.selected { background: rgba(240,180,41,0.12); border-color: var(--primary); }
.odd-label { font-size: 10px; color: var(--text2); margin-bottom: 3px; }
.odd-val { font-size: 15px; font-weight: 800; color: var(--green); }
.odd-btn.selected .odd-val { color: var(--primary); }
.odd-change-up { animation: flash-green 0.6s; }
.odd-change-down { animation: flash-red 0.6s; }
@keyframes flash-green { 0%,100% {} 50% { background: rgba(0,212,170,0.2); } }
@keyframes flash-red { 0%,100% {} 50% { background: rgba(255,77,109,0.2); } }

/* ===== BET SLIP ===== */
.bet-slip-float {
  position: fixed; bottom: 70px; left: 0; right: 0; z-index: 90;
  padding: 0 12px; transform: translateY(calc(100% + 12px));
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.bet-slip-float.show { transform: translateY(0); }
.bet-slip-inner {
  background: linear-gradient(135deg, #1a2a1a, #0f1a0f);
  border: 1px solid rgba(0,212,170,0.3); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.bet-slip-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bet-slip-title { font-size: 14px; font-weight: 700; color: var(--green); }
.bet-slip-close { color: var(--text2); font-size: 20px; cursor: pointer; line-height: 1; }
.bet-selection { font-size: 12px; color: var(--text); margin-bottom: 10px; padding: 8px; background: rgba(0,0,0,0.2); border-radius: 6px; }
.bet-input-row { display: flex; gap: 8px; align-items: center; }
.bet-input {
  flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); padding: 10px 12px; color: #fff;
  font-size: 16px; outline: none; font-weight: 600;
}
.bet-input:focus { border-color: var(--green); }
.bet-confirm {
  background: linear-gradient(90deg, #00d4aa, #00a882);
  border: none; color: #000; font-weight: 800; padding: 10px 18px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; white-space: nowrap;
}
.bet-confirm:active { transform: scale(0.97); }
.bet-quick-amounts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bet-quick {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--text2);
}
.bet-quick:active { background: rgba(240,180,41,0.1); color: var(--primary); }
.bet-potential { font-size: 12px; color: var(--text2); margin-top: 8px; }
.bet-potential span { color: var(--primary); font-weight: 700; }

/* ===== TABS ===== */
.tabs-scroll {
  display: flex; gap: 8px; padding: 12px 12px 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab-item {
  flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; transition: all 0.15s; color: var(--text2);
  display: flex; align-items: center; gap: 4px;
}
.tab-item.active { background: var(--primary); color: #000; font-weight: 700; border-color: var(--primary); }

/* ===== TOAST ===== */
.toast {
  position: fixed; top: auto; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--card2); border-radius: 20px; padding: 10px 20px;
  font-size: 13px; font-weight: 600; z-index: 1000;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.08); white-space: nowrap; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(0,212,170,0.4); color: var(--green); }
.toast.win { border-color: var(--primary); color: var(--primary); }
.toast.info { border-color: var(--blue); color: var(--blue); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: var(--bg2); border-radius: 24px 24px 0 0;
  width: 100%; max-width: 500px;
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.34,1.2,0.64,1);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.show .modal-sheet { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; margin: 14px auto 20px; }

/* ===== BUTTONS ===== */
.btn {
  border: none; border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: transform 0.1s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(90deg, var(--primary), var(--orange)); color: #000; }
.btn-green { background: linear-gradient(90deg, var(--green), #00a882); color: #000; }
.btn-ghost { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-purple { background: linear-gradient(90deg, var(--purple), #6d28d9); color: #fff; }
.btn-full { width: 100%; }

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; color: var(--text2); margin-bottom: 8px; display: block; }
.form-input {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text); font-size: 15px; outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: rgba(240,180,41,0.5); }
.form-input::placeholder { color: var(--text3); }

/* ===== LIST ITEM ===== */
.list-item {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); cursor: pointer; transition: border-color 0.15s;
}
.list-item:active { border-color: rgba(240,180,41,0.2); }

/* ===== CHIP / BADGE ===== */
.chip {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
}
.chip-red { background: rgba(255,77,109,0.15); color: var(--red); }
.chip-green { background: rgba(0,212,170,0.15); color: var(--green); }
.chip-yellow { background: rgba(240,180,41,0.15); color: var(--primary); }
.chip-purple { background: rgba(139,92,246,0.15); color: var(--purple); }
.chip-blue { background: rgba(77,159,255,0.15); color: var(--blue); }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.divider-section { height: 8px; background: var(--bg); margin: 8px 0; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text2);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-text { font-size: 15px; }

/* ===== LOADING ===== */
.shimmer {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== JACKPOT ===== */
.jackpot-text {
  background: linear-gradient(90deg, #f0b429, #ff6b35, #f0b429);
  background-size: 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shine 2s linear infinite;
}
@keyframes shine { 0% { background-position: 0%; } 100% { background-position: 200%; } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 2px; }

/* ===== HELPERS ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.pb-0 { padding-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text2); }
.text-primary { color: var(--primary); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }
.text-center { text-align: center; }
