:root {
  --bg: #111418;
  --panel: #171b21;
  --panel-2: #1e232b;
  --line: #2a3039;
  --text: #e7eaee;
  --muted: #8d96a3;
  --faint: #5d6672;
  --accent: #94d42a;
  --accent-ink: #13200a;
  --accent-soft: rgba(148, 212, 42, 0.14);
  --danger: #ff6b5e;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: 0.3em; font-size: 12px; }
.brand img { width: 28px; height: 28px; }
#who { position: relative; }
.who-menu {
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 230px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.who-name { font-weight: 600; }
.who-email { color: var(--muted); font-size: 13px; margin-bottom: 8px; word-break: break-all; }
.who-menu .link { display: block; padding: 8px 0; }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; }
.card.narrow { max-width: 420px; margin: 24px auto; }
.center { text-align: center; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.page-title { margin: 4px 0 14px; }
.section-title { margin: 26px 0 10px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

form { display: grid; gap: 12px; margin-top: 14px; }
input:not([type=checkbox]) {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 16px; /* 16px stops phones zooming in */
}
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: inherit;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input.code { font-size: 28px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.label { color: var(--muted); font-size: 13px; margin-bottom: -6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
button.primary, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.55; }
.link { border: 0; background: none; color: var(--accent); padding: 6px 0; cursor: pointer; font-size: 14px; text-align: left; }
.link:disabled { color: var(--faint); cursor: default; }
.row-links { display: flex; justify-content: space-between; margin-top: 10px; gap: 12px; flex-wrap: wrap; }
.note { margin: 0; min-height: 0; font-size: 14px; color: var(--muted); }
.note:empty { display: none; }
.note.error { color: var(--danger); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.avatar.small { width: 32px; height: 32px; font-size: 12px; cursor: default; }

.list { display: grid; gap: 8px; }
.team-row, .member {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.team-row:active { background: var(--panel-2); }
.team-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; flex: none; }
.team-name, .member-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); flex: none; }
.role.owner { color: var(--accent); border-color: rgba(148, 212, 42, 0.45); }
.role.coach { color: #7cc4ff; border-color: rgba(124, 196, 255, 0.4); }

.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 8px; padding: 6px 0; }
.team-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.team-head h1 { margin: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tab.soon { opacity: 0.6; }
.soon-card { margin-bottom: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.join-card { text-align: center; }
.join-card p { margin: 8px 0; }
.team-badge.big { width: 64px; height: 64px; border-radius: 16px; font-size: 20px; margin: 0 auto 12px; }
.small { font-size: 13px; }
button.wide { width: 100%; margin-top: 12px; }
.join-card .link { margin: 8px auto 0; display: block; text-align: center; }

/* ---- team tabs, lists, video and play pages ---------------------------------------------- */
.faint { color: var(--faint); }
.tab { text-decoration: none; }
.tab.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.tab-body { margin-top: 4px; }
.search { margin-bottom: 12px; }
.empty { text-align: center; padding: 36px 16px; border: 1px dashed var(--line); border-radius: 14px; }
.empty h2 { margin-bottom: 4px; }
.video-list, .play-list { display: grid; gap: 10px; }
.video-card, .play-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.video-card:active, .play-card:active { background: var(--panel-2); }
.thumb { position: relative; flex: none; width: 132px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #0a0c0f; }
.thumb.play { background: #12301c; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 5px; bottom: 5px; padding: 1px 6px; border-radius: 5px; background: rgba(8, 10, 13, 0.8); font-size: 12px; font-variant-numeric: tabular-nums; }
.video-info { min-width: 0; flex: 1; }
.video-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 14px; }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.video-player { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; display: block; }
.video-heading { margin: 14px 0 4px; font-size: 20px; }
.notes { line-height: 1.55; white-space: pre-wrap; }
.play-stage { position: relative; width: 100%; max-height: 72vh; margin: 12px auto 0; border-radius: 10px; overflow: hidden; background: #12301c; touch-action: pan-y; }
.play-canvas { width: 100%; height: 100%; display: block; }
.play-controls { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.ctl { min-width: 48px; height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 22px; cursor: pointer; }
.ctl.play { min-width: 110px; font-size: 16px; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ctl:disabled { opacity: 0.4; }
.step-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.step-chip { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); font-weight: 600; }
.step-chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step-name { margin-top: 14px; font-weight: 700; font-size: 17px; text-align: center; }
.play-page .notes { text-align: center; margin: 6px 0 0; }
.play-page .video-card { margin-top: 8px; }
@media (min-width: 700px) {
  .video-list, .play-list { grid-template-columns: 1fr 1fr; }
}

.expand {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.65);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.play-full { position: fixed; inset: 0; z-index: 20; background: #050607; }
.play-box { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.play-box .play-stage { margin: 0; max-height: none; border-radius: 0; }
.play-box .expand { display: none; }
.play-bar { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.play-bar .play-controls { margin: 0; }
.play-bar .step-name { margin: 0; font-size: 15px; }
.ctl.close { font-size: 16px; }
body.no-scroll { overflow: hidden; }

/* ---- account and legal pages ------------------------------------------------------------- */
.agree { margin: 14px 0 0; }
.agree a, .legal a, .account-page a:not(.button):not(.back) { color: var(--accent); }
.account-page .card { margin-bottom: 12px; }
.acct-email { font-weight: 600; margin-bottom: 4px; word-break: break-all; }
a.button.secondary, button.button.secondary {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; margin-top: 4px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer;
}
.danger-zone { border-color: rgba(255, 107, 94, 0.35); }
.danger-button { height: 46px; border: 1px solid var(--danger); border-radius: 10px; background: none; color: var(--danger); font-weight: 700; cursor: pointer; }
.danger-button:disabled { opacity: 0.5; }
.legal { max-width: 700px; line-height: 1.6; }
.legal h2 { margin-top: 24px; }
.legal li { margin: 6px 0; }
.draft { padding: 10px 14px; border-radius: 10px; background: rgba(255, 176, 32, 0.12); border: 1px solid rgba(255, 176, 32, 0.4); color: #ffcf7a; font-size: 14px; }
.placeholder { color: #ffcf7a; }

/* ---- desktop app download ---------------------------------------------------------------- */
.app-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.app-card[hidden] { display: none; }
.app-card-text { flex: 1 1 240px; }
.app-card h2 { margin: 0 0 4px; }
.app-card p { margin: 2px 0; }
.app-card .button { flex: none; }
.app-help { flex-basis: 100%; }
.app-help summary { cursor: pointer; }
.narrow:not(.card) { max-width: 420px; margin: 0 auto; }

/* ---- who it's for, request access, admin ----------------------------------------------- */
.who-for { display: grid; gap: 12px; margin: 0 auto 24px; }
.who-card h2 { margin: 0 0 4px; font-size: 18px; }
.who-card p { margin: 0 0 12px; }
.who-card p:last-child { margin-bottom: 0; }
.link-button { background: none; border: 0; padding: 8px 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.link-button:disabled { opacity: 0.5; }
.own-team { margin-top: 22px; }
.own-team a { color: var(--accent); }
.admin-page .card { margin-bottom: 10px; }
.admin-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; }
.admin-main { flex: 1 1 220px; min-width: 0; word-break: break-word; }
.admin-title { font-weight: 700; }
.admin-message { margin: 8px 0 0; white-space: pre-wrap; color: var(--text); font-size: 14px; }
.admin-actions { display: flex; align-items: center; gap: 14px; }
button.primary.small-button { height: 40px; padding: 0 16px; }
.admin-list { padding: 6px 20px; }
.admin-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-line:last-child { border-bottom: 0; }
