/* CardCollection — built by XmarkBuilds, started 2026-09-09 */
:root {
  --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb; --bg: #f6f7f9; --card: #ffffff;
  --brand: #1e3a8a; --brand-2: #2563eb; --accent: #f59e0b; --accent-ink: #78350f; --danger: #b91c1c;
  --radius: 12px; --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
img { max-width: 100%; }
html, body { margin: 0; }
html { overflow-x: hidden; } /* the page scrolls down only; nothing is meant to be wider than the screen */
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 22px; margin: 28px 0 10px; }
h3 { font-size: 16px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
code { background: #eef; padding: 1px 5px; border-radius: 4px; }
/* The page follows the window: a little margin on a wide screen, not a fixed column. */
.wrap { max-width: 96vw; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.inline { display: inline; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand-2); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.pill { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; text-align: center; vertical-align: middle; }

/* header / footer */
.site-header { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; }
.header-row { display: flex; align-items: center; gap: 20px; padding: 14px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .01em; }
.brand-logo { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; }
.brand:hover { text-decoration: none; }
.site-nav { flex: 1; color: rgba(255,255,255,.85); font-size: 14px; }
.site-nav a { color: #fff; }
.owner-nav { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; }
.owner-nav a, .owner-nav .linklike { color: #fff; }
.owner-nav .muted { color: rgba(255,255,255,.75); }
.site-footer { margin-top: 48px; padding: 24px 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }
.site-footer .credit { margin-top: 6px; font-size: 12px; opacity: .85; }
.site-footer .legal { margin-top: 8px; }
.page { max-width: 760px; }
.page h2 { font-size: 18px; margin-top: 24px; }

/* messages */
.messages { list-style: none; padding: 0; margin: 16px 0 0; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.msg-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.msg ul { margin: 0; padding-left: 18px; }

/* buttons */
[hidden] { display: none !important; } /* the attribute wins over any display rule below (scripts toggle it) */
.btn { display: inline-block; background: var(--brand-2); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand); text-decoration: none; }
.btn-small { padding: 6px 12px; font-size: 14px; }
.btn-secondary { background: #e5e7eb; color: var(--ink); }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #7f1d1d; }

/* landing & pickers */
.hero { padding: 36px 0 12px; }
.hero p { color: var(--muted); max-width: 640px; }
.grid { display: grid; gap: 14px; }
.grid-sports { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 16px; }
.grid-teams { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.tile.has-cards { border-color: var(--accent); }
.tile-sport { align-items: center; text-align: center; padding: 28px 16px; }
.tile-icon { font-size: 44px; }
.tile-title { font-weight: 700; }
.tile-sub { color: var(--muted); font-size: 13px; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.year-nav { display: flex; gap: 12px; font-weight: 600; white-space: nowrap; padding-top: 6px; }
.decade { margin-top: 12px; }
.years { display: flex; flex-wrap: wrap; gap: 8px; }
.year { position: relative; display: inline-block; min-width: 68px; text-align: center; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-weight: 600; }
.year:hover { border-color: var(--brand-2); text-decoration: none; }
.year.has-cards { border-color: var(--accent); background: #fffbeb; }
.year .pill { position: absolute; top: -8px; right: -6px; }
.league { margin-top: 8px; }
.division { margin-bottom: 8px; }

/* team page */
.field-wrap { margin-top: 20px; }
/* The field scales with the page (100% up to max-width); everything on it is sized in cqw
   (1% of the field's width) so cards and badges scale with it. */
/* Card size comes from the owner's setting (cards-s/m/l on the field element) as a share of the
   field's width; the px floor and ceiling keep it sane, and the phone rules below lower the floor
   so slots keep shrinking with the field instead of colliding. */
.field { --card-min: 30px; --card-w: 7.5cqw; --card-max: 210px; --name-w: 9cqw; --card-landscape: 1.3; /* a sideways card is this much wider than a portrait one */ }
.field.cards-t { --card-w: 5cqw; --card-max: 150px; --name-w: 6.5cqw; }
.field.cards-s { --card-w: 6.5cqw; --card-max: 180px; --name-w: 8cqw; }
.field.cards-l { --card-w: 9cqw; --card-max: 250px; --name-w: 10.5cqw; }
/* The field keeps its shape (stretching the drawing would distort the diamond) and sits centred in a
   stands-coloured band that fills the page width. With fit-window it grows until the whole field
   fits the window height; with fit-width it takes the whole column and the page scrolls. */
.team-layout { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; align-items: start; }
.field-band { display: flex; justify-content: center; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #3b4756 radial-gradient(ellipse at 50% 110%, #4a5768 0%, #3b4756 55%, #2f3946 100%); }
.field-band.fit-window .field { max-width: min(100%, calc((100vh - 200px) * var(--field-aspect, 1.24))); }
.field { position: relative; width: 100%; margin: 0 auto; overflow: hidden; background: #2f6b2f; container-type: inline-size; }
@media (min-width: 1500px) {
  .team-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 520px); }
  .team-layout .roster { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; margin-top: 20px; }
  .team-layout .roster h2 { margin-top: 0; }
}
.field svg { display: block; width: 100%; height: 100%; }
.slot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.slot:hover, .slot:focus-within { z-index: 2; }
.slot-main { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 66px; min-width: clamp(44px, 7cqw, 150px); padding: 4px 8px 5px; background: rgba(15, 23, 42, .88); color: #fff; border: 2px solid rgba(255,255,255,.25); border-radius: 10px; font: 600 12px/1.15 system-ui, sans-serif; font-size: clamp(9px, 1.45cqw, 22px); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.slot-main:hover, .slot-main:focus-visible { border-color: #fff; outline: none; }
.slot.has-cards .slot-main { background: rgba(180, 83, 9, .94); border-color: var(--accent); }
.slot-card .slot-main { min-width: 0; padding: 3px 3px 4px; background: rgba(15, 23, 42, .8); border-radius: 9px; }
/* the card: a share of the field's width set by the owner's card-size setting (cards-s/m/l on
   the field element), whole card visible (contain, never cropped) */
.slot-card .slot-main img { display: block; width: 74px; width: clamp(var(--card-min), var(--card-w), var(--card-max)); aspect-ratio: 2.5 / 3.5; object-fit: contain; border-radius: 5px; box-shadow: 0 4px 10px rgba(0,0,0,.45); background: #0f172a; }
.slot-card .slot-main img.is-landscape { width: calc(clamp(var(--card-min), var(--card-w), var(--card-max)) * var(--card-landscape)); aspect-ratio: 3.5 / 2.5; }
.slot-card .slot-main:hover img { transform: scale(1.04); transition: transform .15s; }
.slot-pos { font-size: .85em; opacity: .8; letter-spacing: .04em; }
.slot-name { white-space: nowrap; }
.slot-card .slot-name { padding-top: 2px; max-width: 80px; max-width: clamp(36px, var(--name-w), 260px); overflow: hidden; text-overflow: ellipsis; }
.slot-extras { display: flex; gap: 4px; }
.slot-more, .slot-cards { font: 700 10px/1.6 system-ui, sans-serif; font-size: clamp(8px, 1.2cqw, 18px); border-radius: 999px; padding: 0 7px; border: 0; background: rgba(15, 23, 42, .85); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.slot-more { cursor: pointer; }
.slot-more:hover, .slot-more:focus-visible { background: #fff; color: var(--ink); outline: none; }
.slot-cards { background: var(--accent); color: var(--accent-ink); }
.pill-outline { display: inline-block; padding: 2px 10px; border: 2px solid var(--accent); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--accent-ink); background: #fffbeb; vertical-align: middle; }
.star { color: var(--accent); }
.copy { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 11px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.slot-list-thumb { display: inline-block; width: 28px; height: 39px; object-fit: contain; border-radius: 3px; vertical-align: middle; margin-right: 8px; background: #0f172a; }
.slot-list-empty { border: 1px dashed var(--line); background: transparent; }
.roster { margin-top: 8px; }
.roster-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.roster-table th, .roster-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.roster-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f9fafb; }
.roster-row { cursor: pointer; }
.roster-row:hover, .roster-row:focus-visible { background: #f3f4f6; outline: none; }
.roster-row.has-cards td:first-child { border-left: 4px solid var(--accent); }

/* team look: TeamStyle colours arrive as custom properties on .team-page (and on season tiles);
   an unthemed page never sets them, so every rule below falls back to the site's own colours */
.title-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.team-logo { height: 72px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.team-page.themed .title-row { background: linear-gradient(100deg, var(--team-primary), var(--team-secondary)); color: var(--team-ink); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
.team-page.themed .title-row .muted { color: var(--team-ink); opacity: .88; }
.team-page.themed .title-row a { color: var(--team-ink); text-decoration: underline; }
/* the year links sit on the far end of the gradient, whose colour the ink was not chosen for: give them a
   pill in the primary colour so they read on any banner */
.team-page.themed .year-nav a { background: var(--team-primary); color: var(--team-ink); text-decoration: none; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); }
.team-page.themed .year-nav a:hover { text-decoration: underline; }
.team-page.themed .title-row .pill-outline { border-color: var(--team-ink); color: var(--team-ink); background: transparent; }
.team-page.themed .slot-main { background: var(--team-primary); color: var(--team-ink); border-color: var(--team-secondary); }
.team-page.themed .slot.has-cards .slot-main { background: var(--team-primary); border-color: var(--team-accent, var(--accent)); }
.team-page.themed .slot-card .slot-main { background: var(--team-primary); }
.team-page.themed .slot-cards { background: var(--team-accent, var(--accent)); }
.field-band { position: relative; }
.field-band .field { position: relative; z-index: 1; }
.field-band.themed::before, .field-band.themed::after { content: ""; position: absolute; z-index: 0; top: 10%; bottom: 10%; width: 22%; background: var(--team-logo) center / contain no-repeat; opacity: .22; pointer-events: none; }
.field-band.themed::before { left: 1.5%; }
.field-band.themed::after { right: 1.5%; }
.tile-team.themed { border-top: 6px solid var(--team-primary); }
.tile-logo { height: 30px; width: auto; max-width: 64px; object-fit: contain; align-self: flex-start; }

/* owner: team looks */
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; margin-right: 3px; }
.badge-preview { display: inline-block; padding: 3px 9px; border: 2px solid; border-radius: 8px; font: 600 12px/1.2 system-ui, sans-serif; vertical-align: middle; margin-left: 6px; }
.logo-thumb { height: 36px; width: auto; max-width: 72px; object-fit: contain; }
.looks-table .is-current td { background: #fffbeb; }
.row-actions { white-space: nowrap; }
.look-preview { display: flex; gap: 10px; align-items: center; padding: 12px; background: #2f6b2f; border-radius: 8px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) { .form-row-3 { grid-template-columns: 1fr; } }

/* dialogs */
.dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(92vw, 560px); width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.dialog-wide { max-width: min(94vw, 980px); }
.dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dialog-body { padding: 24px 28px 28px; max-height: 85vh; overflow: auto; }
.dialog-body h2 { margin-top: 0; }
.dialog-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; }
.dialog-close:hover { color: var(--ink); }
.slot-list { list-style: none; padding: 0; margin: 0; }
.slot-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* cards & flip */
.cards-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; margin-top: 12px; }
.card-figure { margin: 0; }
.card-figure figcaption { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); margin-top: 8px; }
.card-figure figcaption strong { color: var(--ink); }
.card-figure .notes { white-space: pre-line; }
.flip-card { display: block; width: 100%; aspect-ratio: 2.5 / 3.5; perspective: 1200px; background: none; border: 0; padding: 0; cursor: pointer; }
/* the box takes the shape of the face being shown: a sideways-printed front or back is sideways */
.flip-card.front-landscape:not(.flipped), .flip-card.back-landscape.flipped { aspect-ratio: 3.5 / 2.5; }
.flip-card:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; border-radius: 10px; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s; transform-style: preserve-3d; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; overflow: hidden; background: #e5e7eb; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.flip-face img { width: 100%; height: 100%; object-fit: contain; display: block; }
.flip-back { transform: rotateY(180deg); background: #d1d5db; }
.no-back { color: var(--muted); font-size: 14px; }

/* owner: rosters */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.stat { display: flex; flex-direction: column; min-width: 130px; padding: 12px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-value { font-size: 26px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.update-log h2 { margin-top: 24px; }
.log { background: #0f172a; color: #e5e7eb; padding: 14px 16px; border-radius: 8px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.pill-danger { border-color: var(--danger); color: var(--danger); background: #fef2f2; }
.btn[disabled] { opacity: .6; cursor: default; }

/* owner: manage — browse panel beside the grid; tile size from the owner's setting */
.manage-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 8px; }
.browse { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.browse h3 { margin: 2px 0 8px; }
.browse-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink); }
.browse-item:hover { background: #f3f4f6; text-decoration: none; }
.browse-item.is-active { background: #eef2ff; color: var(--brand); font-weight: 700; }
.browse-teams { margin: 2px 0 6px 10px; padding-left: 6px; border-left: 2px solid var(--line); }
.browse-team { font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 12px; }
.toolbar-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.toolbar input[type=search] { flex: 1; min-width: 160px; max-width: 420px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.toolbar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.size-switch { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.seg { border: 1px solid var(--line); background: #fff; padding: 5px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.seg.is-active { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.chips { margin: 0 0 12px; color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin: 20px 0; }
/* A fixed column count per size: a tile is always the same share of the width, so it scales continuously
   as the window resizes instead of shrinking then jumping when an auto-fill column drops out.
   Tiny 8 · Small 6 · Medium 4 · Large 3; on a phone 4 · 3 · 2 · 1. The base (medium) rule must come
   BEFORE the phone block — it once sat below it and won, so medium was the smallest size on phones. */
.manage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.manage-grid.size-t { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.manage-grid.size-s { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.manage-grid.size-l { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 600px) {
  .manage-grid, .manage-grid.size-m { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-grid.size-t { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .manage-grid.size-s { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manage-grid.size-l { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
/* tiny: icon buttons in one row, no field link — the tile is for recognising the card */
.manage-grid.size-t .manage-actions { grid-template-columns: repeat(4, 1fr); }
.manage-grid.size-t .btn-text, .manage-grid.size-t .manage-meta a { display: none; }
.manage-grid.size-t .btn-icon { display: inline; }
.btn-icon { display: none; }
@media (max-width: 900px) {
  .manage-layout { grid-template-columns: 1fr; }
  .browse { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .browse h3 { width: 100%; }
  .browse-teams { display: contents; }
}

/* owner: manage */
.search-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 20px; }
.search-row input { flex: 1; max-width: 420px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
/* Each tile is its own measurement container: text, padding, buttons and gaps are a share of the
   tile's width (with floors), so the whole tile shrinks together at any size or window width. */
.manage-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; container-type: inline-size; }
.manage-card .flip-card { padding: clamp(4px, 3.5cqw, 8px) clamp(4px, 3.5cqw, 8px) 0; }
.manage-meta { display: flex; flex-direction: column; padding: clamp(4px, 4cqw, 10px) clamp(6px, 5cqw, 12px) clamp(2px, 1.5cqw, 4px); font-size: clamp(9px, 5.8cqw, 14px); line-height: 1.35; }
.manage-meta a { margin-top: clamp(2px, 1.5cqw, 4px); font-size: clamp(9px, 5.3cqw, 13px); }
.manage-meta .copy { font-size: .8em; }
/* four actions in a 2×2 grid that shrinks with the tile, so nothing is ever clipped */
.manage-actions { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(4px, 3cqw, 8px); padding: clamp(4px, 3cqw, 8px) clamp(6px, 5cqw, 12px) clamp(6px, 5cqw, 12px); }
.manage-actions .inline { display: contents; }
.manage-actions .btn { width: 100%; text-align: center; white-space: nowrap; padding: clamp(3px, 2.8cqw, 7px) clamp(3px, 2cqw, 8px); font-size: clamp(9px, 5.4cqw, 13px); border-radius: clamp(4px, 2.5cqw, 8px); }

/* forms */
.card-form fieldset, .login-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 8px; margin: 18px 0; box-shadow: var(--shadow); }
.card-form legend { font-weight: 700; padding: 0 6px; }
.settings-group { margin: 26px 0 0; font-size: 20px; }
.settings-group + .muted { margin: 2px 0 6px; }
.card-form { max-width: 960px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.form-row > * { min-width: 0; } /* a grid cell may shrink below its content: a long <option> must not widen the page */
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 14px; }
.form-field small { color: var(--muted); font-size: 12px; }
.form-field input, .form-field select, .form-field textarea { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; }
.form-field select, .form-field textarea, .form-field input:not([type=checkbox]):not([type=radio]) { width: 100%; max-width: 100%; }
.form-field input[type=file] { padding: 6px 0; }
.form-field .errorlist { list-style: none; padding: 0; margin: 0; color: var(--danger); font-size: 13px; }
.form-check label { display: flex; align-items: center; gap: 8px; }
.form-radios > div { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.form-radios > div label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.form-check input[type=checkbox] { width: 18px; height: 18px; }
.manage-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 3px #fde68a, var(--shadow); }
.btn-featured { background: var(--accent); color: var(--accent-ink); }
.btn-featured:hover { background: #d97706; color: #fff; }
.form-actions { display: flex; gap: 12px; align-items: center; margin: 8px 0 24px; }
.login-box { max-width: 380px; margin: 48px auto; padding-bottom: 22px; }
.login-box .form-field { margin-bottom: 12px; }

/* card form: photo slots (camera on phones, drop/paste on computers) and the name search */
.photo-row { position: relative; border-radius: var(--radius); transition: background .15s; }
.photo-row.is-drag { background: #eef2ff; outline: 2px dashed var(--brand-2); outline-offset: 6px; }
.photo-field { align-items: stretch; }
.photo-title { font-weight: 600; font-size: 14px; }
.photo-preview-wrap { position: relative; width: 100%; max-width: 240px; aspect-ratio: 2.5 / 3.5; border-radius: 10px; background: #e5e7eb; border: 1px dashed #cbd5e1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo-preview-wrap.is-landscape { aspect-ratio: 3.5 / 2.5; max-width: 336px; }
.photo-preview { width: 100%; height: 100%; object-fit: contain; display: block; background: #0f172a; }
.photo-rotate { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-placeholder { color: var(--muted); font-size: 13px; }
.photo-field.js .photo-real { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; flex: 1 1 140px; cursor: pointer; text-align: center; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.photo-btn:focus-within { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.photo-status { color: var(--muted); font-size: 12px; min-height: 1.2em; }
.photo-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 12px; }
.form-check-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; }
/* what kind of card: a row of buttons (radio inputs inside the labels) */
.kind-row > div { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-row > div > div { display: contents; }
.kind-row label { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; }
.kind-row label:has(input:checked) { border-color: var(--brand-2); background: #eef2ff; }
.kind-row input { accent-color: var(--brand-2); margin: 0; }
.kind { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #fef3c7; color: #78350f; font-size: 11px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.tile-card { width: 42px; aspect-ratio: 2.5 / 3.5; object-fit: cover; border-radius: 4px; align-self: flex-start; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.form-subhead { margin: 4px 0 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
#player-search { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; width: 100%; }
.search-results { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.search-hit { display: block; width: 100%; text-align: left; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
.search-hit:hover, .search-hit:focus-visible { border-color: var(--brand-2); background: #eef2ff; outline: none; }
.search-note { margin: 4px 0 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: #eef2ff; color: #1e3a8a; font-size: 13px; font-weight: 600; }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: inherit; padding: 0 2px; }

/* in-page camera (camera.js): full screen on a phone, a window on a computer */
.camera-dialog { border: 0; padding: 0; margin: auto; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; background: #0f172a; color: #fff; border-radius: 0; }
.camera-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.camera-live, .camera-review { display: flex; flex-direction: column; height: 100%; }
.camera-stage { position: relative; flex: 1; min-height: 0; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* the live picture fills the stage (a viewfinder), so the guide always lies inside it; the review shows the whole crop */
.camera-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.camera-stage video.is-mirrored { transform: scaleX(-1); }
/* the guide is the crop: what is inside the dotted line is the photo */
.camera-guide { position: absolute; inset: 0; margin: auto; height: 90%; max-width: 92%; aspect-ratio: 2.5 / 3.5; border: 3px dashed rgba(255, 255, 255, .85); border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
.camera-stage.is-landscape .camera-guide { aspect-ratio: 3.5 / 2.5; width: 92%; height: auto; max-height: 90%; }
.camera-left { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.camera-head { margin: 8px 16px 0; font-size: 14px; min-height: 1.4em; }
.camera-note { color: #fbbf24; }
.camera-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.camera-bar > :first-child { justify-self: start; }
.camera-bar > :last-child { justify-self: end; }
.camera-bar-2 { grid-template-columns: 1fr 1fr; }
.camera-bar-2 .btn { padding: 14px; text-align: center; }
.camera-shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: #e5e7eb; box-shadow: inset 0 0 0 4px #0f172a; cursor: pointer; }
.camera-shutter:disabled { opacity: .4; }
.camera-app { color: #cbd5e1; font-size: 13px; }
.camera-cancel { color: #fff; z-index: 2; }
/* a modal dialog is pinned top and bottom by the browser, so `auto` would stretch it: fit-content */
@media (min-width: 721px) { .camera-dialog { width: min(92vw, 640px); height: fit-content; max-height: 92vh; border-radius: var(--radius); } .camera-live, .camera-review { height: auto; } .camera-stage { aspect-ratio: 4 / 3; flex: none; } }

@media (max-width: 720px) {
  h1 { font-size: 24px; }
  .form-row { grid-template-columns: 1fr; }
  /* phone header: brand, then the breadcrumb on its own line, then the owner links */
  .header-row { gap: 8px 16px; }
  .site-nav { flex: 1 1 100%; order: 2; }
  .owner-nav { order: 3; }
  /* phone: 16px inputs stop iOS zooming on focus; big, full-width controls */
  .form-field input, .form-field select, .form-field textarea, #player-search { font-size: 16px; min-height: 44px; }
  .photo-preview-wrap { max-width: 200px; }
  .photo-preview-wrap.is-landscape { max-width: 280px; }
  .photo-btn { min-height: 56px; font-size: 16px; }
  .card-form fieldset { padding: 14px 14px 4px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { padding: 14px; width: 100%; text-align: center; }
  /* phone: everything on the field keeps shrinking with it; names live in the viewer */
  .field { --card-min: 18px; }
  .slot { gap: 1px; }
  .slot-main { padding: 2px 4px 3px; border-width: 1px; min-width: clamp(28px, 7cqw, 76px); font-size: clamp(7px, 1.45cqw, 13px); border-radius: 6px; }
  .slot-card .slot-main { padding: 2px; }
  .slot-card .slot-main img { border-radius: 3px; }
  .slot-card .slot-name { display: none; }
  .slot-more, .slot-cards { font-size: clamp(7px, 1.2cqw, 11px); padding: 0 4px; line-height: 1.5; }
  .roster-table th:nth-child(4), .roster-table td:nth-child(4), .roster-table th:nth-child(5), .roster-table td:nth-child(5) { display: none; }
}
