/* Tableland — warm cardstock & letterpress.
   Cream paper, warm ink, rust accent. Fraunces display / Alegreya Sans body. */

:root {
  --paper: #f7f1e5;
  --card: #fffcf4;
  --ink: #221c14;
  --ink-soft: #5c5344;
  --rust: #b4432c;
  --rust-dark: #93361f;
  --line: #d9cfba;
  --shadow: #d3c5a8;
  --good: #3e6b42;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Alegreya Sans", ui-sans-serif, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(90, 70, 40, 0.055) 1px, transparent 1px);
  background-size: 5px 5px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 50;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

a { color: var(--rust); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rust-dark); }

/* --- header / footer --- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.wordmark {
  font-size: 1.6rem;
  font-weight: 640;
  color: var(--ink);
  text-decoration: none;
}

.site-nav { display: flex; align-items: baseline; gap: 1.1rem; }
.site-nav a { color: var(--ink); }
.site-nav a.btn { color: var(--paper); }

.linklike {
  background: none;
  border: none;
  font: inherit;
  color: var(--rust);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.site-main {
  flex: 1;
  width: 100%;
  padding: 2.5rem 1.5rem 4rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* honeypot form field: hidden from people, visible to bots */
.trap { position: absolute; left: -9999px; }

/* --- hero --- */

.hero { padding: 3rem 0 2.5rem; max-width: 40rem; }

.kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.9rem;
}

.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.3rem); margin-bottom: 1.1rem; }

.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 34rem; }

.hero-actions { display: flex; gap: 0.8rem; margin-top: 1.8rem; }
.hero-note { margin-top: 1.6rem; color: var(--good); font-weight: 500; }

/* --- cards --- */

.three-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: 4px 4px 0 var(--shadow);
}
.card h3 { margin-bottom: 0.5rem; font-size: 1.15rem; }
.card p { color: var(--ink-soft); font-size: 0.98rem; }

/* --- forms --- */

.form-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--shadow);
  max-width: 26rem;
  margin: 2rem auto;
  padding: 2rem 2.1rem 1.6rem;
}
.form-card h2 { margin-bottom: 1.1rem; font-size: 1.6rem; }
.form-card > p { color: var(--ink-soft); margin-bottom: 1rem; }

form label { display: block; margin-bottom: 1rem; font-weight: 500; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; }

input[type="email"], input[type="password"], input[type="text"], input[type="tel"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
}
input:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

label.check {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  font-weight: 400;
  margin-bottom: 0.7rem;
}
label.check input { accent-color: var(--rust); }

.form-foot {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* --- buttons --- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 0.55rem 1.3rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 60ms ease, box-shadow 60ms ease;
}
.btn:hover { color: var(--paper); background: #000; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }

.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--card); }
.btn-small { padding: 0.3rem 0.9rem; font-size: 0.95rem; }
.btn-full { display: block; width: 100%; margin-top: 0.4rem; }

/* --- flashes --- */

.flash {
  max-width: 26rem;
  margin: 0 auto 1rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1.5px solid;
  font-weight: 500;
}
.flash-error { border-color: var(--rust); color: var(--rust-dark); background: #fbeae5; }
.flash-info { border-color: var(--good); color: var(--good); background: #eef3ea; }

/* --- prose / account --- */

.prose { max-width: 38rem; }
.prose h1 { font-size: 2.2rem; margin-bottom: 1.4rem; }
.prose h3 { margin: 1.5rem 0 0.4rem; }
.prose p { color: var(--ink-soft); }

.account-info { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.4rem; }
.account-info dt { font-weight: 700; }
.account-info dd { color: var(--ink-soft); }

/* --- page heads, tables, badges (venues & admin) --- */

.page-head { padding: 1rem 0 1.6rem; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-head .lede { font-size: 1.05rem; margin-top: 0.3rem; }
.page-head .kicker a { color: var(--rust); text-decoration: none; }

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.data-table th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.data-table td, .data-table th { padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }
.cell-right { text-align: right; }

.card-table {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 0.5rem 1rem;
}
.card-table td, .card-table th { padding: 0.55rem 0.8rem; }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  color: var(--ink-soft);
}
.badge-good { border-color: var(--good); color: var(--good); background: #eef3ea; }

.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { color: inherit; box-shadow: 6px 6px 0 var(--shadow); }

.muted { color: var(--ink-soft); }
.danger { color: var(--rust-dark); }
.empty { color: var(--ink-soft); padding: 2rem 0; }
.mt { margin-top: 1.2rem; }
.plain-list { list-style: none; }
.plain-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: none; }

select, input[type="date"] {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}
select:focus-visible, input[type="date"]:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

.hours-table td { border-bottom: none; padding: 0.25rem 0.4rem 0.25rem 0; }

.row-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.row-form input[type="text"], .row-form input[type="tel"] { width: auto; flex: 1; min-width: 8rem; margin-top: 0; display: inline-block; }
.row-form .input-narrow { flex: 0; min-width: 5rem; }

.form-card-wide { max-width: 32rem; }

/* --- games board --- */

.game-list { display: flex; flex-direction: column; gap: 1rem; }
.game-card h3 { font-size: 1.25rem; }
.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.game-card p { margin-top: 0.25rem; }

.tier-needs  { border-color: var(--ink-soft); color: var(--ink-soft); }
.tier-bubble { border-color: #b07d1a; color: #8a6114; background: #f9efd8; }
.tier-likely { border-color: var(--good); color: var(--good); background: #eef3ea; }
.tier-hot    { border-color: var(--rust); color: var(--rust-dark); background: #fbeae5; }

.filter-row { margin-bottom: 1.2rem; }
.chip {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  background: var(--card);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip-active { border-color: #b07d1a; background: #f9efd8; color: #8a6114; }

.section-title {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row label { flex: 1; min-width: 7rem; }
.field-row .input-narrow { width: 5rem; }

textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--rust); outline-offset: 1px; }

input[type="number"] {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  width: 5rem;
  margin-top: 0.3rem;
}
input[type="number"]:focus-visible { outline: 2px solid var(--rust); outline-offset: 1px; }

.hint-block { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0.7rem; }
.prose-body { white-space: pre-line; }
.mb { margin-bottom: 1.1rem; }
.mb-small { margin-bottom: 0.5rem; }

/* --- cover images --- */

.cover-sq {
  width: 96px;
  height: 96px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  object-fit: cover;
  background: var(--card);
  flex-shrink: 0;
}

.cover-lg {
  width: 160px;
  height: 160px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 4px 4px 0 var(--shadow);
  flex-shrink: 0;
}

.game-head { display: flex; gap: 1.4rem; align-items: flex-start; }
.game-head-body { flex: 1; min-width: 0; }

.game-card-media { display: flex; gap: 1.1rem; align-items: flex-start; }
.game-card-body { flex: 1; min-width: 0; }

input[type="file"] { font: inherit; font-size: 0.9rem; }

@media (max-width: 600px) {
  .game-head { flex-direction: column; }
  .cover-sq { width: 72px; height: 72px; }
}

.stat-big {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.8rem;
  font-weight: 640;
  line-height: 1.1;
  margin: 0.3rem 0;
}

.json-dump {
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 600px) {
  .site-main { padding-top: 1.5rem; }
  .hero { padding-top: 1.5rem; }
  .form-card { padding: 1.5rem 1.3rem 1.2rem; }
}

/* --- homepage: the game finder --- */

.finder-head { padding: 0.6rem 0 1.1rem; align-items: flex-end; }
.finder-head h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); }
.drop-note { margin-top: 0.25rem; font-size: 0.95rem; }

/* homepage countdown: the quiet focal point above the board */
.drop-banner {
  display: block;
  width: fit-content;
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: -1.25rem auto 0.9rem;
  text-decoration: none;
}
.drop-banner:hover { color: var(--rust); text-decoration: underline; }

.loop-strip {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.loop-item {
  display: block;
  font-size: 0.98rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--good);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
}
a.loop-item:hover { border-color: var(--ink); }
.loop-urgent { border-left-color: var(--rust); background: #fbeae5; }
.loop-quiet { border-left-color: var(--line); color: var(--ink-soft); }

/* filter bar: one tight horizontal row, wraps on small screens */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
  margin-bottom: 1.6rem;
}
.filter-bar select {
  font-size: 0.92rem;
  padding: 0.28rem 0.45rem;
  border-width: 1.5px;
  max-width: 12rem;
}
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  padding: 0.22rem 0.8rem;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.filter-toggle:has(input:checked) {
  border-color: #b07d1a;
  background: #f9efd8;
  color: #8a6114;
}
.filter-toggle input { accent-color: var(--rust); }
.filter-clear {
  font-size: 0.92rem;
  margin-left: auto;
  white-space: nowrap;
}

/* game grid: cover-forward tiles */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.3rem;
}
.game-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
  overflow: hidden;
}
.game-tile:hover { box-shadow: 6px 6px 0 var(--shadow); color: inherit; }
.game-tile-media { position: relative; }
.game-tile-media img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1.5px solid var(--ink);
}
.game-tile-badge {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
}
/* tier-needs has no tint of its own; over an image it needs a backing */
.game-tile-badge.tier-needs { background: var(--card); }
.game-tile-body { padding: 0.8rem 0.95rem 0.95rem; }
.game-tile-body h3 { font-size: 1.12rem; margin-bottom: 0.3rem; }
.game-tile-body p { font-size: 0.92rem; margin-top: 0.15rem; }
.game-tile-when { font-weight: 500; }
.game-tile-venues { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- account menu (nav dropdown) --- */
[x-cloak] { display: none !important; }
.nav-menu { position: relative; display: inline-block; }
.nav-menu-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: inherit; color: var(--ink); background: none; border: 0;
  padding: 0; cursor: pointer;
}
.nav-menu-btn .caret { font-size: 0.7em; }
.nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 50;
  min-width: 12rem; padding: 0.4rem 0;
  background: var(--card); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
}
.nav-dropdown a, .nav-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 0.45rem 1rem; color: var(--ink); text-decoration: none;
  font: inherit; background: none; border: 0; cursor: pointer;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: var(--paper); }
.nav-dropdown form { margin: 0; border-top: 1px solid var(--shadow); padding-top: 0.2rem; margin-top: 0.2rem; }

/* --- avatars --- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--paper); }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--ink); border: 2px solid var(--ink);
}
.avatar-xs { width: 1.6rem; height: 1.6rem; font-size: 0.8rem; }
.avatar-lg { width: 5.5rem; height: 5.5rem; font-size: 2.2rem; }
img.avatar { border: 2px solid var(--ink); }
.profile-head { display: flex; align-items: center; gap: 1.1rem; }

/* --- settings sub-navigation --- */
.subnav {
  display: flex; gap: 1.2rem; flex-wrap: wrap;
  max-width: 34rem; margin: 0 auto 1.2rem;
  border-bottom: 2px solid var(--shadow); padding-bottom: 0.5rem;
}
.subnav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--ink); font-weight: 700; border-bottom: 3px solid var(--ink); padding-bottom: 0.45rem; margin-bottom: -0.62rem; }

/* --- declare interaction (tap your hours + live session preview) --- */
[x-cloak] { display: none !important; }
.declare-date { margin-top: 1rem; }
.declare-date-label { font-weight: 700; margin-bottom: 0.4rem; }
.hour-blocks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hour-block {
  flex: 1 1 4.2rem; min-width: 3.4rem; padding: 0.55rem 0.2rem;
  font: inherit; font-weight: 600; text-align: center; cursor: pointer;
  color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: calc(var(--radius) - 3px);
}
.hour-block.half { flex: 0.5 1 2.2rem; min-width: 2rem; font-size: 0.85em; }
.hour-block:hover { border-color: var(--ink-soft); }
.hour-block.on {
  background: var(--rust); border-color: var(--rust-dark);
  color: var(--paper);
}
.chips-label { margin: 0.7rem 0 0.3rem; font-size: 0.9em; }
.session-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.session-chip {
  padding: 0.25rem 0.6rem; font-size: 0.85em; white-space: nowrap;
  color: var(--ink-soft); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px;
}
.session-chip.on {
  color: var(--good); border-color: var(--good); font-weight: 700;
  background: color-mix(in srgb, var(--good) 10%, var(--card));
}
.fine-tune { display: inline-block; margin-top: 0.8rem; font-size: 0.9em; }
.declare-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  margin: 0.9rem -1.4rem -1.3rem; padding: 0.8rem 1.4rem 1rem;
  background: var(--card); border-top: 1.5px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}
.declare-commit:disabled { opacity: 0.45; cursor: not-allowed; }
.declare-status { font-size: 0.9em; }
.declare-error { color: var(--rust-dark); margin-top: 0.6rem; font-weight: 600; }

/* --- venue picker (tap to add, tap order = preference) --- */
.venue-pick-list { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; display: grid; gap: 0.6rem; }
.venue-pick {
  display: flex; align-items: center; gap: 0.85rem; width: 100%;
  padding: 0.7rem 0.9rem; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.venue-pick:hover { border-color: var(--ink); }
.venue-pick.picked { border-color: var(--ink); box-shadow: 2px 2px 0 var(--shadow); }
.venue-pick-badge {
  flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); color: var(--ink-soft); font-weight: 700;
}
.venue-pick.picked .venue-pick-badge { background: var(--rust); border-color: var(--rust); color: var(--paper); }
.venue-pick-info { display: flex; flex-direction: column; }

/* --- cover picker (post a game) & cover library (admin) --- */

.game-new-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 62rem;
  margin: 0 auto;
}
.game-new-side { position: sticky; top: 1.5rem; }
.game-new-side .hint-block { margin-top: 0.9rem; text-align: center; }
.game-new-main { margin: 0; max-width: none; }

.cover-picker {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 5px 5px 0 var(--shadow);
  cursor: pointer;
  overflow: hidden;
}
.cover-picker img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-picker:hover img { opacity: 0.88; }
.cover-picker:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
.cover-picker-icon {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--paper);
}

.file-hidden { display: none; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(34, 28, 20, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.picker-modal {
  width: 100%;
  max-width: 44rem;
  max-height: min(85dvh, 42rem);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 1.1rem 1.2rem;
}
.picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.picker-head h3 { font-size: 1.25rem; }
.picker-close {
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
}
.picker-close:hover { color: var(--ink); }

.picker-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  background: var(--paper);
}
.picker-drop:hover { border-color: var(--ink-soft); }
.picker-drop strong { display: block; }
.picker-drop span { color: var(--ink-soft); font-size: 0.9rem; }

.picker-body {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}
.picker-cats { display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem; overflow-y: auto; }
.picker-cats button {
  font: inherit;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  white-space: nowrap;
}
.picker-cats button:hover { color: var(--ink); background: var(--paper); }
.picker-cats button.active { color: var(--ink); background: var(--paper); font-weight: 700; }

.picker-panes { overflow-y: auto; min-height: 12rem; }
.picker-cat-label { font-weight: 700; margin-bottom: 0.6rem; }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.6rem;
}
.picker-img {
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
}
.picker-img:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--shadow); }
.picker-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* admin: cover library */
.cover-thumbs { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.cover-thumbs img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.8rem;
}
.library-item { position: relative; }
.library-item > img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
}
.library-x {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.7rem;
  height: 1.7rem;
  line-height: 1;
  font: inherit;
  font-weight: 700;
  background: var(--card);
  color: var(--rust-dark);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.library-x:hover { background: #fbeae5; }

@media (max-width: 760px) {
  .game-new-layout { grid-template-columns: 1fr; }
  .game-new-side { position: static; width: 100%; max-width: 20rem; margin: 0 auto; }
  .picker-body { grid-template-columns: 1fr; }
  .picker-cats { flex-direction: row; overflow-x: auto; }
}
