/* Basecon, Con Badge style. Light blue-grey ground, white badge cards, cobalt for actions.
   Big Shoulders Display for con names and dates, Figtree for everything else. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/assets/fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ground: #E9EEF6;
  --panel: #FFFFFF;
  --ink: #16203A;
  --ink-2: #3A4562;
  --muted: #5B6683;
  --line: #CBD3E1;
  --line-2: #EDF0F6;
  --pick: #2B4BF2;
  --pick-2: #2445D6;
  --tint: #EEF1FE;
  --tag: #FFD43B;
  --ok-bg: #DDF3EE;
  --ok-ink: #0B6A5D;
  --soon-bg: #FFF4C7;
  --soon-ink: #6B5200;
  --err-bg: #FDE8E8;
  --err-ink: #9B1C1C;
  --rpg: #7B3FE4;
  --board: #0E8C7B;
  --card: #E5484D;
  --minis: #E59A00;
  --mix: #9AA6BF;
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabs-h: 58px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.45 var(--body);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 16px);
}
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--pick); }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 3px solid var(--pick); outline-offset: 2px; }
button { font: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--panel); color: var(--ink); font-weight: 700; }
.skip:focus { top: 8px; }
.icon { flex: none; }

/* ---------- colors for game types ---------- */
.c-rpg { background: var(--rpg); }
.c-board { background: var(--board); }
.c-card { background: var(--card); }
.c-minis { background: var(--minis); }
.c-mix { background: var(--mix); }
.c-border-rpg { border-left-color: var(--rpg) !important; }
.c-border-board { border-left-color: var(--board) !important; }
.c-border-card { border-left-color: var(--card) !important; }
.c-border-minis { border-left-color: var(--minis) !important; }
.c-border-mix { border-left-color: var(--mix) !important; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---------- header and navigation ---------- */
.site-header { display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter); max-width: 1080px; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo-word { font: 800 28px/1 var(--display); }
.header-help { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--pick); font-weight: 700; font-size: 14px; text-decoration: none; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--panel); box-shadow: 0 -1px 0 var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabs-h); border-top: 3px solid transparent;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
}
.tab.is-active { color: var(--pick); font-weight: 700; border-top-color: var(--pick); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 4px var(--gutter) 28px; }

.site-footer { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter) 24px; color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); font-weight: 600; }
.site-footer p { margin: 0; max-width: 60ch; }

/* ---------- type ---------- */
.hero-title { font: 800 34px/0.95 var(--display); margin: 0; text-wrap: balance; }
.hero-guide { margin: 6px 0 0; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--pick); }
.hero-sub { margin: 2px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); max-width: 52ch; }
.page-title { font: 800 clamp(38px, 12.5vw, 48px)/0.95 var(--display); margin: 8px 0 0; overflow-wrap: break-word; text-wrap: balance; }
.page-sub { margin: 4px 0 14px; color: var(--ink-2); font-size: 15px; max-width: 60ch; }
.section-title { font: 800 28px/1 var(--display); margin: 0 0 10px; }
.section-title-sm { font-size: 26px; }
.count { font: 800 26px/1 var(--display); margin: 14px 0 10px; }
.fine { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.empty { color: var(--ink-2); }
.more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 8px 0 0; }
.subtle { color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px;
  border: 0; background: none; color: var(--pick); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.prose { max-width: 640px; }
.prose h2 { font: 800 26px/1 var(--display); margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose pre { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); overflow-x: auto; color: var(--ink); font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prose code { font: 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.card { max-width: 560px; padding: 16px; border-radius: 18px; background: var(--panel); box-shadow: 0 1px 0 var(--line); }
.empty-card { padding: 18px; border-radius: 16px; background: var(--panel); box-shadow: 0 1px 0 var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.empty-card p { margin: 0; }
.empty-card .btn { margin-top: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: 14px; border: 1.5px solid transparent;
  font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--pick); color: #fff; }
.btn-primary:hover { background: var(--pick-2); }
.btn-outline { background: var(--panel); color: var(--ink); border-color: var(--ink); }
.btn-outline[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn-grow { flex: 1 1 auto; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; }

/* ---------- search ---------- */
.searchbox { margin-top: 16px; }
.searchbox-field {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px;
  border-radius: 14px; background: var(--panel); color: var(--muted); box-shadow: 0 1px 0 var(--line);
}
.searchbox-field:focus-within { box-shadow: 0 0 0 2px var(--pick); }
.searchbox-field input {
  flex: 1 1 auto; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit;
}
.searchbox-field input::placeholder { color: var(--muted); opacity: 1; }
.where { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.where .icon { color: var(--pick); }

.filters { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-weight: 700; font-size: 14px; }
.field-inline { max-width: 320px; }
.input {
  width: 100%; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--ink); font: inherit;
}
.input-area { padding: 10px 12px; resize: vertical; }
.form { display: flex; flex-direction: column; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip-face, .chip-link, .chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.chip-input:checked + .chip-face, .chip-link.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-input:focus-visible + .chip-face { outline: 3px solid var(--pick); outline-offset: 2px; }
.chips-scroll { margin-top: 12px; }

/* ---------- list rows ---------- */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: stretch; gap: 12px; overflow: hidden;
  border-radius: 16px; background: var(--panel); color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 0 var(--line);
}
.row:hover { box-shadow: 0 1px 0 var(--line), 0 8px 18px -12px rgba(22, 32, 58, 0.5); }
.row-bar { flex: 0 0 6px; }
.row-date { flex: 0 0 52px; padding: 10px 0; text-align: center; }
.row-mon { display: block; font: 800 24px/1 var(--display); white-space: nowrap; }
.row-mon.is-long { font-size: 16px; padding-top: 4px; }
.row-day { display: block; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.row-year { display: block; font-size: 11px; color: var(--muted); }
.row-main { flex: 1 1 auto; min-width: 0; padding: 10px 12px 10px 0; }
.row-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.25; }
.row-place { display: block; font-size: 13px; color: var(--muted); }
.row-dist { flex: 0 0 auto; padding: 12px 12px 0 0; font-size: 14px; font-weight: 700; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.pill-verified { background: var(--ok-bg); color: var(--ok-ink); }
.pill-expected { background: var(--soon-bg); color: var(--soon-ink); }
.row .pill { margin-top: 4px; padding: 1px 8px; font-size: 12px; }

.cta {
  display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding: 14px;
  border: 1.5px dashed var(--pick); border-radius: 16px; background: var(--panel);
}
.cta-text { margin: 0; font-weight: 700; line-height: 1.3; }
.cta .btn { align-self: flex-start; min-height: 44px; padding: 0 16px; border-radius: 12px; }

.month { scroll-margin-top: 16px; margin-top: 22px; }
.state-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.state {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 14px;
  border-radius: 14px; background: var(--panel); color: var(--ink); font-weight: 700; text-decoration: none; box-shadow: 0 1px 0 var(--line);
}
.state-n { font: 800 20px/1 var(--display); }
.state-empty { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 600; }

/* ---------- the badge ---------- */
.lanyard-wrap { position: relative; padding-top: 48px; margin-top: 24px; }
.lanyard { position: absolute; left: 50%; top: 0; width: min(358px, 100%); height: auto; transform: translateX(-50%); }
.badge {
  position: relative; padding: 28px 18px 18px; border-radius: 22px; background: var(--panel);
  box-shadow: 0 1px 0 var(--line), 0 16px 30px -20px rgba(22, 32, 58, 0.5);
}
.badge-slot {
  position: absolute; left: 50%; top: 11px; transform: translateX(-50%); width: 56px; height: 10px; border-radius: 5px;
  background: var(--ground); box-shadow: inset 0 1px 2px rgba(22, 32, 58, 0.25);
}
.strip { display: flex; height: 7px; margin-bottom: 14px; border-radius: 4px; overflow: hidden; }
.strip span { flex: 1; }
.badge-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tag {
  display: inline-block; transform: rotate(-3deg); padding: 4px 10px; border-radius: 6px;
  background: var(--tag); color: var(--ink); font-size: 14px; font-weight: 800;
}
.badge-link { display: block; color: var(--ink); text-decoration: none; }
.badge-name { margin: 0; font: 800 clamp(38px, 13vw, 50px)/0.92 var(--display); overflow-wrap: break-word; }
.badge-date { margin-top: 6px; font: 700 30px/1.1 var(--display); color: var(--pick); }
.badge-place { margin-top: 6px; font-size: 15px; }
.badge-dist { font-size: 14px; color: var(--muted); }
.badge-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.badge-actions { display: flex; gap: 8px; margin-top: 16px; }
.badge-actions .btn-outline { padding: 0 18px; }

/* ---------- a con's own page ---------- */
.con { position: relative; }
.back {
  position: absolute; left: 0; top: 12px; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--panel); color: var(--ink);
}
.con-band {
  height: 150px; margin: 0 calc(var(--gutter) * -1); background: var(--ink);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 14px, transparent 14px 28px);
}
.con-badge { position: relative; margin-top: -100px; }
.con-badge .lanyard-wrap { margin-top: 0; }
.con-info { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.con-about { margin: 0; color: var(--ink-2); max-width: 60ch; }
.source { margin: 0; font-size: 13px; color: var(--muted); }
.info-card { overflow: hidden; border-radius: 18px; background: var(--panel); box-shadow: 0 1px 0 var(--line); }
.info { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.info:last-child { border-bottom: 0; }
.info:target { background: var(--tint); }
.info-icon { flex: 0 0 40px; display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px; background: var(--tint); color: var(--pick); }
.info-main { flex: 1 1 auto; min-width: 0; }
.info-title { font-weight: 700; }
.info-text { font-size: 14px; color: var(--muted); }
.info-action { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--pick); font-size: 15px; font-weight: 700; text-decoration: none; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.game { padding: 10px 12px; border-left: 6px solid var(--mix); border-radius: 14px; background: var(--panel); font-weight: 700; }
.game-wide { grid-column: 1 / -1; font-weight: 600; }
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--panel); box-shadow: 0 -1px 0 var(--line);
}

/* ---------- sheets ---------- */
.sheet {
  width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; padding: 8px 16px 20px; overflow: auto;
  border: 0; border-radius: 24px 24px 0 0; background: var(--panel); color: var(--ink);
}
.sheet[open] { display: flex; flex-direction: column; gap: 12px; }
.sheet::backdrop { background: rgba(22, 32, 58, 0.5); }
.sheet-grip { flex: none; width: 40px; height: 5px; margin: 0 auto; border-radius: 3px; background: var(--line); }
.sheet-title { margin: 4px 0 0; font: 800 34px/1 var(--display); overflow-wrap: break-word; }
.sheet-text { margin: 0; color: var(--ink-2); }
.sheet-close { align-self: center; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in 0.18s ease-out; }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
}

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.seg-item { position: relative; display: flex; }
.seg-item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-item span {
  display: flex; flex: 1; align-items: center; justify-content: center; min-height: 54px; padding: 0 8px; text-align: center;
  border: 1.5px solid var(--ink); border-radius: 14px; background: var(--panel); font-weight: 700;
}
.seg-item input:checked + span { background: var(--pick); border-color: var(--pick); color: #fff; }
.seg-item input:focus-visible + span { outline: 3px solid var(--pick); outline-offset: 2px; }

.notice { margin: 0; padding: 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.notice-error { background: var(--err-bg); color: var(--err-ink); }

.share-preview { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--ground); }
.mini-badge { flex: 0 0 104px; height: 62px; padding: 7px 8px; overflow: hidden; border-radius: 10px; background: var(--panel); }
.mini-badge .strip { height: 4px; margin-bottom: 4px; border-radius: 2px; }
.mini-name { display: block; font: 800 15px/0.95 var(--display); }
.mini-date { display: block; font: 700 12px/1.2 var(--display); color: var(--pick); }
.share-preview-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.share-preview-text strong { font-size: 15px; color: var(--ink); }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tile-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px;
  border: 0; border-radius: 14px; background: #F1F4F9; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.tile-btn .icon { color: var(--pick); }
.share-detail-title { margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.chip-btn { font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 700; text-align: center;
}

/* ---------- phone: con page shows its own top and a share bar ---------- */
@media (max-width: 899px) {
  .chips-scroll { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .chips-scroll::-webkit-scrollbar { display: none; }
  .home { display: flex; flex-direction: column; gap: 24px; }
  .home-list { display: flex; flex-direction: column; gap: 24px; }
  .page-con { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .page-con .site-header, .page-con .tabs { display: none; }
  .page-con .wrap { padding-top: 0; }
  .page-con .badge-actions { display: none; }
}

/* ---------- computer ---------- */
@media (min-width: 900px) {
  :root { --gutter: 32px; }
  body { padding-bottom: 0; }
  .site-header { padding-block: 16px; gap: 16px; }
  .logo { margin-right: 16px; }
  .tabs { position: static; display: flex; gap: 4px; margin-right: auto; padding: 0; background: none; box-shadow: none; }
  .tab { flex-direction: row; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; font-size: 15px; }
  .tab .icon { width: 18px; height: 18px; }
  .tab.is-active { background: var(--ink); color: #fff; }
  .header-help { font-size: 15px; }
  .wrap { padding-top: 8px; padding-bottom: 56px; }

  .hero-title { font-size: 64px; }
  .hero-guide { font-size: 18px; }
  .hero-sub { font-size: 16px; }
  .home { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; }
  .home-intro { position: sticky; top: 16px; }
  .home-list { display: flex; flex-direction: column; gap: 32px; }
  .page-title { font-size: 64px; }

  .con-band { display: none; }
  .back { position: static; margin-bottom: 4px; }
  .con-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; }
  .con-badge { position: sticky; top: 16px; margin-top: 0; }
  .con-info { margin-top: 24px; }
  .actionbar { display: none; }
  .sheet { max-width: 480px; margin: auto; border-radius: 24px; padding-bottom: 20px; }
  .toast { bottom: 32px; }
  .chips-scroll { margin-inline: 0; }
}
