/* Skills voting app: the web app's look (dark green, Barlow Condensed titles, green accent) as plain CSS. */

@font-face { font-family: "Barlow"; font-weight: 400 500; font-display: swap; src: url("../fonts/Barlow-Medium.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/Barlow-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../fonts/Barlow-Bold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 400 600; font-display: swap; src: url("../fonts/BarlowCondensed-Medium.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/BarlowCondensed-Bold.ttf") format("truetype"); }

:root {
  --bg: #0E1512;
  --surface: #17201B;
  --raised: #1D2822;
  --raised-2: #243029;
  --border: rgba(233, 242, 236, 0.08);
  --border-strong: rgba(233, 242, 236, 0.16);
  --ink: #E9F2EC;
  --soft: #9DB3A6;
  --muted: #6E8377;
  --accent: #43C878;
  --accent-deep: #1E9E55;
  --accent-dim: rgba(67, 200, 120, 0.14);
  --accent-line: rgba(67, 200, 120, 0.45);
  --on-accent: #06210F;
  --warn: #FAB219;
  --warn-dim: rgba(250, 178, 25, 0.12);
  --danger: #E66767;
  --danger-dim: rgba(230, 103, 103, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg) radial-gradient(900px 380px at 50% -140px, rgba(67, 200, 120, 0.11), transparent 70%) no-repeat;
  color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- layout ------------------------------------------------------------------------ */
.shell { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 var(--gutter) 3.5rem; }
.shell--wide { max-width: 1040px; }
.shell--narrow { max-width: 460px; }
.stack > * + * { margin-top: 0.9rem; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(14, 21, 18, 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 720px; margin: 0 auto; padding: 0.55rem var(--gutter);
  display: flex; align-items: center; gap: 0.75rem; min-height: 3.5rem;
}
.shell--wide .topbar-in, .topbar--wide .topbar-in { max-width: 1040px; }
.topbar .grow { flex: 1; min-width: 0; }
.brand {
  font-family: var(--font-title); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
}
.back {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.7rem 0 0.35rem; margin-left: -0.35rem;
  border-radius: 999px; color: var(--soft); font-weight: 600; font-size: 0.95rem;
}
.back:hover { color: var(--ink); background: rgba(233, 242, 236, 0.06); }
.back svg { width: 20px; height: 20px; }

.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0; }
.title {
  font-family: var(--font-title); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  line-height: 1.02; margin: 0.15rem 0 0; font-size: 2.6rem; overflow-wrap: anywhere;
}
.title--lg { font-size: 3.2rem; }
.title--md { font-size: 2rem; }
.lede { color: var(--soft); margin: 0.5rem 0 0; font-size: 1rem; }
.muted { color: var(--muted); }
.page-head { padding: 1.6rem 0 1.1rem; }

/* ---- surfaces ---------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.15rem; }
.card + .card { margin-top: 0.8rem; }
.card-title { font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.6rem; }
.note {
  display: flex; gap: 0.65rem; align-items: flex-start; color: var(--soft); font-size: 0.92rem;
  background: rgba(233, 242, 236, 0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 0.95rem;
}
.note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--accent); }
.notice { border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; font-size: 0.92rem; margin-top: 0.8rem; border: 1px solid var(--border); }
.notice--warn { color: var(--warn); background: var(--warn-dim); border-color: rgba(250, 178, 25, 0.35); }
.notice--ok { color: var(--accent); background: var(--accent-dim); border-color: var(--accent-line); }
.notice--err { color: var(--danger); background: var(--danger-dim); border-color: rgba(230, 103, 103, 0.4); }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.65rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.6;
  border: 1px solid var(--border); background: var(--raised); color: var(--soft); white-space: nowrap;
}
.pill--ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.pill--warn { color: var(--warn); border-color: rgba(250, 178, 25, 0.4); background: var(--warn-dim); }
.pill svg { width: 12px; height: 12px; }

/* ---- avatar ------------------------------------------------------------------------ */
.avatar {
  --s: 40px; flex: none; position: relative; display: inline-grid; place-items: center; overflow: hidden;
  width: var(--s); height: var(--s); border-radius: 50%; color: #fff; background: #3987E5;
  font-family: var(--font-title); font-weight: 700; font-size: calc(var(--s) * 0.42); letter-spacing: 0.04em; line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tone-0 { background: #D95926; } .tone-1 { background: #2E8B57; } .tone-2 { background: #8E5BD0; }
.tone-3 { background: #3987E5; } .tone-4 { background: #C0455F; } .tone-5 { background: #1E8F8A; }
.avatar-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 50%; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 2px var(--accent-line); }

/* ---- buttons and forms ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0 1.25rem;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--raised); color: var(--ink);
  font-weight: 600; font-size: 1rem; text-align: center; transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--raised-2); border-color: rgba(233, 242, 236, 0.26); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn--primary:hover { background: #55d687; border-color: #55d687; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); border-color: rgba(230, 103, 103, 0.4); background: transparent; }
.btn--danger:hover { background: var(--danger-dim); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 0 0.9rem; font-size: 0.9rem; border-radius: 10px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

.field { display: block; margin-top: 1rem; }
.field > span { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); margin-bottom: 0.4rem; }
.input {
  width: 100%; min-height: 48px; padding: 0 0.9rem; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 12px; color: var(--ink); font-size: 1rem;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input--pin {
  text-align: center; font-family: var(--font-title); font-weight: 700; font-size: 2.4rem; letter-spacing: 0.5em;
  padding: 0; min-height: 68px; border-radius: 16px;
}
/* Letter-spacing also trails the last character, so typed dots get an equal left pad to stay centred.
   Empty, the caret sits at the true centre, so no pad there and the placeholder uses spaces instead. */
.input--pin:not(:placeholder-shown) { padding-left: 0.5em; }
.input--pin::placeholder { color: var(--muted); letter-spacing: 0; word-spacing: 0.05em; opacity: 0.6; }
.form-error { margin: 0.8rem 0 0; color: var(--danger); font-size: 0.92rem; }
.form-hint { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.85rem; }

/* ---- start: voter tiles ------------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; list-style: none; padding: 0; margin: 0.9rem 0 0; }
.find { position: relative; display: block; margin-top: 1rem; }
.find .input { padding-left: 2.6rem; }
.find svg { position: absolute; left: 0.85rem; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--muted); pointer-events: none; }
.find-empty { margin-top: 0.9rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem; text-align: center; min-height: 44px; height: 100%;
  padding: 0.8rem 0.35rem 0.7rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.tile:hover { border-color: var(--accent-line); background: var(--raised); }
.tile:active { transform: scale(0.985); }
.tile .name { font-weight: 600; font-size: 0.88rem; line-height: 1.2; overflow-wrap: anywhere; }
.privacy { margin-top: 1.4rem; }

/* ---- login ------------------------------------------------------------------------- */
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.2rem 0 1.4rem; }
.login-head .avatar { margin-bottom: 1rem; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent-line); }
.login-card { padding: 1.3rem 1.25rem 1.4rem; }
.login-card .btn { margin-top: 1.15rem; }
.help { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 1.2rem 0 0; }

/* ---- progress ---------------------------------------------------------------------- */
.bar { height: 8px; border-radius: 999px; background: var(--raised-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width 0.3s ease; }
.bar--thin { height: 4px; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.7rem; }
.progress-text { font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-num { font-family: var(--font-title); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---- segmented switch (By player / By skill) --------------------------------------- */
.switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; margin-top: 1rem;
}
.switch a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px;
  font-weight: 600; color: var(--soft); transition: background 0.15s, color 0.15s;
}
.switch a:hover { color: var(--ink); }
.switch a.is-on { background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }

.toggle {
  display: flex; align-items: center; gap: 0.7rem; min-height: 44px; margin-top: 0.7rem; padding: 0 0.2rem;
  color: var(--soft); font-size: 0.95rem;
}
.toggle-box {
  position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--raised-2);
  border: 1px solid var(--border-strong); transition: background 0.15s;
}
.toggle-box::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--soft); transition: transform 0.15s, background 0.15s;
}
.toggle.is-on { color: var(--ink); }
.toggle.is-on .toggle-box { background: var(--accent-dim); border-color: var(--accent-line); }
.toggle.is-on .toggle-box::after { transform: translateX(18px); background: var(--accent); }

/* ---- overview lists ---------------------------------------------------------------- */
.list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.row {
  display: flex; align-items: center; gap: 0.85rem; min-height: 64px; padding: 0.6rem 0.9rem 0.6rem 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.15s, background 0.15s;
}
.row:hover { border-color: var(--accent-line); background: var(--raised); }
.row-main { flex: 1; min-width: 0; }
.row-name { display: block; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.row-sub { display: block; color: var(--muted); font-size: 0.84rem; line-height: 1.3; margin-top: 2px; }
.row-meta { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.row .bar { width: 52px; }
.count { color: var(--soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; min-width: 2.2rem; text-align: right; }
.tick {
  display: none; flex: none; width: 22px; height: 22px; border-radius: 50%; place-items: center;
  background: var(--accent); color: var(--on-accent);
}
.tick svg { width: 14px; height: 14px; }
.row.is-complete .tick { display: inline-grid; }
.row.is-complete .count { display: none; }
.row.is-complete { border-color: rgba(67, 200, 120, 0.25); }
.chev { flex: none; width: 18px; height: 18px; color: var(--muted); }

.finish { margin-top: 1.4rem; }
.finish p { margin: 0 0 0.9rem; color: var(--soft); font-size: 0.92rem; }
.finish.is-done { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-dim), var(--surface)); }
.foot { display: flex; justify-content: center; margin-top: 1.6rem; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 0.92rem; min-height: 44px; padding: 0 1rem; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--soft); }

/* ---- save status ------------------------------------------------------------------- */
.status {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 32px; padding: 0 0.8rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--soft); font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status[data-state="saved"] { color: var(--accent); border-color: rgba(67, 200, 120, 0.3); }
.status[data-state="saved"] .dot { background: var(--accent); }
.status[data-state="saving"] .dot { background: var(--warn); animation: pulse 0.9s ease-in-out infinite; }
.status[data-state="offline"] { color: var(--warn); border-color: rgba(250, 178, 25, 0.4); background: var(--warn-dim); }
.status[data-state="offline"] .dot { background: var(--warn); }
.status[data-state="error"] { color: var(--danger); border-color: rgba(230, 103, 103, 0.4); background: var(--danger-dim); }
.status[data-state="error"] .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---- rating controls --------------------------------------------------------------- */
.rate { display: flex; align-items: center; gap: 0.5rem; }
.seg { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 3px; background: var(--bg); border: 1px solid var(--border); border-radius: 13px; }
.seg-btn {
  min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--soft);
  font-family: var(--font-title); font-weight: 700; font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s, transform 0.05s;
}
.seg-btn:hover { background: var(--raised); color: var(--ink); }
.seg-btn:active { transform: scale(0.96); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.dk {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px dashed var(--border-strong); background: transparent;
  color: var(--muted); font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; line-height: 1;
}
.dk:hover { color: var(--ink); border-color: rgba(233, 242, 236, 0.35); }
.dk[aria-pressed="true"] { background: var(--soft); border-style: solid; border-color: var(--soft); color: var(--bg); }
.is-closed .seg-btn, .is-closed .dk { opacity: 0.45; pointer-events: none; }

/* ---- by player --------------------------------------------------------------------- */
.strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.9rem var(--gutter) 0.6rem; margin: 0 calc(var(--gutter) * -1); scrollbar-width: none; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; scroll-snap-align: center; }
.chip .avatar { --s: 40px; opacity: 0.6; transition: opacity 0.15s; }
.chip:hover .avatar { opacity: 1; }
.chip[aria-current="true"] { box-shadow: 0 0 0 2px var(--accent); }
.chip[aria-current="true"] .avatar { opacity: 1; }
.chip .tick { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border: 2px solid var(--bg); }
.chip .tick svg { width: 10px; height: 10px; }
.chip.is-complete .tick { display: inline-grid; }

.pcard-head { display: flex; align-items: center; gap: 1rem; }
.pcard-head .title { font-size: 2.1rem; }
.pcard-head .avatar { --s: 72px; }
.pcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; margin-top: 0.45rem; color: var(--muted); font-size: 0.85rem; }
.legend { margin: 1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.skills { margin-top: 0.5rem; }
.skill { padding: 1rem 0; border-top: 1px solid var(--border); border-radius: 0; }
.skill:first-child { border-top: 0; }
.skill-name { font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.skill-hint { margin: 0.15rem 0 0.7rem; color: var(--muted); font-size: 0.85rem; line-height: 1.35; }
.skill.is-active, .prow.is-active { background: rgba(67, 200, 120, 0.06); box-shadow: 0 0 0 10px rgba(67, 200, 120, 0.06); }
.dk-all { margin-top: 0.4rem; }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 1rem; }
.pager .btn { min-height: 52px; min-width: 0; justify-content: flex-start; padding: 0 0.9rem; gap: 0.5rem; }
.pager .btn--next { justify-content: flex-end; }
.pager .btn span { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; line-height: 1.15; }
.pager .btn--next span { text-align: right; }
.pager .btn small { display: block; color: var(--muted); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.2; }
.pager .btn--primary small { color: rgba(6, 33, 15, 0.7); }
.pager .btn b { display: block; font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kbd-help { display: none; margin-top: 0.9rem; color: var(--muted); font-size: 0.8rem; text-align: center; }
.kbd-help kbd { font-family: var(--font); font-size: 0.75rem; padding: 0.05rem 0.4rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; color: var(--soft); }

/* ---- by skill ---------------------------------------------------------------------- */
.sk-head { padding: 1.3rem 0 0.9rem; }
.sk-head .title { font-size: 2.3rem; }
.sk-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.9rem 0 0.2rem; }
.sort { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0 0.9rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--soft); font-size: 0.88rem; font-weight: 600; }
.sort svg { width: 16px; height: 16px; }
.sort.is-on { color: var(--accent); background: var(--accent-dim); border-color: var(--accent-line); }
.prow { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 0.8rem; align-items: center; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.prow:first-child { border-top: 0; }
.prow .who { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.prow .who .avatar { --s: 40px; }
.prow .who b { font-weight: 600; overflow-wrap: anywhere; }
.prow .rate { grid-column: 1 / -1; }

/* ---- profile ----------------------------------------------------------------------- */
.me-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.4rem 0 1.2rem; }
.me-hero .avatar { --s: 132px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent-line); margin-bottom: 1.1rem; }
.upload-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-input:focus-visible + label.btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-hint { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.85rem; }
.preview-name { color: var(--soft); font-size: 0.88rem; margin-top: 0.7rem; }

/* ---- admin ------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.9rem; }
.stat .label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--font-title); font-weight: 700; font-size: 1.9rem; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.card--flush { padding: 0; overflow: hidden; }
.vlist details + details { border-top: 1px solid var(--border); }
.vsum {
  display: grid; align-items: center; gap: 0.55rem 0.8rem; padding: 0.85rem 1rem; min-height: 64px; cursor: pointer; list-style: none;
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who chev" "prog prog" "flags when";
  transition: background 0.15s;
}
.vsum::-webkit-details-marker { display: none; }
.vsum::marker { content: ""; }
.vsum:hover { background: rgba(233, 242, 236, 0.03); }
.vsum:focus-visible { outline-offset: -3px; }
.vsum .who { grid-area: who; display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.vsum .who b { font-weight: 600; overflow-wrap: anywhere; }
.vsum .prog { grid-area: prog; display: flex; align-items: center; gap: 0.7rem; color: var(--soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.vsum .prog .bar { flex: 1; max-width: 220px; }
.vsum .prog > span:last-child { white-space: nowrap; }
.vsum .flags { grid-area: flags; display: flex; gap: 0.4rem; flex-wrap: wrap; min-height: 1px; }
.vsum .when { grid-area: when; justify-self: end; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.vchev { grid-area: chev; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); transition: transform 0.18s, color 0.15s; }
.vchev svg { width: 16px; height: 16px; }
.vpanel[open] > .vsum { background: rgba(233, 242, 236, 0.025); }
.vpanel[open] .vchev { transform: rotate(90deg); color: var(--accent); }
.vbody { padding: 0.2rem 1rem 1.1rem; background: rgba(0, 0, 0, 0.14); border-top: 1px solid var(--border); }
.vstats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0; margin: 0.95rem 0 0.7rem; color: var(--soft); font-size: 0.88rem; }
.vstats b { color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 0.3rem; }
.vstats .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); margin: 0 0.7rem; }
.tscroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); -webkit-overflow-scrolling: touch; }
.ballot { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.ballot th, .ballot td { padding: 0; height: 40px; min-width: 2.7rem; text-align: center; border-bottom: 1px solid var(--border); }
.ballot thead th { height: 36px; background: var(--surface); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ballot abbr { text-decoration: none; cursor: help; }
.ballot tbody tr:last-child > * { border-bottom: 0; }
.ballot tbody tr:hover > td { background-image: linear-gradient(rgba(233, 242, 236, 0.04), rgba(233, 242, 236, 0.04)); }
.ballot .pcol {
  position: sticky; left: 0; z-index: 1; min-width: 6.6rem; max-width: 9rem; padding: 0 0.8rem; text-align: left; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; background: var(--bg); box-shadow: 1px 0 0 var(--border); font-size: 0.9rem; font-weight: 600; color: var(--ink);
}
.ballot thead .pcol { background: var(--surface); font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.ballot td { font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; line-height: 1; }
.v-1 { color: #F08A8A; background: rgba(230, 103, 103, 0.12); }
.v-2 { color: #EBAA6B; background: rgba(235, 170, 107, 0.10); }
.v-3 { color: var(--ink); }
.v-4 { color: #9BDDB2; background: rgba(67, 200, 120, 0.08); }
.v-5 { color: var(--accent); background: rgba(67, 200, 120, 0.17); }
.v-dk { color: var(--muted); font-weight: 600; }
.v-none::after { content: "\00b7"; color: var(--border-strong); font-weight: 400; }
.vlegend { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; margin: 0.75rem 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.vlegend b { color: var(--soft); font-weight: 700; margin-right: 0.2rem; }
.vactions { display: flex; justify-content: flex-end; margin-top: 0.9rem; }
.card-lede { margin: 0 0 0.2rem; color: var(--soft); font-size: 0.92rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.input--file { padding: 0.65rem 0.8rem; min-height: 48px; font-size: 0.92rem; color: var(--soft); }
.input--file::file-selector-button {
  margin-right: 0.8rem; padding: 0.4rem 0.85rem; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--raised);
  color: var(--ink); font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.input--file::file-selector-button:hover { background: var(--raised-2); }
.lock-badge { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1rem; border-radius: 50%; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-line); }
.lock-badge svg { width: 26px; height: 26px; }
.admin-grid > .card { margin-top: 0; }
.admin-grid { display: grid; gap: 0.8rem; margin-top: 0.8rem; align-items: start; }
.radios { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.radios input { position: absolute; opacity: 0; pointer-events: none; }
.radios label { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; font-weight: 600; color: var(--soft); cursor: pointer; }
.radios input:checked + label { background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.radios input:focus-visible + label { outline: 2px solid var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.inline-form .field { margin-top: 0; flex: 1; min-width: 150px; }

/* ---- responsive -------------------------------------------------------------------- */
@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
  .tile .name { font-size: 0.95rem; }
  .title { font-size: 3.1rem; }
  .title--lg { font-size: 4rem; }
  .page-head { padding-top: 2.6rem; }
  .prow { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
  .prow .rate { grid-column: auto; }
  .stat .value { font-size: 2.3rem; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vsum { grid-template-columns: minmax(170px, 1.1fr) minmax(170px, 1.2fr) minmax(130px, auto) 120px 28px; grid-template-areas: "who prog flags when chev"; padding: 0.8rem 1.2rem; }
  .vsum .flags { justify-content: flex-end; }
  .vbody { padding: 0.2rem 1.2rem 1.2rem; }
  .ballot th, .ballot td { min-width: 3.2rem; }
  .skill { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); column-gap: 1.2rem; align-items: center; }
  .skill .skill-name, .skill .skill-hint { grid-column: 1; }
  .skill .skill-hint { margin-bottom: 0; }
  .skill .rate { grid-column: 2; grid-row: 1 / span 2; }
}
@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr 1fr; }
}
@media (hover: hover) and (pointer: fine) { .kbd-help { display: block; } }
/* ---- photo lightbox ---------------------------------------------------------------- */
.avatar img[data-zoom] { cursor: zoom-in; }
.avatar img[data-zoom]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; cursor: zoom-out;
  background: rgba(6, 10, 8, 0.88); opacity: 0; transition: opacity 0.15s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox-fig { margin: 0; display: grid; justify-items: center; gap: 0.9rem; transform: scale(0.94); transition: transform 0.15s ease; }
.lightbox.is-open .lightbox-fig { transform: none; }
.lightbox-img {
  width: min(90vw, 90vh, 640px); height: min(90vw, 90vh, 640px); object-fit: cover; border-radius: 18px;
  background: var(--raised); box-shadow: 0 0 0 1px var(--border-strong), 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-name { font-family: var(--font-title); font-weight: 700; font-size: 1.7rem; letter-spacing: 0.04em; color: var(--ink); text-align: center; }
.lightbox-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--raised); color: var(--ink);
}
.lightbox-close svg { width: 22px; height: 22px; }
.lightbox-close:hover { background: var(--raised-2); }
.lightbox-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* The brand title is a link home: same look, no underline. */
a.brand { text-decoration: none; }
a.brand-link { color: inherit; text-decoration: none; }
a.brand:hover, a.brand-link:hover { opacity: 0.85; }
a.brand:focus-visible, a.brand-link:focus-visible { outline: 2px solid var(--accent, #43C878); outline-offset: 3px; border-radius: 4px; }

/* Start page: the "Who are you?" block is the main call to action. */
.who { margin-top: 1.25rem; }
.who-title { font-family: var(--font-title); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  font-size: 1.6rem; line-height: 1.1; margin: 0; color: var(--ink, #EEF3EF); }
.who-sub { margin: 0.3rem 0 0.9rem; color: var(--muted, #9DB0A5); }
.who + .privacy, main > .privacy:last-child { margin-top: 1.5rem; }

/* By skill: a strip of skill pills to jump between skills, like the player strip. */
.strip--skills { gap: 0.4rem; padding-bottom: 0.4rem; }
.skchip { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; height: 40px; padding: 0 0.85rem; border-radius: 999px; scroll-snap-align: center;
  font-family: var(--font-title); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); background: rgba(233, 242, 236, 0.04); border: 1px solid rgba(233, 242, 236, 0.10);
  text-decoration: none; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.skchip:hover { color: var(--ink); border-color: rgba(233, 242, 236, 0.22); }
.skchip[aria-current="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.skchip .tick { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; border: 2px solid var(--bg); }
.skchip .tick svg { width: 9px; height: 9px; }
.skchip.is-complete .tick { display: inline-grid; }
