:root {
  --bg: #050506;
  --panel: #0e0e11;
  --line: #232228;
  --text: #f5f5f7;
  --muted: #8b8a93;
  --blue: #2f6bff;
  --red: #ef3b52;
  --orange: #f5a623;
  --green: #1fdf85;
  --cyan: #22d3ee;
  --pink: #ff4fa0;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: 'Rubik', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.phone {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 32px;
}

/* ---------- generic bits ---------- */

.eyebrow {
  color: var(--green);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

h1.title {
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.1;
}

h1.title .accent-blue { color: var(--blue); }
h1.title .accent-red { color: var(--red); }
h1.title .accent-orange { color: var(--orange); }
h1.title .accent-green { color: var(--green); }
h1.title .accent-cyan { color: var(--cyan); }
h1.title .accent-pink { color: var(--pink); }

.subtitle {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 22px;
}

.spacer { flex: 1; }

.btn {
  border: none;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary { background: var(--green); color: #06210f; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text);
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #06210f;
  font-size: 20px;
  flex-shrink: 0;
}
.fab:active { transform: scale(0.94); }

.row { display: flex; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }

.text-input {
  flex: 1;
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
}
.text-input::placeholder { color: #55545c; }
.text-input:focus { border-color: #45444c; }

/* ---------- progress dots (onboarding) ---------- */

.dots { display: flex; gap: 6px; align-items: center; margin-top: 24px; }
.dot { height: 6px; width: 22px; border-radius: 3px; background: var(--line); }
.dot.active { background: var(--green); width: 34px; }

/* ---------- team select tiles ---------- */

.team-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }

.team-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.team-tile.selected { background: rgba(255,255,255,0.03); }
.team-tile .jersey {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.team-tile .name { flex: 1; font-weight: 700; font-size: 17px; }
.team-tile .check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: transparent;
}
.team-tile.selected .check { color: #fff; }

/* ---------- roster / player chips ---------- */

.section-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 20px 0 10px;
}

.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip .x { opacity: 0.7; font-size: 12px; margin-left: 2px; }
.chip.is-captain { box-shadow: 0 0 0 2px #ffd23f inset; }
.captain-badge { margin-right: 6px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* ---------- scroll area ---------- */

.scroll { overflow-y: auto; flex: 1; padding-bottom: 8px; }
.scroll::-webkit-scrollbar { display: none; }

/* ---------- time picker ---------- */

.time-picker {
  margin: 30px auto 0;
  width: 240px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  padding: 26px 20px;
  text-align: center;
}
.time-picker .row-pick { display: flex; align-items: center; justify-content: center; gap: 18px; }
.time-picker .arrow {
  background: none; border: none; color: var(--muted);
  font-size: 26px; cursor: pointer; width: 34px; height: 34px;
}
.time-picker .arrow:active { color: var(--green); }
.time-picker .value { font-size: 46px; font-weight: 900; color: var(--green); min-width: 70px; }
.time-picker .unit { color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; margin-top: 8px; }
.time-picker .ghost { color: #3c3b41; font-size: 22px; font-weight: 700; }

.range-pill {
  margin: 18px auto 0;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- in-game scoreboard ---------- */

.clock { font-size: 56px; font-weight: 900; letter-spacing: -1px; margin-top: 6px; }
.clock-label { color: var(--muted); font-weight: 700; font-size: 12.5px; letter-spacing: 0.05em; margin-top: -6px; }

.scoreboard {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 22px 0 30px;
}
.team-pill {
  padding: 8px 14px; border-radius: 10px; font-weight: 900; font-size: 13px;
}
.team-pill.blue { background: rgba(47,107,255,0.15); color: var(--blue); }
.team-pill.red { background: rgba(239,59,82,0.15); color: var(--red); }
.score { font-size: 34px; font-weight: 900; }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: auto;
}
.action-card {
  border-radius: 18px;
  padding: 22px 18px;
  cursor: pointer;
  border: none;
  text-align: left;
  color: #06210f;
}
.action-card .label { font-size: 20px; font-weight: 900; display: block; }
.action-card .sub { font-size: 12px; font-weight: 700; opacity: 0.75; display: block; margin-top: 2px; }
.action-card.goal { background: var(--green); }
.action-card.steal { background: var(--orange); }
.action-card.save { background: var(--cyan); }
.action-card.foul { background: var(--pink); color: #2b0016; }

.live-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.live-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background: var(--green); margin-right:6px; }

.end-link { text-align: center; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }

/* ---------- activity feed (editable events) ---------- */

.activity { margin-top: 18px; }
.activity-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.activity-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 13.5px;
}
.activity-row:active { transform: scale(0.99); }
.activity-icon {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.activity-text { flex: 1; }
.activity-text .muted { color: var(--muted); }
.activity-time { color: var(--muted); font-weight: 700; font-size: 12px; }
.activity-edit { color: var(--muted); font-size: 13px; }

/* ---------- edit event screen ---------- */

.field-label { color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; margin: 18px 0 8px; }
.minute-stepper { display: flex; align-items: center; gap: 14px; }
.minute-stepper .arrow {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--panel); border: 1.5px solid var(--line);
  color: var(--text); font-size: 20px; cursor: pointer;
}
.minute-stepper .minute-value { font-size: 22px; font-weight: 900; min-width: 70px; text-align: center; }
.danger-link { text-align: center; margin-top: 18px; color: var(--red); font-size: 13px; font-weight: 700; cursor: pointer; }

/* ---------- team tabs (event flows) ---------- */

.team-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.team-tab {
  padding: 8px 14px; border-radius: 8px; font-weight: 900; font-size: 12.5px;
  border: none; cursor: pointer; opacity: 0.45;
  background: var(--team-bg, var(--panel)); color: var(--team-color, var(--muted));
}
.team-tab.active { opacity: 1; }

.player-list { display: flex; flex-direction: column; gap: 10px; }
.player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-weight: 700; font-size: 15px;
}
.player-row .dot-team { width: 8px; height: 8px; border-radius: 50%; background: var(--team-color, var(--muted)); }
.player-row.selected { background: var(--team-color, var(--panel)); color: #06210f; }
.player-row .tag {
  margin-left: auto;
  font-size: 10.5px; font-weight: 900;
  background: rgba(255,255,255,0.15);
  padding: 3px 8px; border-radius: 6px;
}
.player-row.disabled { opacity: 0.35; pointer-events: none; }

.no-assist-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid var(--green);
  background: transparent;
  color: var(--green);
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 16px;
}
.no-assist-btn.chosen { background: var(--green); color: #06210f; }

.skip-row { display: flex; gap: 10px; margin-top: 14px; }

.top-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.back-btn {
  background: var(--panel); border: 1.5px solid var(--line); color: var(--text);
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer; font-size: 16px;
}

.empty-state { color: var(--muted); text-align: center; margin-top: 60px; font-size: 14.5px; }

.match-card {
  border: 1.5px solid var(--line); background: var(--panel);
  border-radius: 16px; padding: 16px; margin-bottom: 12px; cursor: pointer;
}
.match-card .row-between { margin-bottom: 6px; }
.match-card .meta { color: var(--muted); font-size: 12.5px; }

.status-pill {
  font-size: 11px; font-weight: 900; padding: 4px 9px; border-radius: 8px;
}
.status-pill.live { background: rgba(31,223,133,0.15); color: var(--green); }
.status-pill.done { background: rgba(255,255,255,0.08); color: var(--muted); }


/* ---------- player tracker ---------- */
.player-tracker {
  margin-top: 18px;
  padding: 16px 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.tracker-heading { margin-bottom: 12px; }
.tracker-heading .section-label { margin: 0; font-weight: 900; }
.tracker-subtitle { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; margin-top: 3px; }
.tracker-count {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(31,223,133,.12); color: var(--green); font-size: 11px; font-weight: 900;
}
.stats-table { overflow: hidden; border-radius: 12px; border: 1px solid var(--line); }
.stats-row {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 27px);
  align-items: center; gap: 4px; min-height: 42px; padding: 0 8px;
  border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; text-align: center;
}
.stats-row:last-child { border-bottom: 0; }
.stats-header { min-height: 30px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.stats-player { display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-player b { color: var(--muted); width: 15px; flex: 0 0 15px; font-size: 10px; }
.stats-row .wins { color: var(--green); font-weight: 900; }
.stats-legend { display: flex; flex-wrap: wrap; gap: 7px 11px; margin: 10px 2px 0; color: var(--muted); font-size: 9px; font-weight: 700; }
.tracker-empty { padding: 18px 4px 8px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.4; }
