/* Shared tokens and parts of the site and the game page: a dark game showcase, felt-green surfaces, gold for play. */
@font-face { font-family: 'Unbounded'; src: url('/fonts/unb.woff') format('woff'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Onest'; src: url('/fonts/onest.woff') format('woff'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jbm.woff') format('woff'); font-weight: 500; font-display: swap; }

:root {
  --bg: #0e1411; --s1: #151d19; --s2: #1d2823; --s3: #283530; --bar: #0a0f0d; --line: #26332c;
  --t1: #eef1ea; --t2: #b4bfb7; --t3: #8d9a92;
  --gold: #e8b04a; --gold-hi: #f3c467; --gold-edge: #b8862b; --gold-ink: #1a1405;
  --ok: #7fd1a8; --warn: #f2a38c; --focus: #8fd3ff;
  --chip: #55695e; --chip-on: #3a2f14;
  --head: 'Unbounded', 'Arial Black', system-ui, sans-serif; --text: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ico { width: 1.2em; height: 1.2em; flex: none; }


/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 10px; border: 0;
  font: 700 18px/1.1 var(--text); text-decoration: none; cursor: pointer; transition: background .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease); }
.btn-play { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 -3px 0 var(--gold-edge); }
.btn-play:hover { background: var(--gold-hi); }
.btn-play:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--gold-edge); }
.btn-play .tri { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; }
.btn-ghost { background: transparent; color: var(--t1); box-shadow: inset 0 0 0 1.5px var(--chip); font-weight: 600; font-size: 16px; }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold-hi); }

/* Download for offline */
.dl { display: flex; flex-direction: column; gap: 6px; }
.dl-note { font: 400 14px/1.4 var(--text); color: var(--t3); margin: 0; }
.dl-bar { position: relative; min-height: 48px; border-radius: 10px; background: var(--s3); overflow: hidden; display: flex; align-items: center; padding: 0 14px; gap: 12px; font: 600 16px/1 var(--text); color: var(--t1); }
.dl-bar i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--gold) 45%, transparent); width: 0; transition: width .2s linear; }
.dl-bar span { position: relative; flex: 1; }
.dl-bar button { position: relative; background: none; border: 0; color: var(--t2); font: 500 15px/1 var(--text); min-height: 44px; cursor: pointer; text-decoration: underline; }
.dl-ok { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 600 16px/1.3 var(--text); color: var(--ok); min-height: 44px; }
.dl-ok button { background: none; border: 0; color: var(--t3); font: 400 14px/1 var(--text); text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0; }
.dl-err { color: var(--t2); font: 400 15px/1.4 var(--text); }

/* Sheets and dialogs */
.sheet { padding: 0; border: 0; background: var(--s2); color: var(--t1); width: min(480px, 100vw); max-width: 100vw; max-height: min(85dvh, 760px);
  border-radius: 16px; overflow: hidden; display: none; flex-direction: column; font: 400 17px/1.55 var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .6); }
.sheet[open] { display: flex; animation: sheet-in .22s var(--ease); }
.sheet::backdrop { background: rgba(5, 8, 7, .6); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 20px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { margin: 0; font: 600 16px/1.2 var(--head); }
.sheet-body { overflow: auto; padding: 18px 20px 20px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { flex: none; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--s2); }
.x { width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--t1); font: 400 28px/1 var(--text); cursor: pointer; }
.x:hover { background: var(--s3); }
.link-btn { min-height: 44px; background: none; border: 0; color: var(--t2); font: 500 16px/1 var(--text); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
@media (max-width: 640px) {
  .sheet { margin: auto 0 0; width: 100vw; border-radius: 16px 16px 0 0; }
  .sheet[open] { animation-name: sheet-up; }
  .sheet-head::before { content: ''; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--s3); }
  .sheet-head { position: relative; padding-top: 14px; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }

.confirm { border: 0; border-radius: 16px; background: var(--s2); color: var(--t1); width: min(92vw, 400px); padding: 22px 20px 18px; font: 400 17px/26px var(--text); }
.confirm[open] { animation: sheet-in .16s var(--ease); }
.confirm::backdrop { background: rgba(5, 8, 7, .6); }
.confirm h2 { margin: 0 0 8px; font: 600 18px/1.3 var(--head); }
.confirm p { margin: 0 0 18px; color: var(--t2); }
.confirm .btn { width: 100%; min-height: 52px; }
.confirm .btn + .btn { margin-top: 8px; }
.btn-leave { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--chip); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; max-width: min(92vw, 440px);
  background: var(--s3); color: var(--t1); padding: 12px 16px; border-radius: 10px; font: 500 16px/1.35 var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

.cr { list-style: none; margin: 0; padding: 0; }
.cr li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.cr-title { font: 600 16px/1.35 var(--text); color: var(--t1); }
.cr-kind { font: 500 13px/1.3 var(--text); color: var(--t3); }
.cr-by { font: 400 15px/1.4 var(--text); color: var(--t2); }
.cr-lic { display: inline-block; font: 500 12px/1 var(--mono); color: var(--t2); background: var(--s3); border-radius: 6px; padding: 4px 6px; margin-left: 6px; text-decoration: none; }
.cr a { color: inherit; text-underline-offset: .18em; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .12s !important; transition-duration: .12s !important; scroll-behavior: auto !important; } }
