.score-pill span:last-child,
.go-stat span:last-child,
#hud-score,
#hud-accuracy,
#hud-highscore,
#hud-timer,
#dash-highscore {
  font-family: 'JetBrains Mono', monospace;
}

.mode-card h4,
.stat-card p.text-3xl,
h3.font-display,
.font-display {
  letter-spacing: -0.02em;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #8b95a8;
  text-align: left;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-btn:hover {
  color: #e8edf5;
  background: rgba(18, 23, 31, 0.8);
}

.nav-btn.active {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.08);
}

.stat-card,
.panel {
  background: #12171f;
  border: 1px solid #1e2633;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.stat-card {
  background: linear-gradient(145deg, #12171f 0%, #0d1017 100%);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.feed-item {
  display: flex;
  gap: 0.875rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #1e2633;
}

.feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feed-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  margin-top: 0.4rem;
  flex-shrink: 0;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: #0d1017;
  border: 1px solid #1e2633;
  color: #e8edf5;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.quick-action:hover {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.05);
}

.score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.5rem;
  padding: 0.5rem 0.85rem;
  background: #12171f;
  border: 1px solid #1e2633;
  border-radius: 0.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #07080c;
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.25);
  transition: all 0.15s ease;
}

.btn-sm:hover {
  background: rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

.btn-sm.joined {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.25);
  pointer-events: none;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #8b95a8;
  background: #12171f;
  border: 1px solid #1e2633;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: #e8edf5;
}

.filter-btn.active {
  color: #07080c;
  background: #22d3ee;
  border-color: #22d3ee;
}

.league-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.league-badge.nesf {
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
}

.league-badge.komplett {
  background: rgba(167, 139, 250, 0.12);
  color: #a78bfa;
}

.app-card {
  background: linear-gradient(145deg, #12171f 0%, #0d1017 100%);
  border: 1px solid #1e2633;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.app-card:hover {
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.08);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.live {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.status-badge.beta {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.status-badge.planned {
  background: rgba(139, 149, 168, 0.12);
  color: #8b95a8;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #8b95a8;
  background: #12171f;
  border: 1px solid #1e2633;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  color: #e8edf5;
  border-color: rgba(52, 211, 153, 0.35);
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 1.35rem;
  border-radius: 0.85rem;
  background: linear-gradient(160deg, #0f172a 0%, #0a1220 55%, #071018 100%);
  border: 1px solid rgba(51, 65, 85, 0.7);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(52, 211, 153, 0.08), transparent 55%);
  pointer-events: none;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 28px rgba(52, 211, 153, 0.1);
}

.mode-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #34d399;
  margin-bottom: 1rem;
}

.mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.mode-hs {
  font-size: 0.7rem;
  color: #64748b;
}

.mode-hs strong {
  color: #94a3b8;
  font-weight: 600;
}

.go-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.85rem 0.5rem;
  background: #0d1017;
  border: 1px solid #1e2633;
  border-radius: 0.65rem;
}

.prompt-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ecfdf5;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
}

#game-canvas:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.team-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(145deg, #12171f 0%, #0d1017 100%);
  border: 1px solid #1e2633;
  border-radius: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.team-search:focus-within {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.08), 0 0 24px rgba(52, 211, 153, 0.08);
}

.team-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #e8edf5;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
}

.team-search-input::placeholder {
  color: #64748b;
}

.team-result {
  border: 1px solid #1e2633;
  border-radius: 0.65rem;
  background: #0d1017;
  overflow: hidden;
  transition: border-color 0.15s;
}

.team-result:hover,
.team-result.open {
  border-color: rgba(52, 211, 153, 0.35);
}

.team-result-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  color: inherit;
  transition: background 0.15s;
}

.team-result-header:hover {
  background: rgba(52, 211, 153, 0.04);
}

.team-result-body {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid #1e2633;
}

.team-result.open .team-result-body {
  display: block;
}

.team-result.open .team-chevron {
  transform: rotate(180deg);
}

.team-chevron {
  transition: transform 0.2s ease;
  color: #8b95a8;
}

.match-timeline {
  position: relative;
  margin-top: 0.85rem;
  padding-left: 1.1rem;
}

.match-timeline::before {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.5), rgba(34, 211, 238, 0.15));
  border-radius: 9999px;
}

.match-item {
  position: relative;
  padding: 0.65rem 0.75rem 0.65rem 0.5rem;
  margin-bottom: 0.35rem;
}

.match-item::before {
  content: '';
  position: absolute;
  left: -0.95rem;
  top: 1rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
  border: 2px solid #0d1017;
}

.match-item:last-child {
  margin-bottom: 0;
}

.club-card {
  border: 1px solid #1e2633;
  border-radius: 0.85rem;
  background: linear-gradient(160deg, #0f172a 0%, #0a1220 55%, #071018 100%);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.06);
}

.club-card-header {
  text-align: center;
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid #1e2633;
  background: radial-gradient(ellipse at top, rgba(52, 211, 153, 0.08), transparent 65%);
}

.club-card-header h5 {
  font-family: Syne, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0;
}

.dept-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  padding: 1rem;
}

@media (min-width: 768px) {
  .dept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dept-panel {
  border: 1px solid #1e2633;
  border-radius: 0.65rem;
  background: #0d1017;
  overflow: hidden;
}

.dept-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #1e2633;
  background: rgba(18, 23, 31, 0.7);
}

.standings-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.standings-mini th {
  text-align: left;
  padding: 0.45rem 0.65rem;
  color: #8b95a8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  border-bottom: 1px solid #1e2633;
}

.standings-mini th.num,
.standings-mini td.num {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.standings-mini td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(30, 38, 51, 0.7);
}

.standings-mini tr.highlight {
  background: rgba(52, 211, 153, 0.08);
}

.standings-mini tr.highlight td:first-child {
  color: #34d399;
  font-weight: 600;
}

.club-matches {
  padding: 0 1rem 1.1rem;
  border-top: 1px solid #1e2633;
}

.club-matches h6 {
  margin: 1rem 0 0.65rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b95a8;
  font-weight: 700;
}

.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.15rem 0.35rem;
  border-radius: 0.3rem;
  border: 1px solid #1e2633;
  background: #12171f;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
}

.snake-dpad {
  display: grid;
  grid-template-columns: repeat(3, 3.25rem);
  grid-template-rows: repeat(3, 3.25rem);
  gap: 0.35rem;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.dpad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: #0f172a;
  color: #34d399;
  font-size: 0.9rem;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.dpad-btn:active,
.dpad-btn:focus-visible {
  background: rgba(52, 211, 153, 0.15);
  outline: 2px solid rgba(52, 211, 153, 0.45);
  outline-offset: 1px;
}

.dpad-up {
  grid-column: 2;
  grid-row: 1;
}

.dpad-left {
  grid-column: 1;
  grid-row: 2;
}

.dpad-down {
  grid-column: 2;
  grid-row: 2;
}

.dpad-right {
  grid-column: 3;
  grid-row: 2;
}

#snake-pause-overlay.flex {
  display: flex;
}

#snake-controls .btn-sm:focus-visible,
#snake-controls .btn-ghost:focus-visible {
  outline: 2px solid rgba(52, 211, 153, 0.5);
  outline-offset: 2px;
}

#tournament-tbody tr {
  border-bottom: 1px solid #1e2633;
  transition: background 0.15s;
}

#tournament-tbody tr:last-child {
  border-bottom: none;
}

#tournament-tbody tr:hover {
  background: rgba(34, 211, 238, 0.03);
}

#toast.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ——— Nav groups (Sikkerhet) ——— */
.nav-group {
  margin-top: 0.35rem;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #8b95a8;
  text-align: left;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-group-toggle:hover {
  color: #e8edf5;
  background: rgba(18, 23, 31, 0.8);
}

.nav-group-chevron {
  transition: transform 0.2s ease;
}

.nav-group.collapsed .nav-group-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  padding: 0.15rem 0 0.35rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-btn.nav-sub {
  padding-left: 1.1rem;
  font-size: 0.8125rem;
}

/* ——— Mobile Security Center ——— */
.msc-platform-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #8b95a8;
  background: #12171f;
  border: 1px solid #1e2633;
  transition: all 0.15s ease;
}

.msc-platform-btn:hover {
  color: #e8edf5;
  border-color: rgba(34, 211, 238, 0.3);
}

.msc-platform-btn.active {
  color: #07080c;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.25);
}

.msc-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #8b95a8;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.msc-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #e8edf5;
  background: #0d1017;
  border: 1px solid #1e2633;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.msc-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.msc-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.msc-help {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #8b95a8;
  line-height: 1.4;
}

.msc-skeleton {
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #12171f 25%, #1a2230 50%, #12171f 75%);
  background-size: 200% 100%;
  animation: msc-shimmer 1.2s ease-in-out infinite;
}

@keyframes msc-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.src-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid #1e2633;
}

.src-chip.src-ok {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
}

.src-chip.src-warn {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
}

.src-chip.src-muted {
  color: #8b95a8;
  background: rgba(139, 149, 168, 0.08);
}

.msc-status-hero {
  background: linear-gradient(145deg, #12171f 0%, #0d1017 100%);
  border: 1px solid #1e2633;
  border-radius: 0.75rem;
  padding: 1.35rem 1.5rem;
  border-left-width: 4px;
}

.msc-status-hero.risk-critical { border-left-color: #f43f5e; }
.msc-status-hero.risk-high { border-left-color: #fb923c; }
.msc-status-hero.risk-medium { border-left-color: #fbbf24; }
.msc-status-hero.risk-low { border-left-color: #34d399; }
.msc-status-hero.risk-unknown { border-left-color: #64748b; }

.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.risk-badge.risk-critical {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.risk-badge.risk-high {
  color: #fed7aa;
  background: rgba(251, 146, 60, 0.2);
  border: 1px solid rgba(251, 146, 60, 0.4);
}

.risk-badge.risk-medium {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.risk-badge.risk-low {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.risk-badge.risk-unknown {
  color: #cbd5e1;
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.msc-risk-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

.msc-risk-seg {
  height: 0.65rem;
  border-radius: 9999px;
  opacity: 0.28;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
}

.msc-risk-seg.active {
  opacity: 1;
  transform: scaleY(1.35);
  box-shadow: 0 0 12px currentColor;
}

.msc-risk-seg.risk-critical { background: #f43f5e; color: #f43f5e; }
.msc-risk-seg.risk-high { background: #fb923c; color: #fb923c; }
.msc-risk-seg.risk-medium { background: #fbbf24; color: #fbbf24; }
.msc-risk-seg.risk-low { background: #34d399; color: #34d399; }
.msc-risk-seg.risk-unknown { background: #64748b; color: #64748b; }

.msc-rec {
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: #0d1017;
  border: 1px solid #1e2633;
  border-left-width: 3px;
}

.msc-rec.priority-critical { border-left-color: #f43f5e; }
.msc-rec.priority-high { border-left-color: #fb923c; }
.msc-rec.priority-medium { border-left-color: #fbbf24; }
.msc-rec.priority-low { border-left-color: #34d399; }

.sev-badge {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sev-badge.sev-critical {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.2);
}

.sev-badge.sev-high {
  color: #fed7aa;
  background: rgba(251, 146, 60, 0.2);
}

.sev-badge.sev-medium {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.18);
}

.sev-badge.sev-low {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.15);
}

.sev-badge.sev-unknown {
  color: #94a3b8;
  background: rgba(100, 116, 139, 0.2);
}

.cve-row {
  border-bottom: 1px solid #1e2633;
  cursor: pointer;
  transition: background 0.12s;
}

.cve-row:hover,
.cve-row:focus-visible {
  background: rgba(34, 211, 238, 0.05);
  outline: none;
}

.cve-row:last-child {
  border-bottom: none;
}

#msc-cve-modal:not(.hidden) {
  display: flex;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #8b95a8;
  background: transparent;
  border: 1px solid #1e2633;
  transition: all 0.15s ease;
}

.btn-ghost:hover:not(:disabled) {
  color: #e8edf5;
  border-color: rgba(34, 211, 238, 0.3);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .msc-risk-track {
    gap: 0.25rem;
  }

  .msc-status-hero {
    padding: 1.1rem;
  }
}

/* ——— Mobile shell / PWA ——— */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-h: 4rem;
  --mobile-header-h: 3.25rem;
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: calc(var(--mobile-header-h) + var(--safe-top));
  padding: var(--safe-top) 0.875rem 0.55rem;
  background: rgba(13, 16, 23, 0.92);
  border-bottom: 1px solid #1e2633;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 30;
  flex-shrink: 0;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  min-height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding: 0.25rem 0.15rem var(--safe-bottom);
  background: rgba(13, 16, 23, 0.96);
  border-top: 1px solid #1e2633;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.2rem;
  font-size: 0.62rem;
  font-weight: 500;
  color: #8b95a8;
  border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
}

.bottom-nav-btn.active {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
}

.bottom-nav-btn:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.45);
  outline-offset: 1px;
}

/* !important beats Tailwind CDN utilities injected after our stylesheet */
.content-pad-bottom {
  padding-bottom: calc(1rem + var(--bottom-nav-h) + var(--safe-bottom)) !important;
}

@media (min-width: 768px) {
  .content-pad-bottom {
    padding-bottom: 2rem !important;
  }
}

.game-canvas {
  height: min(62vh, 440px);
  max-height: 560px;
  touch-action: none;
  -webkit-touch-callout: none;
}

@media (min-width: 640px) {
  .game-canvas {
    height: 500px;
  }
}

@media (max-width: 430px) {
  .game-canvas {
    height: min(52vh, 360px);
  }

  .snake-dpad {
    grid-template-columns: repeat(3, 3.5rem);
    grid-template-rows: repeat(3, 3.5rem);
  }

  .dpad-btn {
    font-size: 1rem;
  }
}

body.game-playing {
  overscroll-behavior: none;
  touch-action: none;
}

body.game-playing .main-scroll {
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.game-playing .game-canvas {
  touch-action: none;
}

.offline-banner,
.sw-update-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: calc(100% - 1.5rem);
  max-width: 28rem;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid #1e2633;
  background: #12171f;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
}

.offline-banner {
  top: calc(0.75rem + var(--safe-top));
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(18, 23, 31, 0.96);
}

.sw-update-banner {
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 0.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #e8edf5;
  border-color: rgba(34, 211, 238, 0.35);
}

@media (min-width: 768px) {
  .sw-update-banner {
    bottom: 1.25rem;
  }
}

.more-sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.more-sheet.hidden {
  display: none;
}

.more-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.more-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32rem;
  max-height: min(78vh, 36rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem calc(1rem + var(--safe-bottom));
  border-radius: 1rem 1rem 0 0;
  background: #12171f;
  border: 1px solid #1e2633;
  border-bottom: none;
  animation: sheet-up 0.22s ease-out;
}

.more-sheet-handle {
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 9999px;
  background: #1e2633;
  margin: 0.15rem auto 0.85rem;
}

.more-sheet-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.more-sheet-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.85rem;
  border-radius: 0.5rem;
  text-align: left;
  color: #e8edf5;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.more-sheet-item:hover,
.more-sheet-item:focus-visible {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.2);
  outline: none;
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .more-sheet-panel,
  .msc-skeleton,
  .bottom-nav-btn,
  .nav-btn {
    animation: none !important;
    transition: none !important;
  }
}

/* Forms: avoid iOS zoom */
input.msc-input,
select.msc-input,
textarea.msc-input,
.team-search-input,
input[type='search'],
input[type='text'],
input[type='date'] {
  font-size: 16px;
}

@media (min-width: 768px) {
  input.msc-input,
  select.msc-input,
  .team-search-input {
    font-size: 0.875rem;
  }
}

.quick-action {
  min-height: 48px;
}

.stat-card p.text-3xl {
  font-size: clamp(1.35rem, 4vw, 1.875rem);
}

@media (max-width: 374px) {
  .bottom-nav-btn span {
    font-size: 0.55rem;
  }

  .mobile-header {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

/* Landscape phones: keep bottom nav, shrink canvas */
@media (max-height: 480px) and (orientation: landscape) {
  .game-canvas {
    height: min(58vh, 280px);
  }

  .bottom-nav {
    min-height: calc(3.25rem + var(--safe-bottom));
  }

  .bottom-nav-btn {
    min-height: 40px;
    gap: 0;
  }

  .bottom-nav-btn span {
    display: none;
  }
}

html.is-offline #conn-status {
  color: #fbbf24;
}

/* Trainer (Gridshot / Reflex) */
.trainer-sparkline {
  display: block;
  margin-top: 0.35rem;
  background: rgba(13, 16, 23, 0.8);
  border: 1px solid #1e2633;
  border-radius: 0.5rem;
}

#trainer-countdown.flex {
  display: flex;
}

#trainer-setup .msc-label {
  margin-bottom: 0.3rem;
}

#go-trainer-extra .go-stat {
  min-height: 3.25rem;
}

/* Auth / sync */
#sync-status-chip[data-tone='busy'] span:first-child {
  background: #fbbf24;
  animation: pulse 1.2s ease infinite;
}

#sync-status-chip[data-tone='err'] span:first-child {
  background: #f87171;
}

#sync-status-chip[data-tone='ok'] span:first-child {
  background: #34d399;
}

#user-menu .more-sheet-item {
  width: 100%;
}

#onboarding-modal .msc-input,
#import-modal .msc-input,
#delete-account-modal .msc-input,
#profile-root .msc-input {
  width: 100%;
}

/* Official NitroCloud logo (from brand/) */
.brand-logo {
  display: block;
  object-fit: contain;
  object-position: left center;
}
