/* ============================================================
   Green Sox Coaches Hub
   Look: bold, flat, black & white with Dublin green — big condensed
   type, pill buttons, no shadows. Editing works one question at a time.
   TEAM COLORS: change the tokens below to restyle everything.
   ============================================================ */
/* Fonts are self-hosted (Anton + Archivo, SIL Open Font License). */
@font-face { font-family: "Anton"; src: url("assets/fonts/anton-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("assets/fonts/archivo-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("assets/fonts/archivo-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("assets/fonts/archivo-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("assets/fonts/archivo-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("assets/fonts/archivo-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --green: #18462c;        /* Dublin green (from the logos) */
  --green-hi: #22613d;
  --green-wash: #e8f0eb;
  --silver: #a7a9ac;       /* outline grey from the D logo */
  --ink: #000000;
  --paper: #ffffff;
  --mist: #f5f5f5;
  --line: #e5e5e5;
  --steel: #707072;
  --loss: #d30005;
  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --body: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

.display {
  font-family: var(--display); text-transform: uppercase;
  line-height: .9; letter-spacing: .005em; font-weight: 400;
}

/* ---------- Buttons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 14px 26px; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 16px;
  text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { background: #3a3a3a; }
.pill.green { background: var(--green); }
.pill.green:hover { background: var(--green-hi); }
.pill.light { background: var(--paper); color: var(--ink); }
.pill.light:hover { background: #d9d9d9; }
.pill.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.pill.outline:hover { box-shadow: inset 0 0 0 1.5px var(--ink); background: transparent; }
.pill.small { padding: 8px 16px; font-size: 14px; }
.pill:disabled { opacity: .4; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.link-btn.danger { color: var(--loss); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; background: #000; color: #fff;
  display: grid; place-items: center; padding: 32px 16px;
}
.login-inner { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 36px; }
.login img { width: min(240px, 60vw); animation: rise .7s var(--ease) both; }
.login form { width: 100%; display: flex; flex-direction: column; gap: 22px; animation: rise .7s .15s var(--ease) both; }
.login label { font-size: 15px; color: #a3a3a3; }
.login input {
  width: 100%; background: transparent; border: 0; border-bottom: 2px solid #3d3d3d; border-radius: 0;
  padding: 10px 0; color: #fff; font-family: var(--display); font-size: 44px; letter-spacing: .12em; text-transform: uppercase;
}
.login input:focus { outline: none; border-bottom-color: #fff; }
.login .row { display: flex; align-items: center; gap: 16px; }
.login .hint { color: #8a8a8a; font-size: 14px; }
.login .error { color: #ff6b6b; min-height: 1.5em; font-size: 15px; margin-top: -8px; }
.login.shake form { animation: shake .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Top bar ---------- */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; margin-right: auto; }
.brand img { width: 44px; height: 40px; object-fit: contain; }
.brand span { font-family: var(--display); text-transform: uppercase; font-size: 22px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: 22px; font-weight: 500; font-size: 15px; }
.topnav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a.on { border-bottom-color: var(--ink); }
.topbar .pill { margin-left: 8px; }

main { max-width: 1240px; margin: 0 auto; padding: 0 16px 96px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 20px 0 8px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--steel); }
.back:hover { color: var(--ink); }
.page-head { padding: 18px 0 28px; }
.page-head h1 { font-size: clamp(56px, 10vw, 128px); }
.page-head p { color: var(--steel); margin: 14px 0 0; font-size: 17px; max-width: 60ch; }

/* ---------- Hub ---------- */
.hub-hello { padding: 36px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hub-hello h1 { font-size: clamp(60px, 11vw, 150px); }
.hub-hello p { margin: 0 0 8px; color: var(--steel); font-size: 17px; }
.hub-tiles { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: auto auto; gap: 8px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 300px; padding: 28px; text-decoration: none; overflow: hidden;
}
.tile:first-child { grid-row: span 2; min-height: 620px; }
.tile.t-green { background: var(--green); color: #fff; }
.tile.t-black { background: #000; color: #fff; }
.tile.t-mist { background: var(--mist); color: var(--ink); }
.tile h2 { font-family: var(--display); text-transform: uppercase; font-size: clamp(48px, 7vw, 96px); line-height: .88; position: relative; z-index: 1; }
.tile p { margin: 0; max-width: 34ch; opacity: .85; position: relative; z-index: 1; }
.tile .tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.tile .stat { font-family: var(--display); font-size: 22px; letter-spacing: .02em; }
.tile .go { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: currentColor; flex: none; transition: transform .25s var(--ease); }
.tile .go svg { width: 22px; height: 22px; }
.tile.t-green .go svg, .tile.t-black .go svg { color: #000; stroke: #000; }
.tile.t-mist .go svg { stroke: #fff; }
.tile:hover .go { transform: translateX(6px); }

/* ---------- Jersey grid (players) ---------- */
.jerseys { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.jersey {
  background: var(--mist); text-decoration: none; padding: 18px 18px 20px; aspect-ratio: 4 / 5;
  display: flex; flex-direction: column; justify-content: space-between; transition: background .2s, color .2s;
}
.jersey .num { font-family: var(--display); font-size: clamp(96px, 12vw, 140px); line-height: .82; color: var(--green); transition: color .2s; }
.jersey .nm { font-weight: 700; font-size: 18px; line-height: 1.2; }
.jersey .sub { color: var(--steel); font-size: 14px; margin-top: 4px; transition: color .2s; }
.jersey:hover { background: var(--green); color: #fff; }
.jersey:hover .num { color: #fff; }
.jersey:hover .sub { color: rgba(255,255,255,.75); }

/* ---------- Player hero ---------- */
.hero {
  background: var(--green); color: #fff; position: relative; overflow: hidden;
  margin: 0 calc(50% - 50vw); padding: 40px 16px 34px;
}
.hero-inner { max-width: 1240px; margin: 0 auto; position: relative; }
.hero .bignum {
  position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  font-family: var(--display); font-size: clamp(200px, 32vw, 400px); line-height: .8;
  color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.28); pointer-events: none; user-select: none;
}
.hero .jno { font-family: var(--display); font-size: 26px; color: var(--silver); }
.hero h1 { font-family: var(--display); text-transform: uppercase; font-size: clamp(52px, 9vw, 120px); line-height: .88; margin: 6px 0 18px; max-width: 70%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.chip { border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
a.chip:hover { background: #fff; color: var(--ink); }
.hero .actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; }

/* ---------- Development overview ---------- */
.dev-sections { margin-top: 8px; }
.dev-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.dev-row h2 { font-family: var(--display); text-transform: uppercase; font-size: 30px; line-height: 1; }
.dev-row .content { white-space: pre-wrap; font-size: 17px; line-height: 1.6; max-width: 70ch; }
.dev-row .content.empty { color: var(--steel); }
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.goals li { display: grid; grid-template-columns: 40px 1fr; align-items: baseline; font-size: 17px; white-space: pre-wrap; }
.goals li b { font-family: var(--display); font-size: 30px; font-weight: 400; color: var(--green); line-height: 1; }
.goals li.empty span { color: var(--steel); }
.saved-note { color: var(--steel); font-size: 14px; padding: 18px 0 0; }

.drills-wrap { padding: 36px 0 0; }
.drills-wrap h2 { font-family: var(--display); text-transform: uppercase; font-size: clamp(40px, 6vw, 64px); line-height: .9; margin-bottom: 18px; }
.drills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 8px; }
.drill { display: flex; flex-direction: column; gap: 10px; }
.drill .thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.drill .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.drill .thumb:hover img { transform: scale(1.04); }
.drill .thumb .play { position: absolute; left: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.drill .thumb .play::after { content: ""; border-left: 14px solid #000; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.drill .meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.drill .meta b { font-weight: 600; }
.empty-block { background: var(--mist); padding: 28px; color: var(--steel); }

/* ---------- Inline editing (Typeform-easy: click, type, it saves) ---------- */
.ed {
  width: 100%; display: block; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
  font-size: 19px; line-height: 1.55; padding: 4px 0 8px; resize: none; overflow: hidden; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.ed::placeholder { color: #a9a9a9; }
.ed:hover { border-bottom-color: var(--line); }
.ed:focus { outline: none; border-bottom-color: var(--green); }
.goal-ed { display: grid; grid-template-columns: 40px 1fr; align-items: baseline; }
.goal-ed b { font-family: var(--display); font-size: 32px; font-weight: 400; color: var(--green); line-height: 1; }
.goal-ed + .goal-ed { margin-top: 6px; }
.dev-row .hint { color: var(--steel); font-size: 14px; margin-top: 6px; }
.savestate {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 0); z-index: 50;
  background: #000; color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; transition: opacity .25s, transform .25s var(--ease);
}
.savestate.idle { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.savestate.err { background: var(--loss); }
.savestate i { width: 8px; height: 8px; border-radius: 50%; background: #5fd38a; }
.savestate.saving i { background: #f5c451; }
.adder { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: end; background: var(--mist); padding: 20px; margin-bottom: 22px; }
.adder input { width: 100%; border: 0; border-bottom: 2px solid #d4d4d4; background: transparent; font-size: 20px; padding: 8px 0; border-radius: 0; }
.adder input:focus { outline: none; border-bottom-color: var(--green); }
.adder .fields { display: grid; gap: 6px; }
.adder .pv { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; }
.adder .pv img { width: 150px; aspect-ratio: 16/9; object-fit: cover; background: #000; }
.err { color: var(--loss); font-size: 15px; min-height: 1.2em; grid-column: 1 / -1; }
.empty-block { background: var(--mist); padding: 28px; color: var(--steel); }

/* ---------- Stats ---------- */
.scoreboard { background: #000; color: #fff; margin: 0 calc(50% - 50vw); padding: 40px 16px; }
.scoreboard-inner { max-width: 1240px; margin: 0 auto; display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.scoreboard .record { font-family: var(--display); font-size: clamp(110px, 18vw, 220px); line-height: .8; }
.scoreboard .record small { display: block; font-family: var(--body); font-size: 16px; color: #a3a3a3; margin-top: 14px; line-height: 1.4; }
.scoreboard dl { display: grid; grid-template-columns: repeat(4, auto); gap: 8px 36px; margin: 0; }
.scoreboard dt { color: #a3a3a3; font-size: 14px; }
.scoreboard dd { margin: 0; font-family: var(--display); font-size: 44px; line-height: 1; }

.section-h { font-family: var(--display); text-transform: uppercase; font-size: clamp(40px, 6vw, 64px); line-height: .9; margin: 48px 0 18px; }
.section-sub { color: var(--steel); margin: -6px 0 18px; }

.games { border-top: 2px solid var(--ink); }
.game { border-bottom: 1px solid var(--line); }
.game summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 44px 1fr auto 28px;
  gap: 16px; align-items: center; padding: 18px 4px;
}
.game summary::-webkit-details-marker { display: none; }
.game summary:hover { background: var(--mist); }
.res { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.res.W { background: var(--green); color: #fff; }
.res.L { background: var(--paper); color: var(--loss); box-shadow: inset 0 0 0 2px var(--loss); }
.res.T { background: var(--mist); }
.game .opp { font-weight: 700; font-size: 18px; line-height: 1.25; }
.game .when { color: var(--steel); font-size: 14px; }
.game .score { font-family: var(--display); font-size: 44px; line-height: 1; white-space: nowrap; }
.game .chev { transition: transform .25s var(--ease); font-size: 20px; color: var(--steel); }
.game[open] .chev { transform: rotate(180deg); }
.game .box { padding: 6px 4px 30px; display: flex; flex-direction: column; gap: 26px; }
.box-h { font-weight: 700; font-size: 15px; margin: 0 0 8px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: right; white-space: nowrap; }
th { font-weight: 600; font-size: 13px; color: var(--steel); border-bottom: 2px solid var(--ink); background: var(--paper); }
td { border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); padding-left: 0; }
td:first-child { font-weight: 600; }
td:first-child a { text-decoration: none; }
td:first-child a:hover { text-decoration: underline; }
tr.total td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); }
td.pos { text-align: left; color: var(--steel); }

.statband { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.statband div { background: var(--mist); padding: 18px 16px; }
.statband b { display: block; font-family: var(--display); font-size: 48px; line-height: 1; font-weight: 400; color: var(--green); }
.statband span { color: var(--steel); font-size: 14px; }
.foot-note { color: var(--steel); font-size: 14px; margin: 10px 0 0; }

.tabs { display: flex; gap: 8px; margin: 28px 0 8px; flex-wrap: wrap; }
.tabs button { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 600; cursor: pointer; background: var(--mist); }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; }

/* ---------- Scouting ---------- */
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.team {
  background: var(--mist); text-decoration: none; padding: 22px; min-height: 230px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px; transition: background .2s, color .2s;
}
.team .rank { font-family: var(--display); font-size: 92px; line-height: .8; color: transparent; -webkit-text-stroke: 2px var(--green); }
.team .rank.none { -webkit-text-stroke: 0; color: var(--silver); font-size: 40px; }
.team .tn { font-weight: 800; font-size: 22px; line-height: 1.15; }
.team .tm { color: var(--steel); font-size: 15px; margin-top: 4px; }
.team:hover { background: #000; color: #fff; }
.team:hover .rank { -webkit-text-stroke-color: #fff; }
.team:hover .tm { color: #bdbdbd; }
.add-team { display: flex; gap: 10px; margin: 0 0 24px; flex-wrap: wrap; }
.add-team input {
  flex: 1 1 260px; border: 0; border-bottom: 2px solid var(--line); font-size: 20px; padding: 10px 0; background: transparent;
}
.add-team input:focus { outline: none; border-bottom-color: var(--green); }

.reports { border-top: 2px solid var(--ink); }
.report { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.report .ico { width: 44px; height: 54px; background: var(--loss); color: #fff; display: grid; place-items: end center; padding-bottom: 6px; font-size: 11px; font-weight: 800; flex: none; clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%); }
.report .info { flex: 1; min-width: 180px; }
.report .fn { font-weight: 700; word-break: break-word; }
.report .rm { color: var(--steel); font-size: 14px; }
.drop {
  margin-top: 16px; padding: 34px 20px; text-align: center; background: var(--mist);
  border: 2px dashed transparent; transition: border-color .15s, background .15s;
}
.drop.drag { border-color: var(--green); background: var(--green-wash); }
.drop p { margin: 0 0 14px; color: var(--steel); }
.drop .st { margin: 12px 0 0; font-size: 15px; }

.loading { padding: 80px 0; text-align: center; color: var(--steel); }
.notice { background: var(--mist); padding: 18px 20px; margin: 24px 0; }

@media (max-width: 860px) {
  .hub-tiles { grid-template-columns: 1fr; }
  .tile:first-child { grid-row: auto; min-height: 380px; }
  .tile { min-height: 240px; }
  .dev-row { grid-template-columns: 1fr; gap: 12px; padding: 24px 0; }
  .statband { grid-template-columns: repeat(2, 1fr); }
  .scoreboard dl { grid-template-columns: repeat(2, auto); }
  .topnav { display: none; }
  .hero h1 { max-width: 100%; }
}
@media (max-width: 520px) {
  .jerseys { grid-template-columns: repeat(2, 1fr); }
  .jersey .num { font-size: 88px; }
  .game summary { grid-template-columns: 40px 1fr auto; }
  .game .chev { display: none; }
  .game .score { font-size: 34px; }
  .brand span { font-size: 18px; }
  .adder { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Player-page share line (staff development card) ---------- */
.share {
  position: relative; margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: rgba(0,0,0,.22); padding: 12px 12px 12px 18px; border-radius: 999px; max-width: 760px; font-size: 15px;
}
.share span { flex: 1; min-width: 220px; }
@media (max-width: 520px) { .share { border-radius: 16px; } }
.share-opts { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 2px; }
.pill.outline-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }
.pill.outline-light:hover { background: rgba(255,255,255,.12); }
.share:has(.share-opts:not(.hidden)) { border-radius: 24px; }
