:root {
  --bg: #e6efe9;
  --panel: #f8fbf9;
  --ink: #12352b;
  --muted: #4b675d;
  --line: #b4c8be;
  --hl: #e4efe8;
  --sel: #ffd66b;
  --accent: #5b2a86;
  --accent-ink: #ffffff;
  --bad: #c0352b;
  --good: #1f7a4d;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a16;
    --panel: #16261f;
    --ink: #e4f0ea;
    --muted: #93b3a6;
    --line: #2b443a;
    --hl: #1c3128;
    --sel: #6b5200;
    --accent: #c9a2f5;
    --accent-ink: #1a0b2b;
    --bad: #ff8a80;
    --good: #6fdca2;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.5;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.shell { width: min(100% - 2rem, 34rem); margin-inline: auto; padding-bottom: 4rem; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0 0.5rem; gap: 0.75rem; }
.mark { font-weight: 800; font-size: 1.9rem; letter-spacing: -0.04em; text-decoration: none; color: var(--ink); line-height: 1; }
.acct { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip { font-size: 0.85rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }

.btn {
  display: inline-block;
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--ink); filter: none; }
.btn.small { padding: 0.4rem 0.8rem; min-height: 36px; font-size: 0.92rem; border-radius: 10px; }

.intro { color: var(--muted); margin: 0 0 1rem; max-width: 30rem; }

.picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; align-items: center; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0.45rem 0.8rem; min-height: 40px; cursor: pointer; font-weight: 600; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lock { font-size: 0.7rem; margin-left: 0.3em; opacity: 0.7; font-weight: 600; }
.picker input[type="date"] { font: inherit; padding: 0.4rem 0.5rem; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); min-height: 40px; }

.status { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; font-weight: 600; gap: 1rem; }
.status #title { font-size: 1.05rem; }
.status #timer { font-variant-numeric: tabular-nums; color: var(--muted); }

.board {
  --cell: min(calc((100vw - 2rem - 6px - var(--n) * 1px) / var(--n)), 4.6rem);
  width: calc(var(--n) * var(--cell) + (var(--n) - 1) * 1px + 6px);
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cell));
  grid-auto-rows: var(--cell);
  gap: 1px;
  background: var(--line);
  border: 3px solid var(--ink);
  border-radius: 6px;
  touch-action: manipulation;
}
.cell {
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow:
    var(--st, inset 0 0 0 0 transparent),
    var(--sr, inset 0 0 0 0 transparent),
    var(--sb, inset 0 0 0 0 transparent),
    var(--sl, inset 0 0 0 0 transparent);
}
.cell.bt { --st: inset 0 2px 0 0 var(--ink); }
.cell.br { --sr: inset -2px 0 0 0 var(--ink); }
.cell.bb { --sb: inset 0 -2px 0 0 var(--ink); }
.cell.bl { --sl: inset 2px 0 0 0 var(--ink); }
.cell.hl { background: var(--hl); }
.cell.sel { background: var(--sel); }
.cell .val { font-size: calc(var(--cell) * 0.5); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cell .lab {
  position: absolute;
  top: calc(var(--cell) * 0.07);
  left: calc(var(--cell) * 0.1);
  font-size: calc(var(--cell) * 0.24);
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}
.cell.dup .val { color: var(--bad); }
.cell.badcage { background: color-mix(in srgb, var(--bad) 22%, var(--panel)); }
.board.won .cell .val { color: var(--good); }

.msg { min-height: 1.6rem; margin: 0.7rem 0 0.4rem; text-align: center; font-weight: 600; }
.msg.good { color: var(--good); }
.msg.bad { color: var(--bad); }

.pad { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.pad .nums { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 0.4rem; }
.pad .nums button {
  min-height: 52px;
  font-size: 1.35rem;
  font-weight: 700;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
}
.pad .nums button:active { background: var(--sel); }
.pad .acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.pad .acts button {
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.pad .acts button:hover { border-color: var(--ink); }
.pad .acts button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pad .acts .lockd::after { content: " Plus"; font-size: 0.7rem; opacity: 0.7; }
.pad[hidden] { display: none; }

.stats { display: flex; gap: 1.25rem; justify-content: center; color: var(--muted); margin: 1.2rem 0 0; font-size: 0.98rem; }
.stats b { color: var(--ink); }

details.how { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
details.how summary { cursor: pointer; font-weight: 700; }
details.how ul { padding-left: 1.2rem; color: var(--muted); }

.plus { margin-top: 2.5rem; border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.plus h2 { font-size: clamp(1.7rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 0.6rem; }
.plus .sub { margin: 0 0 1rem; color: var(--muted); }
.perks { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.55rem; }
.perks li { padding-left: 1.6rem; position: relative; }
.perks li::before { content: ""; position: absolute; left: 0.15rem; top: 0.5em; width: 0.65rem; height: 0.35rem; border-left: 3px solid var(--good); border-bottom: 3px solid var(--good); transform: rotate(-45deg); }
.plans { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 30rem) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { border: 2px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.2rem; background: var(--panel); }
.plan.best { border-color: var(--accent); }
.plan .tagline { font-size: 0.85rem; font-weight: 700; color: var(--accent); min-height: 1.2em; }
.plan .price { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.plan .price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .eq { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.6rem; }
.plan .btn { margin-top: auto; text-align: center; }
.fine { color: var(--muted); font-size: 0.9rem; margin: 0.9rem 0 0; }
.err { color: var(--bad); min-height: 1.3em; margin: 0.6rem 0 0; font-weight: 600; }

dialog { border: 0; border-radius: 18px; padding: 1.5rem; width: min(94vw, 34rem); max-height: 92vh; background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgba(8, 18, 14, 0.6); }
dialog .close { position: absolute; top: 0.6rem; right: 0.6rem; }
dialog .why { font-weight: 700; color: var(--accent); margin: 0 0 0.6rem; min-height: 2.4em; padding-right: 5.5rem; }
.signin { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.signin summary { cursor: pointer; font-weight: 700; }
.signin form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.signin input[type="email"] { flex: 1 1 12rem; font: inherit; padding: 0.7rem 0.9rem; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); min-height: 44px; }
.signin input[type="email"]:focus { border-color: var(--accent); outline: none; }
.signin .note { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.95rem; }

footer { margin-top: 2.5rem; color: var(--muted); font-size: 0.9rem; }

@media (prefers-reduced-motion: no-preference) {
  .board.won { animation: settle 0.5s ease-out; }
  @keyframes settle { from { transform: scale(0.985); } to { transform: scale(1); } }
}

.cell .notes {
  position: absolute;
  inset: calc(var(--cell) * 0.3) calc(var(--cell) * 0.06) calc(var(--cell) * 0.03);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  font-size: calc(var(--cell) * 0.21);
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}
.cell .notes i { font-style: normal; text-align: center; line-height: 1.05; }

.page { padding: 1.5rem 0 1rem; }
.page h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 1rem; }
.page h2 { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 0.4rem; }
.page p, .page li { color: var(--ink); max-width: 38rem; }
.page .meta { color: var(--muted); }
footer a { color: inherit; }

.link { background: none; border: 0; color: var(--muted); font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0.4rem 0.3rem; min-height: 36px; font-size: 0.95rem; }
.link:hover { color: var(--ink); }

.afterwin { text-align: center; margin: 0.25rem 0 1rem; }
.afterwin .next { color: var(--muted); margin: 0.7rem 0 0; }
.afterwin .next b { color: var(--ink); font-variant-numeric: tabular-nums; }
.upsell { margin: 1.1rem auto 0; max-width: 24rem; text-align: left; border: 2px solid var(--accent); border-radius: 16px; padding: 1rem 1.1rem; background: var(--panel); }
.upsell h3 { margin: 0 0 0.3rem; font-size: 1.15rem; }
.upsell p { margin: 0 0 0.8rem; color: var(--muted); }
details.how .howvid { display: block; width: 100%; max-width: 320px; margin: 0.75rem auto 1rem; border-radius: 12px; background: #0f2d28; }

/* ---------- games nav ---------- */
.games { display: flex; gap: 0.25rem; margin-inline: auto 0.5rem; }
.games a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.95rem; padding: 0.35rem 0.7rem; border-radius: 999px; }
.games a[aria-current="page"] { background: var(--hl); color: var(--ink); }
.games a:hover { color: var(--ink); }

/* ---------- solitaire ---------- */
.sol .shell, .shell.sol { width: min(100% - 1rem, 40rem); }
.solboard { --cw: 44px; --ch: 62px; --gap: 5px; user-select: none; -webkit-user-select: none; touch-action: manipulation; margin: 0.5rem 0 0.75rem; }
.solrow { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--gap); align-items: start; }
.solrow.top { margin-bottom: calc(var(--gap) * 3); }
.solrow.tab { align-items: start; }
.slot, .col { position: relative; min-height: var(--ch); border-radius: 8px; }
.slot { aspect-ratio: 5 / 7; min-height: 0; border: 2px dashed var(--line); background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--muted); }
.slot.stock { cursor: pointer; border-style: solid; background: transparent; }
.slot.found { border-color: var(--line); }
.slot .ghost { font-size: calc(var(--cw) * 0.55); opacity: 0.35; }
.slot.found.red .ghost { color: var(--bad); }
.slot .again { font-size: calc(var(--cw) * 0.6); line-height: 1; }
.slot .count { position: absolute; right: 3px; bottom: 1px; font-size: 0.72rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.spacer { display: block; }
.col { border: 2px dashed transparent; }
.col.empty { border-color: var(--line); }
.slot > .card, .slot.waste > .card, .slot.found > .card { position: absolute; inset: -2px; width: auto; }
.card { position: absolute; left: 0; width: 100%; aspect-ratio: 5 / 7; border-radius: 7px; border: 1px solid #9fb5aa; background: #fffdf8; color: #12352b; display: flex; flex-direction: column; align-items: flex-start; padding: 2px 0 0 4px; font: inherit; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.18); overflow: hidden; }
.card.red { color: #c0352b; }
.card .cr { font-size: calc(var(--cw) * 0.34); letter-spacing: -0.04em; }
.card .cs { font-size: calc(var(--cw) * 0.3); margin-top: 1px; }
.card.down { background: repeating-linear-gradient(45deg, #1f5a46, #1f5a46 4px, #17483a 4px, #17483a 8px); border-color: #0f2d24; cursor: default; padding: 0; }
.slot.stock .card.down { position: absolute; inset: -2px; width: auto; cursor: pointer; }
.card.sel { outline: 3px solid var(--sel); outline-offset: 0; box-shadow: 0 0 0 2px var(--sel), 0 3px 8px rgba(0,0,0,.35); z-index: 3; }
.slot.waste { border-color: transparent; }

.solctl { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.solmoves { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.solwin { margin: 1rem 0; padding: 1rem 1.2rem; border-radius: 14px; background: var(--panel); border: 2px solid var(--good); }
.solwin h2 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.solwin p { margin: 0.25rem 0 0.75rem; }
.solarchive { margin-top: 1rem; }
.past { color: var(--muted); font-size: 0.95rem; }
.past input { font: inherit; margin-left: 0.4rem; padding: 0.3rem 0.5rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }

.btn[hidden], .solwin[hidden] { display: none !important; }

/* Word game and small-screen bundle navigation */
.top { flex-wrap: wrap; gap: .7rem; }
.crypto-board { display:flex;flex-wrap:wrap;gap:1rem .7rem;padding:1.5rem 0; }
.crypto-word {display:flex;gap:3px;max-width:100%;flex-wrap:wrap;}
.crypto-cell {display:flex;flex-direction:column;align-items:center;justify-content:center;width:clamp(25px,7vw,40px);height:62px;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-size:1.25rem;}
.crypto-cell small {font-size:.7rem;color:var(--muted);}
.crypto-cell.selected {background:var(--sel);border-color:var(--ink);}
.crypto-keyboard {display:grid;grid-template-columns:repeat(7,1fr);gap:5px;margin:1rem 0;}
.crypto-keyboard button {padding:.5rem 0;border:1px solid var(--line);border-radius:6px;background:var(--panel);}
.crypto-keyboard button.used {opacity:.55;}
#practice {max-width:10rem;padding:.6rem;font:inherit;text-transform:uppercase;}

/* ---------- ladder ---------- */
.ladder { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; margin: 0.8rem 0 0.4rem; }
.lrow { display: grid; grid-template-columns: 3.2rem auto; align-items: center; gap: 0.6rem; justify-content: center; }
.llab { font-size: 0.74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; text-align: right; }
.ltiles { display: flex; gap: 0.35rem; }
.lt { width: clamp(46px, 13vw, 60px); height: clamp(46px, 13vw, 60px); display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 800; font-size: clamp(1.3rem, 6vw, 1.7rem); text-transform: uppercase; padding: 0; }
button.lt { cursor: pointer; touch-action: manipulation; }
button.lt:hover { border-color: var(--ink); }
.lt.fixed { background: var(--hl); }
.lt.chg { background: var(--sel); border-color: var(--ink); }
.lt.sel { background: var(--sel); outline: 3px solid var(--ink); outline-offset: 2px; }
.lt.goal { border-style: dashed; border-color: var(--accent); color: var(--accent); background: transparent; }
.lrow.active .lt { border-color: var(--ink); }
.ladkeys { margin: 0.6rem 0 0.9rem; }
.ladkeys button:disabled { opacity: 0.45; }

/* four game links plus the account link need to wrap on small phones */
.games { flex-wrap: wrap; }
@media (max-width: 440px) { .games a { padding: 0.3rem 0.5rem; font-size: 0.88rem; } }

/* ---------- rewards: coin chip, toast, page ---------- */
.coinchip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.28rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--hl); color: var(--ink); font-weight: 800; font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.coinchip::before { content: ""; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1b8, #e0b23c 60%, #b98a1c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.coinchip:hover { border-color: var(--ink); }
.cwtoast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(0.8rem + env(safe-area-inset-top, 0px)); width: min(92vw, 24rem); background: var(--ink); color: var(--bg); padding: 0.9rem 1.1rem; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 60; cursor: pointer; }
.cwt-big { font-size: 1.5rem; font-weight: 800; }
.cwt-line { font-size: 0.92rem; opacity: 0.9; }
.cwt-rank { margin-top: 0.4rem; font-weight: 800; color: #ffd66b; }
.cwt-link { display: inline-block; margin-top: 0.5rem; color: inherit; font-weight: 700; }
.rw-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.rw-card h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.rw-kicker { margin: 0; color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.rw-rank { margin: 0 0 0.6rem; font-size: 2rem; }
.rw-bar { height: 12px; border-radius: 999px; background: var(--hl); border: 1px solid var(--line); overflow: hidden; }
.rw-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.rw-sub { color: var(--muted); font-size: 0.95rem; margin: 0.5rem 0 0; }
.rw-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 0.8rem; }
.rw-stats b { font-size: 1.3rem; }
.rw-stats span { color: var(--muted); }
.rw-list { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.rw-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.rw-badge { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem; border: 1px dashed var(--line); border-radius: 12px; opacity: 0.7; }
.rw-badge span { color: var(--muted); font-size: 0.88rem; }
.rw-badge em { font-style: normal; font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.rw-badge.got { border: 2px solid var(--good); background: var(--hl); opacity: 1; }
.rw-badge.got em { color: var(--good); }
.rw-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.7rem; margin-top: 0.6rem; }
.rw-item { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.7rem; border: 1px solid var(--line); border-radius: 12px; align-items: flex-start; }
.rw-item span { color: var(--muted); font-size: 0.88rem; }
.rw-item small { color: var(--muted); }
.rw-item .btn { margin-top: auto; }
.rw-sw { position: relative; width: 100%; height: 44px; border-radius: 8px; border: 1px solid var(--line); display: flex; gap: 6px; align-items: center; padding: 0 10px; }
.rw-sw i { width: 22px; height: 22px; border-radius: 6px; display: block; }
.rw-cb { width: 54px; height: 76px; border-radius: 7px; border: 1px solid #9fb5aa; }
.rw-fine { color: var(--muted); font-size: 0.88rem; margin: 1rem 0; }

/* card backs: shown on the Rewards page and on face-down Solitaire cards */
.cb-plain { background: repeating-linear-gradient(45deg, #1f5a46, #1f5a46 4px, #17483a 4px, #17483a 8px); }
.cb-linen, html[data-cw-back="linen"] .card.down { background: repeating-linear-gradient(0deg, #efe6d2 0 3px, #e4d8bf 3px 4px), repeating-linear-gradient(90deg, rgba(160,140,100,.28) 0 3px, transparent 3px 4px); border-color: #bfae8a; }
.cb-ember, html[data-cw-back="ember"] .card.down { background: repeating-linear-gradient(135deg, #b4531f 0 6px, #8f3d14 6px 12px); border-color: #5e2608; }
.cb-constellation, html[data-cw-back="constellation"] .card.down {
  background:
    radial-gradient(circle at 22% 24%, #ffe9a8 0 1.3px, transparent 1.9px),
    radial-gradient(circle at 72% 18%, #f5d77a 0 1px, transparent 1.6px),
    radial-gradient(circle at 46% 52%, #ffe9a8 0 1.5px, transparent 2.1px),
    radial-gradient(circle at 80% 68%, #f5d77a 0 1px, transparent 1.6px),
    radial-gradient(circle at 26% 80%, #f5d77a 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 60% 88%, #ffe9a8 0 1px, transparent 1.6px),
    linear-gradient(160deg, #10183a, #1c2a5e);
  border-color: #d6b35a; box-shadow: inset 0 0 0 2px #1c2a5e, inset 0 0 0 3px #d6b35a;
}

/* unlockable color themes (light and dark system settings both covered) */
html[data-cw-theme="sand"] { --bg: #f3ebdd; --panel: #fbf7ef; --ink: #3b2a1a; --muted: #7a6550; --line: #d4c4a8; --hl: #efe3cc; --sel: #ffcf6b; --accent: #a4471f; --accent-ink: #ffffff; }
html[data-cw-theme="ocean"] { --bg: #e4eef5; --panel: #f6fafc; --ink: #0f2a3d; --muted: #4a6578; --line: #b3c9d8; --hl: #dbe9f2; --sel: #ffe08a; --accent: #1b6ca8; --accent-ink: #ffffff; }
html[data-cw-theme="berry"] { --bg: #f5e8ef; --panel: #fcf5f8; --ink: #3a1228; --muted: #7c4d66; --line: #dcbccb; --hl: #f0dbe5; --sel: #ffd1a3; --accent: #a1195e; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  html[data-cw-theme="sand"] { --bg: #1d1710; --panel: #2a2117; --ink: #f3e8d6; --muted: #c1ad90; --line: #44372a; --hl: #352a1d; --sel: #7a5a10; --accent: #f0a36b; --accent-ink: #2a1405; }
  html[data-cw-theme="ocean"] { --bg: #0b1721; --panel: #12242f; --ink: #e1eef7; --muted: #8fb0c7; --line: #26425a; --hl: #19303f; --sel: #6b5a14; --accent: #7cc0f2; --accent-ink: #08202f; }
  html[data-cw-theme="berry"] { --bg: #1c0d15; --panel: #2a1520; --ink: #f7e3ee; --muted: #c79bb3; --line: #4a2638; --hl: #36202d; --sel: #7a4b1a; --accent: #ff8cc0; --accent-ink: #2d0a1a; }
}
html[data-cw-theme="midnight"] { --bg: #0f1220; --panel: #181c30; --ink: #e6e9ff; --muted: #9aa3d6; --line: #2d3358; --hl: #20264a; --sel: #6a5400; --accent: #9db4ff; --accent-ink: #0c1030; color-scheme: dark; }

/* ---------- win effects (gentle; disabled for reduced motion) ---------- */
@keyframes cwlit { 0% { transform: scale(1); } 40% { transform: scale(1.1); background: #ffe08a; color: #12352b; } 100% { transform: scale(1); } }
@keyframes cwstar { 0% { opacity: 0; transform: translate(0, 0) scale(0.3) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--r)); } }
@keyframes cwglow { 0%, 100% { box-shadow: none; } 40% { box-shadow: 0 0 18px 4px rgba(255, 214, 107, 0.85); } }
@keyframes cwfade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes cwpulse { 0%, 100% { transform: none; } 45% { transform: scale(1.07); background: #ffe08a; } }
@keyframes cwpop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.14); box-shadow: 0 0 12px rgba(255, 214, 107, 0.9); } }
.lrow.lit .lt { animation: cwlit 0.6s ease; }
.lrow.gold .lt { background: #ffd66b; color: #12352b; border-color: #b98a1c; box-shadow: 0 0 14px rgba(255, 214, 107, 0.8); }
.cwfx { position: fixed; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; z-index: 55; }
.cwstar { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; background: #ffd66b; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: cwstar 1.8s ease-out both; }
.solboard.cwglow .slot.found { animation: cwglow 1.8s ease; }
.crypto-board.cwreveal .crypto-cell span { animation: cwfade 0.5s ease both; animation-delay: var(--d, 0ms); }
.cell.cwpulse { animation: cwpulse 0.7s ease both; animation-delay: var(--d, 0ms); }
.coinchip.pop { animation: cwpop 0.8s ease; }
.cwt-rank { animation: cwfade 0.6s ease both 0.3s; }
@media (prefers-reduced-motion: reduce) { .coinchip.pop, .cwt-rank, .lrow.lit .lt, .cwstar { animation: none; } }
.rw-fx { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.rw-fx input { width: 1.2rem; height: 1.2rem; }

html[data-cw-theme="slate"] { --bg: #e8ecf1; --panel: #f6f8fa; --ink: #1f2933; --muted: #556270; --line: #c3ccd6; --hl: #dde3ea; --sel: #ffe08a; --accent: #41627f; --accent-ink: #ffffff; }
html[data-cw-theme="lavender"] { --bg: #efeaf7; --panel: #f9f6fd; --ink: #2b1745; --muted: #6a5a85; --line: #d3c7e6; --hl: #e6def2; --sel: #ffdca0; --accent: #6b3fa0; --accent-ink: #ffffff; }
html[data-cw-theme="sunrise"] { --bg: #fbeadd; --panel: #fff6ee; --ink: #40201a; --muted: #85554a; --line: #eccbb6; --hl: #f7dcc9; --sel: #ffd166; --accent: #d1503a; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  html[data-cw-theme="slate"] { --bg: #12171d; --panel: #1b222b; --ink: #e6ecf2; --muted: #9aa9b8; --line: #2f3a46; --hl: #232c37; --sel: #6b5a14; --accent: #8fb4d8; --accent-ink: #0d1822; }
  html[data-cw-theme="lavender"] { --bg: #17101f; --panel: #221833; --ink: #efe6fb; --muted: #b6a3d0; --line: #3b2b57; --hl: #2c2040; --sel: #6b5a14; --accent: #c3a2f2; --accent-ink: #1c0c33; }
  html[data-cw-theme="sunrise"] { --bg: #1f1410; --panel: #2c1d17; --ink: #fbeadd; --muted: #cba592; --line: #4a3126; --hl: #382519; --sel: #7a5a10; --accent: #ff9a80; --accent-ink: #331005; }
}
/* ladder tile styles */
html[data-cw-tile="round"] .lt, .rw-tl[data-t="round"] .lt { border-radius: 999px; }
html[data-cw-tile="stamp"] .lt, .rw-tl[data-t="stamp"] .lt { border-width: 1px; border-radius: 3px; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
html[data-cw-tile="gilded"] .lt, .rw-tl[data-t="gilded"] .lt { border-color: #b98a1c; box-shadow: inset 0 0 0 2px rgba(255, 214, 107, 0.55); }
.rw-tl { display: flex; gap: 5px; align-items: center; height: 44px; }
.rw-tl .lt { width: 32px; height: 32px; font-size: 1rem; font-style: normal; }
html[data-cw-tile="gilded"] .lrow.active .lt { border-color: #b98a1c; }

/* ---------- homepage hub ---------- */
.hero { padding: 0.6rem 0 1rem; }
.hero h1 { font-size: clamp(1.9rem, 7.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 0.6rem; text-wrap: balance; }
.hero .lead { color: var(--muted); margin: 0; max-width: 30rem; }
.gcards { display: grid; gap: 0.9rem; margin: 0.5rem 0 1.5rem; }
.gcard { display: grid; grid-template-columns: clamp(6rem, 31vw, 8rem) 1fr; gap: 0.9rem; align-items: center; border: 2px solid var(--line); border-radius: 16px; background: var(--panel); padding: 0.85rem; }
.gart { width: 100%; height: auto; display: block; }
.gtext { min-width: 0; }
.gtext h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.25rem; }
.gtext p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.95rem; }
.gtext .btn { display: inline-block; text-align: center; }
.a-panel { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.a-line { stroke: var(--line); stroke-width: 1.5; fill: none; }
.a-cage { stroke: var(--accent); stroke-width: 3; }
.a-num text, text.a-num { fill: var(--ink); font: 800 17px system-ui, sans-serif; }
.a-tiny { fill: var(--accent); font: 800 8px system-ui, sans-serif; }
.a-tiny2 text { fill: var(--muted); font: 700 9px system-ui, sans-serif; }
.a-tile { fill: var(--hl); stroke: var(--ink); stroke-width: 1.5; }
.a-tile.a-hot { fill: var(--sel); }
.a-card { fill: #fff; stroke: #8a948f; stroke-width: 1.5; }
.a-suit { fill: #222; font: 800 13px system-ui, sans-serif; }
.a-pip { fill: #222; font: 400 26px system-ui, sans-serif; }
.a-red { fill: #c0392b; }
.a-solved { fill: var(--accent); }
.a-bar { fill: var(--hl); }
.cmp { margin: 0.5rem 0 1rem; }
.cmp h2 { font-size: clamp(1.5rem, 5.5vw, 1.9rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 0.4rem; }
.cmp .sub { color: var(--muted); margin: 0 0 1rem; }
.cmprow { border: 2px solid var(--line); border-radius: 14px; padding: 0.8rem 0.9rem; margin-bottom: 0.7rem; background: var(--panel); }
.cmprow h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.cmprow .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.cmprow .cols > div { min-width: 0; }
.cmprow b { display: block; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.2rem; }
.cmprow .plusc b { color: var(--accent); }
.cmprow p { margin: 0; font-size: 0.95rem; }
@media (max-width: 420px) { .cmprow .cols { grid-template-columns: 1fr; } }
.perks b { font-weight: 800; }
.a-code { fill: var(--muted); font: 700 11px system-ui, sans-serif; }
.a-num { fill: var(--ink); font: 800 17px system-ui, sans-serif; }
.rw-plus { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); vertical-align: 0.1em; }

.qday { margin: 0.2rem 0 1.2rem; padding: 0.9rem 1rem; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 12px 12px 0; }
.qk { margin: 0 0 0.25rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.qt { margin: 0 0 0.3rem; font-size: clamp(1.2rem, 4.8vw, 1.45rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.qn { margin: 0; color: var(--muted); font-size: 0.9rem; }
.about { margin: 0.5rem 0 1.5rem; }
.about h2 { font-size: clamp(1.5rem, 5.5vw, 1.9rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 0.6rem; }
.about p { margin: 0 0 0.75rem; max-width: 32rem; }
.about .sig { color: var(--muted); font-size: 0.95rem; margin-top: 1rem; }
