/* Ace: what every page shares. A game adds its own table on top of this.

   The look follows Turbo Snow's: the phone's own lettering, a page and its surfaces in the phone's light or dark,
   one accent, hairline borders, and everything that can be tapped a pill that dips under the finger. Pop-ups are
   sheets that rise from the bottom. The one place with a look of its own is a game's table, which is cloth. */
:root{
  color-scheme:light;
  --page:#f4f6f8; --surface:#ffffff; --ink:#0f1720; --ink2:#4b5560; --muted:#6b7480;
  --border:rgba(15,23,32,.10); --wash:rgba(15,23,32,.05); --field:rgba(15,23,32,.04);
  --accent:#1f8a5b; --on-accent:#ffffff; --tint:rgba(31,138,91,.12);
  --warn:#c8161d; --hi:#9a6200;                       /* hi: a figure worth noticing (money won, a winner) */
  --gold:#f2c14e; --on-gold:#1d1602;                  /* the table's own highlight; on a page it is only ever a fill */
  --shadow:0 1px 2px rgba(15,23,32,.06),0 8px 24px rgba(15,23,32,.06);
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --tap:44px;                                         /* the height of anything tapped in a row with other things */
  /* Names from the first look, kept so a game's own styles and anything not yet moved over still resolve. */
  --bg:var(--page); --dim:var(--muted); --line:var(--border); --hot:var(--warn); --panel:var(--surface); --glass:var(--wash); --mono:var(--sans);
}
@media (prefers-color-scheme:dark){:root{
  color-scheme:dark;
  --page:#0d1014; --surface:#161a1f; --ink:#f0f2f4; --ink2:#c0c6cc; --muted:#8a929b;
  --border:rgba(255,255,255,.10); --wash:rgba(255,255,255,.07); --field:rgba(255,255,255,.05);
  --accent:#35a873; --on-accent:#06150e; --tint:rgba(53,168,115,.16);
  --warn:#ff6b6f; --hi:#f2c14e;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 30px rgba(0,0,0,.35);
}}
/* Tapping twice quickly (a keypad, a card) must not zoom the page; sliding and pinching still work. */
*{box-sizing:border-box;margin:0;padding:0;touch-action:manipulation}
html,body{height:100%}
body{background:var(--page);color:var(--ink);font-family:var(--sans);line-height:1.45;min-height:100svh;overflow-x:hidden;
  -webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;font-variant-numeric:tabular-nums}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
button:disabled{cursor:default}
[hidden]{display:none!important}
a{color:inherit}
input:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Nothing flashes a color when it is pressed. What can be pressed gives a little instead: it dips while the finger
   is down and springs back when it lifts. */
.go,.ghost,.chips button,.seg button,.trow,.tile,.setting,.alink,.faces button,.swatches button,.me,.pillbtn{
  transition:transform .32s cubic-bezier(.3,1.6,.5,1),background-color .15s,border-color .15s,opacity .15s}
:is(.go,.ghost,.chips button,.seg button,.faces button,.swatches button,.pillbtn):not(:disabled):active{transform:scale(.95);transition-duration:.1s}
:is(a.trow,a.tile,.setting,.me):active{transform:scale(.985);transition-duration:.1s}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* A solid strip over the clock, in the page's own color. Since iOS 26 an iPhone lays a soft blur over the top of a
   page and smears whatever is there, unless something fixed, opaque, nearly full width and more than 10px deep
   sits against the top edge: then it fills the strip with that color instead. The phone finds the strip by
   asking what a touch there would land on, so it must be touchable (no pointer-events:none), which costs nothing
   up where the clock is. */
#topTint{position:fixed;top:0;left:0;right:0;height:calc(env(safe-area-inset-top,0px) + 12px);z-index:7;background:var(--page)}

/* ---------- a page ---------- */
.page{max-width:560px;margin:0 auto;padding:calc(26px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom))}
.brand{display:flex;align-items:center;gap:12px}
.brand img{width:46px;height:46px;border-radius:12px;box-shadow:var(--shadow)}
h1{font-weight:750;font-size:clamp(28px,7.4vw,36px);letter-spacing:-.02em;line-height:1.1}
.tag{color:var(--muted);font-size:15px;margin:8px 0 20px}
/* The way back: a pill, like everything else that is tapped. */
.crumb{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px 0 10px;margin-bottom:14px;border-radius:999px;background:var(--wash);
  color:var(--ink2);font-size:14px;font-weight:600;text-decoration:none}
.crumb::before{content:"‹";font-size:19px;line-height:1;margin-top:-2px}
.panel{border:1px solid var(--border);border-radius:20px;background:var(--surface);padding:18px;margin-top:14px;box-shadow:var(--shadow)}
.panel h2,.label{font-size:13px;font-weight:650;color:var(--muted);margin-bottom:12px;letter-spacing:.01em}
.none{color:var(--muted);font-size:14.5px}

/* a player's face */
.av{flex:none;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-size:24px;line-height:1;
  background:var(--c,#1f8a5b);box-shadow:0 0 0 2px var(--surface),0 0 0 3px var(--border)}
.av.big{width:58px;height:58px;font-size:32px}
.av.sm{width:30px;height:30px;font-size:17px}
.av.empty{background:var(--wash);color:var(--muted);font-size:16px}

/* What is set, in one line; tapping it changes it. */
.setup{display:flex;align-items:center;gap:10px;width:100%;min-height:var(--tap);padding:0 8px 0 16px;border-radius:999px;background:var(--wash);text-align:left;font-size:14.5px;color:var(--ink2);
  transition:transform .32s cubic-bezier(.3,1.6,.5,1)}
.setup:active{transform:scale(.98);transition-duration:.1s}
.setup span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.setup b{flex:none;display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:999px;background:var(--surface);color:var(--accent);font-size:13.5px;font-weight:650;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.hint{color:var(--muted);font-size:13.5px;margin-top:12px}

/* who you are, in one line */
.me{display:flex;align-items:center;gap:14px;width:100%;text-align:left}
.me .t{flex:1;min-width:0}
.me .t b{display:block;font-size:17px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me .t span{display:block;color:var(--muted);font-size:14px;margin-top:1px}

/* choosing a name, face, and color */
.who{display:flex;gap:12px;align-items:center}
.who input,.acctform input,.num{background:var(--field);border:1px solid var(--border);border-radius:14px;color:var(--ink);font:inherit;font-size:16px;
  padding:0 14px;height:var(--tap);-webkit-appearance:none;appearance:none}
.who input{flex:1;min-width:0;font-size:17px}
.who input:focus,.acctform input:focus,.num:focus{outline:none;border-color:var(--accent)}
.faces{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;margin-top:14px}
.faces button{aspect-ratio:1;border-radius:12px;font-size:22px;line-height:1;background:var(--wash)}
.faces button[aria-pressed=true]{background:var(--tint);box-shadow:0 0 0 2px var(--accent)}
.swatches{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
.swatches button{width:30px;height:30px;border-radius:50%;background:var(--c)}
.swatches button[aria-pressed=true]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--ink)}

/* buttons: a filled pill for the thing to do, a quiet pill for everything else */
.go{display:flex;align-items:center;justify-content:center;width:100%;min-height:50px;margin-top:18px;padding:0 20px;border-radius:999px;
  background:var(--accent);color:var(--on-accent);font-weight:700;font-size:16.5px;text-align:center;text-decoration:none}
.go:disabled{opacity:.45}
.ghost{display:inline-flex;align-items:center;justify-content:center;min-height:var(--tap);border-radius:999px;padding:0 18px;background:var(--wash);
  font-weight:600;font-size:15.5px;text-align:center;text-decoration:none}
.ghost.warn{color:var(--warn)}
.row{display:flex;gap:10px;flex-wrap:wrap}
.btns{display:flex;gap:10px;margin-top:20px}
.btns .go{margin-top:0;flex:2;min-height:48px}.btns .ghost{flex:1;min-height:48px}

/* a choice among a few: pills, the chosen one filled */
.chips{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chips button{min-height:40px;padding:0 16px;border-radius:999px;background:var(--wash);font-size:15px;font-weight:600}
.chips button[aria-pressed=true]{background:var(--ink);color:var(--page)}
.num{width:96px;height:40px;border-radius:999px;font-size:15px}

/* a table in a list */
.tables{display:flex;flex-direction:column}
.trow{display:flex;align-items:center;gap:12px;padding:12px 0;text-decoration:none;border-top:1px solid var(--border);min-width:0}
.trow:first-child{border-top:0;padding-top:0}
.trow:last-child{padding-bottom:0}
.trow .t{min-width:0;flex:1}
.trow .t b{display:block;font-size:16px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.trow .t span{display:block;color:var(--muted);font-size:13.5px;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.badge{flex:none;font-size:12.5px;font-weight:650;border-radius:999px;padding:5px 11px;color:var(--ink2);background:var(--wash);white-space:nowrap}
.badge.you{background:var(--gold);color:var(--on-gold)}
.badge.sit{background:var(--accent);color:var(--on-accent)}

/* pop-ups: sheets that rise from the bottom, as in Turbo Snow */
dialog{box-sizing:border-box;width:calc(100vw - 16px);max-width:540px;max-height:calc(100dvh - env(safe-area-inset-top,0px) - 28px);
  margin:auto auto calc(8px + env(safe-area-inset-bottom,0px));padding:22px 18px 18px;border:0;border-radius:26px;overflow:auto;
  background:var(--surface);color:var(--ink);box-shadow:0 18px 60px rgba(0,0,0,.35);overscroll-behavior:contain}
dialog[open]{animation:sheetup .24s cubic-bezier(.2,.9,.3,1)}
dialog::backdrop{background:rgba(15,23,32,.38)}
@keyframes sheetup{from{transform:translateY(28px);opacity:0}}
@media (min-width:700px){dialog{margin:auto}}
dialog:focus{outline:none}
dialog h3{font-size:clamp(22px,6vw,28px);line-height:1.15;letter-spacing:-.02em;font-weight:750}
dialog .why{color:var(--muted);margin-top:6px;font-size:15px}
dialog .why.warn{color:var(--warn);min-height:0}
dialog .why.warn:empty{display:none}
.setting{display:flex;align-items:center;gap:12px;padding:13px 0;border-top:1px solid var(--border);width:100%;text-align:left}
.setting:first-of-type{margin-top:14px}
.setting .t{flex:1;min-width:0}
.setting .t b{display:block;font-size:16px;font-weight:600}
.setting .t span{display:block;color:var(--muted);font-size:13.5px;margin-top:1px}
.setting b.warn{color:var(--warn)}
.switch{flex:none;width:50px;height:30px;border-radius:999px;background:var(--wash);box-shadow:inset 0 0 0 1px var(--border);position:relative;transition:background .18s}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .22s cubic-bezier(.3,1.4,.5,1)}
[aria-checked=true] .switch{background:var(--accent);box-shadow:none}
[aria-checked=true] .switch::after{transform:translateX(20px)}
.chev{flex:none;color:var(--muted);font-size:20px}
.link{font-size:14px;background:var(--field);border:1px solid var(--border);border-radius:14px;
  padding:12px 14px;word-break:break-all;user-select:all;-webkit-user-select:all;margin:12px 0;color:var(--ink2)}
.qr{display:block;width:min(220px,60vw);margin:16px auto 4px;border-radius:16px;overflow:hidden;background:#fff;padding:6px}
.qr svg{display:block;width:100%;height:auto}

#toast{position:fixed;left:50%;bottom:calc(96px + env(safe-area-inset-bottom));transform:translate(-50%,20px);opacity:0;pointer-events:none;
  background:var(--ink);color:var(--page);border-radius:999px;padding:10px 18px;font-size:14.5px;font-weight:600;max-width:calc(100vw - 30px);
  box-shadow:0 8px 24px rgba(0,0,0,.3);transition:opacity .2s,transform .28s cubic-bezier(.3,1.4,.5,1);z-index:200;text-align:center}
#toast.on{opacity:1;transform:translate(-50%,0)}

/* ---------- accounts and the leaderboard ---------- */
.acct{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px;padding-top:14px;border-top:1px solid var(--border);font-size:14px;color:var(--muted)}
.acct > span{flex-basis:100%}
.acct b{color:var(--ink)}
.alink{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border-radius:999px;background:var(--tint);color:var(--accent);font-size:13.5px;font-weight:650}
.acctform{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.trow.lb .rank{flex:none;width:20px;text-align:right;font-size:13px;font-weight:650;color:var(--muted)}
.trow.lb .wl{flex:none;font-size:13.5px;color:var(--muted);white-space:nowrap}
.trow.lb .wl b{color:var(--hi);font-size:16px}
.trow.lb.me .t b{color:var(--accent)}
