:root {
  --bg: #1a2218;
  --bg2: #141a14;
  --card: #243022;
  --accent: #c41e3a;
  --accent2: #2d5a27;
  --text: #e8ebe6;
  --muted: #9aa89a;
  --ok: #5cb85c;
  --warn: #f0ad4e;
  --border: rgba(255, 255, 255, 0.08);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

h1, h2, h3, .brand {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  font-weight: 400;
}

a { color: #8ec98e; }

.app-shell { display: flex; min-height: 100svh; min-height: 100dvh; }

.app-shell.guest .sidebar,
.app-shell.guest .topbar { display: none; }

.app-shell.guest .main { margin-left: 0; }

.app-shell.guest .content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  min-height: 100dvh;
  max-width: none;
  padding: 1.5rem;
}

.app-shell.guest .login-wrap {
  margin: 0;
  width: 100%;
  max-width: 420px;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.2s;
  -webkit-overflow-scrolling: touch;
}

.sidebar.open { transform: translateX(0); }

.main {
  flex: 1;
  margin-left: 0;
  min-width: 0;
}

@media (min-width: 900px) {
  .sidebar { transform: none; }
  .main { margin-left: var(--sidebar-w); }
  .menu-btn { display: none !important; }
}

@media (min-width: 768px) and (max-width: 899px) {
  .content { max-width: 100%; }
  .page-title { font-size: 1.75rem; }
}

.brand {
  padding: 0 1rem 1rem;
  font-size: 1.5rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  -webkit-tap-highlight-color: transparent;
}

.nav a:hover, .nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav a.active { border-left: 3px solid var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  background: rgba(20, 26, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar #top-user {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.content {
  padding: 1rem 1rem calc(3rem + env(safe-area-inset-bottom, 0px));
  max-width: 1100px;
}

.page-title { font-size: 2rem; margin: 0 0 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.grid2 { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid3 { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }

.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-card .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
}

.stat-card .lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.75rem 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input, select, textarea, button {
  font: inherit;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1f1a;
  font-size: 16px; /* sprečava iOS zoom */
}

textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.btn.ok { background: var(--accent2); }

.btn.sm {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.table-scroll table { min-width: 0; width: 100%; }
.table-scroll table.table--wide { min-width: 560px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }

tr.clickable { cursor: pointer; }
tr.clickable:hover { background: rgba(255, 255, 255, 0.03); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.live { background: rgba(196, 30, 58, 0.25); color: #ff8a8a; }
.badge.draft { background: rgba(154, 168, 154, 0.2); color: var(--muted); }
.badge.finished { background: rgba(45, 90, 39, 0.35); color: #8ec98e; }
.badge.paused { background: rgba(240, 173, 78, 0.2); color: var(--warn); }
.badge.suspended { background: rgba(196, 30, 58, 0.25); color: #ff8a8a; }

.membership-alert-panel {
  border-color: rgba(240, 173, 78, 0.35);
}

.membership-warn {
  border-color: rgba(196, 30, 58, 0.4);
  box-shadow: 0 0 0 1px rgba(196, 30, 58, 0.15);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.msg {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.msg.ok { background: rgba(92, 184, 92, 0.15); color: var(--ok); }
.msg.err { background: rgba(196, 30, 58, 0.2); color: #ff8a8a; }

.hidden { display: none !important; }

.muted { color: var(--muted); font-size: 0.9rem; }

.login-wrap {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.login-wrap h1 { font-size: 2.5rem; text-align: center; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

.overlay.show { display: block; }

@media (min-width: 900px) { .overlay { display: none !important; } }

.scoreboard-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.scoreboard-player.dead { opacity: 0.55; }

.attendance-table th,
.attendance-table td {
  text-align: center;
  white-space: nowrap;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
}

.att-cell {
  min-width: 2.2rem;
  font-weight: 700;
  color: var(--ok);
}

.att-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.att-month-nav strong {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  font-size: 1.35rem;
}

.att-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.att-calendar__dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0.25rem 0;
}

.att-cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 48px;
  padding: 0.35rem 0.2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.att-cal-day--empty {
  border: none;
  background: transparent;
  pointer-events: none;
  min-height: 48px;
}

.att-cal-day__num {
  font-weight: 700;
  font-size: 0.95rem;
}

.att-cal-day__count {
  font-size: 0.65rem;
  color: var(--ok);
  font-weight: 700;
}

.att-cal-day.has-training {
  border-color: rgba(92, 184, 92, 0.45);
  background: rgba(92, 184, 92, 0.12);
}

.att-cal-day.today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.att-cal-day.selected {
  border-color: var(--accent);
  background: rgba(196, 30, 58, 0.2);
}

.att-cal-day:active {
  transform: scale(0.97);
}

.att-check-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.att-soldier-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.att-soldier-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.att-soldier-check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.att-soldier-check:has(input:checked) {
  border-color: rgba(92, 184, 92, 0.5);
  background: rgba(92, 184, 92, 0.1);
}

.live-panel { border: 2px solid var(--accent); }

.pill-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pill {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.profile-photo-card { text-align: center; }
.profile-photo-wrap { display: flex; justify-content: center; margin-bottom: 0.75rem; }
.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  background: #111;
}
.profile-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: #fff;
}

.club-logo-card { max-width: 360px; }
.club-logo-wrap { display: flex; justify-content: flex-start; margin-bottom: 0.75rem; }
.club-logo-preview {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px;
  border: 1px solid var(--border);
}
.club-logo-preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* --- Trening / meč (mobile-first) --- */
.training-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.training-step {
  flex: 1;
  text-align: center;
  padding: 0.65rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}

.training-step.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.training-step.done {
  color: var(--ok);
  border-bottom-color: var(--ok);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.cat-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.cat-pick:active { transform: scale(0.98); }

.cat-pick.selected {
  border-color: var(--accent);
  background: rgba(196, 30, 58, 0.12);
}

.cat-pick__name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: #fff;
}

.cat-pick__desc {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.2;
}

.team-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .team-split { grid-template-columns: 1fr 1fr; }
}

.team-col {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 2px solid var(--border);
  min-height: 120px;
  overflow: hidden;
}

.team-col--alpha { border-top: 3px solid #c41e3a; }
.team-col--bravo { border-top: 3px solid #2d5a27; }

.team-col__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.65rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.2);
}

.team-col__count {
  font-family: Inter, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.team-col__list {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 60px;
}

.team-col__empty {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0.5rem;
}

.soldier-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.soldier-chip:active { background: rgba(255, 255, 255, 0.1); }

.soldier-chip--pool { opacity: 0.85; }

.soldier-chip__hint {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.soldier-chip--alpha { border-left: 3px solid #c41e3a; }
.soldier-chip--bravo { border-left: 3px solid #2d5a27; }

.pool-section { margin-bottom: 1rem; }

.pool-section__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.pool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pool-grid .soldier-chip {
  width: auto;
  flex: 1 1 calc(50% - 0.4rem);
  min-width: 140px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.match-card {
  display: block;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.match-card:active { border-color: var(--accent); }

.match-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.match-card__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.match-card__meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.match-card.live { border-color: rgba(196, 30, 58, 0.5); }

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 1rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
  margin-top: 1rem;
  background: linear-gradient(transparent, var(--bg) 30%);
  z-index: 20;
}

.sticky-actions .btn { width: 100%; }

.btn-row-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-row-mobile .btn { width: 100%; }

.live-tap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.live-tap-btn {
  min-height: 48px;
  padding: 0.85rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.live-tap-btn:active {
  background: rgba(196, 30, 58, 0.2);
  border-color: var(--accent);
}

.team-roster-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 1rem 0;
}

.team-roster-preview .team-col__list { min-height: 40px; }

.fab-training {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

/* ---- SOLDIER LOADOUT ---- */

.loadout-card h3 { margin-bottom: 0.75rem; }
.loadout-subtitle {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.loadout-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 1rem 0;
}
.loadout-hint { margin-bottom: 0.75rem; font-size: 0.85rem; }

.loadout-rep-list { display: flex; flex-direction: column; gap: 0.5rem; }
.loadout-rep {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
.loadout-rep__meta { margin-top: 0.15rem; font-size: 0.78rem; }

.eq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.eq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.eq-item__body { min-width: 0; flex: 1; }
.eq-item__slot {
  display: inline-block;
  margin-bottom: 0.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(196, 30, 58, 0.18);
  color: #ff8a8a;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eq-item__name {
  display: block;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.25;
}
.eq-item__id {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  word-break: break-word;
}
.eq-item__del { flex-shrink: 0; min-width: 40px; }

.loadout-slots {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.loadout-slots::-webkit-scrollbar { display: none; }
.loadout-slot-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.loadout-slot-tab.active {
  border-color: rgba(196, 30, 58, 0.55);
  background: rgba(196, 30, 58, 0.18);
  color: #fff;
}
.loadout-slot-tab__count {
  opacity: 0.75;
  font-size: 0.68rem;
}

.loadout-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 0.15rem;
}
@media (max-width: 380px) {
  .loadout-parts { grid-template-columns: 1fr; }
}
.loadout-part {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.loadout-part:active,
.loadout-part:focus-visible {
  border-color: rgba(196, 30, 58, 0.45);
  background: rgba(196, 30, 58, 0.12);
}
.loadout-part__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
}
.loadout-part__id {
  font-size: 0.68rem;
  color: var(--muted);
  word-break: break-word;
}

.loadout-presets {
  margin-top: 0.85rem;
  padding-left: 1rem;
  color: var(--text);
}
.loadout-presets li { margin-bottom: 0.35rem; font-size: 0.88rem; }

@media (min-width: 768px) {
  .loadout-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- SOLDIER MATCH INVITE + LIVE MODE ---- */

.match-invite-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.match-invite {
  width: 100%;
  max-width: 380px;
  padding: 1.5rem 1.25rem;
  border: 1px solid rgba(196, 30, 58, 0.45);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(26, 34, 24, 0.98), rgba(10, 10, 10, 0.98));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.match-invite__icon {
  font-size: 2.5rem;
  margin-bottom: 0.35rem;
}

.match-invite__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.match-invite__title {
  margin: 0 0 0.35rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1;
}

.match-invite__team {
  margin: 0.75rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--team-color, #c41e3a) 55%, transparent);
  background: color-mix(in srgb, var(--team-color, #c41e3a) 16%, transparent);
}

.match-invite__hint {
  margin: 0.85rem 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.match-invite__accept {
  width: 100%;
  min-height: 52px;
  font-size: 0.95rem;
}

.app-shell--live .sidebar { display: none; }
.app-shell--live .main { margin-left: 0; }
.app-shell--live .menu-btn { display: none; }
.app-shell--live .topbar { display: none; }
.app-shell--live .bottom-nav { display: none !important; }
.app-shell--live .content > p.muted:first-child {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -0.25rem 0 0.75rem;
  padding: 0.65rem 0;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.app-shell--live .content {
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
}

.live-hud { max-width: 480px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
.live-hud__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.live-hud__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(196, 30, 58, 0.22);
  border: 1px solid rgba(196, 30, 58, 0.55);
  color: #ff8a8a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.live-hud__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.live-hud__cat { margin-bottom: 1rem; }
.live-hud__team {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border-left: 4px solid var(--team-color, #c41e3a);
  background: rgba(0, 0, 0, 0.28);
}
.live-hud__team-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-hud__team strong { font-size: 1.15rem; color: #fff; }

.live-hud__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.live-stat {
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.live-stat__num {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent);
}
.live-stat__lbl {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-lobby { text-align: center; margin-bottom: 1rem; }
.live-lobby__dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.live-lobby__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: liveDot 1.2s ease-in-out infinite;
}
.live-lobby__dots span:nth-child(2) { animation-delay: 0.15s; }
.live-lobby__dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes liveDot {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.live-done { text-align: center; }

/* ---- PWA INSTALL MODAL ---- */

body.pwa-install-open { overflow: hidden; }

.pwa-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pwa-install {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 1.35rem 1.25rem 1.25rem;
  border: 1px solid rgba(196, 30, 58, 0.35);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(26, 34, 24, 0.98), rgba(10, 10, 10, 0.98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.pwa-install__close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-install__icon {
  font-size: 2.2rem;
  margin-bottom: 0.35rem;
}

.pwa-install__title {
  margin: 0 0 0.5rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  color: #fff;
}

.pwa-install__text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.pwa-install__ios-steps {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.pwa-install__ios-steps li + li { margin-top: 0.35rem; }

.pwa-install__ios-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}

.pwa-install__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pwa-install__actions .btn { width: 100%; }

.pwa-install__solo { margin-top: 0; }

/* ---- TEAM VOICE (LiveKit PTT) ---- */

body.voice-ptt-active .content {
  padding-bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
}

.voice-ptt-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(10, 12, 10, 0.92) 24%, rgba(8, 10, 8, 0.98));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

.voice-ptt-bar:not(.hidden) { pointer-events: auto; }

.voice-ptt-bar__inner {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  gap: 0.45rem;
}

.voice-ptt-bar__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.voice-ptt-bar__status--ok { color: var(--ok); }
.voice-ptt-bar__status--err { color: #ff8a8a; }

.voice-ptt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 56px;
  border: 2px solid rgba(196, 30, 58, 0.55);
  border-radius: 14px;
  background: rgba(196, 30, 58, 0.18);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

.voice-ptt-btn.is-active {
  background: rgba(196, 30, 58, 0.55);
  border-color: #ff8a8a;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.25);
}

.voice-ptt-bar--rx .voice-ptt-btn {
  box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.4);
  border-color: rgba(92, 184, 92, 0.55);
}

.voice-ptt-bar--rx .voice-ptt-bar__status {
  color: var(--ok);
}

.voice-ptt-btn__icon { font-size: 1.25rem; }
.voice-ptt-btn__label { font-size: 0.82rem; }

.voice-ptt-hint {
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
}

.voice-team-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.voice-team-pick .btn { flex: 1; min-width: 120px; }

.voice-admin-card { margin-bottom: 1rem; }

.voice-audio-root {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ========== Mobile UI polish ========== */

.bottom-nav {
  display: none;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.list-row:active { background: rgba(255, 255, 255, 0.05); }

.list-row__main {
  flex: 1;
  min-width: 0;
}

.list-row__title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.list-row__aside {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.list-row__chevron {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.dash-stats .stat-card {
  padding: 0.9rem 0.65rem;
  margin-bottom: 0;
}

.dash-stats .stat-card .num { font-size: 1.85rem; }

.quick-actions .btn {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 140px;
}

.club-logo-card details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--muted);
  padding: 0.25rem 0;
}

.club-logo-card details summary::-webkit-details-marker { display: none; }

body.voice-ptt-active .sticky-actions {
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 899px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.15rem;
    min-height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: rgba(14, 18, 14, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 48px;
    padding: 0.35rem 0.2rem;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav a .bottom-nav__icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  .bottom-nav a.active {
    color: #fff;
    background: rgba(196, 30, 58, 0.18);
  }

  .app-shell:not(.guest):not(.app-shell--live) .content {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  .app-shell.guest .bottom-nav,
  .app-shell.guest ~ .bottom-nav,
  body.guest .bottom-nav { display: none !important; }

  .topbar #btn-logout {
    min-height: 44px;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .page-title { font-size: 1.65rem; margin-bottom: 0.85rem; }

  .card { padding: 0.9rem; border-radius: 14px; }

  .stat-card .num { font-size: 2rem; }

  .grid3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .quick-actions .btn {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .btn-row .btn { flex: 1 1 auto; }

  tr.clickable:active { background: rgba(255, 255, 255, 0.05); }

  .desktop-only { display: none !important; }

  .mobile-only { display: block !important; }

  .list-stack.mobile-only { display: flex !important; }

  .table-scroll--mobile-cards > table,
  .table-scroll--mobile-cards table.desktop-only { display: none !important; }

  .table-scroll--mobile-cards .list-stack { display: flex; }
}

@media (min-width: 900px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: revert !important; }
  table.desktop-only { display: table !important; }
  .table-scroll--mobile-cards .list-stack { display: none !important; }
  .table-scroll--mobile-cards table { display: table; }
}

@media (max-width: 480px) {
  .content {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .page-title { font-size: 1.5rem; }

  .login-wrap {
    margin: 1.5rem auto;
    padding: 0 0.25rem;
  }

  .login-wrap h1 { font-size: 2.1rem; }

  .dash-hero p.muted {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  .live-hud__title { font-size: 1.85rem; }

  .live-stat__num { font-size: 1.55rem; }

  .team-roster-preview {
    grid-template-columns: 1fr;
  }

  .voice-team-pick {
    flex-direction: column;
  }

  .voice-team-pick .btn {
    width: 100%;
    min-width: 0;
  }

  th, td {
    padding: 0.7rem 0.45rem;
    font-size: 0.85rem;
  }
}

@media (min-width: 481px) and (max-width: 699px) {
  .grid3 { grid-template-columns: repeat(2, 1fr); }
}
