@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url(../fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-display: swap; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

:root {
  /* The page has one look; don't let a dark system theme repaint form controls. */
  color-scheme: light !important;
  --bg: #f1f5f2;          /* the work area behind the cards */
  --surface: #ffffff;     /* board, cards, dialogs */
  --hover: #eef4f0;
  --line: #e0e8e3;
  --line-strong: #cad6cf;
  --line-hover: #9fb3a7;
  --ink: #0e1a14;
  --muted: #4d5e55;
  --faint: #66776e;
  --field: #0c3d26;       /* the top bar, banners, and the wells behind portraits */
  --lime: #c6f24e;        /* the main action on the field: Export, the overall */
  --lime-hover: #d6fb6e;
  --lime-ink: #0c2a19;
  --turf: #12823f;
  --turf-deep: #0b6630;
  --turf-soft: #e2f4e7;
  --ring: rgba(18, 130, 63, .22);
  --danger: #b4261d;
  --danger-ink: #6d1a14;
  --danger-soft: #fdeceb;
  --danger-line: #f1bab5;
  --warn: #d99a1e;
  --warn-bg: #fff6df;
  --warn-ink: #6b4b00;
  --warn-line: #ecd28d;

  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --h: 38px;
  --h-sm: 30px;
  --yard-lines: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 72px);
  --shadow-sm: 0 1px 2px rgba(10, 40, 20, .05);
  --shadow-card: 0 1px 2px rgba(10, 40, 20, .05), 0 6px 20px rgba(10, 40, 20, .05);
  --shadow-md: 0 12px 32px rgba(10, 40, 20, .14), 0 0 0 1px rgba(10, 40, 20, .06);
  --shadow-lg: 0 28px 70px rgba(10, 40, 20, .25), 0 0 0 1px rgba(10, 40, 20, .05);
}
::selection { background: var(--lime); }

* { box-sizing: border-box; }
html, body { height: 100%; }
html, body, input, select, textarea, button { color-scheme: light !important; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--turf); outline-offset: 2px; }
img { display: block; }
.i { display: block; flex: none; width: 16px; height: 16px; }
.spr { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-size: 2400% 2400%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Form controls ------------------------------------------------------ */
input[type=text], input[type=search], input[type=number], select {
  height: var(--h); padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background-color: var(--surface); color: var(--ink); font-size: 14px; box-shadow: var(--shadow-sm);
}
input::placeholder { color: var(--faint); }
input[type=text]:focus-visible, input[type=search]:focus-visible, input[type=number]:focus-visible, select:focus-visible {
  outline: none; border-color: var(--turf); box-shadow: 0 0 0 3px var(--ring);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355636f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
input:disabled, select:disabled { background-color: var(--hover); color: var(--faint); box-shadow: none; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--turf); }

/* Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h); padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background-color .12s, border-color .12s, color .12s;
}
.btn:not(:disabled):hover, .btn[aria-expanded="true"] { background-color: var(--hover); }
.btn-primary { background: var(--turf); border-color: var(--turf); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--turf-deep); border-color: var(--turf-deep); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:not(:disabled):hover { color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-danger:not(:disabled):hover { background: var(--danger-soft); border-color: var(--danger-line); }
.btn-del { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-del:not(:disabled):hover { background: #8f1d17; border-color: #8f1d17; }
.btn-small { height: var(--h-sm); padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.btn-del:disabled { opacity: 1; background: var(--surface); border-color: var(--line-strong); color: var(--faint); }
.btn .i { margin: 0 -2px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--h); height: var(--h); padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.icon-btn .i { width: 18px; height: 18px; }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--turf-deep); font-weight: 600;
  text-decoration: underline; text-decoration-color: rgba(11, 102, 48, .35); text-underline-offset: 2px;
}
.link-btn:hover { text-decoration-color: currentColor; }

/* Top bar: the field ------------------------------------------------- */
.topbar {
  flex: none; display: flex; align-items: center; gap: 4px;
  height: 60px; padding: 0 12px 0 16px;
  background: var(--yard-lines), linear-gradient(90deg, var(--field), #0f4a2e); color: #fff;
}
.topbar :focus-visible { outline-color: var(--lime); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; font-size: 19px; line-height: 1; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { display: block; width: 28px; height: 28px; flex: none; }
.class-switch { display: flex; align-items: center; min-width: 0; }
.class-switch::before { content: '/'; margin: 0 4px 0 10px; color: rgba(255, 255, 255, .3); font-size: 22px; font-weight: 300; }
.class-switch:empty::before { display: none; }
.class-btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 340px;
  height: var(--h); padding: 0 8px 0 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: #fff; font-size: 15px; font-weight: 600;
}
.class-btn:hover, .class-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
.class-btn .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-btn .i { color: rgba(255, 255, 255, .7); }
.top-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.topbar .btn-ghost, .topbar .icon-btn { color: rgba(255, 255, 255, .82); }
.topbar .btn-ghost:not(:disabled):hover, .topbar .icon-btn:hover, .topbar .icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .12); color: #fff; }
.top-actions .btn-primary { margin-left: 8px; background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.top-actions .btn-primary:not(:disabled):hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.narrow-only, .short-label { display: none !important; }

/* Menus -------------------------------------------------------------- */
.menu {
  position: fixed; z-index: 70; min-width: 230px; max-width: min(340px, calc(100vw - 16px));
  max-height: min(440px, calc(100vh - 80px)); overflow-y: auto; padding: 6px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-md);
}
.menu[hidden] { display: none; }
.menu-head { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 5px 10px;
  border: 0; border-radius: 9px; background: none; text-align: left; font-size: 14px; color: var(--ink);
}
.menu-item:not(:disabled):hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item:disabled { color: var(--faint); opacity: .7; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:not(:disabled):hover, .menu-item.danger:focus-visible { background: var(--danger-soft); }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-meta { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.menu-check { display: grid; place-items: center; width: 16px; color: var(--turf); }
.menu-item[aria-checked="false"] .menu-check .i { visibility: hidden; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* Room layout -------------------------------------------------------- */
.room { flex: 1; display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 0; }
.board { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.work { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.sheet { flex: 1; overflow-y: auto; min-height: 0; }

/* Quick add ---------------------------------------------------------- */
.quick {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.quick-label { margin-right: 4px; font-weight: 600; }
.quick .qa-name { flex: 1 1 180px; min-width: 0; max-width: 360px; }
.quick select { flex: 0 1 200px; min-width: 0; }
.qa-ovr {
  display: flex; align-items: stretch; height: var(--h); overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-sm);
}
.qa-ovr span { display: flex; align-items: center; padding: 0 8px; background: var(--turf-soft); border-right: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--turf-deep); }
.qa-ovr input[type=number] { width: 60px; height: 100%; border: 0; border-radius: 0; box-shadow: none; font-variant-numeric: tabular-nums; }
.qa-ovr input[type=number]:focus-visible { box-shadow: none; }
.qa-ovr:focus-within { border-color: var(--turf); box-shadow: 0 0 0 3px var(--ring); }
.quick-hint { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }

/* Board -------------------------------------------------------------- */
.board-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.board-bar { display: flex; align-items: center; gap: 4px; min-height: var(--h-sm); }
.board-count { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.board-count b { font-weight: 600; color: var(--ink); }
.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; padding-left: 34px; }
.board-filters { display: flex; gap: 8px; }
.board-filters select { flex: 1; min-width: 0; }
.board-alert {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; text-align: left;
  border: 1px solid var(--warn-line); border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn-ink);
  font-size: 13px; font-weight: 600;
}
.board-alert.is-block { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-ink); }
.board-alert span { flex: 1; }
.board-alert u { text-underline-offset: 2px; }
.board-note { margin: 10px 16px 0; font-size: 12.5px; color: var(--muted); }
.board-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.board-empty { padding: 32px 20px; text-align: center; font-size: 13.5px; color: var(--muted); }
.round-head { position: sticky; top: -6px; z-index: 1; margin: 0 -10px; padding: 14px 14px 6px; background: var(--surface); }
.round-head span { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--field); color: var(--lime); font-size: 12px; font-weight: 700; }
.strip {
  display: grid; grid-template-columns: 24px 40px minmax(0, 1fr) auto 20px; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 4px 0 6px; border-radius: var(--r-sm); cursor: pointer; user-select: none;
}
.strip + .strip { margin-top: 2px; }
.strip:hover { background: var(--hover); }
.strip.selected { background: var(--turf); color: #fff; }
.strip.selected .strip-name { font-weight: 600; }
.strip.selected .strip-pick { color: rgba(255, 255, 255, .75); }
.strip.selected .strip-del { color: rgba(255, 255, 255, .8); }
.strip.dragging { opacity: .4; }
.strip.drop-before { box-shadow: 0 -2px 0 0 var(--turf); }
.strip.drop-after { box-shadow: 0 2px 0 0 var(--turf); }
.strip.just-added { animation: added 1.6s ease-out; }
@keyframes added { from { background: var(--lime); } }
.strip-pick { text-align: right; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.strip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.strip-ovr { text-align: right; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.strip.auto .strip-name { color: var(--muted); }
.auto-tag {
  display: inline-block; margin-right: 6px; padding: 0 4px; border-radius: 4px; background: var(--hover);
  font-size: 9.5px; font-weight: 700; line-height: 15px; letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; color: var(--faint);
}
.strip-del { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--faint); opacity: 0; }
.strip-del .i { width: 13px; height: 13px; }
.strip:hover .strip-del, .strip.selected .strip-del, .strip-del:focus-visible { opacity: 1; }
.strip-del:hover { background: var(--danger-soft); color: var(--danger); }
/* select mode */
.sel-bar { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.sel-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sel-count { margin-right: auto; }
.sel-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sel-count { font-size: 14px; font-weight: 600; }
.sel-hidden { font-size: 12px; color: var(--muted); }
.sel-hint { margin: 0; font-size: 12px; color: var(--muted); }
.strip.picking { grid-template-columns: 16px 24px 40px minmax(0, 1fr) auto; }
.strip.picking .strip-del { display: none; }
.strip-check { display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); }
.strip.picked { background: var(--turf-soft); }
.strip.picked .auto-tag { background: rgba(255, 255, 255, .7); }
.strip.selected .auto-tag { background: rgba(255, 255, 255, .2); color: #fff; }
.strip.picked .strip-check { background: var(--turf); border-color: var(--turf); }
.strip.picked .strip-check::after { content: ''; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }

/* Position tags: one solid color per position group */
.pos-tag { display: inline-block; padding: 2px 0; border-radius: 6px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: .03em; }
.g-qb { background: #f4b400; color: #2d2000; }
.g-rb { background: #f0661d; color: #fff; }
.g-rec { background: #1f74cc; color: #fff; }
.g-ol { background: #5b6b78; color: #fff; }
.g-dl { background: #d43838; color: #fff; }
.g-lb { background: #7a4fd6; color: #fff; }
.g-db { background: #0e9683; color: #fff; }
.g-st { background: #7f9618; color: #fff; }

/* Sheet -------------------------------------------------------------- */
.sheet-inner { position: relative; max-width: 1040px; margin: 0 auto; padding: 24px 32px 64px; }
.back-btn { display: none; }
/* The player's header is a banner on the field */
.player-head {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 20px; align-items: center;
  padding: 22px; border-radius: var(--r-lg); color: #fff; box-shadow: 0 10px 30px rgba(12, 61, 38, .22);
  background: var(--yard-lines), radial-gradient(600px 220px at 85% 0%, rgba(198, 242, 78, .18), transparent 70%), linear-gradient(120deg, var(--field), var(--turf));
}
.head-menu { align-self: start; }
.player-head .head-menu { color: rgba(255, 255, 255, .85); }
.player-head .head-menu:hover, .player-head .head-menu[aria-expanded="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
.player-head .link-btn { color: var(--lime); text-decoration-color: rgba(198, 242, 78, .5); }
.player-head :focus-visible { outline-color: var(--lime); }
.portrait-btn {
  position: relative; width: 96px; height: 96px; padding: 0; overflow: hidden;
  border: 0; border-radius: 18px; background: var(--field); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9);
}
.portrait-btn img { width: 100%; height: 100%; object-fit: cover; }
.portrait-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 0; background: rgba(19, 29, 38, .8); color: #fff; font-size: 11.5px; font-weight: 600; text-align: center; }
@media (hover: hover) {
  .portrait-cap { opacity: 0; transition: opacity .12s; }
  .portrait-btn:hover .portrait-cap, .portrait-btn:focus-visible .portrait-cap { opacity: 1; }
}
.portrait-none { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; font-size: 12px; color: #9fbfae; }
.player-name { margin: 0 0 8px; font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -.02em; overflow-wrap: anywhere; }
.player-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.player-meta .pos-tag { padding: 2px 8px; font-size: 12px; }
.ovr-badge { min-width: 108px; padding: 12px; text-align: center; background: var(--lime); color: var(--lime-ink); border-radius: 18px; }
.ovr-badge b { display: block; font-family: var(--cond); font-weight: 700; font-size: 50px; line-height: 1; font-variant-numeric: tabular-nums; }
.ovr-badge span { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.2; color: rgba(12, 42, 25, .72); }
/* pills on the banner */
.dev-pill, .auto-pill, .name-pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.dev-1 { border-color: #f4b400; background: #f4b400; color: #2d2000; }
.dev-2 { border-color: #9a7bf0; background: #9a7bf0; color: #fff; }
.dev-3 { border-color: #ff5a4a; background: #ff5a4a; color: #fff; }
.auto-pill { border-style: dashed; }

/* Pill tabs */
.tabs {
  display: inline-flex; max-width: 100%; gap: 2px; margin-top: 20px; padding: 4px; overflow-x: auto;
  border-radius: 999px; background: #e1e9e4; scrollbar-width: none;
}
.tab {
  flex: none; height: 36px; padding: 0 18px; border: 0; border-radius: 999px;
  background: none; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(10, 40, 20, .15); }
.panel { padding-top: 18px; }

.block { margin-bottom: 16px; padding: 22px 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.block h3 { margin: 0 0 14px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.block h3 + .hint, .block h3 + p { margin-top: -10px; }
.block .hint { max-width: 72ch; margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select { width: 100%; }
.field .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.inline { display: flex; gap: 8px; }
.inline > * { flex: 1; min-width: 0; }
.wide { grid-column: span 2; }
.check-row { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 500; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 0; }

.choice-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choice { padding: 10px 12px; text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.choice b { display: block; font-size: 14px; font-weight: 600; }
.choice small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.choice:disabled { opacity: .5; }
.choice:not(:disabled):hover, .trait:not(:disabled):hover, .gear-tile:hover, .pick:hover { border-color: var(--line-hover); }
.choice[aria-pressed="true"], .trait[aria-pressed="true"], .gear-tile.changed {
  border-color: var(--turf); background: var(--turf-soft); box-shadow: inset 0 0 0 1px var(--turf);
}

.note { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--warn-line); border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.note.bad { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-ink); }
.okay { color: var(--turf-deep); font-weight: 600; }

/* Ratings ------------------------------------------------------------ */
.rate-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.rate-tools .field { width: 140px; }
.rate-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px 32px; }
.rate-group h4 { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--turf-deep); }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) 104px 50px; align-items: center; gap: 10px; min-height: 32px; }
.rate label { font-size: 13.5px; }
.rate label.counts::after, .legend-dot { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--turf); vertical-align: middle; }
.rate label.counts::after { margin-left: 6px; }
.legend-dot { margin: 0 4px 1px 0; }
.rate input[type=range] { width: 100%; margin: 0; }
.rate input[type=number] { width: 50px; height: 28px; padding: 0 6px; text-align: right; font-variant-numeric: tabular-nums; box-shadow: none; }

/* Persona ------------------------------------------------------------ */
.trait-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.trait { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px; text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
/* the game's trait icons are light, drawn for a dark background */
.trait img { width: 32px; height: 32px; padding: 3px; border-radius: 8px; background: var(--field); }
.trait b { display: block; font-size: 13.5px; font-weight: 600; }
.trait small { display: block; font-size: 12px; line-height: 1.35; color: var(--muted); }
.trait[disabled] { opacity: .45; }

/* Appearance --------------------------------------------------------- */
.look-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; align-items: start; }
.look-thumb { width: 104px; height: 104px; overflow: hidden; border-radius: var(--r-md); background: var(--field); }
.look-thumb img { width: 100%; height: 100%; object-fit: cover; }
.look-body p { margin: 0 0 10px; }
.look-body p.note { margin-top: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.gear-tile {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 60px; padding: 7px 10px 7px 7px;
  text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
}
.gear-tile .gimg { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: var(--r-sm); background: var(--hover); }
.gear-tile .gimg .spr { width: 44px; height: 44px; }
.gear-tile small { display: block; font-size: 11.5px; color: var(--muted); }
.gear-tile b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.gear-tile.same b { font-weight: 500; color: var(--muted); }

/* Empty states ------------------------------------------------------- */
/* The pitch is on the field */
.empty {
  max-width: 900px; margin: 32px auto; padding: 60px 48px 44px; text-align: center; color: #fff;
  border-radius: 28px; box-shadow: 0 20px 50px rgba(12, 61, 38, .25);
  background: var(--yard-lines), radial-gradient(700px 300px at 50% -60px, rgba(198, 242, 78, .22), transparent 70%), linear-gradient(160deg, var(--field), var(--turf));
}
.empty h2 { margin: 0 0 10px; font-weight: 700; font-size: clamp(36px, 5vw, 54px); line-height: 1.02; letter-spacing: -.03em; }
.empty p { max-width: 50ch; margin: 0 auto 24px; font-size: 17px; color: rgba(255, 255, 255, .86); }
.empty .btn-row { justify-content: center; }
.empty .btn-primary { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.empty .btn-primary:not(:disabled):hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.empty .btn:not(.btn-primary) { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; box-shadow: none; }
.empty .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .2); }
.empty .link-btn { color: var(--lime); text-decoration-color: rgba(198, 242, 78, .5); }
.empty :focus-visible { outline-color: var(--lime); }
.empty .empty-alt { margin: 14px auto 0; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 44px 0 0; padding: 0; list-style: none; text-align: left; }
.steps li { padding: 14px 16px; background: var(--surface); border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); font-size: 13px; color: var(--muted); }
.steps b { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 600; color: var(--ink); }
.steps .n { display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 10px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 700; }

/* Modal -------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 30, .45); }
.modal-panel {
  position: relative; display: flex; flex-direction: column; width: min(980px, 100%); max-height: calc(100vh - 32px);
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg);
}
.modal-panel.sm { width: min(460px, 100%); }
.modal-panel.md { width: min(680px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-body { padding: 22px 24px 24px; overflow-y: auto; }
.modal-body > p:first-child { margin-top: 0; }
.modal-body .hint { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 22px; }
.modal-actions.split { justify-content: space-between; }
.sub-head { margin: 22px 0 6px; font-size: 15px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }

.picker-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.picker-bar input[type=search] { flex: 1 1 240px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { background: var(--turf); border-color: var(--turf); color: #fff; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, .2); border-radius: 50%; }
.pick-count { margin-bottom: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.pick-grid.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pick { display: flex; flex-direction: column; justify-content: flex-start; padding: 0 0 8px; overflow: hidden; text-align: center; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.pick[aria-pressed="true"] { border-color: var(--turf); box-shadow: 0 0 0 2px var(--turf); }
.pick .pimg { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: var(--field); }
.pick .pimg.light { background: var(--hover); }
.pick .pimg img { width: 100%; height: 100%; object-fit: cover; }
.pick .pimg.light .spr { width: 72%; height: 72%; }
.pick b { display: block; padding: 7px 6px 0; font-size: 12.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pick small { display: block; padding: 0 6px; font-size: 11px; color: var(--muted); }
.pick small.pick-note { padding-top: 2px; font-weight: 600; color: var(--warn-ink); }
.pick-ovr { display: inline-block; min-width: 30px; padding: 2px 5px; border: 1.5px solid var(--turf); border-radius: 8px; background: var(--turf); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 16px; line-height: 1.1; text-align: center; font-variant-numeric: tabular-nums; }
.pick-ovr.est { background: rgba(255, 255, 255, .94); color: var(--turf-deep); border-style: dashed; }
.pick .pick-ovr { position: absolute; top: 6px; left: 6px; }
.pick-tag { position: absolute; top: 6px; right: 6px; padding: 3px 7px; border-radius: 8px; font-family: var(--cond); font-weight: 700; font-size: 13px; line-height: 1.1; letter-spacing: .04em; text-transform: uppercase; }
.pick-tag.used { background: #f2b33d; color: #2a1d00; }
.pick-tag.current { background: var(--turf); color: #fff; }
.pick-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.pick-key > span { display: inline-flex; align-items: center; gap: 8px; }
.pick-key .pick-ovr { min-width: 26px; font-size: 14px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; }
.pager:empty { display: none; }
.pager-at { padding: 0 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 480px) {
  .pager { gap: 5px; }
  .pager .btn-small { padding: 0 7px; }
  .pager-at { padding: 0 2px; }
}

.fd-range { display: flex; align-items: center; gap: 8px; }
.fd-range > * { flex: none; }
.fd-range input { width: 80px; }
.fd-radio { display: flex; align-items: center; gap: 8px; padding: 3px 0; text-align: left; font-size: 14px; cursor: pointer; }
.field .fd-radio input { flex: none; width: auto; margin: 0; padding: 0; }
.fd-summary { margin: 18px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13.5px; }
.ea-scope { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 12px; }
.ea-scope label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 24px; }
.ea-group h4 { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--turf-deep); }
.ea-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13.5px; }
.ea-row input[type=number] { width: 58px; height: 28px; padding: 0 6px; text-align: right; font-variant-numeric: tabular-nums; box-shadow: none; }
.ea-actions { position: sticky; bottom: -24px; margin: 22px -24px -24px; padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; }
.ea-count { margin-right: auto; font-size: 13.5px; color: var(--muted); }
.check-list { margin: 0; padding-left: 20px; }
.check-list li { margin: 4px 0; }

/* Name check --------------------------------------------------------- */
.name-flag { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; font-size: 11px; font-weight: 800; line-height: 1; vertical-align: 1px; color: #fff; }
.name-flag.is-block { background: var(--danger); }
.name-flag.is-warn { background: var(--warn); color: #241600; }
.name-pill.is-block { border-color: #fff; background: #fff; color: var(--danger); }
.name-pill.is-warn { border-color: #fff3c4; background: #fff3c4; color: var(--warn-ink); }
.name-check { margin-top: 12px; padding: 10px 14px; border: 1px solid; border-radius: var(--r-sm); font-size: 13.5px; }
.name-check ul { margin: 6px 0; padding-left: 18px; }
.name-check li { margin: 3px 0; }
.name-check p { margin: 6px 0 0; }
.name-check.is-block { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger-ink); }
.name-check.is-warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.name-check.ok { border-color: #b9e0c8; background: #eef8f2; color: var(--turf-deep); }
.name-fine { margin-top: 10px; font-size: 13px; color: var(--turf-deep); }
.nc-sum { margin: 0 0 12px; font-weight: 600; }
.nc-sum.ok { color: var(--turf-deep); }
.nc-list { display: grid; gap: 8px; }
.nc-row { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r-sm); }
.nc-row.is-block { border-left-color: var(--danger); }
.nc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.nc-head .pos-tag { padding: 2px 6px; }
.nc-head .auto-tag { margin: 0; }
.nc-name { font-size: 15px; text-decoration: none; color: var(--ink); }
.nc-lvl { font-size: 13px; font-weight: 600; color: var(--muted); }
.nc-head .btn { margin-left: auto; }
.nc-row ul { margin: 6px 0 2px; padding-left: 18px; font-size: 13.5px; color: var(--muted); }

/* About -------------------------------------------------------------- */
.about { max-width: 68ch; }
.about h3 { margin: 20px 0 4px; font-size: 15px; font-weight: 600; }
.about p { margin: 0 0 8px; }

/* Footer and toast --------------------------------------------------- */
.site-foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px;
  padding: 6px 16px; background: var(--surface); border-top: 1px solid var(--line); font-size: 12px; color: var(--faint);
}
.site-foot .link-btn { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration-color: var(--line-strong); }
.foot-links { display: flex; gap: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 10px 20px;
  border-radius: 999px; background: var(--field); color: #fff; font-weight: 500; box-shadow: 0 10px 30px rgba(16, 24, 40, .28);
}
.toast[hidden] { display: none; }
.toast-action { flex: none; padding: 0; border: 0; background: none; color: var(--lime); font-weight: 700; }
.toast-action:hover { text-decoration: underline; }

/* Small screens: the board and the player take turns ------------------ */
@media (max-width: 900px) {
  .wide-only { display: none !important; }
  .narrow-only { display: inline-flex !important; }
  .top-actions .btn-primary { margin-left: 4px; padding: 0 12px; }
  .room { display: flex; flex-direction: column; }
  .work { display: contents; }
  .quick { order: 1; padding: 12px; }
  .board, .sheet { order: 2; flex: 1; min-height: 0; }
  .board { border-right: 0; }
  body[data-view="list"] .sheet, body[data-view="detail"] .board, body[data-view="welcome"] .board, body[data-view="detail"] .quick { display: none; }
  /* 16px keeps phones from zooming in when a box gets focus */
  input[type=text], input[type=search], input[type=number], select { font-size: 16px; }
  .quick-label, .quick-hint { display: none; }
  .quick .qa-name { flex: 1 1 100%; max-width: none; }
  .quick select { flex: 1 1 0; width: auto; min-width: 0; }
  .back-btn { display: inline-flex; margin: -10px 0 12px -10px; }
  .sheet-inner { padding: 20px 16px 48px; }
  .player-head { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border-radius: 18px; }
  /* the menu button moves above the banner, beside All players */
  .head-menu { position: absolute; top: 10px; right: 8px; }
  .player-head .head-menu { color: var(--muted); }
  .player-head .head-menu:hover, .player-head .head-menu[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
  .player-head .head-menu:focus-visible { outline-color: var(--turf); }
  .portrait-btn { width: 64px; height: 64px; }
  .player-name { font-size: 28px; }
  .ovr-badge { min-width: 0; padding: 8px 12px; border-radius: 14px; }
  .ovr-badge b { font-size: 34px; }
  .tabs { display: flex; }
  .tab { flex: 1 0 auto; padding: 0 12px; }
  .empty { margin: 12px; padding: 36px 20px 24px; border-radius: 22px; }
  .ovr-badge span { display: none; }
  .site-foot { padding: 4px 12px; font-size: 11px; line-height: 1.35; }
  .site-foot .link-btn { font-size: 11px; }
  .foot-tm { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 8px 0 12px; }
  .brand-name, .wide-label { display: none; }
  .short-label { display: inline !important; }
  .class-switch::before { margin-left: 6px; }
  .class-btn { font-size: 14px; }
  .block { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .topbar:has(.class-switch:empty) .brand-name { display: inline; }
  .steps { grid-template-columns: 1fr; gap: 8px; margin-top: 32px; }
  .steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; padding: 12px 14px; }
  .steps .n { grid-row: span 2; margin: 0; }
  .empty h2 { font-size: 32px; }
  .rate { grid-template-columns: minmax(0, 1fr) 72px 50px; }
  .look-row { grid-template-columns: 72px minmax(0, 1fr); }
  .look-thumb { width: 72px; height: 72px; }
  .modal { padding: 8px; }
  .modal-panel { max-height: calc(100vh - 16px); }
  .modal-head { padding: 10px 8px 10px 16px; }
  .modal-body { padding: 16px; }
  .ea-actions { bottom: -16px; margin: 16px -16px -16px; padding: 12px 16px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
