/* ==========================================================
   Design tokens — single source of truth for colors / radii
   Zen of Python: "There should be one obvious way to do it."
   ========================================================== */
:root {
  --pitch-deep:   #0e3b1f;
  --pitch:        #14532d;
  --pitch-soft:   #2f8a4d;
  --chalk:        #f6f8f4;
  --kit-accent:   #ff6b35;   /* boot/kit accent */
  --ink:          #14181a;
  --muted:        #6c7570;
  --card:         #ffffff;
  --line:         #e3e8e1;
  --shadow:       0 8px 24px rgba(14, 59, 31, 0.12);
  --radius:       14px;
  --radius-sm:    8px;
  --max-w:        920px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--chalk);
  line-height: 1.55;
}

a { color: var(--pitch); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative;
  min-height: 380px;
  padding: 3rem 1.25rem 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 20%, rgba(255,255,255,0.12), transparent 55%),
    linear-gradient(135deg, var(--pitch-deep) 0%, var(--pitch) 55%, var(--pitch-soft) 100%);
}

/* Faint pitch stripes overlay — purely decorative */
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 0 60px,
    transparent             60px 120px
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.player-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  background: #d8d8d8;
  border: 4px solid var(--kit-accent);
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}

.hero .tagline {
  font-size: 1.05rem;
  opacity: 0.92;
  margin: 0 0 1.25rem;
}

.badge-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}


/* ---------------------------- Layout ---------------------------- */
main {
  max-width: var(--max-w);
  margin: -2.5rem auto 3rem;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ----------------------------- Tabs ----------------------------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.tab {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 0.65rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover { color: var(--ink); background: var(--chalk); }

.tab.active {
  background: var(--pitch);
  color: #fff;
}

.tab:focus-visible {
  outline: 2px solid var(--kit-accent);
  outline-offset: 2px;
}

.panel { display: none; }
.panel.active { display: block; animation: fade 0.2s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: var(--pitch-deep);
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.4rem;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

p { margin: 0 0 0.9rem; }

.muted { color: var(--muted); font-size: 0.9rem; }

/* ----------------------- Reusable: Stat grid ----------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.stat {
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  text-align: center;
}

.stat .num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pitch);
  line-height: 1.1;
}

.stat .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* -------------------------- Reusable: Table -------------------------- */
.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

table.data th {
  background: var(--chalk);
  font-weight: 600;
  color: var(--pitch-deep);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}

table.data tbody tr:hover { background: #fafaf6; }

.num-cell { text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------- Profile list (Personal Bio) -----------------------
   Ported from lukethomasselzer.com's .profile-list. Two-column key/value
   info card that collapses to 1 column on phones. The leading pitch-soft
   border on each item is the visual signature — feels structured, not
   like a generic table. */
.profile-list {
  list-style: none;
  padding: 0; margin: 0 0 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1.2rem;
}
@media (max-width: 540px) {
  .profile-list { grid-template-columns: 1fr; }
}
/* Lonely-last-child fix: when there's an odd number of items, the trailing
   one would sit alone in row N with an empty cell beside it — looks ragged.
   Letting it span both columns turns that gap into intentional emphasis.
   (No-op for even counts. Skipped on mobile where the grid is 1-col.) */
@media (min-width: 541px) {
  .profile-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.profile-list li {
  padding: 0.7rem 0.9rem;
  background: var(--chalk);
  border-left: 3px solid var(--pitch-soft);
  border-radius: 6px;
  font-size: 0.95rem;
}
.profile-list .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.15rem;
  font-weight: 700;
}
.profile-list .value {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

/* ----------------------- About photo ----------------------- */
/* Larger display photo inside the About panel. Shares its src
   with .player-photo so a single file update refreshes both. */
.about-photo {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 0 1.4rem;
  background: #f0eee6;
}
@media (max-width: 540px) {
  .about-photo { max-height: 320px; }
}

/* ----------------------------- Video ----------------------------- */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.video-wrap iframe,
.video-wrap video,
.video-wrap .placeholder {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-wrap video { object-fit: contain; background: #000; }

.video-wrap .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 50%, var(--pitch-soft), var(--pitch-deep));
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ----------------------------- Footer ----------------------------- */
footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ==========================================================
   Owner Gate / Visitor mode
   Visitors are the default (untrusted). When auth succeeds we
   add `.is-owner` to <body>, which reveals `.owner-only` elements
   and hides `.visitor-only` ones. Single CSS toggle, zero JS gymnastics.
   ⚠️ This is UX-level gating only — the password hash lives in this
   file, so a determined dev-tools snooper can bypass it. Don't put
   anything actually secret behind it; it's an editing convenience.
   ========================================================== */
.owner-only          { display: none !important; }
body.is-owner .owner-only   { display: revert !important; }
body.is-owner .visitor-only { display: none !important; }

/* Full-screen modal that asks Visitor vs Owner on first visit. */
.gate-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: rgba(14, 59, 31, 0.78);
  backdrop-filter: blur(6px);
  padding: 1.5rem;
}
.gate-overlay[hidden] { display: none; }
.gate-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  padding: 2rem 1.8rem;
  max-width: 440px; width: 100%;
  text-align: center;
}
.gate-card h2 {
  margin: 0.2rem 0 0.4rem;
  color: var(--pitch-deep);
  font-size: 1.5rem;
}
.gate-card > div > p { margin: 0 0 1.3rem; color: var(--muted); font-size: 0.95rem; }
.gate-roles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
}
.gate-role-btn {
  padding: 1rem 0.8rem;
  border: 2px solid rgba(14, 59, 31, 0.2);
  background: var(--chalk);
  border-radius: 10px;
  font-family: inherit; font-weight: 700; font-size: 1rem;
  color: var(--ink); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.gate-role-btn:hover {
  border-color: var(--pitch-deep);
  background: #fff;
  transform: translateY(-2px);
}
.gate-role-emoji { font-size: 1.7rem; }
.gate-role-btn small {
  color: var(--muted); font-weight: 400; font-size: 0.78rem;
}
.gate-pw-form {
  display: flex; flex-direction: column; gap: 0.55rem;
  margin-top: 1rem; text-align: left;
}
.gate-pw-form label {
  font-size: 0.85rem; font-weight: 600; color: var(--pitch-deep);
}
.gate-pw-form input {
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(14, 59, 31, 0.25);
  border-radius: 8px;
  font-family: inherit; font-size: 1rem;
}
.gate-pw-form input:focus {
  outline: none;
  border-color: var(--pitch-deep);
  box-shadow: 0 0 0 3px rgba(14, 59, 31, 0.12);
}
.gate-pw-form .gate-actions {
  display: flex; gap: 0.5rem; justify-content: space-between;
  margin-top: 0.3rem;
}
.gate-pw-form button {
  padding: 0.65rem 1.2rem;
  font-family: inherit; font-weight: 700; font-size: 0.95rem;
  border-radius: 8px; cursor: pointer; border: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.gate-pw-form button[type="submit"] { background: var(--pitch-deep); color: #fff; }
.gate-pw-form button[type="submit"]:hover { background: var(--pitch); transform: translateY(-1px); }
.gate-back-btn {
  background: transparent; color: var(--muted);
  border: 1px solid rgba(0,0,0,0.1) !important;
}
.gate-back-btn:hover { background: rgba(0,0,0,0.04); }
.gate-error {
  color: #b03030; font-size: 0.85rem; font-weight: 600;
  min-height: 1.2em; margin: 0;
}
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.gate-card.is-shaking { animation: gate-shake 0.3s ease; }

/* Floating mode pill — anchored to top-right of the hero (which is
   already position: relative). Scrolls with the header and a subtle
   white outline keeps it readable against the green gradient. */
.mode-pill {
  position: absolute; top: 1rem; right: 1rem; z-index: 3;
  background: var(--pitch-deep); color: #fff;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; font-weight: 700;
  transition: background 0.2s ease;
}
.mode-pill[hidden] { display: none; }
.mode-pill.is-visitor { background: var(--muted); }
.mode-pill button {
  background: rgba(255,255,255,0.18); color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.25rem 0.6rem; border-radius: 999px;
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s ease;
}
.mode-pill button:hover { background: rgba(255,255,255,0.32); }

/* ---------- Theme editor (owner-only palette changer) ----------
   Pill that sits below the mode-pill in the hero. Same visual language
   so the two controls read as a stacked group, not competing widgets. */
.theme-pill {
  position: absolute; top: 4rem; right: 1rem; z-index: 3;
  background: var(--pitch-deep); color: #fff;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s ease, transform 0.1s ease;
}
.theme-pill:hover  { background: var(--pitch); transform: translateY(-1px); }
.theme-pill:active { transform: translateY(0); }
.theme-pill[hidden] { display: none; }

/* The modal itself — opens when the owner clicks the 🎨 pill. Native
   <input type="color"> handles the actual color picker per-platform so
   we only style the wrapper UI. */
.theme-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.theme-modal[hidden] { display: none; }
.theme-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 59, 31, 0.55);
  cursor: pointer;
}
.theme-modal-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.theme-modal-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  color: var(--pitch-deep);
}
.theme-modal-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
  line-height: 1.45;
}
.theme-modal-help strong { color: var(--ink); }

.theme-field {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0.6rem 0;
  gap: 1rem;
}
.theme-field > span {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
/* Native color input — strip default chrome so it looks like a clean
   clickable swatch. Cross-browser pseudo-elements normalize the look. */
.theme-field input[type="color"] {
  width: 52px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(14, 59, 31, 0.3);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.theme-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.theme-field input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.theme-field input[type="color"]::-moz-color-swatch { border: none; border-radius: 5px; }

/* Four-square live preview strip: derived-dark / primary / derived-light
   / accent. JS updates these on every color-picker `input` event. */
.theme-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0.9rem 0 0.3rem;
}
.theme-preview-swatch {
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
}
.theme-status {
  font-size: 0.85rem; min-height: 1.2em;
  margin: 0.6rem 0 0; color: var(--muted);
}
.theme-status.is-error   { color: #b03030; font-weight: 600; }
.theme-status.is-success { color: var(--pitch-deep); font-weight: 600; }

.theme-modal-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.2rem;
}
.theme-modal-actions button {
  padding: 0.55rem 1rem;
  font-family: inherit; font-weight: 700; font-size: 0.9rem;
  border-radius: 8px; cursor: pointer; border: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.theme-modal-actions .theme-save  { background: var(--pitch-deep); color: #fff; }
.theme-modal-actions .theme-save:hover  { background: var(--pitch); transform: translateY(-1px); }
.theme-modal-actions .theme-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid rgba(0,0,0,0.12);
}
.theme-modal-actions .theme-ghost:hover { background: rgba(0,0,0,0.04); }

/* Small ghost button used for owner-only "Edit" affordances. */
.edit-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-left: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: var(--chalk); color: var(--pitch-deep);
  border: 1px solid var(--line); border-radius: 999px;
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
  vertical-align: middle;
}
.edit-btn:hover { background: #fff; border-color: var(--pitch-deep); }
.edit-btn.is-editing { background: var(--kit-accent); color: #fff; border-color: var(--kit-accent); }
[contenteditable="true"] {
  outline: 2px dashed var(--kit-accent);
  outline-offset: 4px;
  background: rgba(255, 107, 53, 0.06);
  border-radius: 4px;
}

/* ----------------------------- Mobile tweaks ----------------------------- */
@media (max-width: 540px) {
  .hero { min-height: 320px; padding: 2.5rem 1rem 3.5rem; }
  .player-photo { width: 110px; height: 110px; }
  main { margin-top: -2rem; }
  .card { padding: 1.1rem; }
}

