/* ============================================
   动物世界杯2026 - Mobile First Styles
   ============================================ */

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

:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --surface: #16213e;
  --border: #2a2a4a;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --primary: #e94560;
  --primary-hover: #ff6b81;
  --accent: #f5c518;
  --success: #2ecc71;
  --danger: #e74c3c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* --- Layout --- */
/* --- Page Transition --- */
.page {
  animation: pageFadeIn 0.35s ease-out;
  max-width: 640px; margin: 0 auto; padding: 0 12px 80px;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Header --- */
.page-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0; position: relative;
}
.page-header h1 { font-size: 1.25rem; font-weight: 700; flex: 1; }
.back-link { font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; }

.header-left { display: flex; align-items: center; gap: 10px; }
.header-left .animal-emoji { font-size: 2rem; }
.header-right { margin-left: auto; }

/* --- Navigation Tabs --- */
.tab-nav {
  display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border-radius: var(--radius); padding: 4px; margin-bottom: 16px;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; text-align: center; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; transition: all 0.2s;
}
.tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.tab:hover:not(.active) { color: var(--text); background: var(--bg-card); }

/* --- Hero Section --- */
.hero {
  text-align: center; padding: 32px 0 24px;
}
.hero h1 { font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { color: var(--text-muted); margin-top: 8px; font-size: 0.9rem; }
.hero-sub {
  display: flex; justify-content: center; gap: 24px; margin-top: 16px; font-size: 0.85rem;
}
.hero-sub span { color: var(--text-muted); }
.hero-sub strong { color: var(--accent); }

/* --- Animal Grid (Home) --- */
.animal-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0;
}
.animal-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 4px; background: var(--bg-card); border-radius: var(--radius);
  text-align: center; transition: transform 0.2s; cursor: default;
}
.animal-card .animal-emoji { font-size: 2rem; }
.animal-card .animal-name { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* --- Toast Notification --- */
.toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 360px; width: 90%;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
  font-size: 0.85rem; font-weight: 500;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent); }
.toast-out {
  animation: toastOut 0.3s ease-in forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15,15,26,0.6); z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Pulse Animation --- */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pulse { animation: pulse 2s ease-in-out infinite; }

/* --- Button Ripple --- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 28px; border-radius: var(--radius); font-size: 1rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary:active { background: var(--primary-hover); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; }
.btn-large { padding: 14px 40px; font-size: 1.1rem; }
.btn-center { text-align: center; margin-top: 16px; }

/* --- Score Badge --- */
.score-badge {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-card); border-radius: var(--radius); padding: 6px 14px;
}
.score-num { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.score-badge small { font-size: 0.65rem; color: var(--text-muted); }

/* --- Stats Bar --- */
.user-stats-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.stat {
  flex: 1; text-align: center; background: var(--bg-card); border-radius: var(--radius); padding: 12px 8px;
}
.stat-value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* --- Boost Bar --- */
.boost-bar {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #1a1a2e, #16213e); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px;
}
.boost-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.boost-icon { font-size: 1.3rem; }
.boost-text { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.boost-active-badge { font-size: 0.8rem; font-weight: 600; color: var(--success); }

/* --- Section --- */
.section { margin-top: 20px; }
.section-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 12px;
}
.section-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.section-title-row .section-title { margin-bottom: 0; }
.badge {
  font-size: 0.75rem; color: var(--text-muted); background: var(--bg-card);
  padding: 4px 10px; border-radius: 20px;
}

/* --- Match Card --- */
.match-list { display: flex; flex-direction: column; gap: 10px; }
.match-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px; transition: all 0.2s;
}
.match-card.upcoming { border-left: 3px solid var(--primary); }
.match-card.past { border-left: 3px solid var(--border); }
.match-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.match-stage { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.match-date { font-size: 0.7rem; color: var(--text-muted); }
.match-teams, .match-tevens {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px;
}
.team-side {
  display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600;
  min-width: 80px;
}
.team-side:last-child { flex-direction: row-reverse; text-align: right; }
.team-side.winner { color: var(--success); }
.team-color {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.team-code { font-size: 0.95rem; }
.team-full { font-size: 0.75rem; color: var(--text-muted); display: block; }
.vs { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; min-width: 24px; text-align: center; }
.score { font-size: 1.1rem; font-weight: 800; color: var(--accent); min-width: 40px; text-align: center; }

/* --- Predict Actions --- */
.predict-actions {
  display: flex; gap: 6px;
}
.btn-predict {
  flex: 1; padding: 10px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-predict:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.prediction-made {
  font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.prediction-result {
  font-size: 0.8rem; padding: 6px 10px; border-radius: var(--radius-sm); text-align: center;
}
.prediction-result.correct { background: rgba(46,204,113,0.15); color: var(--success); }
.prediction-result.wrong { background: rgba(231,76,60,0.15); color: var(--danger); }
.no-prediction { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }

/* --- Prediction Detail (profile) --- */
.prediction-detail {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--text-muted);
}

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 0.9rem;
}
.empty-state .btn { margin-top: 12px; }

/* --- Modal --- */
.modal {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 90%; max-width: 360px; background: var(--bg-card); border-radius: var(--radius);
  padding: 24px; z-index: 1000; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.modal.show { display: block; }
.modal h3 { margin-bottom: 16px; text-align: center; }
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 999;
}
.modal-overlay.show { display: block; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

.score-inputs {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0;
}
.score-team { text-align: center; }
.score-team span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.score-input {
  width: 72px; height: 56px; text-align: center; font-size: 1.5rem; font-weight: 700;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color 0.2s;
}
.score-input:focus { border-color: var(--primary); }
.score-colon { font-size: 1.5rem; font-weight: 700; color: var(--text-muted); margin-top: 24px; }
.score-hint { text-align: center; font-size: 0.75rem; color: var(--text-muted); }

/* --- Leaderboard --- */
.leaderboard-full { margin-bottom: 20px; }
.lb-header {
  display: flex; align-items: center; padding: 10px 12px; font-size: 0.75rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.lb-h-rank { width: 44px; }
.lb-h-player { flex: 1; }
.lb-h-team { width: 48px; text-align: center; }
.lb-h-score { width: 52px; text-align: right; }

.lb-row {
  display: flex; align-items: center; padding: 12px; border-radius: var(--radius-sm);
  margin-bottom: 4px; background: var(--bg-card); transition: background 0.2s;
  text-decoration: none; color: var(--text);
}
.lb-row:hover { background: var(--bg-card-hover); }
.lb-row.top3 { background: linear-gradient(135deg, var(--bg-card), rgba(233,69,96,0.1)); }
.lb-rank {
  width: 44px; font-size: 0.9rem; font-weight: 700; text-align: center;
}
.lb-rank.top { font-size: 1.2rem; }
.lb-player { flex: 1; display: flex; align-items: center; gap: 8px; }
.lb-animal { font-size: 1.3rem; }
.lb-name { font-size: 0.9rem; font-weight: 600; }
.lb-team { width: 48px; text-align: center; font-size: 0.85rem; font-weight: 700; }
.lb-score { width: 52px; text-align: right; font-size: 1rem; font-weight: 800; color: var(--accent); }

/* --- Profile --- */
.profile-hero {
  display: flex; align-items: center; gap: 16px; padding: 20px 0;
}
.profile-avatar { flex-shrink: 0; }
.profile-avatar svg { width: 100px; height: 100px; border-radius: 50%; background: var(--bg-card); padding: 4px; }
.avatar-svg { line-height: 0; }
.profile-info h2 { font-size: 1.3rem; font-weight: 700; }
.profile-team { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.9rem; }

.profile-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px;
}
.stat-card {
  text-align: center; background: var(--bg-card); border-radius: var(--radius); padding: 16px 8px;
}
.stat-card .stat-value { font-size: 1.5rem; }
.stat-card .stat-label { font-size: 0.75rem; }

/* --- Team Badge --- */
.team-badge-sm {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700;
}
.animal-emoji-big { font-size: 4rem; }

/* --- Groups --- */
.groups-container { display: flex; flex-direction: column; gap: 16px; }
.group-card { background: var(--bg-card); border-radius: var(--radius); padding: 14px; }
.group-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }

.standings-table { font-size: 0.78rem; }
.st-header {
  display: flex; padding: 6px 4px; color: var(--text-muted); font-weight: 600;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.st-row {
  display: flex; align-items: center; padding: 7px 4px; border-radius: 4px;
  margin-bottom: 2px;
}
.st-row.qualify { background: rgba(46,204,113,0.08); }
.st-rank { width: 24px; text-align: center; font-weight: 700; }
.st-team { flex: 1; padding-left: 6px; font-weight: 600; }
.st-code { font-size: 0.8rem; }
.st-played, .st-won, .st-drawn, .st-lost { width: 22px; text-align: center; color: var(--text-muted); }
.st-gd { width: 32px; text-align: center; color: var(--text-muted); }
.st-pts { width: 28px; text-align: center; font-weight: 800; color: var(--accent); }

.st-empty { text-align: center; padding: 20px; color: var(--text-muted); }

.group-matches { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.gm-row {
  display: flex; align-items: center; gap: 6px; padding: 5px 4px;
  font-size: 0.78rem;
}
.gm-team { flex: 1; font-weight: 600; }
.gm-row .gm-team:last-child { text-align: right; }
.gm-score { font-weight: 700; color: var(--accent); min-width: 36px; text-align: center; }
.gm-vs { font-size: 0.7rem; color: var(--text-muted); min-width: 36px; text-align: center; }
.gm-date { font-size: 0.7rem; color: var(--text-muted); width: 48px; text-align: right; }

.qualify-note {
  margin-top: 16px; padding: 12px; background: var(--surface); border-radius: var(--radius);
  font-size: 0.8rem; color: var(--text-muted); text-align: center;
}

/* --- Bracket --- */
.bracket-container { display: flex; flex-direction: column; gap: 16px; }
.bracket-round { background: var(--bg-card); border-radius: var(--radius); padding: 14px; }
.round-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; }
.round-matches { display: flex; flex-direction: column; gap: 8px; }

.bracket-match {
  background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px;
}
.bm-teams { display: flex; flex-direction: column; gap: 4px; }
.bm-team {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85rem; padding: 2px 0;
}
.bm-team.bm-winner { font-weight: 700; color: var(--success); }
.bm-name { font-weight: 600; }
.bm-score { font-size: 1rem; font-weight: 800; color: var(--accent); }
.bm-date { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* --- Setup Page --- */
.setup-step { margin-bottom: 24px; }
.setup-step h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.setup-step .hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

.animal-select {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.animal-option {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 4px; background: var(--bg-card); border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
}
.animal-option:hover { border-color: var(--border); }
.animal-option.selected { border-color: var(--primary); background: rgba(233,69,96,0.1); }
.animal-option svg { width: 56px; height: 56px; }
.animal-svg-thumb { line-height: 0; }
.animal-svg-thumb svg { width: 52px; height: 52px; }

.team-select {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 300px;
  overflow-y: auto; padding: 4px;
}
.team-option {
  padding: 8px 4px; text-align: center; background: var(--bg-card); border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
  font-size: 0.75rem; font-weight: 600;
}
.team-option:hover { border-color: var(--border); }
.team-option.selected { border-color: var(--primary); background: rgba(233,69,96,0.1); }
.team-option .team-dot {
  width: 20px; height: 20px; border-radius: 50%; display: inline-block; margin-bottom: 4px;
}

.input {
  display: block; width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 2px solid var(--border); color: var(--text);
  font-size: 1rem; outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: var(--primary); }

/* --- Preview --- */
.preview-area { text-align: center; padding: 20px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 20px; }
.preview-area svg { width: 120px; height: 120px; }

/* --- Bracket Intro --- */
.bracket-intro { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

/* --- Home Page Hero --- */
.home-page { padding-bottom: 40px; }
.hero-bg { display: none; }
.hero-content { padding: 20px 0; }
.hero-animals { margin-bottom: 16px; }
.animal-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.animal-icon { font-size: 2.4rem; display: inline-block; animation: float 3s ease-in-out infinite; }
.animal-row:nth-child(2) .animal-icon:nth-child(1) { animation-delay: 0.2s; }
.animal-row:nth-child(2) .animal-icon:nth-child(2) { animation-delay: 0.6s; }
.animal-row:nth-child(2) .animal-icon:nth-child(3) { animation-delay: 1.0s; }
.animal-row:nth-child(2) .animal-icon:nth-child(4) { animation-delay: 1.4s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 8px; }
.hero-title span { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.hero-info { display: flex; justify-content: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 24px; }
.hero-users { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }

/* --- Countdown --- */
.countdown {
  display: flex; justify-content: center; gap: 12px; margin: 16px 0;
}
.countdown-item { text-align: center; }
.countdown-num {
  display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent);
  min-width: 48px; background: var(--bg-card); border-radius: var(--radius-sm); padding: 6px 8px;
}
.countdown-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; display: block; }

/* --- PWA Install Banner --- */
.install-banner {
  display: none; align-items: center; justify-content: space-between;
  background: var(--surface); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
  font-size: 0.85rem; border: 1px solid var(--border);
}

.animal-card h3 { font-size: 0.85rem; font-weight: 700; margin-top: 4px; }
.animal-card p { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.animal-emoji-lg { font-size: 2.5rem; }

/* --- Home Leaderboard Preview --- */
.leaderboard-preview { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.lb-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--bg-card); border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
  transition: background 0.2s;
}
.lb-item:hover { background: var(--bg-card-hover); }
.lb-item .lb-rank { width: 28px; font-weight: 700; font-size: 0.85rem; text-align: center; }
.lb-item .lb-rank.top { color: var(--accent); }
.lb-item .lb-animal { font-size: 1.2rem; }
.lb-item .lb-name { flex: 1; font-weight: 600; font-size: 0.85rem; }
.lb-item .lb-team { font-size: 0.8rem; font-weight: 700; width: 60px; text-align: center; }
.lb-item .lb-score { font-size: 0.95rem; font-weight: 800; color: var(--accent); }

/* --- Match Highlights --- */
.match-highlights { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.match-highlight {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  text-align: center; border-left: 3px solid var(--primary);
}
.match-info { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.match-teams { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.highlight-date { font-size: 0.75rem; color: var(--text-muted); }

/* --- Footer --- */
.footer { text-align: center; padding: 24px 0; margin-top: 32px; }
.footer p { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }

/* --- Setup Container --- */
.setup-container { padding: 8px 0; }
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 0.85rem; font-weight: 700; margin-bottom: 10px;
}
.setup-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.animal-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.team-search { margin-bottom: 10px; }
.team-selector {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-height: 280px; overflow-y: auto; padding: 4px;
}
.team-option {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; background: var(--bg-card); border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
  font-size: 0.75rem;
}
.team-option:hover { border-color: var(--border); }
.team-option.selected { border-color: var(--primary); background: rgba(233,69,96,0.1); }
.team-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 0.75rem; font-weight: 700; margin-bottom: 2px;
}
.team-name { font-weight: 600; }
.team-group { font-size: 0.65rem; color: var(--text-muted); }

.setup-preview {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; text-align: center;
}
.setup-preview h3 { margin-bottom: 12px; }
.preview-container { display: flex; align-items: center; justify-content: center; gap: 16px; }
.preview-svg { flex-shrink: 0; }
.preview-svg svg { width: 100px; height: 100px; }
.preview-placeholder {
  width: 100px; height: 100px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-radius: 50%; font-size: 0.75rem; color: var(--text-muted);
}
.preview-info { text-align: left; }
.preview-info p { font-size: 0.85rem; margin-bottom: 4px; }

.btn-create { margin-top: 8px; }
.btn-create:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Admin Page --- */
.admin-section { margin-bottom: 20px; }
.admin-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.admin-match {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 6px;
  flex-wrap: wrap;
}
.admin-match .match-label { font-size: 0.75rem; color: var(--text-muted); min-width: 80px; }
.admin-match .admin-teams { flex: 1; font-size: 0.85rem; font-weight: 600; text-align: center; }
.admin-score-input {
  width: 44px; height: 36px; text-align: center; font-size: 0.95rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); outline: none;
}
.admin-score-input:focus { border-color: var(--primary); }
.admin-colon { font-size: 1rem; font-weight: 700; color: var(--text-muted); }
.admin-save-btn {
  padding: 6px 16px; border-radius: 6px; border: none;
  background: var(--primary); color: #fff; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.admin-save-btn:hover { background: var(--primary-hover); }
.admin-saved { font-size: 0.75rem; color: var(--success); }
.admin-filter {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.admin-filter-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 0.78rem; cursor: pointer;
}
.admin-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Group Filter (Setup Page) --- */
.group-filter {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.group-filter-btn {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 0.78rem; cursor: pointer; transition: all 0.2s;
}
.group-filter-btn:hover { border-color: var(--primary); color: var(--text); }
.group-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Session Bar (persistent login state) --- */
.session-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; margin-bottom: 8px;
  background: var(--bg-card); border-radius: var(--radius-sm);
  font-size: 0.8rem; max-width: 640px; margin-left: auto; margin-right: auto;
}
.session-bar-guest { justify-content: space-between; }
.session-avatar { font-size: 1.2rem; line-height: 1; }
.session-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-team { font-weight: 700; font-size: 0.75rem; }
.session-logout { font-size: 0.7rem; color: var(--text-muted); text-decoration: none; cursor: pointer; }
.session-logout:hover { color: var(--danger); }

/* --- Shop --- */
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: var(--bg-card); border-radius: var(--radius);
  transition: background 0.2s;
}
.shop-icon { font-size: 2rem; width: 48px; text-align: center; }
.shop-info { flex: 1; }
.shop-name { font-weight: 700; font-size: 0.9rem; }
.shop-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.shop-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.shop-owned { font-size: 0.72rem; color: var(--text-muted); }
.inventory-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 4px;
}
.inventory-icon { font-size: 1.3rem; }
.inventory-name { flex: 1; font-size: 0.85rem; font-weight: 600; }
.inventory-qty { font-size: 0.85rem; font-weight: 700; color: var(--accent); }

/* --- Coins Page --- */
.coins-hero {
  text-align: center; padding: 20px 0;
}
.coins-balance {
  font-size: 3rem; font-weight: 800; color: var(--accent);
}
.coins-label { font-size: 0.85rem; color: var(--text-muted); }
.coins-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.coin-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 4px;
}
.coin-icon { font-size: 1.2rem; }
.coin-amount { font-weight: 700; white-space: nowrap; }
.coin-amount.positive { color: var(--success); }
.coin-amount.negative { color: var(--danger); }
.coin-desc { flex: 1; font-size: 0.8rem; }
.coin-time { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

/* --- Support Page --- */
.support-header {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.support-stat {
  flex: 1; text-align: center; background: var(--bg-card); border-radius: var(--radius); padding: 14px 8px;
}
.support-stat-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.support-stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.support-list { margin-top: 12px; }
.support-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 4px;
}
.support-rank {
  width: 28px; text-align: center; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.support-rank.top { font-size: 1.1rem; }
.support-team-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 22px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.support-team-info { width: 64px; flex-shrink: 0; }
.support-team-name { display: block; font-size: 0.8rem; font-weight: 600; line-height: 1.2; }
.support-team-group { font-size: 0.65rem; color: var(--text-muted); }
.support-bar-wrap { flex: 1; min-width: 60px; padding: 0 4px; }
.support-bar-bg {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.support-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 3px; transition: width 0.5s ease;
}
.support-count { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); width: 36px; text-align: right; flex-shrink: 0; }
.support-pct { font-size: 0.85rem; font-weight: 700; color: var(--accent); width: 38px; text-align: right; flex-shrink: 0; }

/* --- Page Tab Bar (fixed bottom) --- */
.page-tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--bg-card); border-top: 1px solid var(--border); z-index: 100;
  padding: 4px 0; padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.page-tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0; font-size: 0.65rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s;
}
.page-tab-item.active { color: var(--primary); }
.page-tab-item .tab-icon { font-size: 1.2rem; }

/* --- Responsive --- */
@media (min-width: 768px) {
  .page { max-width: 800px; }
  .animal-grid { grid-template-columns: repeat(4, 140px); justify-content: center; }
  .bracket-container {
    flex-direction: row; flex-wrap: wrap; gap: 12px;
  }
  .bracket-round { flex: 1; min-width: 220px; }
  .groups-container {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  }
  .team-select { grid-template-columns: repeat(6, 1fr); }
  .profile-stats { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .page { max-width: 960px; }
  .groups-container { grid-template-columns: repeat(3, 1fr); }
  .team-select { grid-template-columns: repeat(8, 1fr); }
}
