/* =============================================================
 * Mobile Design Tokens — Niksen Beyblade
 * 套到所有手機可見頁面 (#checkin, #live-board, #ref) 上
 * m- prefixed classes，與 desktop styles.css 不衝突
 * ============================================================= */

:root {
  --pad-screen: 20px;
  --pad-screen-tight: 16px;
  --home-indicator-h: 32px;
}

/* === Cards === */
.m-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.m-card.accent-acid::before,
.m-card.accent-magenta::before,
.m-card.accent-electric::before,
.m-card.accent-gold::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 1;
}
.m-card.accent-acid::before     { background: var(--acid-500);     box-shadow: 0 0 8px var(--acid-glow); }
.m-card.accent-magenta::before  { background: var(--magenta-500);  box-shadow: 0 0 8px var(--magenta-glow); }
.m-card.accent-electric::before { background: var(--electric-500); box-shadow: 0 0 8px var(--electric-glow); }
.m-card.accent-gold::before     { background: var(--gold-500);     box-shadow: 0 0 8px var(--gold-glow); }

/* === Chip === */
.m-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--bg-inset);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  white-space: nowrap;
}
.m-chip .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.m-chip.acid     { color: var(--acid-400); background: rgba(197,240,44,0.08); border-color: rgba(197,240,44,0.3); }
.m-chip.electric { color: #8fa8ff; background: rgba(42,92,255,0.1); border-color: rgba(42,92,255,0.35); }
.m-chip.gold     { color: var(--gold-500); background: rgba(255,212,59,0.08); border-color: rgba(255,212,59,0.3); }
.m-chip.magenta  { color: var(--magenta-400); background: rgba(255,45,111,0.08); border-color: rgba(255,45,111,0.3); }
.m-chip.warning  { color: #ff9824; background: rgba(255,152,36,0.08); border-color: rgba(255,152,36,0.3); }
.m-chip.muted    { color: var(--text-tertiary); }
.m-chip.lg       { font-size: 11px; padding: 4px 9px; }

/* === Tag strip — 海報式黃底斜體標籤 === */
.m-tag-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--acid-500);
  color: #0a0a08;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  font-style: italic;
}
.m-tag-strip.magenta { background: var(--magenta-500); color: #fff; }
.m-tag-strip.gold    { background: var(--gold-500); color: #2a1d05; }
.m-tag-strip.electric { background: var(--electric-500); color: #fff; }

/* === Buttons === */
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: opacity 0.12s, transform 0.1s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}
.m-btn:active { transform: scale(0.97); }
.m-btn.sm    { min-height: 36px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.m-btn.lg    { min-height: 52px; font-size: 16px; border-radius: 14px; }
.m-btn.block { width: 100%; }
.m-btn-primary {
  background: var(--acid-500); color: #0a0a08;
  box-shadow: 0 0 0 1px rgba(197,240,44,0.4), 0 4px 18px -4px var(--acid-glow);
}
.m-btn-secondary {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.m-btn-ghost { color: var(--text-secondary); background: transparent; }
.m-btn-magenta {
  background: var(--magenta-500); color: #fff;
  box-shadow: 0 0 0 1px rgba(255,45,111,0.4), 0 4px 18px -4px var(--magenta-glow);
}
.m-btn-electric {
  background: rgba(42,92,255,0.14);
  color: #8fa8ff;
  border: 1px solid rgba(42,92,255,0.4);
}
.m-btn-acid-outline {
  background: rgba(197,240,44,0.08);
  color: var(--acid-400);
  border: 1px solid rgba(197,240,44,0.3);
}
.m-btn-danger {
  background: rgba(255,45,111,0.1);
  color: var(--magenta-400);
  border: 1px solid rgba(255,45,111,0.3);
}

/* === Avatars (中性色，不依 battle style) === */
.m-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(197,240,44,0.18), rgba(197,240,44,0.04));
  border: 1px solid rgba(197,240,44,0.35);
  color: var(--acid-400);
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.m-avatar.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 7px; }
.m-avatar.lg { width: 56px; height: 56px; font-size: 22px; border-radius: 14px; }
.m-avatar.xl { width: 76px; height: 76px; font-size: 28px; border-radius: 18px; }

/* === Stats === */
.m-stat {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.m-stat-xl { font-size: 48px; }
.m-stat-lg { font-size: 34px; }
.m-stat-md { font-size: 22px; }
.m-stat-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* === Progress === */
.m-progress-track {
  height: 6px;
  background: var(--bg-inset);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.m-progress-fill {
  height: 100%;
  background: var(--acid-500);
  border-radius: 100px;
  box-shadow: 0 0 10px var(--acid-glow);
  transition: width 0.6s ease;
}
.m-progress-fill.electric { background: var(--electric-500); box-shadow: 0 0 10px var(--electric-glow); }
.m-progress-fill.gold     { background: var(--gold-500);     box-shadow: 0 0 10px var(--gold-glow); }
.m-progress-fill.magenta  { background: var(--magenta-500);  box-shadow: 0 0 10px var(--magenta-glow); }

/* === VS row === */
.m-vs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.m-vs {
  font-family: "Space Grotesk", sans-serif;
  font-style: italic;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.m-vs.lg { font-size: 26px; }
.m-vs.md { font-size: 18px; }
.m-vs.sm { font-size: 13px; }

/* === Player side block === */
.m-player-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  min-width: 0;
}
.m-player-side.winner {
  background: rgba(197,240,44,0.08);
  border-color: rgba(197,240,44,0.4);
}
.m-player-side.right {
  flex-direction: row-reverse;
  text-align: right;
}
.m-player-side .meta { flex: 1; min-width: 0; }
.m-player-side .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-player-side.winner .name { color: var(--acid-400); }
.m-player-side .sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* === Speed lines & halftone === */
.m-speed-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: repeating-linear-gradient(115deg,
    transparent 0,
    transparent 24px,
    rgba(197,240,44,0.06) 24px,
    rgba(197,240,44,0.06) 25px,
    transparent 25px,
    transparent 60px);
}
.m-halftone {
  position: absolute;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0);
  background-size: 6px 6px;
  opacity: 0.22;
}

/* === Notification banner === */
.m-notif {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 11px;
  position: relative;
}
.m-notif .notif-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--acid-500); color: #0a0a08;
  display: grid; place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}

/* === Utility === */
.m-row { display: flex; align-items: center; gap: 10px; }
.m-col { display: flex; flex-direction: column; gap: 10px; }
.m-spacer { flex: 1; }
.m-divider { height: 1px; background: var(--border-subtle); }
.m-vdiv { width: 1px; background: var(--border-subtle); align-self: stretch; }
.m-mono { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.m-head-font { font-family: "Space Grotesk", sans-serif; }

/* === Pulse for live dots === */
@keyframes m-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.m-pulse { animation: m-pulse 1.4s infinite; }

/* === Section === */
.m-section {
  margin-bottom: 18px;
}
.m-section-head {
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.m-section-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.m-section-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-family: "JetBrains Mono", monospace;
}

/* === iOS safe area === */
@supports (padding: max(0px)) {
  .m-safe-bottom { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}
