: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 */
}
input: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; }
.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; }
