/* 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); }

.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%;
  max-width: 960px;
  margin: 0 auto;
  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; }

.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; }
