/* Fabestonia — "The Arena Ledger"
   Flesh and Blood community: warm obsidian arena, bone parchment text,
   gold for victory/structure, blood-crimson for action/defeat. */

:root {
  --ink:        #14100b;  /* arena background (warm near-black) */
  --ink-2:      #1d1711;  /* card / surface */
  --ink-3:      #271f16;  /* inputs / elevated */
  --line:       #3a2e1f;  /* warm gold-tinted hairline */
  --line-soft:  #2c2317;
  --bone:       #ece3cf;  /* primary text (parchment/bone) */
  --bone-dim:   #a4967b;  /* muted text */
  --gold:       #c9a25a;
  --gold-bright:#e7c67d;
  --gold-deep:  #8a6d34;
  --blood:      #a02a22;
  --blood-bright:#c5392e;

  --r: 4px;               /* restrained radius — these are card frames, not pills */
  --shadow: 0 18px 40px -22px rgba(0,0,0,0.85);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 620px at 50% -340px, rgba(201,162,90,0.10), transparent 70%),
    var(--ink);
  background-attachment: fixed;
  color: var(--bone);
  font-family: 'Spectral', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Headings: Cinzel, engraved heraldry ---- */
h1, h2, h3 {
  font-family: 'Cinzel', 'Spectral', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
  color: var(--bone);
}

.page-title {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* Section headers get a heraldic lozenge + trailing hairline. */
h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
}
h2::before {
  content: "";
  width: 8px; height: 8px;
  flex: 0 0 auto;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(201,162,90,0.5);
}
h2::after {
  content: "";
  height: 1px; flex: 1;
  background: linear-gradient(90deg, var(--line), transparent);
}

h3 { font-size: 1.05rem; letter-spacing: 0.03em; }

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(180deg, rgba(40,32,22,0.96), rgba(20,16,11,0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(201,162,90,0.12);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  backdrop-filter: blur(6px);
}
.topbar .brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.topbar .brand img { display: block; width: auto; height: 40px; max-width: 220px; object-fit: contain; }
.topbar nav { display: flex; gap: 1.4rem; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.topbar nav a {
  color: var(--bone-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.topbar nav a:hover { color: var(--gold-bright); text-decoration: none; border-bottom-color: var(--gold-deep); }
.topbar .account { display: flex; align-items: center; gap: 0.75rem; flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
.topbar .who { color: var(--bone-dim); font-size: 0.9rem; font-family: 'Cinzel', serif; letter-spacing: 0.04em; }
.topbar .who:hover { color: var(--gold-bright); }

/* Hamburger: hidden on desktop, shown under the nav-fit breakpoint. */
.nav-toggle {
  display: none;
  flex: 0 0 auto;
  margin-left: auto;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--gold); }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--gold);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}
.nav-toggle-bars::before { position: absolute; left: 0; top: -6px; }
.nav-toggle-bars::after  { position: absolute; left: 0; top: 6px; }
.topbar.nav-open .nav-toggle-bars { background: transparent; }
.topbar.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.topbar.nav-open .nav-toggle-bars::after  { top: 0; transform: rotate(-45deg); }

/* ---- Layout ---- */
.content { max-width: 1040px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.muted { color: var(--bone-dim); }

/* ---- Cards (card frames) ---- */
.card {
  position: relative;
  display: block;
  background:
    linear-gradient(180deg, rgba(201,162,90,0.05), transparent 120px),
    var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  color: var(--bone);
  box-shadow: var(--shadow);
}
/* Gold frame-rule across the top of every card */
.card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-deep) 18%, var(--gold) 50%, var(--gold-deep) 82%, transparent);
  opacity: 0.55;
  border-radius: var(--r) var(--r) 0 0;
}
a.card { transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
a.card:hover {
  border-color: var(--gold-deep);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(201,162,90,0.25);
}
a.card:hover::before { opacity: 1; }
a.card h3 { color: var(--gold-bright); }

.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Title + inline badge on one line (keeps cards equal height) */
.card-title { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.card-title .badge { margin-left: auto; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line-soft); }
th {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--line);
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(201,162,90,0.045); }
td a { color: var(--bone); }
td a:hover { color: var(--gold-bright); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--ink-3);
  color: var(--bone);
  padding: 0.55rem 1.05rem;
  border-radius: var(--r);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--gold); color: var(--gold-bright); text-decoration: none; }
.btn.primary {
  background: linear-gradient(180deg, var(--blood-bright), var(--blood));
  border-color: var(--blood);
  color: #fbeee9;
}
.btn.primary:hover { border-color: var(--gold); color: #fff; filter: brightness(1.08); }
.btn.gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold);
  color: #1a130a;
}
.btn.gold:hover { color: #1a130a; filter: brightness(1.08); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { color: #fff; border-color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--blood); color: var(--blood-bright); background: transparent; }
.btn.danger:hover { background: var(--blood); color: #fff; border-color: var(--blood); }
.btn.sm { padding: 0.3rem 0.65rem; font-size: 0.68rem; }

/* ---- Forms ---- */
input, select, textarea {
  background: var(--ink-3);
  border: 1px solid var(--line);
  color: var(--bone);
  border-radius: var(--r);
  padding: 0.5rem 0.65rem;
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.95rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,162,90,0.2);
}
label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  margin-bottom: 0.3rem;
}
.field { margin-bottom: 0.85rem; }
.row { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: flex-end; }
label.radio {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--bone);
}
label.radio input {
  width: auto;
  margin: 0;
  padding: 0;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid transparent;
}
.badge.available { background: rgba(201,162,90,0.14); color: var(--gold-bright); border-color: var(--gold-deep); }
.badge.reserved  { background: rgba(197,57,46,0.14);  color: var(--blood-bright); border-color: var(--blood); }
.badge.delivered { background: rgba(164,150,123,0.12); color: var(--bone-dim); border-color: var(--line); }
.badge.admin     { background: rgba(201,162,90,0.14); color: var(--gold-bright); border-color: var(--gold-deep); }
.badge.live      { background: rgba(197,57,46,0.18); color: var(--blood-bright); border-color: var(--blood); }
.badge.live::before {
  content: "";
  display: inline-block;
  width: 0.5em; height: 0.5em;
  margin-right: 0.4em;
  border-radius: 50%;
  background: var(--blood-bright);
  vertical-align: middle;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* ---- Win/Loss meter: gold (victory) vs blood (defeat) ---- */
.bar {
  height: 12px;
  border-radius: 999px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  margin: 0.6rem 0;
}
.bar .seg-win  { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }
.bar .seg-loss { background: linear-gradient(180deg, var(--blood-bright), var(--blood)); }

/* ---- Flash messages ---- */
.flash { padding: 0.75rem 1rem; border-radius: var(--r); margin-bottom: 1.25rem; font-size: 0.95rem; }
.flash.success { background: rgba(201,162,90,0.12); border: 1px solid var(--gold-deep); color: var(--gold-bright); }
.flash.error   { background: rgba(197,57,46,0.12); border: 1px solid var(--blood); color: var(--blood-bright); }
.error { color: var(--blood-bright); }

/* ---- Home hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3rem 2rem 2.6rem;
  text-align: center;
  background:
    radial-gradient(700px 320px at 50% -60px, rgba(201,162,90,0.16), transparent 70%),
    linear-gradient(180deg, rgba(160,42,34,0.12), transparent 55%),
    var(--ink-2);
}
.hero .eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.15;
  margin: 0 auto 0.9rem;
  max-width: 16ch;
}
.hero .lede {
  color: var(--bone-dim);
  font-size: 1.05rem;
  max-width: 54ch;
  margin: 0 auto 1.7rem;
}
.hero .actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.hero-logo { display: block; width: min(100%, 460px); height: auto; margin: 0 auto 1.4rem; }

/* ---- Hero portraits ---- */
.hero-portrait {
  border-radius: var(--r);
  object-fit: cover;
  vertical-align: middle;
  background: var(--ink-3);
  border: 1px solid var(--line);
}
.hero-portrait-sm { width: 30px; height: 30px; }
.hero-portrait-lg { width: 60px; height: 60px; }
.hero-line { display: inline-flex; align-items: center; gap: 0.55rem; }
.hero-line p { margin: 0; }

/* ---- Card catalog: thumbnails, listing layout, search ---- */
.card-thumb {
  width: 86px;
  height: 120px;
  object-fit: contain;
  border-radius: var(--r);
  background: var(--ink-3);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.listing-body { display: flex; gap: 0.9rem; align-items: flex-start; margin-top: 0.4rem; }
.listing-body > div { flex: 1 1 auto; min-width: 0; }
.listing-body p { margin: 0 0 0.35rem; }

/* ---- Bulk add / wishlist ---- */
.bulk-textarea { font-family: 'Spectral', Georgia, serif; line-height: 1.5; resize: vertical; }
.card-thumb-sm {
  width: 40px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--r);
  background: var(--ink-3);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.wishlist-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  cursor: pointer;
}
.wishlist-row:first-of-type { border-top: none; }
.wishlist-row input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.wishlist-row > span { flex: 1 1 auto; min-width: 0; }

/* ---- Reservation detail (large, low-clutter, dyslexia/ADHD friendly) ---- */
.reservation-summary { font-size: 1.15rem; line-height: 1.7; margin: 0 0 1.4rem; }
.big-num {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-bright);
  vertical-align: -0.1em;
}
.res-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.6rem;
}
.res-tile {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.9rem;
  text-align: center;
}
.res-tile-img { position: relative; display: inline-block; }
.card-thumb-lg {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  border-radius: var(--r);
  background: var(--ink-3);
  border: 1px solid var(--line);
}
.qty-badge {
  position: absolute;
  top: -0.7rem;
  right: -0.7rem;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-bright);
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.res-tile-name { font-size: 1.1rem; margin: 0.7rem 0 0.2rem; }
.res-tile-meta { color: var(--bone-dim); font-size: 0.9rem; margin: 0 0 0.3rem; }
.res-tile-price { font-size: 1.05rem; margin: 0 0 0.6rem; }

/* ---- List by set (table) ---- */
.set-table { width: 100%; border-collapse: collapse; }
.set-table th {
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.set-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.set-table tr:hover td { background: var(--ink-2); }
.set-thumb-cell { width: 48px; }
.set-num { color: var(--bone-dim); white-space: nowrap; }
.set-qty { width: 5rem; }
.set-cond { width: 6rem; }
.set-price { width: 7rem; }
.set-table .btn { display: inline; }

.card-results {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 20;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card-result {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  color: var(--bone);
  font-family: 'Spectral', Georgia, serif;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.5rem 0.7rem;
}
.card-result:last-child { border-bottom: none; }
.card-result:hover { background: rgba(201,162,90,0.1); color: var(--gold-bright); }
.card-result small { color: var(--bone-dim); font-size: 0.78rem; }

/* Wide tables (rounds, rosters, set lists) scroll sideways instead of
   bursting the card frame on narrow screens. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table { margin: 0; }
.set-table { min-width: 560px; }

/* ---- Tournament: stat strip ---- */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin: 1.1rem 0 0.4rem;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.stat {
  flex: 1 1 130px;
  padding: 0.85rem 1.15rem;
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* base-align value + label so all tiles share a line */
}
.stat .num {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-bright);
}
.stat .num.text { font-size: 1.05rem; letter-spacing: 0.02em; line-height: 1.2; }
.stat .num.crimson { color: var(--blood-bright); }
.stat .lbl {
  margin-top: 0.4rem;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--bone-dim);
}

/* ---- Tournament: round tabs ---- */
.tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* swipe to reach older rounds; no chrome scrollbar track */
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.55rem 0.9rem;
  color: var(--bone-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tabs button:hover { color: var(--gold-bright); }
.tabs button[aria-selected="true"] { color: var(--gold-bright); border-bottom-color: var(--gold); }
.tab-panels > [role="tabpanel"] { margin-bottom: 0; }
/* The panel carries .card (display:block), which outranks the UA [hidden] rule.
   This selector (0,3,0) wins, so a hidden panel actually stays hidden. */
.tab-panels > [role="tabpanel"][hidden] { display: none; }

/* ---- Tournament: match winner emphasis ---- */
td.match-w a { color: var(--gold-bright); }
td.match-l { color: var(--bone-dim); }
td.match-l a { color: var(--bone-dim); }
.win-mark { color: var(--gold); font-size: 0.85em; }
.bye-row { background: rgba(201,162,90,0.04); }
.bye-row td.muted { font-style: italic; }
.res-tag {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.res-tag.win { color: var(--gold-bright); }
.res-tag.bye { color: var(--gold-deep); }
.res-tag.draw { color: var(--bone-dim); }
.res-tag.pending { color: var(--bone-dim); font-style: italic; }

/* ---- Tournament: the Campaign Trail (per-round pips) ---- */
.record { display: inline-flex; gap: 0.5rem; font-family: 'Cinzel', serif; font-size: 0.82rem; }
.record .w { color: var(--gold-bright); }
.record .l { color: var(--blood-bright); }
.record .d { color: var(--bone-dim); }
.record .b { color: var(--gold-deep); font-size: 0.92em; } /* bye = win */
.score { font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.05rem; color: var(--gold-bright); }

.trail { display: inline-flex; gap: 3px; }
.pip {
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-3);
  color: var(--bone-dim);
}
.pip-w { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: var(--gold); color: #1a130a; }
.pip-l { background: linear-gradient(180deg, var(--blood-bright), var(--blood)); border-color: var(--blood); color: #fbeee9; }
.pip-d { background: var(--ink-3); border-color: var(--bone-dim); color: var(--bone-dim); }
/* Bye = a win: gold family, faded vs the solid pip-w. */
.pip-b { background: rgba(201,162,90,0.16); border-color: var(--gold-deep); color: var(--gold-bright); }
.pip-p { background: transparent; border: 1px dashed var(--gold-deep); color: var(--gold); }
.pip-bye { background: transparent; border-style: dotted; border-color: var(--line); color: var(--bone-dim); }
.trail-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.9rem 0 0;
  color: var(--bone-dim);
  font-size: 0.78rem;
}
.trail-legend .pip { margin-right: 0.1rem; }

/* ---- Want-list: shareable link box + acquired cards ---- */
.share-box { display: flex; gap: 0.5rem; align-items: stretch; }
.share-box input { flex: 1 1 auto; min-width: 0; font-family: 'Spectral', Georgia, serif; }
.share-box .btn { flex: 0 0 auto; }
.res-tile.got { opacity: 0.5; }
.res-tile.got .res-tile-name { text-decoration: line-through; text-decoration-color: var(--bone-dim); }
.got-line { margin: 0.1rem 0 0; font-size: 0.92rem; color: var(--bone-dim); }
.got-line.some { color: var(--gold-bright); }
.got-line.all { color: #66bb6a; }
.got-form { display: flex; align-items: center; justify-content: center; gap: 0.45rem; margin-top: 0.55rem; }
.got-form .got-lbl {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.got-input { width: 4.2rem; text-align: center; }
.got-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 0.4rem; }
.got-check {
  position: absolute;
  top: -0.7rem; left: -0.7rem;
  width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  background: #2e7d32; color: #fff;
  font-size: 1.4rem; font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ---- Admin: OBS overlay links ---- */
.ov-links { margin-top: 0.5rem; }
.ov-links summary {
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.ov-links a { display: inline-block; margin: 0.4rem 0.6rem 0 0; font-size: 0.88rem; }
.ov-links p { margin: 0.5rem 0 0; font-size: 0.8rem; }
.ov-links code { background: var(--ink-3); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3em; }

/* ---- A11y & motion ---- */
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

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

/* ---- Responsive: tablet ---- */
@media (max-width: 900px) {
  .topbar { gap: 0.9rem 1.2rem; padding: 0.6rem 1rem; }
  .topbar nav { gap: 0.9rem 1.2rem; order: 3; flex-basis: 100%; }
}

/* ---- Responsive: collapse nav into a hamburger when it stops fitting ---- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .topbar { gap: 0.6rem 1rem; }

  /* Nav and account are hidden until the menu is opened, then stack full-width.
     Order them links-first, account-last (overrides the order:3 from the 900px rule). */
  .topbar #site-nav,
  .topbar .account {
    display: none;
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
  }
  .topbar #site-nav { order: 2; }
  .topbar .account { order: 3; }
  .topbar.nav-open #site-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0.3rem;
    border-top: 1px solid var(--line-soft);
  }
  .topbar.nav-open #site-nav a {
    padding: 0.7rem 0.2rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--line-soft);
  }
  .topbar.nav-open #site-nav a:last-child { border-bottom: none; }
  .topbar.nav-open .account {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line-soft);
  }
  .topbar.nav-open .account .who { padding: 0.2rem 0; max-width: none; }
  .topbar.nav-open .account .btn { text-align: center; }
}

/* ---- Responsive: wide tables fold into stacked rows on phones (no side-scroll) ---- */
@media (max-width: 640px) {
  .table-cards thead { display: none; }
  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td { display: block; width: 100%; }
  .table-cards tr {
    border-top: 1px solid var(--line);
    padding: 0.7rem 0 0.5rem;
  }
  .table-cards tbody tr:first-child { border-top: none; }
  .table-cards tbody tr:hover { background: transparent; }
  .table-cards td {
    border: none;
    padding: 0.22rem 0;
  }
  .table-cards td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 7em;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bone-dim);
    vertical-align: baseline;
  }
  .table-cards td[data-label="Player"] { font-size: 1.05rem; }
  .table-cards td.trail-cell { padding-top: 0.5rem; }
  .table-cards td.trail-cell::before { display: block; min-width: 0; margin-bottom: 0.4rem; }
  .table-cards .trail { flex-wrap: wrap; }
  .bye-row td[data-label="Player 2"] { color: var(--bone-dim); font-style: italic; }
}

/* ---- Responsive: phone ---- */
@media (max-width: 640px) {
  .content { padding: 1.5rem 1rem 3rem; }

  /* Stack form fields full-width (overrides inline flex:1/flex:2 on .field);
     button-only and title rows have no .field, so they stay inline. */
  .row > .field { flex: 1 1 100% !important; }

  /* 16px inputs stop iOS from zooming the page on focus. */
  input, select, textarea { font-size: 16px; }

  /* Roomier tap targets for the many small action buttons. */
  .btn { padding: 0.6rem 1.1rem; }
  .btn.sm { padding: 0.45rem 0.8rem; font-size: 0.72rem; }

  /* Brand and account stay on one tidy line; trim a long username. */
  .topbar { gap: 0.6rem 1rem; }
  .topbar .brand img { height: 32px; }
  .topbar .who { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Two card tiles per row keeps the qty badge legible on a phone. */
  .res-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
  .qty-badge { font-size: 1.25rem; min-width: 2.2rem; height: 2.2rem; }
  .reservation-summary { font-size: 1.05rem; }
  .big-num { font-size: 1.5rem; }
}
