/* Interface skin: level ring, wallet, tool dock, and the sheets that hold the
 * hub, the quests, the record and every prompt. Plus the unlockable card backs
 * and table surfaces, which are the only rules in here that table.css reads.
 *
 * Loads after table.css and overrides --back-* and --table-* from the equipped
 * pair. A single accent (--key) runs through everything; the rest is the glass
 * the two bars are made of. */

:root {
  --gem: #7fd4ff;         /* only ever drawn with gems switched on */
  --sol: #8f7bff;         /* $SOLITAIRE, and only drawn with LP_P2E on */
  --xp: #a99cff;
  --good: #6ee7a5;
  --warn: #ffb26b;
  --danger: #ff6b81;
  --sheet: #1a2040;
  --line: rgba(255, 255, 255, .1);
}

/* ---------- money ---------- */

/* Drawn, not typed. An emoji coin renders differently on every platform and
   sits differently on the baseline. These are consistent and scale with the
   text they sit in. */
.coin, .gem, .xp, .bo {
  display: inline-block;
  font-style: normal;
  vertical-align: -.12em;
  margin-right: .34em;
}
.coin {
  width: .92em; height: .92em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffe8a3, #f2ad3e 58%, #bd7a15);
  box-shadow: inset 0 0 0 .075em rgba(255, 255, 255, .38);
}
.coin.big { width: 1.8em; height: 1.8em; margin: 0 0 6px; }
.gem {
  width: .82em; height: .82em;
  border-radius: .12em;
  transform: rotate(45deg);
  vertical-align: -.05em;
  background: linear-gradient(135deg, #bdeaff, var(--gem) 55%, #2a9fd6);
}
.xp { color: var(--xp); margin-right: .28em; }
.xp::before { content: "✦"; }
.bo { margin-right: .28em; }

/* $SOLITAIRE. Deliberately not a coin and not a gem: it is the one thing in
   here that is worth something outside the game, and a player should never have
   to work out which of three round things they are looking at. */
.sol {
  display: inline-block;
  font-style: normal;
  vertical-align: -.12em;
  margin-right: .34em;
  width: .92em; height: .92em;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #c9b8ff, var(--sol) 45%, #4b31c9 85%, #c9b8ff);
  box-shadow: inset 0 0 0 .075em rgba(255, 255, 255, .32);
}

/* ---------- top bar ---------- */

/* Level as a filled ring with the number inside it. A bar plus a separate
   number costs roughly three times the width for the same information. */
.ring {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .3);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ring-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
}
/* Conic sweep masked to a thin band: one element and one custom property,
   rather than an SVG with a stroke-dashoffset. */
.ring-fill i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--key) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .13) 0);
  -webkit-mask: radial-gradient(circle, transparent 12px, #000 12.5px);
  mask: radial-gradient(circle, transparent 12px, #000 12.5px);
  transition: background .45s ease;
}
.ring b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring.big { width: 76px; height: 76px; margin: 0 auto 12px; }
.ring.big .ring-fill i {
  -webkit-mask: radial-gradient(circle, transparent 30px, #000 31px);
  mask: radial-gradient(circle, transparent 30px, #000 31px);
}
.ring.big b { font-size: 27px; }

/* Three figures under three labels. Unlabelled, the row has to be decoded on
   every glance. */
.readout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0 auto;
  min-width: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.metric { display: flex; flex-direction: column; line-height: 1.05; }
.metric i {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .42;
}
.metric b { font-size: 15px; font-weight: 700; }

/* ---------- the chain ---------- */

/* A fourth metric that is only there while there is something to say. It sits
   beside the score rather than over the table because it is a number you glance
   at between moves, not an event — the flare below is the event.

   Three states, keyed off data-mult, which klondike.js writes. The first is
   deliberately quiet: a chain under the first rung is worth nothing yet and
   should not shout. The heat is the reward for keeping it. */
.metric.chain[hidden] { display: none; }
.metric.chain b {
  display: flex;
  align-items: baseline;
  gap: .18em;
  color: var(--key);
  transition: color .25s ease;
}
.metric.chain em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
  opacity: .9;
}
.metric.chain i { color: var(--key); opacity: .55; }
.metric.chain[data-mult="1"] b { color: inherit; }
.metric.chain[data-mult="1"] i { color: inherit; opacity: .42; }
.metric.chain[data-mult="3"] b {
  color: #ffd066;
  text-shadow: 0 0 10px rgba(255, 194, 71, .65);
}

/* Retriggered by klondike.js on every link, by removing and re-adding the class.
   A step, not a throb: the chain is being fed, so it should twitch once per card
   and be still in between. */
.metric.chain.tick b { animation: chain-tick .28s ease-out; }
@keyframes chain-tick {
  40% { transform: translateY(-2px) scale(1.22); }
}

/* ---------- the pop ---------- */

/* A hit number, thrown off the card that earned it.
 *
 * The look is moulded, not typed: a fat dark stroke carrying a warm gradient,
 * with the light coming from above — a bright top stop, a deeper bottom one, and
 * a thin bright edge along the top of the glyphs. That is what separates an
 * arcade number from bold text with a shadow.
 *
 * Two stacked copies of the same string do it. `b` is the gradient fill, clipped
 * to the text. `b::before` is the same string again, underneath, wearing the
 * stroke — because a stroke painted on the gradient copy would eat into the
 * letterforms from the outside in, and thick strokes need to grow outward.
 */
/* With the canvas up, `table3d.js` throws the same number as a billboard that
   stands square to the seat and sits in the scene. Exactly one of the two is
   ever on screen, and neither has to know about the other: `data-gl` is `ready`
   only while the renderer is actually drawing, and goes back to `off` the moment
   it is not — at which point this one is simply there again. */
[data-gl="ready"] .pop { display: none; }

.pop {
  position: absolute;
  top: 0; left: 0;
  z-index: 640;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-left: -80px;          /* the element is centred on the point it is given */
  width: 160px;
  pointer-events: none;
  will-change: transform, opacity;
  animation: pop-throw 1.05s cubic-bezier(.16, .84, .3, 1) both;
}
.pop b, .pop i {
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -.01em;
}
/* The base layer wears the outline. -webkit-text-stroke is centred on the glyph
   edge, so half of it grows inward and eats the counters of O and B — hence a
   modest width, and hence the fill going on top rather than behind. An earlier
   pass buried the stroke with `z-index: -1` and it painted over the fill anyway:
   negative-z-index children draw above their parent's background, and with
   background-clip:text the gradient *is* the background. */
.pop b {
  position: relative;
  font-size: 25px;
  -webkit-text-stroke: 5px var(--pop-edge, #4a2200);
  color: var(--pop-edge, #4a2200);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .38)) drop-shadow(0 7px 16px rgba(0, 0, 0, .55));
}
/* …and the fill goes over it, unstroked, so the outline only ever shows outside
   the letterform. Same string, same box, no stroke of its own. */
.pop b::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  -webkit-text-stroke: 0;
  background-image: linear-gradient(
    #fffaf0 0%, #fff0c9 22%, var(--pop-hi, #ffd76b) 46%, var(--pop-lo, #ff9b21) 82%, var(--pop-lo, #ff9b21) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.pop i {
  font-size: 13px;
  color: #fff3d4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .8), 0 0 8px rgba(255, 170, 60, .7);
  opacity: .95;
}

/* Four tiers, one per rung. The chain gets hotter and bigger as it climbs, which
   is the whole reward loop rendered in one property each. */
.pop.t1 { --pop-hi: #ffe9b0; --pop-lo: #ffb43d; --pop-edge: #4a2c00; }
.pop.t2 { --pop-hi: #ffd76b; --pop-lo: #ff8c1a; --pop-edge: #4a2200; }
.pop.t2 b { font-size: 30px; }
.pop.t3 { --pop-hi: #ffc98a; --pop-lo: #ff5f3a; --pop-edge: #4d1500; }
.pop.t3 b { font-size: 35px; }
.pop.t4 { --pop-hi: #ffd0f0; --pop-lo: #ff3d7a; --pop-edge: #4d0022; }
.pop.t4 b { font-size: 41px; }
.pop.t4 i { color: #ffe1ee; }

/* Overshoot, settle, then rise and go. The scale is on an inner wrapper's worth
   of transform so the translate the element carries is not fought over. */
@keyframes pop-throw {
  0%   { opacity: 0; transform: translate(var(--x, 0), var(--y, 0)) scale(.35) rotate(var(--lean, 0deg)); }
  18%  { opacity: 1; transform: translate(calc(var(--x, 0) + var(--drift, 0px)), calc(var(--y, 0) - 12px)) scale(1.22) rotate(var(--lean, 0deg)); }
  32%  { transform: translate(calc(var(--x, 0) + var(--drift, 0px)), calc(var(--y, 0) - 16px)) scale(1) rotate(var(--lean, 0deg)); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--x, 0) + var(--drift, 0px) * 2), calc(var(--y, 0) - 62px)) scale(1.02) rotate(var(--lean, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .pop { animation: pop-fade .9s ease-out both; }
  @keyframes pop-fade { 0% { opacity: 0 } 15%, 65% { opacity: 1 } 100% { opacity: 0 } }
}

@media (max-width: 430px) {
  .pop b { font-size: 22px; }
  .pop.t2 b { font-size: 26px; }
  .pop.t3 b { font-size: 30px; }
  .pop.t4 b { font-size: 35px; }
  .pop b { -webkit-text-stroke-width: 4px; }
}

/* The flare. Bottom centre, above the dock and clear of the top row, because the
   foundations are the one part of the table you are watching when a chain is
   running. Never interactive, and gone in under a second. */
.flare {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 620;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px) scale(.9);
  transition: opacity .18s ease, transform .18s ease;
}
.flare.up {
  color: #2a1c00;
  background: linear-gradient(#ffe08a, var(--key));
  box-shadow: 0 6px 24px rgba(255, 194, 71, .45);
}
.flare.down {
  color: #ffdbe1;
  background: rgba(20, 12, 20, .92);
  border: 1px solid rgba(255, 107, 129, .5);
  letter-spacing: .04em;
}
.flare.show { opacity: 1; }
.flare.up.show { animation: flare-pop .9s ease-out forwards; }
.flare.down.show { transform: translate(-50%, 0) scale(1); }
@keyframes flare-pop {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.82); }
  22%  { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  40%  { transform: translate(-50%, 0) scale(1); }
  76%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(1); }
}

/* The chain is readable without any of the motion: the chip carries the number
   and the multiplier, and the flare still appears and clears. */
@media (prefers-reduced-motion: reduce) {
  .metric.chain.tick b { animation: none; }
  .flare.up.show { animation: none; transform: translate(-50%, 0) scale(1); }
}

/* The wordmark. On the bar because the game has no title screen. */
.wordmark {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  opacity: .82;
}

.hud-right { display: flex; align-items: center; gap: 7px; }

.icon-btn, .purse {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: rgba(255, 255, 255, .07);
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background .15s, transform .08s;
}
.icon-btn:hover, .purse:hover { background: rgba(255, 255, 255, .14); }
.icon-btn:active, .purse:active { transform: translateY(1px); }
.icon-btn[hidden] { display: none; }
.icon-btn b { font-size: 11px; font-weight: 700; opacity: .7; }
.purse { font-size: 13px; padding: 8px 11px; }
.purse .coin { margin-right: 0; }

.dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(12, 16, 32, .8);
  animation: pulse 1.6s ease-in-out infinite;
}
.seg-btn .dot { position: static; display: inline-block; margin-left: 6px; animation: none; }
@keyframes pulse { 50% { transform: scale(.7); opacity: .65 } }

body.boosted .ring-fill i {
  background: conic-gradient(from 0deg, var(--key) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .13) 0);
  filter: drop-shadow(0 0 5px rgba(255, 194, 71, .7));
}

/* ---------- bottom dock ---------- */

.tools { display: flex; gap: 6px; }
.acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Square, with the count tucked into a corner. Three of these read as a row of
   tools; three badged pills read as three notifications. */
.tool {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px; height: 38px;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  cursor: pointer;
  transition: background .15s, transform .08s, opacity .2s;
}
.tool:hover { background: rgba(255, 255, 255, .15); }
.tool:active { transform: translateY(1px); }
.tool i { font-style: normal; margin: 0; }
.tool b {
  position: absolute;
  right: 3px; bottom: 2px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 0 3px;
  border-radius: 5px;
  color: var(--key-deep);
  background: var(--key);
  font-variant-numeric: tabular-nums;
}
.tool.empty { opacity: .45; }
.tool.empty b { color: #fff; background: rgba(255, 255, 255, .2); }
/* The hint reads the whole table before it answers, which takes long enough to
   need saying. Only the glyph pulses: the count stays legible. */
.tool.thinking { cursor: progress; }
.tool.thinking i { animation: tool-think .7s ease-in-out infinite; }
@keyframes tool-think { 50% { opacity: .3; transform: scale(.86); } }

/* One button class for the dock, the sheets and the win splash. `key` carries
   the accent; never more than one in view at a time. */
.act {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: inherit;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  transition: background .15s, transform .08s, opacity .15s, border-color .15s;
}
.act:hover { background: rgba(255, 255, 255, .14); }
.act:active { transform: translateY(1px); }
.act:disabled { opacity: .35; cursor: default; transform: none; }
.act.key {
  color: var(--key-deep);
  border-color: transparent;
  background: linear-gradient(#ffd066, var(--key));
}
.act.key:hover { background: linear-gradient(#ffdd8c, #ffc95e); }
.act.ghost { background: transparent; }
.act.danger { color: #fff; border-color: rgba(255, 107, 129, .5); background: rgba(255, 107, 129, .16); }
.act.danger:hover { background: rgba(255, 107, 129, .3); }
.act.gem-btn { border-color: rgba(127, 212, 255, .45); background: rgba(127, 212, 255, .16); }
.act.small { font-size: 12px; padding: 7px 11px; border-radius: 9px; }
.act.narrow { padding: 9px 11px; }
.act.wide { width: 100%; padding: 12px 16px; font-size: 14px; }

/* Once-a-session settings. Anchored to the dock's right edge so it opens over
   the table rather than off-screen. */
.more { position: relative; }
.menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 148px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(18, 23, 45, .97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.menu[hidden] { display: none; }
.menu-item {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: inherit;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, .1); }
.menu-item.off { opacity: .5; }

/* ---------- sheets ---------- */

/* One panel shape for the whole game: a bottom sheet, where the thumb already
   is. On a wide screen it centres instead; see the media query at the end. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 8, 18, 0);
  backdrop-filter: blur(0px);
  transition: background .2s ease, backdrop-filter .2s ease;
}
.scrim.in {
  background: rgba(6, 8, 18, .6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(#242c55, var(--sheet) 40%);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .5);
  transform: translateY(14px);
  opacity: 0;
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), opacity .18s ease;
}
.scrim.in .sheet { transform: none; opacity: 1; }
/* Grab handle, so the sheet reads as having come up rather than appeared. */
.sheet::before {
  content: "";
  position: absolute;
  left: 50%; top: 8px;
  width: 34px; height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .18);
  transform: translateX(-50%);
}

.x {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 30px; height: 30px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: inherit;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  opacity: .65;
  cursor: pointer;
}
.x:hover { opacity: 1; background: rgba(255, 255, 255, .16); }

.sheet h2 { margin: 0 0 10px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.sheet h3 {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .45;
}
.sheet p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; }
.sheet .eyebrow { margin: 0 0 2px; }
.muted { opacity: .6; }
.sheet section { margin-bottom: 22px; }
.sheet section:last-child { margin-bottom: 0; }
.pair { display: grid; grid-auto-flow: column; gap: 8px; }
.pair.wrap { grid-auto-flow: row; }

/* ---------- hub ---------- */

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 34px 18px 0;
}

/* Two tabs in one track: the current tab is a position, not a shade that has to
   be compared against its neighbour. */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .28);
}
.seg-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  padding: 7px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  opacity: .55;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.seg-btn.on { opacity: 1; background: rgba(255, 255, 255, .11); }

.balance {
  margin-left: auto;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Row: label, state, and the single action available. */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.row:first-of-type { border-top: 0; }
.row.on { color: var(--key); }
.row.claimed { opacity: .45; }
.what { min-width: 0; flex: 1 1 auto; }
.what b { display: block; font-size: 14px; font-weight: 700; }
.what .sub, .claim .sub { display: block; margin-top: 3px; font-size: 12px; opacity: .55; line-height: 1.4; }
.lead { font-style: normal; margin-right: 7px; }
.have { font-weight: 600; opacity: .5; }
.buys { display: flex; gap: 6px; flex: 0 0 auto; }
.tick { font-size: 13px; font-weight: 700; opacity: .5; }

/* The two collectables, at the size of collecting them. Identical shape whether
   pressable or not, so nothing shifts when a chest fills. */
.claims { display: grid; gap: 8px; margin-bottom: 18px; }
.claim {
  font: inherit;
  text-align: left;
  color: inherit;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  cursor: default;
}
.claim b { font-size: 14.5px; font-weight: 700; }
.claim.on {
  cursor: pointer;
  border-color: rgba(255, 194, 71, .45);
  background: linear-gradient(rgba(255, 194, 71, .16), rgba(255, 194, 71, .07));
}
.claim.on:hover { background: rgba(255, 194, 71, .22); }
.claim:disabled { opacity: .55; }
.claim .sub b { font-size: inherit; }

/* Optional purchase attached to the button it modifies. */
.aside {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -2px 0 4px;
  padding: 0 4px;
  font-size: 12px;
}
.aside .muted { flex: 1 1 140px; }

.bar {
  height: 4px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .3);
  overflow: hidden;
}
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--key); transition: width .4s ease; }
.bar.big { height: 7px; margin: 4px 0 20px; }

/* ---------- rewards, tokens, level up ---------- */

.rewards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.rewards.big { font-size: 15px; }
.tok, .rw {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  font-style: normal;
  white-space: nowrap;
  padding: 4px 9px;
  margin: 2px 3px 2px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  font-variant-numeric: tabular-nums;
}
.rw.streak { border-color: rgba(255, 178, 107, .45); color: var(--warn); }

.levelup { text-align: center; }
.unlocks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.unlocks li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
}
.unlocks span { opacity: .55; }

/* ---------- shop: packs and looks ---------- */

.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 9px; }
.look {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  font-size: 12px;
}
.look b { font-weight: 700; }
.look.on { border-color: var(--key); background: rgba(255, 194, 71, .1); }
.look.locked { opacity: .5; }
.prev {
  display: block;
  width: 44px; height: 60px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
/* Swatches use the real rules: the back preview paints --back-bg exactly as the
   cards do, and the surface preview uses the same three stops as the board.
   Approximations drift the first time either changes. */
.prev-back {
  display: block;
  width: 100%; height: 100%;
  background: var(--back-bg);
  border: 1px solid rgba(0, 0, 0, .3);
  border-radius: inherit;
}
.prev-surface { background: linear-gradient(160deg, var(--table-1), var(--table-2) 60%, var(--table-3)); }

/* ---------- record panel ---------- */

.statrow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  font-size: 13px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.statrow:first-child { border-top: 0; }
.statrow span { opacity: .6; }
.statrow.sub { font-size: 11.5px; border-top: 0; padding-top: 0; }

/* ---------- earn, and the admin panel ---------- */

/* The balance, once, big. This tab exists to answer one question and the answer
   should not be something you have to find. */
.sol-total {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  margin: 6px 0 10px;
  font-variant-numeric: tabular-nums;
}
.tok.sol-tok { border-color: rgba(143, 123, 255, .5); }
.tok.sol-tok.muted { border-color: var(--line); opacity: .6; font-weight: 600; }

/* The next drop. The one thing on this tab that is about the future rather than
   about the balance, so it gets the border and the balance does not — a player
   who opens this tab between drops is here to find out how long, and it should
   be the thing their eye lands on. */
.drop .drop-ready,
.drop .drop-next {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  margin-bottom: 10px;
}
.drop .drop-ready {
  border-color: rgba(143, 123, 255, .55);
  background: rgba(143, 123, 255, .1);
}
.drop .drop-ready b,
.drop .drop-next b { display: block; font-size: 15px; font-weight: 800; }
.drop .drop-ready .sub,
.drop .drop-next .sub { display: block; margin-top: 4px; font-size: 12px; opacity: .6; line-height: 1.45; }
/* Done is stated, not celebrated: one of the two gates being open is only half
   an answer, and colouring it like a reward reads as "collect me". */
.drop .row.done .lead { color: var(--key); }
.drop .row.wait { opacity: .75; }

/* The contract, shown as what it is: a document, in a monospace face, scrolling
   inside its own box rather than stretching the sheet. It has to be readable
   before it is signed, so it is never truncated with an ellipsis. */
.contract {
  margin: 0 0 14px;
  padding: 12px 13px;
  max-height: 42vh;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  font: 400 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  opacity: .85;
}

.adm-field { display: block; margin: 0 0 12px; }
.adm-field > span { display: block; font-size: 12px; opacity: .6; margin-bottom: 5px; }
.adm-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: inherit;
  font: inherit;
  font-size: 13px;
}
.adm-field input:focus { outline: none; border-color: var(--key); }
.adm-field .sub { display: block; margin-top: 5px; font-size: 11.5px; opacity: .5; font-style: normal; }

/* Three states, three colours, on the four lines at the top of the admin panel
   that say whether any of this is actually paying anyone.
   Prefixed because `.warn` is already a toast modifier, and a bare one here
   would repaint every warning toast in the game as a side effect. */
.v-ok { color: var(--good); }
.v-warn { color: var(--warn); }
.v-bad { color: var(--danger); }

/* ---------- the shill ---------- */

/* The one button on the win splash that leads off the site. Black, because that
   is what the button it leads to looks like, and a shill button that looks like
   every other button on the panel gets read as another way to spend coins. */
.act.shill {
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
  background: linear-gradient(#22252c, #0b0d11);
}
.act.shill:hover { background: linear-gradient(#31353e, #16191f); }

/* The card the player is about to attach, shown at whatever width the sheet is.
   Fixed aspect from the image itself; the border is what stops a dark card
   dissolving into a dark sheet. */
.shill-card {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* The post, editable. Monospace deliberately not used: this is prose somebody
   is about to publish under their own name, and it should look like it. */
.shill-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 6px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.shill-text:focus { outline: none; border-color: var(--key); }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
/* Fixed height rather than a square aspect: at panel width a 1:1 cell is 60px
   of box around a two-digit date. */
.cell {
  display: grid;
  place-items: center;
  height: 30px;
  font-size: 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .05);
  font-variant-numeric: tabular-nums;
}
.cell.wd { height: 18px; background: none; opacity: .35; font-weight: 700; font-size: 9px; letter-spacing: .08em; }
.cell.pad { background: none; }
.cell.done { color: var(--key-deep); background: var(--key); font-weight: 800; }
.cell.today { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); }
.cell.future { opacity: .28; }

/* ---------- toasts ---------- */

/* ui.js's toast stack, top of screen, clear of the dock and of klondike.js's
   single bottom toast. Newest lowest, nearest the table. */
#toasts {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: min(440px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}
#toasts .toast {
  position: static;
  left: auto; bottom: auto;
  opacity: 1;
  transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  animation: toast-in .22s ease both;
  transition: opacity .35s ease, transform .35s ease;
}
#toasts .toast b { font-weight: 700; }
#toasts .toast .rw { margin: 0; }
/* The qualifier on a hint: what the move is worth, next to what the move is. */
#toasts .toast .sub { opacity: .68; font-size: .9em; }
#toasts .toast.good { border-color: rgba(110, 231, 165, .45); }
#toasts .toast.warn { border-color: rgba(255, 178, 107, .5); }
#toasts .toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) } }

/* ---------- unlockable card backs ---------- */

[data-back="slate"] {
  --back-bg:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .07) 0 .05em, transparent .05em .1em),
    linear-gradient(155deg, #4a5578, #232a48);
}
[data-back="coral"] {
  --back-bg:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 .04em, transparent .04em .1em),
    linear-gradient(155deg, #ff7a68, #a5263f);
  --back-line: rgba(255, 255, 255, .5);
}
[data-back="tide"] {
  --back-bg:
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .13) 0 .025em, transparent .025em .08em),
    linear-gradient(160deg, #2ec5c0, #10486d);
}
[data-back="moss"] {
  --back-bg:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .1) 0 .035em, transparent .035em .09em),
    linear-gradient(155deg, #5fa66a, #1c4230);
}
[data-back="dusk"] {
  --back-bg:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .24) 0 .012em, transparent .018em),
    radial-gradient(circle at 72% 62%, rgba(255, 255, 255, .2) 0 .012em, transparent .018em),
    linear-gradient(155deg, #55407f, #1a1233);
  --back-line: rgba(214, 200, 255, .42);
}
[data-back="bloom"] {
  --back-bg:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .2) 0 .035em, transparent .035em .1em),
    linear-gradient(155deg, #ffb3cd, #c25f93);
  --back-line: rgba(255, 255, 255, .62);
}
[data-back="brass"] {
  --back-bg:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .16) 0 .04em, transparent .04em .085em),
    linear-gradient(155deg, #f5d089, #9a6f1c);
  --back-line: rgba(74, 48, 0, .45);
}
[data-back="aurora"] {
  --back-bg:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, .32) 0 .012em, transparent .018em),
    radial-gradient(circle at 66% 70%, rgba(190, 255, 240, .34) 0 .016em, transparent .022em),
    radial-gradient(130% 95% at 18% 6%, #2fd6a5, transparent 58%),
    linear-gradient(155deg, #3a2c86, #0d0b28);
  --back-line: rgba(180, 255, 232, .5);
}

/* ---------- unlockable tables ---------- */

/* Baize. The lit stop carries the green — the other two only have to get out of
   its way — so it is the one worth being generous with. */
[data-surface="felt"]     { --table-1: #3d8b62; --table-2: #1c4733; --table-3: #091c13; }
[data-surface="indigo"]   { --table-1: #2c3564; --table-2: #191f3c; --table-3: #0d1024; }
[data-surface="harbour"]  { --table-1: #1f6f86; --table-2: #123c53; --table-3: #08202f; }
[data-surface="orchid"]   { --table-1: #7a3f96; --table-2: #45215c; --table-3: #200e30; }
[data-surface="graphite"] { --table-1: #3d444f; --table-2: #23272f; --table-3: #101318; }
[data-surface="ember"]    { --table-1: #b8552f; --table-2: #6d2436; --table-3: #2c0f24; }
[data-surface="wine"]     { --table-1: #8e1f36; --table-2: #551123; --table-3: #240712; }

/* ---------- narrow ---------- */

@media (max-width: 560px) {
  .hud, .dock { margin: 7px 8px; padding: 6px 8px; gap: 8px; }
  .dock { margin-bottom: calc(7px + env(safe-area-inset-bottom)); }
  .hud { margin-right: calc(8px + var(--acct-w, 0px)); }
  .wordmark { display: none; }
  .readout { gap: 12px; }
  .metric b { font-size: 14px; }
  .act { padding: 9px 11px; font-size: 12.5px; }
  .tool { width: 37px; height: 36px; font-size: 16px; }
}

/* Moves drops first. It appears in the win splash and the record panel anyway;
   the clock and the score do not. */
@media (max-width: 430px) {
  .metric.moves { display: none; }
  .ring { width: 31px; height: 31px; }
  .ring-fill i {
    -webkit-mask: radial-gradient(circle, transparent 10.5px, #000 11px);
    mask: radial-gradient(circle, transparent 10.5px, #000 11px);
  }
  .packs { grid-template-columns: repeat(2, 1fr); }
}

/* Enough room to centre: the sheet becomes a panel and drops the grab handle. */
@media (min-width: 720px) and (min-height: 560px) {
  .scrim { align-items: center; padding: 24px; }
  .sheet {
    max-height: 84vh;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding-bottom: 22px;
    box-shadow: 0 26px 64px rgba(0, 0, 0, .55);
    transform: translateY(10px) scale(.98);
  }
  .sheet::before { display: none; }
  .scrim.in .sheet { transform: none; }
  .sheet.wide { max-width: 560px; }
}
