:root {
  --bg: #fdf8f0;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #5f6b76;
  --brand: #0f766e;
  --brand-dark: #0b5a54;
  --accent: #f59e0b;
  --line: #ece4d6;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191d;
    --panel: #1d2429;
    --ink: #e8edf0;
    --muted: #a3afb8;
    --brand: #2bb3a6;
    --brand-dark: #5fd3c8;
    --line: #2c353c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; }
.cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.cats::-webkit-scrollbar { display: none; }
.cats a {
  white-space: nowrap; text-decoration: none; color: var(--ink);
  padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 15px;
}
.cats a:hover, .cats a[aria-current] { background: var(--bg); color: var(--brand); }
.cats .soon { white-space: nowrap; padding: 7px 12px; font-weight: 600; font-size: 15px; color: var(--muted); opacity: .6; cursor: default; }
.cats .more { margin-left: auto; color: var(--brand); }
:root { --top-h: 65px; }
@media (max-width: 640px) {
  :root { --top-h: 105px; }
  .top-in { gap: 4px; padding-top: 10px; }
  .cats { flex-basis: 100%; padding-bottom: 8px; }
  .cats .more { margin-left: 0; }
}
.is-game .top { position: static; }

/* account box in the header */
.acct { flex: none; }
.acct a { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.acct .sign-in { background: var(--brand); color: #fff; padding: 7px 14px; border-radius: 999px; }
.acct .sign-in:hover { background: var(--brand-dark); color: #fff; }
.acct .me { color: var(--ink); max-width: 170px; }
.acct .me .nm { overflow: hidden; text-overflow: ellipsis; }
.acct img, .acct .ini { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.acct .ini { display: grid; place-items: center; background: var(--accent); color: #3b2500; font-size: 15px; }
@media (max-width: 640px) {
  .logo { order: 1; }
  .acct { order: 2; margin-left: auto; }
  .cats { order: 3; }
  .acct .me .nm { display: none; }
}

/* account page */
.acct-head { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.acct-head h1 { margin: 0 0 4px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 14px; margin: 8px 0 0; }
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.form-card label { display: block; font-weight: 700; margin-bottom: 6px; }
.form-card .row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-card input {
  flex: 1 1 200px; min-width: 0; font: inherit; font-size: 17px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.form-card input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-card button { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.msg { margin: 10px 0 0; font-weight: 600; }
.msg.err { color: #c0262d; }
.msg.ok { color: var(--brand); }
form.inline { margin: 8px 0 24px; }
form.inline button { cursor: pointer; font: inherit; font-weight: 700; }
.danger { border-top: 1px solid var(--line); padding-top: 14px; }
.danger summary { cursor: pointer; color: #c0262d; font-weight: 600; }
.check { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.btn-danger { background: #c0262d; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.btn-danger:hover { background: #9b1c22; }

/* home + headings */
main { padding-bottom: 48px; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.2; margin: 28px 0 12px; }
h2 { font-size: 22px; margin: 32px 0 12px; }
.hero { padding: 24px 0 8px; max-width: 760px; }
.hero p, .lead { color: var(--muted); font-size: 18px; }
.crumbs { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* game cards */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; }
.shelf-head a { font-weight: 600; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); color: var(--ink); }
.card { padding: 0 0 14px; overflow: hidden; }
.card-img { display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 8px; background: var(--line); }
.card-name, .card-blurb { padding: 0 14px; }
.card-name { font-weight: 700; font-size: 17px; }
.card-blurb { color: var(--muted); font-size: 14px; line-height: 1.45; }
.card.soon { opacity: .75; }
.badge {
  position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 700;
  background: var(--accent); color: #3b2500; padding: 2px 8px; border-radius: 999px;
}

/* home: featured game + moods */
.feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center;
  margin-top: 24px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
}
.feature h1 { margin-top: 0; }
.feature p { color: var(--muted); font-size: 18px; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.feature-img { position: relative; display: block; border-radius: var(--radius); overflow: hidden; }
.feature-img img { display: block; width: 100%; }
.daily-tag {
  position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; padding: 18px; } .feature-img { order: -1; } }
.moods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 6px; }
.mood {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius);
  text-decoration: none; color: #fff;
}
.mood span { font-size: 13px; opacity: .9; }
.mood-card-classics { background: #15803d; }
.mood-brain { background: #4338ca; }
.mood-board { background: #b45309; }
.mood-quick { background: #0284c7; }
.mood:hover { color: #fff; filter: brightness(1.08); }
@media (max-width: 760px) { .moods { grid-template-columns: repeat(2, 1fr); } }
.shelf { scroll-margin-top: calc(var(--top-h) + 8px); }
.cat-links a { display: inline-block; margin: 0 14px 8px 0; font-weight: 600; }
.btn-big { font-size: 18px; padding: 12px 26px; }
.btn-ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-ghost:hover { background: var(--brand); }
.btn.is-off { background: var(--line); color: var(--muted); cursor: default; }

/* game page: the game takes the first screen, the bar below it stays in view */
.is-game main { max-width: none; padding: 0; }
.play { height: calc(100vh - var(--top-h) - 52px); height: calc(100dvh - var(--top-h) - 52px); min-height: 420px; background: #0f5132; }
.play iframe { display: block; width: 100%; height: 100%; border: 0; }
.play-bar {
  display: flex; align-items: center; gap: 18px; height: 52px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap;
}
.play-bar h1 { font-size: 18px; margin: 0 auto 0 0; }
.play-bar a { font-weight: 600; text-decoration: none; font-size: 15px; }
.play-bar button {
  font: inherit; font-weight: 600; font-size: 15px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; padding: 6px 14px; border-radius: 999px;
}
.game-body, .is-game .shelf { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.game-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.scores {
  align-self: start; margin-top: 24px; padding: 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 12px;
}
.scores h2 { margin: 0 0 10px; font-size: 18px; }
.score-list { margin: 0; padding-left: 22px; }
.score-list .empty { list-style: none; margin-left: -22px; color: var(--muted); }
.score-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.score-sign { font-size: 14px; margin: 10px 0 0; }
.score-sign .sign-in { font-weight: 700; }
@media (max-width: 900px) { .game-body { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 640px) { .play-bar a[href="#scores"] { display: none; } }

/* text pages */
.text { max-width: 760px; }
.text h3 { font-size: 18px; margin: 22px 0 6px; }
.text li { margin-bottom: 6px; }
.big { font-size: 22px; font-weight: 700; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.btn {
  display: inline-block; background: var(--brand); color: #fff; text-decoration: none;
  padding: 10px 20px; border-radius: 999px; font-weight: 700;
}
.btn:hover { background: var(--brand-dark); color: #fff; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--panel); font-size: 14px; color: var(--muted); }
.foot-in { padding: 24px 16px; display: grid; gap: 10px; }
.foot-brand { display: flex; align-items: center; gap: 10px; margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.copy { margin: 0; }
