/* ============================================================
   Game Nizzle Thursdizzle - shared styles
   Mobile first; wider screens get more columns.
   Colors are variables so the whole site can be re-themed here.
   ============================================================ */

:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e2ddd3;
  --accent: #2456d6;        /* the old blue buttons */
  --accent-text: #ffffff;
  --accent-soft: #e6edff;
  --warm: #e8590c;          /* the old orange */
  --good: #2b8a3e;
  --alert: #c92a2a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2126;
    --surface-2: #252930;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --line: #30353d;
    --accent: #5b8cff;
    --accent-text: #0d1117;
    --accent-soft: #23314f;
    --warm: #ff8a3d;
    --good: #51cf66;
    --alert: #ff6b6b;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 14px; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 12px;
  padding-top: 10px; padding-bottom: 10px;
}
.logo img { width: 56px; height: 56px; border-radius: 12px; display: block; }
.site-title { flex: 1; min-width: 0; }
.site-title h1 { margin: 0; font-size: 1.15rem; line-height: 1.2; }
.site-title .sub { color: var(--muted); font-size: .85rem; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-photo img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; display: block; }

/* ---------- quote ---------- */
.quote {
  margin: 14px 0 4px;
  padding: 14px 16px;
  background: var(--surface);
  border-left: 4px solid var(--warm);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.quote q { font-style: italic; font-size: 1.05rem; }
.quote .who { color: var(--muted); white-space: nowrap; }
.quote .links { margin-top: 6px; font-size: .85rem; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- stats nav (scrolls sideways on phones) ---------- */
.pillbar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 0; margin: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pillbar::-webkit-scrollbar { display: none; }
.pillbar .label { color: var(--muted); font-size: .8rem; align-self: center; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  min-height: 36px;
}
.pill:hover { text-decoration: none; border-color: var(--accent); }
.pill.on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
  font-weight: 600;
}

/* ---------- filter panel ---------- */
.filters {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 10px 0;
}
.filters > summary {
  list-style: none; cursor: pointer;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary .now { font-weight: 400; color: var(--muted); font-size: .9rem; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters > summary .chev { transition: transform .2s; color: var(--muted); }
.filters[open] > summary .chev { transform: rotate(180deg); }
.filter-body { padding: 0 16px 14px; border-top: 1px solid var(--line); }
.fgroup { margin-top: 12px; }
.fgroup h3 { margin: 0 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fgroup .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.fgroup .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg a { padding: 8px 12px; color: var(--text); font-size: .9rem; border-right: 1px solid var(--line); background: var(--surface); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.seg a:hover { text-decoration: none; }

/* ---------- banners ---------- */
.banner {
  margin: 10px 0; padding: 12px 16px; border-radius: var(--radius);
  font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.banner.ngt { background: #fff0f0; color: var(--alert); border: 1px solid #ffc9c9; }
.banner.admin { background: var(--accent-soft); color: var(--text); border: 1px solid var(--line); font-weight: 400; }
@media (prefers-color-scheme: dark) { .banner.ngt { background: #3a1d1d; border-color: #5c2b2b; } }

/* ---------- result summary ---------- */
.summary { color: var(--muted); font-size: .9rem; margin: 6px 2px 10px; }
.summary b { color: var(--text); }

/* ---------- game cards ---------- */
.games {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 700px)  { .games { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .games { grid-template-columns: 1fr 1fr 1fr; } }

.game {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.game-top { display: flex; gap: 12px; }
.thumb {
  flex: 0 0 84px; width: 84px; height: 84px;
  border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.game-info { flex: 1; min-width: 0; }
.game-name { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.game-name a { color: var(--text); }
.owner { display: inline-block; font-size: .75rem; color: var(--muted); background: var(--surface-2);
  border-radius: 6px; padding: 1px 6px; margin-left: 2px; vertical-align: 2px; }
.meta { margin-top: 4px; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.meta span { white-space: nowrap; }
.publisher { color: var(--muted); font-size: .8rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the labelled numbers row */
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface-2); border-radius: 10px;
  text-align: center; padding: 6px 2px;
}
.stat .v { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.stat .k { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v small { font-weight: 400; color: var(--muted); font-size: .7rem; }

.last {
  font-size: .88rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.last .when { font-weight: 600; }
.last .win { color: var(--muted); }
.last .win b { color: var(--good); font-weight: 600; }
.never { font-size: .85rem; color: var(--warm); font-weight: 600; }

.game-actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--accent-text);
  font: 600 .9rem var(--font); cursor: pointer; min-height: 40px;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; min-height: 32px; font-size: .82rem; }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
  padding: 18px 0 30px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }
.bgg-credit img { height: 28px; vertical-align: middle; }

/* ---------- login page ---------- */
.login-card {
  max-width: 380px; margin: 40px auto; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.login-card h1 { margin: 0 0 4px; font-size: 1.3rem; }
.login-card p { color: var(--muted); margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
.field input[type=text], .field input[type=password] {
  width: 100%; padding: 11px 12px; font-size: 16px; /* 16px stops iPhone zooming */
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text);
}
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; font-size: .95rem; }
.error { background: #fff0f0; color: var(--alert); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: .9rem; }
.login-card .btn { width: 100%; font-size: 1rem; }

/* small phones: tighten */
@media (max-width: 380px) {
  .thumb { flex-basis: 68px; width: 68px; height: 68px; }
  .stat .k { font-size: .6rem; }
}

/* ===== table, toolbar and filter panel ===== */
/* ---------- table ---------- */
.tablewrap{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;margin-bottom:20px}
.gtable{width:100%;border-collapse:collapse;font-size:.9rem}
.gtable th{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);text-align:left;padding:8px 6px;border-bottom:1px solid var(--line);background:var(--surface-2);white-space:nowrap;user-select:none}
.gtable th[data-sort]{cursor:pointer}
.gtable th[data-sort]:hover{color:var(--text)}
.gtable th.on{color:var(--accent);font-weight:800}
.gtable th .arrow{display:inline-block;width:.8em}
.gtable td{padding:6px;border-bottom:1px solid var(--line);vertical-align:middle}
.gtable tbody tr:nth-child(even){background:var(--surface-2)}
.gtable tbody tr:hover{background:var(--accent-soft)}
.gtable .num{text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
.c-thumb{width:52px;padding-left:10px!important}
.c-thumb a{display:block;width:44px;height:44px;border-radius:6px;background:var(--line);overflow:hidden}
.c-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.gname{font-weight:700;color:var(--text);line-height:1.25}
.sub{font-size:.75rem;color:var(--muted);line-height:1.3}
.vote{font-weight:700} .vote small{font-weight:400;color:var(--muted);font-size:.7rem}
.c-last{white-space:nowrap;font-size:.82rem}
.c-act{padding-right:10px!important}
.dim{color:var(--muted)} .newtag{color:var(--warm);font-weight:600;font-size:.75rem}
.show-sm{display:none}
.owner{font-size:.72rem}
mark{background:#ffe066;color:inherit;border-radius:3px;padding:0 1px}
@media (max-width:700px){
 .hide-sm{display:none} .show-sm{display:block}
 .gtable{font-size:.82rem} .gtable td{padding:6px 4px} .gtable th{padding:7px 4px}
 .c-thumb{width:44px;padding-left:6px!important} .c-thumb a{width:38px;height:38px}
 .vote small{display:none}
}

/* ---------- toolbar ---------- */
.toolbar{
  position:sticky;top:0;z-index:20;
  background:var(--bg);
  padding:8px 0 6px;margin:6px 0 4px;
}
.toolbar.stuck{box-shadow:0 6px 10px -8px rgba(0,0,0,.25)}
.tb-row{display:flex;gap:8px;align-items:center}
.search{flex:1;position:relative;min-width:0}
.search input{
  width:100%;font-size:16px;padding:9px 34px 9px 36px;border-radius:12px;
  border:1px solid var(--line);background:var(--surface);color:var(--text);
}
.search .icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.search .x{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:0;background:none;color:var(--muted);font-size:1.1rem;cursor:pointer;display:none;padding:4px 6px}
.search.has .x{display:block}

.iconbtn{
  display:inline-flex;align-items:center;gap:6px;white-space:nowrap;
  border:1px solid var(--line);background:var(--surface);color:var(--text);
  border-radius:12px;padding:9px 12px;font:600 .9rem var(--font);cursor:pointer;min-height:40px;
}
.iconbtn .badge{background:var(--accent);color:var(--accent-text);border-radius:999px;font-size:.72rem;padding:1px 7px}
.iconbtn[aria-expanded=true]{border-color:var(--accent);color:var(--accent)}

.players{display:flex;gap:5px;align-items:center;margin-top:8px;overflow-x:auto;scrollbar-width:none}
.players::-webkit-scrollbar{display:none}
.players .label{font-size:.75rem;color:var(--muted);white-space:nowrap;margin-right:2px}
.chip{
  flex:1 0 auto;min-width:32px;height:36px;padding:0 6px;border-radius:999px;
  border:1px solid var(--line);background:var(--surface);color:var(--text);
  font:600 .9rem var(--font);cursor:pointer;
}
.chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}
select.mini{
  flex:0 0 auto;height:36px;border-radius:999px;border:1px solid var(--line);background:var(--surface);
  color:var(--text);font:.85rem var(--font);padding:0 10px;
}

.sortrow{display:flex;gap:6px;align-items:center;margin-top:8px}
.sortrow .label{font-size:.75rem;color:var(--muted)}
.sortrow select{flex:0 1 auto;height:36px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--text);font:600 .9rem var(--font);padding:0 8px}
.dirbtn{height:36px;width:40px;border-radius:10px;border:1px solid var(--line);background:var(--surface);color:var(--text);font-size:1rem;cursor:pointer}
.count{margin-left:auto;font-size:.85rem;color:var(--muted);white-space:nowrap}
.count b{color:var(--text)}

.active{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.active:empty{display:none}
.tag{display:inline-flex;align-items:center;gap:6px;background:var(--accent-soft);color:var(--text);border-radius:999px;padding:4px 6px 4px 11px;font-size:.82rem}
.tag button{border:0;background:none;color:var(--muted);cursor:pointer;font-size:.95rem;line-height:1;padding:2px 4px}
.tag.clear{background:none;padding-left:4px}
.tag.clear button{color:var(--accent);font-size:.82rem;font-weight:600}

/* filter panel: a sheet from the bottom on phones, a dropdown card on wide screens */
.panel-back{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:40;display:none}
.panel{
  position:fixed;left:0;right:0;bottom:0;z-index:41;
  background:var(--surface);border-radius:18px 18px 0 0;
  max-height:80vh;overflow:auto;padding:8px 18px 18px;
  transform:translateY(100%);transition:transform .22s ease;
}
.panel.open{transform:none}
.panel-back.open{display:block}
.panel .grab{width:40px;height:5px;border-radius:3px;background:var(--line);margin:4px auto 10px}
.panel h2{font-size:1.05rem;margin:0 0 4px;display:flex;align-items:center}
.panel h2 button{margin-left:auto}
.pgroup{margin-top:14px}
.pgroup h3{margin:0 0 6px;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.pgroup .hint{font-size:.78rem;color:var(--muted);margin-top:5px}
.seg button{padding:8px 12px;color:var(--text);font:.9rem var(--font);border:0;border-right:1px solid var(--line);background:var(--surface);cursor:pointer}
.seg button:last-child{border-right:0}
.seg button.on{background:var(--accent);color:var(--accent-text);font-weight:600}
.panel .done{width:100%;margin-top:18px;font-size:1rem}
@media (min-width:800px){
  .chip{flex:0 0 auto;min-width:40px;padding:0 12px}
  .panel{left:auto;right:max(14px,calc((100vw - 1200px)/2 + 14px));bottom:auto;top:120px;width:420px;border-radius:var(--radius);box-shadow:0 10px 40px rgba(0,0,0,.2);transform:none;display:none}
  .panel.open{display:block}
  .panel .grab{display:none}
}


/* ---------- additions for the live page ---------- */
.sortrow .viewtoggle{margin-left:auto}
.viewtoggle button{padding:7px 11px;font-size:.85rem}
.tb-foot{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:8px}
.tb-foot .count{margin-left:0}
.tb-foot .active{margin-top:0}
button.owner{border:0;cursor:pointer;font:inherit;font-size:.72rem;color:var(--muted);background:var(--surface-2);border-radius:6px;padding:1px 6px;margin-left:2px;vertical-align:1px}
button.owner:hover{color:var(--accent)}
button.pill{font:inherit;font-size:.9rem;cursor:pointer}
.pgroup .opts{display:flex;flex-wrap:wrap;gap:6px}
.gtable .sub a{color:inherit;text-decoration:underline}

/* ---------- login page ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; background: radial-gradient(circle at 50% 0%, var(--accent-soft), var(--bg) 60%); }
.login-page .wrap { width: 100%; }
.login-card { text-align: left; margin: 24px auto 10px; padding: 28px 24px; }
.login-logo { display: block; width: 88px; margin: -4px auto 12px; }
.login-logo img { width: 88px; height: 88px; border-radius: 20px; display: block; box-shadow: var(--shadow); }
.login-card h1 { text-align: center; font-size: 1.4rem; }
.login-card > p { text-align: center; }
.pw { position: relative; }
.pw input { padding-right: 64px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--accent); font: 600 .85rem var(--font); cursor: pointer; padding: 6px 8px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.login-back { text-align: center; font-size: .9rem; margin: 0 0 30px; }
@media (prefers-color-scheme: dark) { .error { background: #3a1d1d; } }

/* ===== play history ===== */
.ph-summary { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.ph-summary:empty { display: none; }
.lead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; }
.lead .k { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; min-width: 82px; }
.month { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 4px 8px; }
.month span { font-weight: 400; text-transform: none; letter-spacing: 0; }
.plays { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 8px; }
.play { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); position: relative; }
.play:last-child { border-bottom: 0; }
.pthumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; background: var(--line); overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pmain { flex: 1; min-width: 0; }
.ptop { line-height: 1.25; padding-right: 30px; }
.pname { border: 0; background: none; padding: 0; font: 700 1rem var(--font); color: var(--text); cursor: pointer; text-align: left; }
.pname:hover { color: var(--accent); }
.pexp { font-size: .82rem; color: var(--muted); }
.pmeta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.results { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.r { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px;
  padding: 3px 9px; font: .82rem var(--font); cursor: pointer; white-space: nowrap; }
.r b { font-weight: 700; }
.r:hover { border-color: var(--accent); }
.r.win { background: #e6f6ea; border-color: #b7e2c1; color: #1e6b31; font-weight: 600; }
.r.dfl em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--alert); margin-left: 2px; }
.r .ico { margin-right: 3px; }
.pcomment { font-size: .82rem; color: var(--muted); font-style: italic; margin-top: 6px; }
.pdel { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--alert); cursor: pointer; font-size: .85rem; }
.pdel:hover { background: #fff0f0; border-color: #ffc9c9; }
.ph-select { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 16px var(--font); padding: 0 10px; }
.site-title .sub a { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .r.win { background: #1d3b25; border-color: #2c5a37; color: #8ce99a; }
  .pdel:hover { background: #3a1d1d; border-color: #5c2b2b; }
}
@media (min-width: 900px) { .lead { font-size: .9rem; } }
.ph-note { font-size: .8rem; color: var(--muted); font-style: italic; }

/* ===== add a play ===== */
.ap { padding-bottom: 120px; }
.ap-error { margin-top: 14px; }
.ap-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin: 12px 0; }
.ap-card h2 { margin: 0; font-size: 1.05rem; }
.ap-game { display: flex; gap: 14px; align-items: center; }
.pthumb.big { flex-basis: 72px; width: 72px; height: 72px; }
.ap-gameinfo h2 { font-size: 1.15rem; line-height: 1.25; }
.ap-change { font-size: .85rem; }
.ap-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap .field { margin-bottom: 12px; }
.ap .field:last-child { margin-bottom: 0; }
.ap .field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .88rem; }
.ap input[type=text], .ap input[type=number], .ap input[type=date], .ap input[type=search] {
  width: 100%; padding: 10px 11px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font-family: var(--font); }
.ap input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.ap .seg button { padding: 9px 12px; }
.ap-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.ap-opts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 6px; }
.ap-opts .check { margin: 0; font-size: .92rem; }
.ap .hint { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.pdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); vertical-align: 0; }
.ap-playing { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.ap-person { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name badge" "score score"; gap: 6px 8px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
@media (min-width: 560px) { .ap-person { grid-template-columns: 1fr auto 230px; grid-template-areas: "name badge score"; } }
.ap-name { grid-area: name; border: 0; background: none; padding: 4px 0; font: 600 1rem var(--font); color: var(--text); text-align: left; cursor: pointer; }
.ap-name .x { color: var(--muted); font-size: .75rem; margin-left: 4px; }
.ap-badge { grid-area: badge; font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ap-badge.win { color: var(--good); }
.ap-badge.dfl { color: var(--alert); }
.ap-score { grid-area: score; display: flex; gap: 6px; align-items: center; }
.ap-score input { flex: 1; min-width: 0; font-size: 18px !important; font-weight: 700; text-align: center; }
.ap-sign { width: 40px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.ap-spill { width: 44px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; filter: grayscale(1); opacity: .55; }
.ap-spill.on { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.ap-spill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap-bench { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-add { border: 1px dashed var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 13px; font: .92rem var(--font); cursor: pointer; }
.ap-add:hover { border-color: var(--accent); border-style: solid; }
.ap-save { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(0,0,0,.08); }
.ap-save .btn { width: 100%; max-width: 1172px; display: flex; margin: 0 auto; font-size: 1.05rem; min-height: 48px; }
.ap-result { max-width: 1172px; margin: 0 auto 8px; font-size: .9rem; min-height: 1.2em; }
.ap-result .err { color: var(--alert); }
.ap-find { display: block; margin: 16px 0 10px; }
.ap .ap-find input { padding-left: 36px; }
.ap-gamelist { display: flex; flex-direction: column; gap: 6px; }
.ap-pick { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow); color: var(--text); font-weight: 600; }
.ap-pick:hover { text-decoration: none; outline: 2px solid var(--accent); }
.ap-pick .pthumb { flex-basis: 44px; width: 44px; height: 44px; }
.banner.saved { background: #e6f6ea; color: #1e6b31; border: 1px solid #b7e2c1; }
.play.just-saved { background: #f1fbf3; box-shadow: inset 4px 0 0 var(--good); }
@media (prefers-color-scheme: dark) {
  .banner.saved { background: #1d3b25; color: #8ce99a; border-color: #2c5a37; }
  .play.just-saved { background: #1c2b20; }
}

/* ===== win % ===== */
.wp-opts { flex-wrap: wrap; justify-content: space-between; }
.wp-opts .check { margin: 0; font-size: .9rem; }
.wp-opts .seg a { padding: 6px 10px; font-size: .82rem; }
.wp-head { margin: 8px 0 12px; }
.wp-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wp-title h2 { margin: 0; font-size: 1.5rem; }
.wp-title span { color: var(--muted); font-size: .9rem; }
.wp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wp-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; border-top: 4px solid var(--line); }
.wp-card.win { border-top-color: var(--good); }
.wp-card.dfl { border-top-color: var(--alert); }
.wp-card .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.wp-card .v { font-size: 1.2rem; font-weight: 800; margin-top: 2px; }
.wp-card .s { font-size: .82rem; color: var(--muted); }
.wp-table td { padding: 9px 6px; }
.wp-name { font-weight: 600; white-space: nowrap; }
.wp-under { font-size: .68rem; font-weight: 600; color: var(--warm); text-transform: uppercase; letter-spacing: .03em; margin-left: 4px; }
.wp-table tr.under td { color: var(--muted); }
.wp-table tr.under .wp-name { font-weight: 400; }
.wp-table a { color: inherit; }
.wp-pct { position: relative; font-weight: 700; min-width: 70px; }
.wp-pct small { display: none; font-weight: 400; color: var(--muted); font-size: .7rem; }
.wp-pct .bar { display: block; height: 4px; border-radius: 2px; margin: 3px auto 0; max-width: 60px; opacity: .8; }
.bar.win { background: var(--good); }
.bar.dfl { background: var(--alert); }
.wp-foot { font-size: .8rem; color: var(--muted); margin: 0 4px 24px; }
@media (max-width: 700px) { .wp-pct small.show-sm { display: block; } .wp-table td { padding: 8px 4px; } }

/* ===== stats charts ===== */
.st-views .chip { flex: 0 0 auto; padding: 0 13px; }
.st-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 8px 2px 10px; }
.st-head h2 { margin: 0; font-size: 1.35rem; }
.st-head span { color: var(--muted); font-size: .9rem; }
.st-chart { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 8px; }
.st-chart .empty { padding: 26px 6px; }
.st-bars { display: flex; flex-direction: column; gap: 6px; }
.st-row { display: grid; grid-template-columns: 112px 1fr 42px; gap: 10px; align-items: center; color: var(--text); padding: 3px 0; }
a.st-row:hover { text-decoration: none; }
a.st-row:hover .st-name { color: var(--accent); }
.st-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-track { display: block; height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; position: relative; }
.st-bar { display: block; height: 100%; border-radius: 6px; min-width: 3px; }
.st-bar.play { background: var(--accent); }
.st-bar.win { background: var(--good); }
.st-bar.dfl { background: var(--alert); }
.st-bar.spill { background: #1c7ed6; }
.st-val { font-weight: 700; font-size: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.st-track.stack { display: flex; }
.st-seg { display: flex; align-items: center; justify-content: center; height: 100%; color: #fff; font-size: .7rem; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.st-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.st-key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.st-key.win { background: var(--good); } .st-key.dfl { background: var(--alert); } .st-key.spill { background: #1c7ed6; }
.st-ratios { display: flex; flex-direction: column; gap: 12px; }
.st-ratio { display: grid; grid-template-columns: 112px 1fr; gap: 3px 10px; align-items: center; }
.st-ratio .st-name { grid-row: span 3; align-self: start; padding-top: 2px; }
.st-ratio .st-of { display: none; }
.st-mini { display: grid; grid-template-columns: 1fr 42px; gap: 8px; align-items: center; color: var(--text); }
.st-mini .st-track { height: 11px; }
.st-mini .st-val { font-size: .78rem; }
.st-mini:hover { text-decoration: none; }
@media (max-width: 420px) { .st-row, .st-ratio { grid-template-columns: 86px 1fr 38px; } .st-ratio { grid-template-columns: 86px 1fr; } }

/* ===== quotes ===== */
.q-add { margin-top: 14px; }
.q-add summary { cursor: pointer; padding: 2px 0; }
.q-add[open] summary { margin-bottom: 12px; }
.q-sort { height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 .9rem var(--font); padding: 0 8px; }
#who .chip small { font-weight: 400; opacity: .7; }
.q-count { margin: 4px 4px 10px; font-size: .9rem; color: var(--muted); }
.q-count b { color: var(--text); }
.q-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px; }
@media (min-width: 760px) { .q-list { grid-template-columns: 1fr 1fr; } }
.q-card { position: relative; margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 44px 12px 16px; border-left: 4px solid var(--warm); }
.q-card blockquote { margin: 0 0 8px; font-size: 1.05rem; font-style: italic; line-height: 1.4; }
.q-card figcaption { font-size: .85rem; }

/* ===== pizza ===== */
.pz-music { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.1rem; cursor: pointer; opacity: .6; }
.pz-music.on { opacity: 1; border-color: var(--warm); box-shadow: 0 0 0 3px rgba(232,89,12,.2); }
.pz-hero { margin-top: 14px; }
.pz-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pz-admin { display: grid; gap: 0 12px; }
@media (min-width: 760px) { .pz-admin { grid-template-columns: 1fr 1fr; align-items: start; } }
.pz-admin summary { cursor: pointer; }
.pz-admin details[open] summary { margin-bottom: 12px; }
.pz-unrated { margin: 8px 2px 0; font-size: .9rem; }
.pz-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 24px; }
.pz-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.pz-card.just-saved { box-shadow: inset 4px 0 0 var(--good), var(--shadow); }
.pz-top { display: flex; align-items: center; gap: 12px; }
.pz-info { flex: 1; min-width: 0; }
.pz-info h2 { margin: 0; font-size: 1.02rem; line-height: 1.25; }
.pz-info h2 a { color: var(--text); }
.pz-score { flex: 0 0 54px; height: 54px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800; line-height: 1; }
.pz-score small { font-size: .62rem; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.pz-score.good { background: #e6f6ea; color: #1e6b31; }
.pz-score.ok { background: #fff4e0; color: #9c5700; }
.pz-score.bad { background: #fff0f0; color: var(--alert); }
.pz-reviews { list-style: none; margin: 10px 0 0 66px; padding: 0; font-size: .88rem; }
.pz-reviews li { padding: 5px 0; border-top: 1px solid var(--line); }
.pz-del { border: 0; background: none; color: var(--alert); cursor: pointer; font-size: .8rem; }
@media (prefers-color-scheme: dark) {
  .pz-score.good { background: #1d3b25; color: #8ce99a; } .pz-score.ok { background: #3b2e14; color: #ffc078; } .pz-score.bad { background: #3a1d1d; }
}
@media (max-width: 480px) { .pz-reviews { margin-left: 0; } .pz-top .btn.small { padding: 6px 8px; } }

/* ===== shelves ===== */
.sh-banner { margin: 14px 0 6px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-height: 220px; }
.sh-banner img { width: 100%; height: 220px; object-fit: cover; display: block; }
@media (max-width: 600px) { .sh-banner, .sh-banner img { height: 130px; max-height: 130px; } }
.sh-maps { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin: 10px 0 4px; }
.sh-map { flex: 1 1 520px; display: grid; gap: 4px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.sh-map:nth-child(2) { flex: 0 1 160px; }
.sh-cell { min-height: 40px; display: flex; align-items: center; justify-content: center; font-size: .78rem; }
.sh-colhead { flex-direction: column; font-weight: 700; color: var(--muted); min-height: 30px; line-height: 1.05; }
.sh-colhead small { font-weight: 400; font-size: .65rem; }
.sh-rowhead { color: var(--muted); font-weight: 700; }
.sh-cube { position: relative; flex-direction: column; border: 1px solid var(--line); background: var(--surface-2); border-radius: 7px; cursor: pointer; color: var(--text); padding: 2px 0; font-family: var(--font); }
.sh-cube .code { font-size: .58rem; color: var(--muted); }
.sh-cube b { font-size: .95rem; line-height: 1; min-height: 1em; }
.sh-cube.empty { opacity: .55; }
.sh-cube:hover { border-color: var(--accent); }
.sh-cube.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.sh-cube.sel .code { color: var(--accent-text); opacity: .8; }
.sh-cube.hit { background: #fff3bf; border-color: #fab005; box-shadow: 0 0 0 2px #fab005; opacity: 1; }
.sh-cube.incart { border-color: var(--warm); }
.sh-cube .cartdot { position: absolute; top: -7px; right: -5px; background: var(--warm); color: #fff; border-radius: 999px; font-size: .58rem; padding: 0 4px; line-height: 1.5; }
@media (prefers-color-scheme: dark) { .sh-cube.hit { background: #3b3214; } }
.sh-note { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; font-size: .92rem; margin-bottom: 24px; }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.sh-title { font-size: 1.05rem; margin: 6px 2px 8px; }
.sh-games { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.sh-game { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.sh-game:last-child { border-bottom: 0; }
.sh-game .pthumb { flex-basis: 44px; width: 44px; height: 44px; }
.sh-gname { font-weight: 600; line-height: 1.25; }
.sh-badge { flex: 0 0 auto; min-width: 42px; text-align: center; font-weight: 800; font-size: .85rem; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 6px 6px; }
.sh-badge.none { background: var(--surface-2); color: var(--muted); }
.sh-set { flex: 0 0 auto; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 .85rem var(--font); padding: 0 4px; }
.sh-cartbtn { flex: 0 0 auto; width: 38px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; filter: grayscale(1); opacity: .5; }
.sh-cartbtn.on { filter: none; opacity: 1; border-color: var(--warm); background: #fff4e6; }
.sh-cart h2 { font-size: 1.05rem; }
.sh-pull { display: flex; flex-direction: column; }
.sh-pullrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.sh-pullrow input { width: 20px; height: 20px; }
.sh-pullrow span:nth-of-type(2) { flex: 1; }
.sh-pullrow.done span:nth-of-type(2) { text-decoration: line-through; color: var(--muted); }
.sh-game.pulled .sh-gname { text-decoration: line-through; color: var(--muted); }

/* ===== player pages ===== */
.pl-head { display: flex; align-items: center; gap: 10px; margin: 10px 2px 12px; flex-wrap: wrap; }
.pl-head h2 { margin: 0; font-size: 1.6rem; }
.pl-head span:last-child { color: var(--muted); }
.pl-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.pl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pl-cards .v { font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
a.wp-card { color: var(--text); }
a.wp-card:hover { text-decoration: none; outline: 2px solid var(--accent); }
.pl-sub { font-size: 1rem; margin: 18px 2px 8px; }
.pl-years { max-width: 520px; }
#who .chip { display: inline-flex; align-items: center; }
.pl-favs { list-style: none; counter-reset: fav; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pl-favs li { counter-increment: fav; display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 10px; font-weight: 600; }
.pl-favs li::before { content: counter(fav); color: var(--muted); font-weight: 800; width: 1.2em; text-align: center; }
.pl-favs .pthumb { flex-basis: 40px; width: 40px; height: 40px; }

/* ===== photos ===== */
.ph-h { font-size: 1.05rem; margin: 22px 2px 10px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ph-grid.fame { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ph-grid.wide { grid-template-columns: 1fr; max-width: 520px; }
.ph-grid figure { margin: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ph-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; background: var(--surface-2); }
.ph-grid.fame img { aspect-ratio: 3 / 4; }
.ph-grid.wide img { aspect-ratio: auto; }
.ph-grid figcaption { padding: 8px 10px; font-size: .85rem; }
.ph-grid figure:not(.dfl) b { color: var(--good); }
.ph-grid figure.dfl b { color: var(--alert); }
.ph { padding-bottom: 24px; }
.ph-viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.ph-viewer::backdrop { background: rgba(0,0,0,.85); }
.ph-viewer img { max-width: 96vw; max-height: 86vh; display: block; margin: 0 auto; border-radius: 8px; }
.ph-viewer p { color: #fff; text-align: center; margin: 8px 0 0; }
.ph-close { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 1.1rem; cursor: pointer; }

/* ===== members ===== */
.mb { padding-bottom: 30px; }
.mb-intro { color: var(--muted); font-size: .9rem; margin: 14px 2px 4px; }
.mb summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mb-seen { margin-left: auto; font-size: .8rem; }
.mb-tag { font-size: .7rem; font-weight: 700; border-radius: 6px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .03em; }
.mb-tag.admin { background: var(--accent-soft); color: var(--accent); }
.mb-tag.off { background: #fff0f0; color: var(--alert); }
.mb-user.off { opacity: .7; }
.mb-groups { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.mb-groups .check, .mb .check { margin: 4px 0; }
.mb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mb select.ph-select { height: 42px; }
.mb-tag.wait { background: #fff4e0; color: #9c5700; }
.mb-invite { border-top: 4px solid var(--accent); }
.mb-invite h2 { margin: 0 0 4px; font-size: 1.1rem; }
.mb-invite textarea { width: 100%; padding: 10px 11px; font: 16px/1.4 var(--font); border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); resize: vertical; }
.mb-invite .btn { flex: 1 1 140px; }
.mb-delete { margin: 14px 0 0; text-align: right; }
.linkbtn.danger { color: #c0392b; }
.pedit { position: absolute; top: 44px; right: 8px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: .9rem; }
.pedit:hover { border-color: var(--accent); }
.play:has(.pedit) .pmain { padding-right: 34px; }
.play:has(.pedit) { min-height: 86px; }
