:root {
  --primary: #1a1a6e;
  --primary-light: #2d2d9f;
  --accent: #e8000d;
  --accent2: #ffd700;
  --collected-bg: #1565c0;
  --collected-text: #fff;
  --foil-from: #b8860b;
  --foil-to: #ffd700;
  --missing-bg: #e8e8e8;
  --missing-text: #888;
  --dup-color: #e65100;
  --sidebar-w: 220px;
  --header-h: 64px;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ===== HEADER ===== */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#sidebar-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: none;
}

#header h1 {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.stat-pill .stat-num {
  font-size: 18px;
  font-weight: 800;
}

.stat-pill .stat-label {
  font-size: 10px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-wrap {
  flex: 1;
  min-width: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 99px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), #ff6f00);
  border-radius: 99px;
  transition: width 0.4s ease;
}

#progress-pct {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
}
.sync-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #aaa;
  flex-shrink: 0;
}
.sync-synced     { background: rgba(76,175,80,0.2); color: #a5d6a7; }
.sync-synced .sync-dot { background: #66bb6a; }
.sync-saving     { background: rgba(255,193,7,0.2); color: #ffe082; }
.sync-saving .sync-dot { background: #ffd54f; animation: pulse 1s infinite; }
.sync-offline    { background: rgba(244,67,54,0.2); color: #ef9a9a; }
.sync-offline .sync-dot { background: #ef5350; }
.sync-connecting { background: rgba(255,255,255,0.1); color: #ccc; }
.sync-connecting .sync-dot { background: #ccc; animation: pulse 1.5s infinite; }
.sync-local      { background: rgba(255,255,255,0.08); color: #aaa; }
.sync-local .sync-dot { background: #aaa; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

.header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.header-actions button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}

.header-actions button:hover {
  background: rgba(255,255,255,0.28);
}

/* ===== LAYOUT ===== */
#main {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  z-index: 50;
  padding-bottom: 24px;
}

.search-wrap {
  padding: 10px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

#search-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
#search-input:focus { border-color: var(--primary-light); }

.filter-tabs {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0;
  gap: 2px;
}

.filter-tab {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  font-weight: 500;
  transition: background 0.15s;
}

.filter-tab:hover { background: #f0f2ff; }
.filter-tab.active { background: var(--primary); color: #fff; }

.sidebar-divider {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  padding: 12px 12px 4px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  font-weight: 500;
  transition: background 0.12s;
  display: block;
}
.nav-btn:hover { background: #f0f2ff; }
.nav-btn.active { background: var(--primary); color: #fff; font-weight: 700; }

.group-btn {
  font-weight: 700;
  color: var(--primary);
  padding: 7px 12px;
  font-size: 13px;
}

.sidebar-teams {
  padding-left: 10px;
}

.team-btn {
  font-size: 12px;
  padding: 4px 10px;
  color: #555;
}

.sidebar-group { margin-bottom: 2px; }

/* ===== CONTENT ===== */
#content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 20px;
  min-width: 0;
}

#section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

#section-stats {
  font-size: 13px;
  color: #666;
}

/* ===== TEAM HEADER ===== */
.team-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.team-flag-lg { font-size: 20px; }
.team-prog { font-size: 12px; color: #888; font-weight: 500; margin-left: auto; }

.team-stickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

/* ===== STICKER CARDS ===== */
.sticker-card {
  position: relative;
  border-radius: var(--radius);
  padding: 8px 6px 28px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  user-select: none;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}

.sticker-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.sticker-card:active { transform: scale(0.97); }

.sticker-card.missing {
  background: var(--missing-bg);
  color: var(--missing-text);
  border: 2px dashed #ccc;
}

.sticker-card.collected {
  background: var(--collected-bg);
  color: var(--collected-text);
  border: 2px solid #1565c0;
  box-shadow: var(--shadow);
}

.sticker-card.collected.foil {
  background: linear-gradient(135deg, #7b5a00, #c9a227, #ffd700, #c9a227, #7b5a00);
  background-size: 200% 200%;
  animation: shimmer 3s ease infinite;
  border-color: var(--accent2);
  color: #3a2000;
}

.sticker-card.missing.foil {
  border-color: #bbb;
  background: repeating-linear-gradient(
    45deg,
    #e8e8e8,
    #e8e8e8 6px,
    #f4f4f4 6px,
    #f4f4f4 12px
  );
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.sticker-card.has-duplicate {
  border-color: var(--dup-color);
}

.sticker-number {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.sticker-icon {
  font-size: 16px;
  line-height: 1;
}

.sticker-name {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.team-flag {
  font-size: 14px;
}

.collected-check {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #a5d6a7;
}

.sticker-card.collected.foil .collected-check { color: #3a2000; }

.duplicate-badge {
  position: absolute;
  top: 4px;
  left: 5px;
  background: var(--dup-color);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
}

/* Duplicate controls */
.dup-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 3px 4px;
  background: rgba(0,0,0,0.12);
  opacity: 0;
  transition: opacity 0.15s;
}

.sticker-card:hover .dup-controls { opacity: 1; }

.dup-btn {
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1.5;
  color: #333;
  transition: background 0.1s;
}
.dup-btn:hover { background: #fff; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  color: #aaa;
  font-size: 16px;
  padding: 60px 20px;
}

/* ===== EDIT MODE ===== */
#edit-mode-btn.active {
  background: #f57c00;
  border-color: #e65100;
  color: #fff;
}

.edit-mode-card {
  outline: 2px dashed #f57c00;
  outline-offset: -2px;
}

.rename-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  opacity: 0.7;
  vertical-align: middle;
  line-height: 1;
}
.rename-btn:hover { opacity: 1; }

.delete-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 2;
}

.extra-sticker { border-style: solid; border-color: #7b1fa2 !important; }
.extra-sticker.collected { background: #6a1b9a !important; border-color: #7b1fa2 !important; }

.add-sticker-tile {
  background: none;
  border: 2px dashed #bbb;
  border-radius: var(--radius);
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.2;
}
.add-sticker-tile:hover { border-color: #f57c00; color: #f57c00; }
.add-sticker-tile small { font-size: 10px; text-align: center; }

/* ===== MODALS ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-box-lg { max-width: 640px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--primary); }

.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.1s;
}
.modal-close-btn:hover { background: #f0f0f0; color: #333; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-team-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
  margin-top: 12px;
}
.form-label:first-of-type { margin-top: 0; }

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(45,45,159,0.1); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-light); }

.btn-secondary {
  background: #f0f0f0;
  color: #444;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #e0e0e0; }

/* ===== INSTRUCTIONS STYLES ===== */
.instructions-body { line-height: 1.6; }

.instr-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.instr-section:last-child { border-bottom: none; margin-bottom: 0; }

.instr-section h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.instr-section p { font-size: 13px; color: #444; margin-bottom: 6px; }

.instr-section ul {
  font-size: 13px;
  color: #444;
  padding-left: 20px;
  margin: 6px 0;
}
.instr-section ul li { margin-bottom: 3px; }

.instr-section code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.instr-section .note {
  background: #fff8e1;
  border-left: 3px solid #ffc107;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #555;
}

.highlight-blue { color: #1565c0; font-weight: 600; }
.highlight-orange { color: #e65100; font-weight: 600; }

.legend-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: center;
  font-size: 13px;
}
.legend-icon {
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  color: var(--primary);
}

/* ===== TEAM COMPLETE ===== */
.team-header.team-complete {
  background: linear-gradient(90deg, rgba(255,215,0,0.15), transparent);
  border-left-color: var(--accent2);
  color: #7b5a00;
}
.team-complete-badge {
  font-size: 16px;
  margin-left: 2px;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1a1a6e;
  color: #fff;
  padding: 12px 22px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-complete { background: linear-gradient(90deg, #7b5a00, #c9a227); }
.toast-update  { background: #1565c0; }

/* ===== STATS PAGE ===== */
.stats-page { max-width: 720px; }

.stats-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 16px;
  padding: 28px 24px 20px;
  text-align: center;
  margin-bottom: 20px;
}
.stats-hero-pct { font-size: 56px; font-weight: 900; line-height: 1; }
.stats-hero-sub { font-size: 14px; opacity: 0.85; margin: 6px 0 14px; }
.stats-hero-bar {
  height: 10px;
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  overflow: hidden;
}
.stats-hero-bar div {
  height: 100%;
  background: var(--accent2);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card-icon { font-size: 22px; margin-bottom: 4px; }
.stat-card-num  { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat-card-num span { font-size: 13px; font-weight: 500; color: #888; }
.stat-card-label { font-size: 11px; color: #666; margin: 4px 0 8px; }
.stat-mini-bar { height: 5px; background: #eee; border-radius: 99px; overflow: hidden; }
.stat-mini-bar div { height: 100%; background: var(--primary-light); border-radius: 99px; }

.stats-section { margin-bottom: 28px; }
.stats-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #eee;
}

.complete-teams-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.complete-team-chip {
  background: linear-gradient(90deg, #7b5a00, #c9a227);
  color: #fff;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
}

.group-stat-block {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.group-stat-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.group-stat-name  { font-weight: 700; color: var(--primary); font-size: 14px; flex: 1; }
.group-stat-right { font-size: 12px; color: #888; }
.group-stat-bar {
  height: 6px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}
.group-stat-bar div { height: 100%; background: var(--primary-light); border-radius: 99px; }

.team-stat-row {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.team-stat-name  { color: #333; }
.team-stat-nums  { color: #888; white-space: nowrap; text-align: right; }
.team-mini-bar   { height: 4px; background: #eee; border-radius: 99px; overflow: hidden; }
.team-mini-bar div { height: 100%; background: #42a5f5; border-radius: 99px; }

.ranking-list { display: flex; flex-direction: column; gap: 4px; }
.ranking-row {
  display: grid;
  grid-template-columns: 24px 24px 1fr 80px 36px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
}
.ranking-row:nth-child(odd) { background: #f8f9ff; }
.ranking-complete { background: #fff8dc !important; }
.ranking-pos   { font-weight: 700; color: #aaa; text-align: center; }
.ranking-flag  { font-size: 16px; }
.ranking-name  { font-weight: 500; color: #333; }
.ranking-bar   { height: 4px; background: #eee; border-radius: 99px; overflow: hidden; }
.ranking-bar div { height: 100%; background: var(--primary-light); border-radius: 99px; }
.ranking-pct   { font-size: 11px; color: #888; text-align: right; }
.ranking-trophy { font-size: 14px; }

/* ===== LOCK BUTTON ===== */
.lock-btn {
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.lock-btn.locked   { background: rgba(229,57,53,0.25); color: #ffcdd2; border-color: rgba(229,57,53,0.4); }
.lock-btn.locked:hover { background: rgba(229,57,53,0.4); }
.lock-btn.unlocked { background: rgba(76,175,80,0.25); color: #c8e6c9; border-color: rgba(76,175,80,0.4); }
.lock-btn.unlocked:hover { background: rgba(76,175,80,0.1); }

/* ===== MOBILE MENU BUTTON ===== */
.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

#mobile-menu-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 22px;
  padding: 2px 10px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.4;
}

.mobile-menu {
  position: fixed;
  top: var(--header-h);
  right: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 150;
  overflow: hidden;
  min-width: 200px;
}
.mobile-menu.hidden { display: none; }
.mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
}
.mobile-menu button:last-child { border-bottom: none; }
.mobile-menu button:hover { background: #f5f5ff; }

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.bottom-nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  cursor: pointer;
  color: #888;
  font-size: 11px;
  gap: 2px;
  transition: color 0.15s;
}
.bottom-nav-btn span { font-size: 20px; line-height: 1; }
.bottom-nav-btn small { font-size: 10px; font-weight: 500; }
.bottom-nav-btn.active { color: var(--primary); }
.bottom-nav-btn.active span { transform: scale(1.1); }

/* ===== MOBILE ===== */
@media (max-width: 680px) {
  #sidebar-toggle { display: block; }
  .mobile-only  { display: block; }
  .desktop-only { display: none !important; }

  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
    box-shadow: none;
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  }

  #content {
    margin-left: 0;
    padding: 10px 10px 80px;
  }

  #bottom-nav { display: flex; }

  .header-stats { display: none; }
  .sync-status .sync-label { display: none; }
  .sync-status { padding: 4px 6px; }

  /* Always show dup controls on mobile (no hover) */
  .dup-controls { opacity: 1; background: rgba(0,0,0,0.08); }

  .team-stickers {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 7px;
  }

  .sticker-card { min-height: 105px; }

  #section-title { font-size: 18px; }

  /* Stats on mobile */
  .stats-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 10px 8px; }
  .stat-card-num { font-size: 16px; }

  .ranking-row { grid-template-columns: 20px 20px 1fr 50px 30px; gap: 4px; }
}

@media (max-width: 400px) {
  .team-stickers { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .stats-cards { grid-template-columns: 1fr; }
}
