/* Chaos Vile: the table is the card back's navy, the white cards are the light. */
:root {
  --navy: #202e56;
  --navy-deep: #18223f;
  --navy-up: #2a3a6c;
  --line: rgba(249, 249, 249, 0.12);
  --ink: #f9f9f9;
  --muted: rgba(249, 249, 249, 0.64);
  --butter: #efe999;
  --red: #e8503c;
  --blue: #6f8cff;
  --green: #5fcf6a;
  --ice: #9fe3ff;
  --radius: 14px;
  --card-r: 9px;
  --shadow: 0 8px 22px rgba(5, 10, 30, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* one scrollbar everywhere: a slim butter-yellow handle, no track, no arrow buttons */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--butter) transparent; } } /* Firefox; Chrome and Safari use the rules below, which can drop the arrows */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--butter); border-radius: 6px; }
::-webkit-scrollbar-button { display: none; }
body {
  background: url(ui/main_bg.webp) center / cover no-repeat fixed, radial-gradient(120% 90% at 50% 40%, #27376a 0%, var(--navy) 45%, var(--navy-deep) 100%) fixed;
  color: var(--ink);
  font: 400 15px/1.45 'Kanit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip; /* nothing can make the page wider than the screen, so phones never pan sideways */
}
html { overflow-x: clip; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--butter); outline-offset: 2px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.center-note { text-align: center; margin-top: 40vh; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.stack { display: grid; gap: 10px; width: 100%; }
.spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  min-height: 44px; padding: 0 20px; border-radius: 12px; border: 1.5px solid var(--line);
  background: rgba(249, 249, 249, 0.06); font-weight: 500; letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: rgba(249, 249, 249, 0.12); border-color: rgba(249, 249, 249, 0.3); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.38; }
.btn.primary { background: var(--butter); border-color: var(--butter); color: var(--navy-deep); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #f6f1b4; border-color: #f6f1b4; }
.btn.primary:disabled { background: rgba(249, 249, 249, 0.06); border-color: var(--line); color: var(--ink); opacity: 0.4; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; }
.icon {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon:hover, .icon[aria-expanded="true"] { color: var(--ink); background: rgba(249, 249, 249, 0.08); }
.chip {
  min-width: 44px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; font-weight: 600;
}
.chip.on { background: var(--butter); color: var(--navy-deep); border-color: var(--butter); }
.chip:disabled:not(.on) { opacity: 0.4; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang button.on { background: rgba(249, 249, 249, 0.14); color: var(--ink); }

/* ---------- home + lobby ---------- */
.home, .lobby {
  max-width: 440px; margin: 0 auto; padding: max(6vh, 24px) 16px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.logo { width: min(277px, 70vw); height: auto; display: block; }
.logo.small { width: 96px; }
.logo.tiny { width: 54px; }
.field { width: 100%; display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
input {
  min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(10, 16, 40, 0.35); padding: 0 14px;
}
input:focus { border-color: var(--butter); outline: none; }
.join { display: flex; gap: 10px; }
.join input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.2em; }
.lobby { max-width: 520px; }
.lobby-head { width: 100%; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lobby-head .btn { white-space: nowrap; }
@media (max-width: 420px) { .lobby-head .btn { width: 100%; } }
.code { flex: 1; display: grid; }
.code small { color: var(--muted); font-size: 12px; }
.code b { font-size: 34px; line-height: 1; letter-spacing: 0.18em; color: var(--butter); font-weight: 700; }
.sizes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.sizes span { margin-right: auto; color: var(--muted); }
.seats { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; }
.seats li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(249, 249, 249, 0.05); border: 1px solid var(--line);
}
.seats li.empty { border-style: dashed; background: transparent; }
.seats .who { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; }
.seats .who b { font-weight: 600; }
.seats .who small { width: 100%; color: var(--muted); }
.av-empty { width: 44px; height: 44px; border-radius: 12px; border: 1.5px dashed var(--line); }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(249, 249, 249, 0.1); color: var(--muted); }
.lobby footer { margin-top: 8px; }

/* ---------- table ---------- */
.table {
  height: 100dvh; display: grid; gap: 10px; padding: 10px 14px 12px;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "banner log" "opps log" "center log" "mine log";
}
.table.down { filter: grayscale(0.6); }
/* the logo sits behind the table on desktop and tablet; on a phone every pixel is needed, so it stays out */
.table { position: relative; isolation: isolate; }
.table-mark { display: none; }
@media (min-width: 621px) and (min-height: 521px) {
  .table-mark { display: block; position: absolute; inset: 0; margin: auto; z-index: -1; width: clamp(260px, 34vw, 460px); height: auto; opacity: .1; pointer-events: none; user-select: none; }
}
.table.sending .actions, .table.sending .hand, .table.sending .sheet-actions, .table.sending .prompt .row { pointer-events: none; opacity: 0.6; transition: opacity 0.2s 0.15s; }
.top { grid-area: top; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pill { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: rgba(249, 249, 249, 0.1); white-space: nowrap; }
.status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.status b { color: var(--butter); font-weight: 600; }
.banner {
  grid-area: banner; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--butter); color: var(--navy-deep); font-weight: 500;
}
.banner .btn { color: var(--navy-deep); border-color: rgba(24, 34, 63, 0.3); }

.opps { grid-area: opps; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.seat {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  width: clamp(200px, 17vw, 240px); padding: 10px 12px; border-radius: var(--radius);
  background: rgba(10, 16, 40, 0.32); border: 1.5px solid var(--line);
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s var(--ease);
}
.seat .av { flex: none; }
.seat-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.who { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chip-s { font-size: 10.5px; line-height: 1.6; padding: 0 7px; border-radius: 99px; background: rgba(249, 249, 249, 0.1); color: var(--muted); }
.chip-s.ice { background: var(--ice); color: var(--navy-deep); }
.chip-s.camo { background: var(--green); color: var(--navy-deep); }
.chip-s.out { background: var(--red); color: #fff; }
.chip-s.wait { background: var(--butter); color: var(--navy-deep); }
.seat.turn { border-color: var(--butter); box-shadow: 0 0 0 3px rgba(239, 233, 153, 0.18), 0 0 26px rgba(239, 233, 153, 0.18); }
.seat.is-frozen { border-color: var(--ice); background: linear-gradient(135deg, rgba(159, 227, 255, 0.18), rgba(10, 16, 40, 0.32)); }
.seat.is-camo { border-style: dashed; opacity: 0.7; }
.seat.is-out { opacity: 0.4; filter: grayscale(1); }
.seat.dim { opacity: 0.35; }
.seat.targetable { border-color: var(--butter); border-style: dashed; }
.seat.targetable::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: 0 0 0 4px rgba(239, 233, 153, 0.25); animation: beckon 1.2s var(--ease) infinite; }
.seat.targetable:hover { background: rgba(239, 233, 153, 0.14); transform: translateY(-2px); }

.hp { position: relative; height: 16px; border-radius: 99px; background: rgba(249, 249, 249, 0.12); overflow: hidden; }
.hp i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--ink); transition: width 0.5s var(--ease), background 0.3s; }
.hp.hurt i { background: var(--butter); }
.hp.crit i { background: var(--red); }
.hp span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 600; line-height: 16px; color: var(--navy-deep); mix-blend-mode: normal; }
.hp.crit span { color: #fff; }
.zones { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.backs { display: flex; align-items: center; }
.backs i, .field-back { width: 19px; height: 28px; border-radius: 4px; }
.backs i { background: var(--card-back, url(cards/back.webp)) center/cover; border: 1px solid rgba(249, 249, 249, 0.45); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3); }
.backs i + i { margin-left: -6px; }
.backs em { font-style: normal; font-size: 12px; color: var(--muted); }
.field-back { border: 1.5px dashed var(--line); }
.field-back.set { background: var(--card-back, url(cards/back.webp)) center/cover; border: 1.5px solid var(--butter); box-shadow: 0 0 0 3px rgba(239, 233, 153, 0.14); }

.center { grid-area: center; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 44px); flex-wrap: wrap; min-height: 0; }
.pile { position: relative; display: grid; justify-items: center; gap: 6px; }
.pile small { color: var(--muted); font-size: 12px; }
.pile .card-img, .pile .slot { width: clamp(76px, 9vw, 140px); }
.pile.event .card-img, .pile.event .slot { width: clamp(92px, 11vw, 172px); }
.pile .count {
  position: absolute; top: -8px; right: -8px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--butter); color: var(--navy-deep);
}
.phases { flex: none; list-style: none; margin: 0 8px 0 0; padding: 0; display: flex; gap: 4px; }
.phases li { padding: 2px 10px; border-radius: 99px; font-size: 12px; color: var(--muted); background: rgba(249, 249, 249, 0.06); transition: background 0.15s, color 0.15s; white-space: nowrap; }
.phases li.on { background: var(--butter); color: var(--navy-deep); font-weight: 600; }
.warn { width: 100%; text-align: center; margin: 0; color: var(--red); font-weight: 600; }
.card-img { display: block; width: 100%; aspect-ratio: 1392 / 2032; border-radius: var(--card-r); box-shadow: var(--shadow); background: #fff; object-fit: cover; }
.card-btn { padding: 0; border: 0; background: none; border-radius: var(--card-r); display: block; }
.card-btn:disabled { cursor: default; opacity: 1; }
.slot {
  aspect-ratio: 1392 / 2032; border-radius: var(--card-r); border: 1.5px dashed var(--line);
  display: grid; place-items: center; padding: 8px; text-align: center; font-size: 12px; color: var(--muted);
}
.flip .card-img { animation: flip 0.7s var(--ease); }
/* the whole deck turning over (Revelation starting or ending): a lift, a full turn, a settle */
.turn-over .card-img { animation: turn-over 0.85s cubic-bezier(.3, .7, .3, 1); }
@keyframes turn-over {
  0% { transform: perspective(700px) rotateY(180deg) translateY(0); filter: brightness(.6); }
  45% { transform: perspective(700px) rotateY(90deg) translateY(-14px) scale(1.06); filter: brightness(1.3); }
  100% { transform: perspective(700px) rotateY(0) translateY(0); filter: brightness(1); }
}

.mine {
  grid-area: mine; display: grid; align-items: center; gap: 14px;
  grid-template-columns: 220px auto minmax(0, 1fr) auto;
  padding: 12px 14px; border-radius: 18px; background: rgba(10, 16, 40, 0.4); border: 1.5px solid var(--line);
}
.mine { position: relative; }
.mine.on { border-color: var(--butter); box-shadow: 0 0 0 4px rgba(239, 233, 153, 0.12), 0 -10px 40px rgba(239, 233, 153, 0.12); }
.turn-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 2px 14px; border-radius: 99px;
  background: var(--butter); color: var(--navy-deep); font-size: 13px; font-weight: 600; white-space: nowrap; animation: pop 0.3s var(--ease);
}
.hand-slot { opacity: 0.45; }
.mine .seat { width: auto; background: none; border: 0; padding: 0; box-shadow: none; }
.mine .seat.targetable { border: 1.5px dashed var(--butter); padding: 8px; }
.my-field { display: grid; gap: 6px; justify-items: center; }
.my-field small { color: var(--muted); font-size: 12px; }
.mini, .slot.mini { width: 78px; }
.hand { display: flex; gap: 12px; justify-content: center; align-items: flex-end; min-width: 0; }
.hand-card, .hand-slot { width: clamp(108px, 12vw, 190px); }
.hand-card { transition: transform 0.18s var(--ease), opacity 0.15s; } /* a new card's arrival is played from app.js, once */
.hand-card.leaving { transform: translateY(-26px) scale(1.03); opacity: 0.75; }
.hand-card.flown { visibility: hidden; }
.pile.tapped .card-img { transform: translateY(-6px); transition: transform 0.12s; }
@keyframes card-arrive { from { opacity: 0; transform: translateY(14px) scale(0.94); } }
.hand-card:hover { transform: translateY(-8px) rotate(-1deg); }
.hand-card.sel { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--butter); }
.actions { display: grid; gap: 8px; min-width: 150px; }
.timer { position: relative; height: 26px; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.timer i { position: absolute; inset: auto 0 0 0; height: 4px; border-radius: 99px; background: var(--butter); transform-origin: left; transform: scaleX(var(--p, 1)); transition: transform 0.25s linear; }
.timer.low i { background: var(--red); }
.timer.low b { color: var(--red); }

.log {
  grid-area: log; display: flex; flex-direction: column; min-height: 0;
  padding: 14px; border-radius: 18px; background: rgba(10, 16, 40, 0.4); border: 1px solid var(--line);
}
.log h2 { font-size: 14px; color: var(--muted); font-weight: 500; }
.log ol { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 4px; align-content: start; font-size: 13.5px; }
.log li { color: var(--muted); }
.log .k-turn { color: var(--ink); margin-top: 6px; font-weight: 500; }
.log .k-dmg, .log .k-out { color: #ff9c8e; }
.log .k-respond, .log .k-countered, .log .k-sniped { color: var(--butter); }
.log .k-heal { color: var(--green); }
.log .k-event, .log .k-win { color: var(--ink); font-weight: 600; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 12, 30, 0.72); backdrop-filter: blur(3px); animation: fade 0.18s;
}
.overlay.danger-bg { background: radial-gradient(circle at 50% 50%, rgba(232, 80, 60, 0.22), rgba(8, 12, 30, 0.8)); }
.sheet {
  display: flex; gap: 20px; align-items: center; max-width: min(720px, 100%); max-height: 100%; overflow: auto;
  padding: 18px; border-radius: 20px; background: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rise 0.22s var(--ease);
}
.sheet-card { width: min(300px, 62vw); max-height: 70dvh; object-fit: contain; border-radius: 12px; background: #fff; }
.sheet-actions { display: grid; gap: 10px; min-width: 180px; }
.small-sheet, .prompt, .win, .wide { flex-direction: column; text-align: center; }
.overlay.settled, .overlay.settled .sheet { animation: none; }
.wide { width: min(860px, 100%); align-items: stretch; }
.book { text-align: left; max-width: 720px; display: block; }
.book section { margin-bottom: 20px; }
.book h2 { font-size: 24px; color: var(--butter); }
.book h3 { font-size: 16px; font-weight: 600; margin: 14px 0 6px; }
.book ul { margin: 0; padding-left: 1.2em; display: grid; gap: 5px; color: rgba(249, 249, 249, 0.86); }
.book .grid { margin-bottom: 8px; }
.book > .btn { width: 100%; position: sticky; bottom: 0; }
.close-hint { position: fixed; left: 50%; bottom: 16px; translate: -50% 0; margin: 0; font-size: 13px; color: var(--muted); pointer-events: none; white-space: nowrap; }
.steal-row { display: flex; gap: 28px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.steal-group { display: grid; gap: 8px; justify-items: center; }
.steal-group small { color: var(--muted); }
.steal-card {
  width: 78px; aspect-ratio: 1392 / 2032; border-radius: var(--card-r); padding: 0;
  background: var(--card-back, url(cards/back.webp)) center/cover; border: 2px solid rgba(249, 249, 249, 0.4); box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease), border-color 0.15s;
}
.steal-card:hover, .steal-card:focus-visible { transform: translateY(-8px) rotate(-2deg); border-color: var(--butter); }
.steal-card.on-field { border: 2px dashed var(--butter); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.prompt h2 { font-size: 22px; }
.duel { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.duel .card-img { width: min(150px, 38vw); }
.duel figure { margin: 0; display: grid; gap: 6px; justify-items: center; }
.duel figcaption { font-size: 12px; color: var(--muted); }
.outcome { margin: 0; font-weight: 500; color: var(--butter); }
.prompt .timer, .shed .timer { width: 100%; }
.shed .duel { flex-wrap: wrap; }
.shed .card-btn { width: min(150px, 27vw); transition: transform 0.15s var(--ease); }
.shed .card-btn:hover, .shed .card-btn:focus-visible { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--red); }
.shed .card-img { width: 100%; }
.win h2 { font-size: 30px; color: var(--butter); margin: 4px 0 0; }
.places { margin: 0; padding-left: 1.4em; text-align: left; color: var(--muted); }
.zoom { max-width: min(520px, 92vw); max-height: calc(100dvh - 96px); /* leaves room for the close hint */ border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
/* live-text card: 1392 x 2032 art canvas, every size below is cqw of the card's own width (1cqw = 13.92 art px) */
.cardface { background: #fff; --en: 'Oswald', 'DIN Condensed', 'Arial Narrow', sans-serif; --th: 'Prompt', 'Kanit', sans-serif; container-type: inline-size; position: relative; aspect-ratio: 1392 / 2032; color: #000; overflow: hidden; text-align: center; font-family: var(--en); }
.cardface:lang(th), :root[lang="th"] .cardface { font-family: var(--th); }
.zoom.cardface { width: min(520px, 92vw, calc((100dvh - 96px) * 0.685)); max-width: none; max-height: none; }
.sheet-card.cardface { width: min(300px, 62vw, calc(70dvh * 0.685)); max-height: none; }
.cardface { user-select: none; -webkit-user-select: none; text-rendering: optimizeLegibility; font-kerning: normal; hyphens: none; }
.cf-name, .cf-story, .cf-rule, .cf-null { text-wrap: balance; overflow-wrap: anywhere; }
.cardface > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cardface > :not(img) { position: absolute; left: 0; right: 0; margin: 0; }
.cf-type { top: 6.1%; left: 18.2% !important; text-align: left; font-size: 6.6cqw; line-height: 1; font-weight: 500; }
.cf-type.second { left: 68.5% !important; }
.cf-type.event { left: 0 !important; text-align: center; top: 9.4%; }
.cf-name { top: 15.5%; font-size: calc(10cqw * var(--fit, 1)); line-height: 1.1; font-weight: 500; padding: 0 4cqw; }
.cf-story { top: 67.5%; padding: 0 12cqw; font-size: 4cqw; line-height: 1.38; color: #555; font-weight: 500; }
.cf-null { top: 42%; font-size: 6.3cqw; color: #555; font-weight: 500; }
:root[lang="th"] .cf-null { font-size: 5cqw; }
.cf-rule { top: 77%; padding: 0 9cqw; font-size: 4.5cqw; line-height: 1.25; font-weight: 500; }
:root[lang="th"] .cf-type { font-weight: 600; font-size: 6cqw; }
:root[lang="th"] .cf-name { font-weight: 600; font-size: calc(8.2cqw * var(--fit, 1)); padding: 0 3cqw; }
:root[lang="th"] .cf-story { font-size: 3.4cqw; line-height: 1.5; }
:root[lang="th"] .cf-rule { font-size: 3.9cqw; line-height: 1.45; font-weight: 600; }
.pop {
  position: fixed; z-index: 25; top: 58px; right: 14px; width: min(340px, calc(100vw - 20px)); max-height: calc(100dvh - 68px); overflow: hidden auto; overscroll-behavior: contain; padding: 10px; border-radius: 14px;
  background: var(--navy-up); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; animation: rise 0.18s var(--ease);
}
.pop button { min-width: 0; border: 0; border-radius: 10px; background: rgba(249, 249, 249, 0.07); transition: background 0.12s; }
.pop button:hover { background: rgba(249, 249, 249, 0.16); }
.pop button:focus-visible { outline: 2px solid var(--butter); outline-offset: 1px; }
.pop[hidden] { display: none; }
.chat-emotes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chat-emotes button { padding: 6px; aspect-ratio: 1; }
.chat-emotes img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 0.12s var(--ease); }
.chat-emotes button:hover img { transform: scale(1.1); }
.chat-emotes button:active img { transform: scale(0.94); }
.chat-side { display: grid; gap: 6px; }
.pop .chat-edit { min-height: 34px; font-size: 13px; color: var(--butter); text-align: center; }
.chat-phrases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.chat-phrases button { min-height: 40px; padding: 6px 8px; font-size: 14px; line-height: 1.2; text-align: center; }
@media (max-height: 480px) and (min-width: 600px) { /* phones held sideways: side by side, so nothing has to scroll */
  .pop { top: 52px; width: min(600px, calc(100vw - 20px)); max-height: calc(100dvh - 60px); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.bubble.settled { animation: none; }
.bubble {
  position: absolute; z-index: 5; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 190px; text-align: center; overflow-wrap: anywhere; padding: 4px 12px; border-radius: 12px; background: var(--ink); color: var(--navy-deep);
  font-weight: 500; font-size: 14px; box-shadow: var(--shadow); animation: pop 0.25s var(--ease);
}
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
/* an opponent's bubble hangs below their seat (yours floats above), its tail pointing up */
.opps .bubble { bottom: auto; top: calc(100% - 6px); }
.opps .bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }
/* while you're picking a target the bubbles are half see-through and ignore taps: one can hang over the piles or another seat */
.table:has(.seat.targetable) .bubble { opacity: 0.5; pointer-events: none; }

#spot {
  position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; pointer-events: none;
  opacity: 0; transition: opacity 0.18s;
}
#spot.show { opacity: 1; }
#spot figure { margin: 0; display: grid; justify-items: center; gap: 10px; }
/* the played card is a sticker: a white band with an ink outline behind it, popping in with a little overshoot */
#spot.show figure { animation: spot-pop var(--pop, 320ms) cubic-bezier(.2, 1.3, .4, 1) both; }
#spot .spot-img { position: relative; display: block; isolation: isolate; }
#spot .spot-img img { display: block; }
#spot .spot-img::before { content: ''; position: absolute; inset: -9px; z-index: -1; border-radius: 20px; background: #fff; border: 3px solid #10160c; pointer-events: none; }
#spot.show.grey .spot-img::before { background: #d4d7de; }
#spot.show.grey img { filter: grayscale(1); transition: filter .3s; }
@keyframes spot-pop { from { transform: scale(.78); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } to { transform: scale(1); opacity: 1; } }
.potato #spot.show figure { animation-name: spot-pop-lite; animation-timing-function: ease-out; }
@keyframes spot-pop-lite { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#spot img { width: min(250px, 52vw); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); background: #fff; }
#spot figcaption { padding: 4px 14px; border-radius: 99px; background: var(--navy-deep); border: 1px solid var(--line); font-weight: 600; }
/* an attack closed your inspect view: red edge flash, a ring on your seat, and the reason */
#alert { position: fixed; inset: 0; z-index: 30; pointer-events: none; box-shadow: inset 0 0 0 6px var(--red), inset 0 0 120px 30px rgba(232, 80, 60, 0.75); animation: alert-edge 1.1s ease-out forwards; }
.alert-pill {
  position: absolute; top: 72px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px); padding: 10px 20px; border-radius: 99px; background: var(--red); color: #fff; font-weight: 600; box-shadow: var(--shadow);
  animation: alert-pill 2.6s var(--ease) forwards;
}
.alert-pill svg { flex: none; }
.alerted .seat.me { box-shadow: 0 0 0 3px var(--red), 0 0 24px rgba(232, 80, 60, 0.7); }
@keyframes alert-edge { from { opacity: 1; } to { opacity: 0; } }
@keyframes alert-pill { 0% { opacity: 0; transform: translateY(-10px) scale(.92); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#turnbar {
  position: fixed; z-index: 14; left: 50%; top: 45%; translate: -50% -50%; pointer-events: none;
  padding: 10px 30px; border-radius: 99px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  background: rgba(24, 34, 63, 0.92); border: 1.5px solid var(--line); box-shadow: var(--shadow);
  font-size: clamp(20px, 3vw, 30px); font-weight: 600;
  opacity: 0; transform: scale(0.85); transition: opacity 0.6s ease, transform 0.6s var(--ease);
}
#turnbar.show { opacity: 1; transform: scale(1); transition: opacity 0.2s ease, transform 0.35s cubic-bezier(.2, 1.4, .4, 1); }
#turnbar.is-you { background: var(--butter); color: var(--navy-deep); border-color: var(--butter); box-shadow: 0 0 40px rgba(239, 233, 153, 0.45), var(--shadow); }
#toast {
  position: fixed; z-index: 1001; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 18px; border-radius: 12px; background: var(--ink); color: var(--navy-deep); font-weight: 500;
  transition: opacity 0.2s, transform 0.25s var(--ease); pointer-events: none; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- card effects (fx.js) ---------- */
/* an effect already mid-flight when a card is opened doesn't play behind the blurred preview */
.inspecting #fx, .inspecting #spot, .inspecting #turnbar { visibility: hidden; }
/* the log stays readable above the preview and keeps updating */
.inspecting .log { position: relative; z-index: 21; }
@media (min-width: 981px) { .inspecting .overlay { padding-right: 66px; } .inspecting .close-hint { margin-left: -25px; } .inspecting .table:has(.log.open) .overlay { padding-right: 350px; } .inspecting .table:has(.log.open) .close-hint { margin-left: -167px; } }
@media (max-width: 980px) { .inspecting .log { display: none; } } /* phones and tablets: an opened card has the screen to itself, no log strip under it */
#fx { position: fixed; inset: 0; z-index: 16; pointer-events: none; overflow: hidden; }
.fx { position: fixed; pointer-events: none; translate: -50% -50%; will-change: transform, opacity; }
.fx.crystal g { transform-box: fill-box; transform-origin: 50% 100%; }
.fx.crack, .fx.whole { border-radius: var(--card-r); background-size: cover; box-shadow: var(--shadow); }
.fx.crack { outline: 2px solid rgba(255, 255, 255, 0.8); }
.fx.piece { translate: -50% -50%; border-radius: 2px; background-color: #fff; background-repeat: no-repeat; }
.fx.volley { left: 0; top: 0; translate: none; transform-origin: 0 0; }
.fx.volley svg { display: block; overflow: visible; margin: -15px 0 0 -92px; } /* the tip sits on the landing point */
/* the house style for every card effect: flat color, ink outline, no glow */
.fx.sprite svg { display: block; overflow: visible; }
.fx.stage { left: 0; top: 0; width: 100vw; height: 100vh; translate: none; will-change: auto; }
.fx.stage svg, .fx.vines svg { display: block; }
.fx.ring { width: 46px; height: 46px; border-radius: 50%; border: 5px solid; box-sizing: border-box; }
.fx.spark { width: 10px; height: 10px; border-radius: 30%; border: 2px solid #10160c; box-sizing: border-box; }
.fx.frost { border-radius: var(--radius); background: rgba(159, 227, 255, 0.35); border: 3px solid #10160c; box-sizing: border-box; }
.fx.crystal g { transform-box: fill-box; transform-origin: 50% 100%; }
.fx.crystal { translate: -50% -100%; transform-origin: 50% 100%; }
.fx.crystal polygon { stroke: #10160c; stroke-width: 3; stroke-linejoin: round; }
.fx.crystal polygon[opacity] { stroke: none; }
.fx.ice-chip { width: 11px; height: 17px; clip-path: polygon(50% 0, 100% 70%, 40% 100%, 0 60%); background: #9fe3ff; }
.fx.pillar { translate: -50% -100%; transform-origin: 50% 100%; border-radius: 8px 8px 0 0; box-sizing: border-box; background: rgba(255, 226, 122, 0.8); border: 2.6px solid #10160c; box-shadow: 0 0 0 3.5px #fff; }
.fx.flyback { width: 44px; height: 64px; border-radius: 5px; background: var(--card-back, url(cards/back.webp)) center/cover; border: 2px solid #10160c; box-sizing: border-box; }
.fx.speck { border-radius: 50%; background: #3f6bff; }
.fx.vines { left: 0; top: 0; width: 100vw; height: 100vh; translate: none; will-change: auto; }
.fx.clod { background: #5a4630; border: 1.5px solid #1c150d; border-radius: 40% 55% 45% 60%; }
.fx.dust { background: #8a8f7c; border-radius: 50%; }
.fx.leaf { width: 16px; height: 9px; background: #4f9e34; border: 1.5px solid #16330f; border-radius: 0 100% 0 100%; }
.fx.piece { box-shadow: 0 0 0 0.5px rgba(20, 28, 56, 0.25); }
.fx.piece.fine { box-shadow: none; }
.pile.reveal > .card-btn { position: relative; }
.pile.reveal > .card-btn::after { content: ''; position: absolute; inset: 0; border-radius: var(--card-r); pointer-events: none; opacity: 0; box-shadow: 0 0 0 3px var(--butter), 0 0 34px 8px rgba(239, 233, 153, 0.65); animation: reveal 1.4s ease-in-out infinite; }
@keyframes reveal { 50% { opacity: 1; } }

/* ---------- seat effects ---------- */
.seat.hit { animation: hit-squash var(--t, 460ms) ease-out; border-color: var(--red); transform-origin: 50% 85%; }
/* a flat white ring (opacity only) flashes while the squash is held */
.seat.hit::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: none; border: 3px solid #fff; animation: hit-ring var(--t, 460ms) ease-out; }
.potato .seat.hit::after { display: none; }
@keyframes hit-squash { 12%, 36% { transform: translateX(-4px) scale(1.08, .86); } 52% { transform: translateX(5px) scale(.96, 1.06); } 70% { transform: translateX(-2px) scale(1.02, .98); } }
@keyframes hit-squash-still { 12%, 36% { transform: scale(1.08, .86); } 52% { transform: scale(.96, 1.06); } 70% { transform: scale(1.02, .98); } }
@keyframes hit-ring { 0% { opacity: 0; } 12%, 36% { opacity: 1; } 100% { opacity: 0; } }
.seat.shield { box-shadow: 0 0 0 4px var(--blue), 0 0 30px rgba(111, 140, 255, 0.6); }
.seat.heal { box-shadow: 0 0 0 4px var(--green), 0 0 30px rgba(95, 207, 106, 0.5); }
.seat-body { position: relative; }
.float {
  position: absolute; z-index: 6; right: -4px; top: 4px; font-size: 26px; line-height: 1; font-weight: 700; pointer-events: none;
  text-shadow: 0 2px 0 var(--navy-deep), 0 0 12px currentColor; animation: float 1.2s var(--ease) forwards;
}
.float.hit { color: #ff6a55; }
.float.heal { color: #7dff94; }
.hp .ghost { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #ff6a55; transition: width 0.55s ease-in 0.35s; }
.hp.gain i { animation: gain 0.9s ease-out; }
.hp.gain i::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 12px #7dff94; animation: gain-glow 0.9s ease-out; }
@keyframes gain { 0%, 40% { background: #7dff94; } }
@keyframes gain-glow { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }

@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-34px); opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px) scale(0.9); } }
@keyframes beckon { 50% { opacity: 1; } }

/* set by app.js when Effects is off (reduce-motion only changes the starting level, to potato) */
.calm *, .calm *::before, .calm *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
.icon.off { opacity: 0.45; }
.icon.leave.armed { width: auto; display: inline-flex; gap: 6px; padding: 0 12px; background: var(--red); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- narrow screens ---------- */
.only-narrow { display: none; }
.turn-banner, .log-rail, .log-x { display: none; }
@media (max-width: 980px) {
  .table {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "banner" "opps" "center" "mine";
    height: auto; min-height: 100dvh; padding: 8px 10px 12px;
  }
  .only-narrow { display: grid; }
  .top { flex-wrap: wrap; }
  .phases { order: 10; width: 100%; justify-content: center; } /* no room beside the round here: its own line */
  .top .status { flex: 1 1 0; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; overflow-wrap: anywhere; } /* a long status or player name stays beside the round: up to 2 lines, then … */
  .top .spacer { flex-basis: 100%; height: 0; }
  html.tut-on .log { display: none; } /* even if a log panel was left open (say, from a wider window) */
  html.tut-on .top .tut-gap, html.tut-on .top [data-p="log"] { display: none; } /* the phone tutorial: no log, and no gaps where chat and leave would be */
  /* the icon row (D): chat and log on the left; sound, settings and leave on the right */
  .top { column-gap: 4px; }
  .top .status { margin-left: 6px; } /* the round and status keep their usual 10px apart */
  .top > .icon-pair { margin-left: auto; gap: 4px; }
  .top > .icon.leave { order: 5; color: #ff8a80; } /* round and status on the first line; quick chat joins log, leave, sound and settings on the next */
  .log {
    position: fixed; z-index: 22; inset: auto 0 0 0; height: 55dvh; border-radius: 18px 18px 0 0;
    background: var(--navy); transform: translateY(100%); transition: transform 0.25s var(--ease); visibility: hidden;
  }
  .log.open { transform: none; visibility: visible; box-shadow: var(--shadow); }
  .mine { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "me field" "hand hand" "act act"; align-items: center; }
  .mine > .seat { grid-area: me; }
  .my-field { grid-area: field; grid-template-columns: auto auto; align-items: center; }
  .my-field small { grid-column: 1 / -1; }
  .mini, .slot.mini { width: 56px; }
  .hand { grid-area: hand; }
  .hand-card, .hand-slot { width: min(150px, 38vw); }
  .actions { grid-area: act; grid-template-columns: 1fr 1fr; }
  .actions .timer { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .top .logo.tiny { display: none; }
  .my-field { grid-template-columns: auto; gap: 4px; } /* buttons under the field card, so your name and HP bar keep their room */
  .my-field small { grid-column: auto; }
  .my-field .btn { width: 100%; padding-inline: 6px; font-size: 12px; white-space: nowrap; }
  .opps { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 14px 2px 56px; margin: -14px -10px -52px; padding-inline: 10px; scrollbar-width: none; }
  .center { position: relative; z-index: 1; } /* the row reaches down over the middle so a two-line chat bubble under a seat fits; the middle sits above that strip, so it keeps its taps. (The row itself must take touches: phones won't scroll one with pointer-events off.) */
  .seat { width: 168px; flex: none; padding: 8px 10px; gap: 8px; }
  .opps .seat .av { width: 34px; height: 34px; }
  .mine > .seat .av { width: 44px; height: 44px; }
  .center { gap: 18px; }
  .pile .card-img, .pile .slot { width: 64px; }
  .pile.event .card-img, .pile.event .slot { width: 78px; }
  .sheet { flex-direction: column; text-align: center; }
  .sheet-actions { width: 100%; }
  .pop { left: 10px; right: 10px; width: auto; }
}


/* ---------- wide screens: the table fits the window, whatever its height ---------- */
@media (min-width: 981px) {
  /* the middle area sets the size of its piles; 46px leaves room for the pile labels */
  .center { container-type: size; align-content: center; row-gap: 8px; }
  .pile .card-img, .pile .slot { width: clamp(44px, calc((100cqh - 46px) / 1.46), 184px); }
  .pile.event .card-img, .pile.event .slot { width: clamp(44px, calc((100cqh - 46px) / 1.46), 212px); }
  /* the log is a slim rail until it's opened, so the table keeps the width */
  .table { grid-template-columns: minmax(0, 1fr) 52px; }
  .top .status { display: none; } /* the turn banner in the middle says it instead */
  .center { position: relative; padding-top: 46px; }
  .turn-banner {
    display: block; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); margin: 0; max-width: 100%; box-sizing: border-box; padding: 5px 18px; border-radius: 99px;
    background: rgba(249, 249, 249, 0.1); color: var(--muted); font-size: 14px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .turn-banner b { color: inherit; font-weight: 600; }
  .turn-banner.mine { background: var(--butter); color: var(--navy-deep); font-weight: 500; }
  .log { padding: 0; overflow: hidden; }
  .log-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; width: 100%; padding: 12px 0; background: none; border: 0; color: var(--muted); cursor: pointer; position: relative; }
  .log-rail:hover { color: var(--ink); background: rgba(249, 249, 249, 0.05); }
  .log-rail svg { width: 20px; height: 20px; }
  .log-rail span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; letter-spacing: .02em; }
  .log-new { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--butter); color: var(--navy-deep); font-size: 11px; line-height: 20px; text-align: center; box-sizing: border-box; }
  .log > h2, .log > ol { display: none; }
  .log.open { position: fixed; z-index: 15; top: calc(10px + var(--tut-h, 0px)); right: 14px; bottom: 12px; width: 330px; padding: 14px; background: var(--navy); box-shadow: var(--shadow); overflow: hidden; }
  .log.open .log-rail { display: none; }
  .log.open > h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
  .log.open > ol { display: grid; }
  .log-x { display: grid; width: 28px; height: 28px; }
  .hand-card, .hand-slot { width: clamp(84px, min(12vw, 20dvh), 190px); }
  /* opponents always share one row, however many there are */
  .opps { flex-wrap: nowrap; }
  .opps .seat { flex: 1 1 0; min-width: 0; max-width: 240px; padding: 8px 10px; gap: 8px; }
  .opps .seat .av { width: clamp(30px, 3vw, 44px); height: auto; }
  .opps .who b { font-size: 14px; }
}

/* accounts, shop and deck builder */
.account { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.account-guest { text-align: center; }
.coins-pill { font-weight: 600; }
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.shop-row .card-btn { width: 56px; flex: none; }
.shop-row .who { flex: 1; display: grid; min-width: 0; }
.slot-icon { width: 56px; height: 82px; flex: none; border: 1px dashed var(--line); border-radius: 6px; }
.deck-sheet { max-height: 92dvh; overflow: auto; }
.deck-status { margin: 4px 0; font-weight: 500; }
.deck-status.bad { color: #ff9c8c; }
.deck-status.good { color: #8fe0a0; }
.deck-confirm { align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; margin: 10px 0; }
.deck-card { display: grid; gap: 4px; justify-items: center; text-align: center; font-size: 12px; }
.deck-card.locked .card-img { filter: grayscale(1); }
.deck-count { display: flex; align-items: center; gap: 6px; }
.deck-count .btn { min-height: 28px; padding: 0 10px; }
.deck-count b { min-width: 20px; }
.lobby-deck { width: 100%; }
.lobby-deck h3 { margin: 0 0 6px; font-size: 14px; font-weight: 500; }
.lobby-deck ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.lobby-deck li { display: grid; justify-items: center; gap: 2px; font-size: 12px; }
.zoom.locked { filter: grayscale(1); }
html.has-overlay, html.has-overlay body { overflow: hidden; }

/* the title screen */
.title { position: fixed; inset: 0; overflow: hidden; display: grid; place-items: center; }
.title-top { position: absolute; inset: 0 0 auto 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.title-settings { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.title-top .account { justify-content: flex-start; }
.title-left { margin-right: auto; display: flex; gap: 8px; }
.title-main { position: relative; z-index: 1; display: grid; justify-items: center; gap: 20px; padding: 72px 20px 24px; }
/* daily reward window and weekly quests */
.daily-wrap { z-index: 40; }
.sheet.daily-ask { width: min(460px, calc(100vw - 32px)); display: grid; justify-items: center; gap: 12px; padding: 24px 20px 20px; text-align: center; }
.daily-ask h2 { margin: 0; font-size: 22px; }
.daily-ask p { margin: 0; }
/* days 1-6 in two rows of three, day 7 a tall tile on the right */
.days { list-style: none; margin: 4px 0 2px; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 8px; }
.day { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 10px 2px 8px; border-radius: 12px; background: rgba(249, 249, 249, .07); border: 2px solid transparent; font-size: 12px; }
.day span { color: var(--muted); white-space: nowrap; }
.day b { font-size: 15px; }
.day .crystal { width: 20px; height: 20px; }
.day.got { background: rgba(239, 233, 153, .14); }
.day.got::after { content: '✓'; position: absolute; top: -7px; right: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 0 0 2px var(--navy); }
.day.now { border-color: #FDE047; animation: day-pulse 1.8s ease-in-out infinite; }
.day.later { opacity: .55; }
.day.lost { opacity: .3; }
.day.big { grid-column: 4; grid-row: 1 / span 2; border-color: #e9c46a; background: rgba(233, 196, 106, .12); }
.day.big.now { border-color: #FDE047; }
.day.big.later { opacity: 1; } /* the grand prize always shows at full strength */
.day.big b { font-size: 20px; color: var(--butter); }
.day.big span { color: var(--ink); font-weight: 500; }
.cluster { width: 48px; height: 60px; object-fit: contain; margin: 6px 0 4px; }
@keyframes day-pulse { 50% { box-shadow: 0 0 0 5px rgba(253, 224, 71, .18); } }
html.calm .day.now { animation: none; box-shadow: 0 0 0 4px rgba(253, 224, 71, .18); } /* effects off in the game's settings (not the computer's reduced-motion) */
.sheet.daily-ask { position: relative; }
.daily-x { position: absolute; top: 10px; right: 10px; }
.daily-go { width: 100%; }
.btn.ghost.daily-go:disabled { color: #202e56; } /* collected: dark navy on the grey drawn button */
.daily-go .crystal { width: 18px; height: 18px; margin: 0 3px 0 2px; vertical-align: -3px; }
/* the Quests page: tabs, the Friends page's left column and panel, and the weekly track as a board */
.quest-tabs { display: flex; gap: 6px; }
.quest-tabs button { min-height: 38px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.quest-tabs button:hover { border-color: var(--butter); }
.quest-tabs button.on { background: var(--butter); border-color: var(--butter); color: var(--navy-deep); }
.quests-page .friend-panel { overflow: auto; background: var(--navy-deep); }
.quest-tabs .count-badge { margin-left: 8px; }
.quest-panel { border: 2px solid #3a4a80; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.board-head h3 { margin: 0; font-size: 18px; }
.board-head h3 span { margin-left: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.track { --road: 28px; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(calc(var(--cols) - 1), minmax(0, 1fr) var(--road)) minmax(0, 1fr); align-items: stretch; }
.step { position: relative; z-index: 1; min-height: 104px; border-radius: 12px; background: var(--navy-up); border: 2px solid transparent; display: grid; justify-items: center; align-content: center; gap: 5px; padding: 10px 6px; text-align: center; }
.step-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.step-pay { display: inline-flex; align-items: center; gap: 3px; color: var(--butter); font-weight: 600; font-size: 13px; }
.step-pay .crystal { width: 16px; height: 16px; }
.step-n { font-size: 12px; color: var(--muted); }
.q-bar { height: 6px; border-radius: 3px; background: rgba(249, 249, 249, .1); overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--butter); border-radius: 3px; }
.q-note { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.step .q-bar { width: 80%; }
.step.done { background: #2a3a70; border-color: #e9c46a; } /* finished and paid: as bright as the rest, edged in gold */
.step .check { flex: none; }
.step.now { border-color: #FDE047; animation: day-pulse 1.8s ease-in-out infinite; }
.step.locked { background: #202d53; color: var(--muted); }
.step.ready { padding: 0; background: var(--butter); }
.step.ready button { width: 100%; height: 100%; display: grid; justify-items: center; align-content: center; gap: 5px; padding: 10px 6px; border: 0; border-radius: 10px; background: none; color: var(--navy-deep); font: inherit; cursor: pointer; }
.step.ready button b { padding: 3px 10px; border-radius: 8px; background: var(--navy-deep); color: var(--butter); font-size: 13px; }
.step.ready button:hover { background: #f6f1b4; }
.step.big { border-color: #e9c46a; background: #31353f; }
.step.big.now { border-color: #FDE047; }
.step.big.locked { color: var(--ink); }
.step.big.ready { background: var(--butter); }
.step .cluster { width: 40px; height: 50px; margin: 0; }
/* the road between steps: a dark track that fills with butter up to the step you're on; it runs a little under each tile */
.step-link, .step-turn { position: relative; }
.step-link i, .step-turn i { position: absolute; display: block; border-radius: 6px; background: #2f3d72; box-shadow: inset 0 0 0 2px #121a33; }
.step-link i { left: -10px; right: -10px; top: 50%; height: 10px; margin-top: -5px; }
.step-turn { grid-column: 1 / -1; height: 26px; }
.step-turn i { top: -10px; bottom: -10px; width: 10px; }
.step-turn.at-end i { right: calc((100% - (var(--cols) - 1) * var(--road)) / var(--cols) / 2 - 5px); }
.step-turn.at-start i { left: calc((100% - (var(--cols) - 1) * var(--road)) / var(--cols) / 2 - 5px); }
.step-link.on i, .step-turn.on i { background: var(--butter); box-shadow: none; }
html.calm .step.now { animation: none; } /* effects off in the game's settings (not the computer's reduced-motion) */
@media (max-width: 640px) { .step { min-height: 96px; } .step-name { font-size: 12px; } .quest-tabs button { flex: 1; } }
.title-links .count-badge { margin-left: 6px; }
.rejoin { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border: 1.5px solid var(--butter); border-radius: 12px; font-weight: 500; animation: rejoin-in .4s var(--ease); }
.rejoin .btn { min-height: 32px; }
@keyframes rejoin-in { from { opacity: 0; transform: translateY(-6px); } }
html.calm .rejoin { animation: none; } /* effects off in the game's settings (not the computer's reduced-motion) */
.title-logo { width: min(520px, 72vw, 58dvh); height: auto; }
.title-play { width: min(340px, 78vw); min-height: 60px; font-size: 22px; font-weight: 600; }
.title-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.title-links button { border: 0; background: none; color: var(--ink); font: inherit; font-weight: 500; padding: 10px 14px; border-radius: 8px; opacity: .78; cursor: pointer; transition: opacity .15s, background .15s; }
.title-links button:hover, .title-links button:focus-visible { opacity: 1; background: rgba(249, 249, 249, .1); }
.title-card { position: absolute; width: clamp(180px, 25vw, 400px); height: auto; border-radius: 16px; top: 50%; opacity: .55; pointer-events: none; box-shadow: var(--shadow); }
.title-card.left { left: 0; transform: translate(-18%, -50%) rotate(-13deg); }
.title-card.right { right: 0; transform: translate(18%, -50%) rotate(13deg); }
.play-sheet { display: grid; gap: 12px; width: min(400px, 100%); box-sizing: border-box; }
.play-sheet h2 { margin: 0; }
.play-sheet .join { display: flex; gap: 8px; }
.play-sheet .join input { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .title-card { width: 44vw; opacity: .28; }
  .title-card.left { transform: translate(-48%, -50%) rotate(-13deg); }
  .title-card.right { transform: translate(48%, -50%) rotate(13deg); }
}
.title-top { justify-content: flex-end; }
.title-settings { margin-left: 0; }

/* profile */
.avatar-btn { border: 0; background: none; padding: 0; border-radius: 50%; cursor: pointer; display: grid; }
.avatar-btn:hover .av, .avatar-btn:focus-visible .av { transform: scale(1.08); }
.avatar-btn .av { transition: transform .15s; }
.profile-sheet { display: grid; gap: 14px; width: min(520px, 100%); box-sizing: border-box; align-items: stretch; }
.profile-sheet.small-sheet { width: min(360px, 100%); }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-id { display: grid; gap: 4px; min-width: 0; flex: 1; }
.profile-id small { overflow-wrap: anywhere; }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 22px; }
.profile-name b { font-weight: 600; overflow-wrap: anywhere; }
.name-edit { display: flex; gap: 8px; }
.name-edit input { flex: 1; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: grid; gap: 2px; padding: 12px 6px; text-align: center; border-radius: var(--radius); background: rgba(10, 16, 40, .35); }
.stat b { font-size: 22px; font-weight: 600; color: var(--butter); }
.stat span { font-size: 12px; color: var(--muted); }
.profile-head { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.collection { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.collection .card-btn { width: 64px; }
.slots-note { margin-left: auto; }
.profile-shop { justify-self: start; }
.profile-pic { position: relative; display: grid; flex: none; }
.pic-edit { position: absolute; bottom: -4px; right: -8px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 2px solid var(--navy); border-radius: 50%; background: var(--butter); color: var(--navy-deep); cursor: pointer; }
.pic-edit:hover { transform: scale(1.08); }
.pic-edit:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.profile-actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-text { color: #ff9c8c; }
.delete-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--red); border-radius: var(--radius); }
.delete-box p { margin: 0; font-size: 14px; }
.seat[data-seat-card] { cursor: pointer; }
.seat[data-seat-card]:hover { border-color: var(--line); filter: brightness(1.08); }
@media (max-width: 480px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* shop and deck screens */
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.screen-head h2 { margin: 0; font-size: 26px; font-weight: 600; }
.shop-sheet, .decks-sheet { display: grid; gap: 18px; width: min(760px, 100%); box-sizing: border-box; align-items: stretch; }
.shop-feature { display: grid; grid-template-columns: minmax(190px, 280px) 1fr; gap: 28px; align-items: center; padding: 24px; border-radius: 16px; background: rgba(10, 16, 40, .35); }
.shop-card { transform: rotate(-3deg); transition: transform .2s var(--ease); }
.shop-card:hover, .shop-card:focus-visible { transform: rotate(0) scale(1.03); }
.shop-card .card-img { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.shop-info { display: grid; gap: 10px; justify-items: start; text-align: left; }
.eyebrow { color: var(--butter); font-weight: 500; }
.shop-info h3 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.15; }
.shop-info p { margin: 0; line-height: 1.5; }
.shop-buy { min-width: 180px; margin-top: 6px; }
.owned-note { color: #8fe0a0; font-weight: 500; }
.shop-more { margin: 0; text-align: center; }
.deck-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.deck-tile { width: 100%; height: 100%; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 18px 12px 14px; color: var(--ink); font: inherit; text-align: center; cursor: pointer; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 16, 40, .35); transition: border-color .15s, transform .15s var(--ease); }
.deck-tile:not(:disabled):hover, .deck-tile:focus-visible { border-color: var(--butter); transform: translateY(-2px); }
.deck-tile b { font-weight: 500; overflow-wrap: anywhere; }
.deck-tile small { color: var(--muted); }
.deck-tile small.bad { color: #ff9c8c; }
.deck-tile.buy { border-style: dashed; }
.deck-tile.buy:disabled { opacity: .55; cursor: not-allowed; }
.deck-pile { position: relative; width: 66px; height: 96px; margin-bottom: 10px; }
.deck-pile i { position: absolute; inset: 0; border-radius: 6px; background: var(--card-back, url(cards/back.webp)) center/cover; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.deck-pile i:nth-child(1) { transform: rotate(-7deg) translateX(-5px); }
.deck-pile i:nth-child(2) { transform: rotate(5deg) translateX(5px); }
.deck-pile.empty, .deck-pile.plus { border: 1.5px dashed var(--line); border-radius: 6px; }
.deck-pile.plus { display: grid; place-items: center; font-size: 30px; color: var(--butter); }
.deck-sheet { display: block; width: min(1080px, 100%); max-width: min(1080px, 100%); height: 92dvh; max-height: 92dvh; padding: 0; overflow: auto; }
.deck-head { position: sticky; top: 0; z-index: 3; display: grid; gap: 12px; padding: 16px 18px 12px; background: var(--navy); border-bottom: 1px solid var(--line); }
.deck-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.deck-title input { flex: 1 1 200px; min-width: 0; font-size: 20px; font-weight: 600; }
.deck-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.deck-meter { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.deck-meter b { color: #ff9c8c; font-size: 16px; font-weight: 600; }
.deck-meter.met b { color: #8fe0a0; }
.deck-meter i { grid-column: 1 / -1; height: 6px; border-radius: 99px; overflow: hidden; background: rgba(249, 249, 249, .12); }
.deck-meter u { display: block; height: 100%; border-radius: inherit; background: #ff9c8c; transition: width .2s var(--ease); }
.deck-meter.met u { background: #8fe0a0; }
.deck-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--red); border-radius: var(--radius); }
.deck-confirm span { flex: 1 1 220px; }
.deck-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.deck-tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.deck-tabs button:hover { color: var(--ink); }
.deck-tabs button.on { background: var(--butter); color: var(--navy-deep); }
.deck-sheet .deck-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px 12px; margin: 0; padding: 16px 18px; }
.deck-art { position: relative; width: 100%; }
.deck-art .card-img { width: 100%; height: auto; }
.deck-badge { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 6px; box-sizing: border-box; display: grid; place-items: center; border-radius: 99px; background: var(--butter); color: var(--navy-deep); font-size: 14px; font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.deck-sheet .deck-count { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.deck-sheet .deck-count button { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: rgba(249, 249, 249, .06); color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; }
.deck-sheet .deck-count button:not(:disabled):hover { border-color: var(--butter); }
.deck-sheet .deck-count button:disabled { opacity: .3; cursor: not-allowed; }
.deck-foot { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; background: var(--navy); border-top: 1px solid var(--line); }
@media (max-width: 620px) {
  .shop-feature { grid-template-columns: 1fr; justify-items: center; padding: 18px; }
  .shop-card { width: min(220px, 60vw); }
  .shop-info { justify-items: center; text-align: center; }
  .deck-meters { grid-template-columns: 1fr; gap: 8px; }
  .deck-sheet .deck-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
.deck-meter span { text-align: left; }

/* the room lobby */
.room { position: fixed; inset: 0; overflow: auto; display: flex; flex-direction: column; }
.room-top { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 20px; background: var(--navy); border-bottom: 1px solid var(--line); }
.room-logo { width: 64px; height: auto; }
.room-code { display: grid; line-height: 1.1; }
.room-code small { color: var(--muted); font-size: 12px; }
.room-code b { font-size: 26px; font-weight: 600; letter-spacing: .14em; color: var(--butter); }
.room-settings { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.room-body { flex: 1; width: min(1120px, 100%); margin: 0 auto; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; padding: 18px 20px; align-items: start; }
.room-panel { display: grid; gap: 14px; padding: 16px; border-radius: 16px; background: rgba(10, 16, 40, .35); }
.room-sizes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.room-sizes h3 { margin: 0; font-size: 16px; font-weight: 500; }
.size-chips { display: flex; gap: 4px; }
.size-chips button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.size-chips button.on { background: var(--butter); border-color: var(--butter); color: var(--navy-deep); }
.size-chips button:disabled { cursor: default; }
.size-chips button:disabled:not(.on) { opacity: .45; }
.room-seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.room-seats li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 12px; border-radius: 12px; background: rgba(249, 249, 249, .05); }
.room-seats li.empty { background: none; border: 1px dashed var(--line); }
.room-seats .who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.room-seats .who b { font-weight: 500; overflow-wrap: anywhere; }
.room-seats .who small { flex-basis: 100%; color: var(--muted); }
.room .lobby-deck h3 { margin: 0 0 10px; font-size: 15px; }
.room .lobby-deck ul { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
.room-foot { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; background: var(--navy); border-top: 1px solid var(--line); }
.room-foot > span:first-child { margin-right: auto; }
@media (max-width: 760px) {
  .room-body { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .room-top { padding: 10px 12px; }
  .room-logo { width: 46px; }
  .room-settings { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* Multiplayer */
.mp-choice { display: grid; gap: 6px; font-size: 14px; }
.mp-choice .size-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mp-choice .size-chips button { width: 100%; height: 44px; }
.mp-choice .size-chips button:hover, .mp-choice .size-chips button:focus-visible { background: var(--butter); border-color: var(--butter); color: var(--navy-deep); }
.queue-sheet { display: grid; justify-items: center; gap: 10px; text-align: center; width: min(380px, 100%); box-sizing: border-box; }
.queue-sheet h2 { margin: 0; }
.queue-sheet p { margin: 0; }
.queue-count { font-size: 22px; font-weight: 600; color: var(--butter); }
.match-wait { flex: 1; display: grid; place-items: center; padding: 20px; text-align: center; }
.vote-title { letter-spacing: 0 !important; color: var(--ink) !important; font-size: 22px !important; }
.vote-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vote-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; border-radius: 12px; border: 1px solid transparent; background: rgba(249, 249, 249, .05); }
.vote-list li.shown { border-color: var(--line); }
.vote-list li.voted { border-color: var(--butter); }
.vote-name { flex: 1; min-width: 0; display: grid; justify-items: start; gap: 2px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; padding: 6px 8px; cursor: pointer; }
.vote-name b { font-weight: 500; overflow-wrap: anywhere; }
.vote-name small { color: var(--muted); }

/* the Play panel */
.play-sheet { display: grid; gap: 10px; width: min(420px, 100%); padding: 20px; box-sizing: border-box; align-items: stretch; }
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.play-head h2 { margin: 0; font-size: 26px; font-weight: 600; }
.play-head .sheet-x { flex: none; margin-right: -8px; }
.play-head .sheet-x:hover { color: var(--ink); background: rgba(249, 249, 249, 0.08); }
.play-name { width: 100%; box-sizing: border-box; }
.play-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(249, 249, 249, .07); border: 1px solid var(--line); }
.play-card.column { display: grid; align-items: stretch; }
.play-card h3 { margin: 0; font-size: 16px; font-weight: 600; }
.play-card > .btn.primary { min-width: 104px; }
.play-sizes { display: flex; gap: 5px; }
.play-sizes button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: rgba(249, 249, 249, .08); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.play-sizes button:hover, .play-sizes button:focus-visible { background: var(--butter); border-color: var(--butter); color: var(--navy-deep); }
.play-card .join { display: flex; gap: 6px; min-width: 0; }
.play-card .join input { flex: 1; min-width: 0; letter-spacing: .1em; }
.play-card .join input::placeholder { letter-spacing: normal; }
@media (max-width: 400px) { .play-sizes { width: 100%; } .play-sizes button { flex: 1; width: auto; } }
.play-card.column { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
.play-card.column > .btn, .play-card.column > .join { width: 100%; box-sizing: border-box; }

/* game results */
.results { display: grid; gap: 16px; width: min(440px, 100%); padding: 24px; box-sizing: border-box; align-items: stretch; }
.results-hero { display: grid; justify-items: center; gap: 6px; text-align: center; }
.results-av { display: grid; animation: results-pop .5s var(--ease) both; }
.results-hero h2 { margin: 4px 0 0; font-size: 34px; line-height: 1.1; font-weight: 600; overflow-wrap: anywhere; }
.results.won h2 { color: var(--butter); }
.results-coins { margin: 2px 0 0; padding: 5px 14px; border-radius: 99px; background: rgba(239, 233, 153, .14); color: var(--butter); font-weight: 500; }
.results-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 38dvh; overflow: auto; }
.results-list li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px; background: rgba(249, 249, 249, .05); }
.results-list li:first-child { background: rgba(239, 233, 153, .14); }
.results-list li.me { outline: 1px solid var(--line); }
.results-list .place { width: 18px; text-align: center; font-weight: 600; color: var(--muted); flex: none; }
.results-list li:first-child .place { color: var(--butter); }
.results-list span:not(.tag) { min-width: 0; overflow-wrap: anywhere; }
.results-list .tag { margin-left: auto; }
.results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.results-actions p { margin: 0; flex-basis: 100%; text-align: center; }
.results-actions .btn { flex: 1 1 120px; }
.overlay.settled .results-av { animation: none; }
/* rows slide in one after another, the winner's doodles wiggle once; only on the first drawing (rows-in, win-in), never on a redraw */
.results-list.rows-in li { animation: row-in calc(.32s / var(--pace, 1)) cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc((.3s + var(--i, 0) * .07s) / var(--pace, 1)); }
@keyframes row-in { from { transform: translateX(-30px); opacity: 0; } 70% { transform: translateX(4px); opacity: 1; } to { transform: none; opacity: 1; } }
.results.won.win-in .doodle { animation: doodle-wiggle calc(.6s / var(--pace, 1)) ease-out both; animation-delay: calc((.4s + var(--i, 0) * .05s) / var(--pace, 1)); }
.results.won.win-in .doodle.star { animation: doodle-wiggle calc(.6s / var(--pace, 1)) ease-out calc(.4s / var(--pace, 1)) both, doodle-bob 3.6s ease-in-out infinite; }
.results.won.win-in .doodle.doll { animation: doodle-wiggle calc(.6s / var(--pace, 1)) ease-out calc(.55s / var(--pace, 1)) both, doodle-bob 4.4s ease-in-out -1.2s infinite; }
@keyframes doodle-wiggle { 0% { rotate: 0deg; scale: .5; } 30% { rotate: 16deg; scale: 1.25; } 55% { rotate: -12deg; scale: .95; } 80% { rotate: 6deg; scale: 1.03; } 100% { rotate: 0deg; scale: 1; } }
.potato .results-list.rows-in li, .potato .results.win-in .doodle, .calm .results-list.rows-in li, .calm .results.win-in .doodle { animation: none; }
@keyframes results-pop { from { transform: scale(.5) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } }
.calm .results-av { animation: none; }
.offer-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.shop-buy s { opacity: .6; font-weight: 400; }
.offer-tag { padding: 4px 12px; border-radius: 99px; background: var(--butter); color: var(--navy-deep); font-size: 13px; font-weight: 600; }

/* the deck builder: your deck on the left, the card list on the right */
.deck-sheet { display: flex; flex-direction: column; width: min(1240px, 100%); max-width: min(1240px, 100%); overflow: hidden; }
.deck-head { position: static; flex: none; }
.deck-foot { position: static; flex: none; }
.deck-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "meters pool" "mine pool"; gap: 12px 14px; padding: 12px 18px; }
.deck-cols .deck-meters { grid-area: meters; }
.deck-mine { grid-area: mine; min-height: 0; overflow: auto; display: grid; align-content: start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--navy-deep); }
.deck-mine h4 { display: flex; justify-content: space-between; margin: 0 0 8px; padding: 4px 10px; border-radius: 8px; background: rgba(249, 249, 249, .07); font-size: 14px; font-weight: 500; }
.deck-mine h4 b { font-weight: 600; }
.deck-copies { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.deck-copies .card-btn { display: block; width: 100%; border-radius: 4px; }
.deck-copies .card-img { display: block; width: 100%; height: auto; border-radius: 4px; }
.deck-copies .card-btn:hover, .deck-copies .card-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.deck-empty { margin: 0; padding: 32px 12px; text-align: center; }
.deck-pool { grid-area: pool; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 0 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--navy-deep); }
.deck-sheet .deck-pool .deck-grid { flex: 1; min-height: 0; overflow: auto; align-content: start; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px 10px; margin: 0; padding: 6px 12px 4px 0; }
.deck-cap { position: absolute; right: 0; bottom: 0; min-width: 26px; height: 22px; padding: 0 7px; box-sizing: border-box; display: grid; place-items: center; border-radius: 9px 0 var(--card-r) 0; background: var(--navy-deep); color: var(--ink); font-size: 13px; font-weight: 600; pointer-events: none; }
.deck-badge.full { background: #d63f2b; color: #fff; }
.deck-view { display: none; }
@media (max-width: 760px) {
  .deck-cols { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "meters" "view" "body"; padding: 10px 12px; gap: 10px; }
  .deck-view { grid-area: view; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 99px; }
  .deck-view button { min-height: 36px; border: 0; border-radius: 99px; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
  .deck-view button.on { background: var(--butter); color: var(--navy-deep); }
  .deck-mine, .deck-pool { grid-area: body; }
  .show-pool .deck-mine, .show-mine .deck-pool { display: none; }
  .deck-head { padding: 12px 12px 10px; }
  .deck-foot { padding: 10px 12px; }
  .deck-cols .deck-meters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .deck-sheet .deck-pool .deck-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* Right-clicks and long-presses reach the page, not the image, so there's no "Open image in new tab". Clicks go to the button around it. */
img { pointer-events: none; -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }

/* settings */
#settings .overlay, #emotes-screen .overlay { z-index: 1000; }
.sheet.emote-sheet { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; width: min(980px, 100%); max-width: none; height: min(620px, 100%); box-sizing: border-box; overflow: hidden; align-items: stretch; text-align: left; }
.emote-sheet h2 { margin: 0; }
.sheet.avatar-sheet { width: min(560px, 100%); height: min(480px, 100%); }
.inv-main { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; min-height: 0; }
.inv-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.inv-tabs button { padding: 10px 18px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.inv-tabs button.on { border-color: var(--butter); color: var(--butter); }
.emote-all.backs { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.emote-all.backs .emote-tile { aspect-ratio: 320 / 467; padding: 5px; }
.emote-all.avatars { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.emote-tile .av { display: block; width: 100%; height: 100%; min-height: 0; } /* a block, so no text baseline pushes it past the tile's bottom edge */
/* avatar tiles: the drawing is pinned inside the tile's padding, so it can't change the tile's size or poke past its edge (Safari) */
.emote-all.avatars .emote-tile .av { position: absolute; top: 8px; left: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.emote-cols { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 14px; min-height: 0; }
.emote-box { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.emote-box h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 15px; font-weight: 600; }
.emote-box h3 span { color: var(--butter); }
.emote-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.emote-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; align-content: start; min-height: 0; padding: 2px; overflow: auto; }
.emote-tile { position: relative; aspect-ratio: 1; min-width: 0; padding: 6px; border: 2px solid transparent; border-radius: 10px; background: rgba(249, 249, 249, 0.07); transition: background 0.12s; }
.emote-tile:hover { background: rgba(249, 249, 249, 0.16); }
.emote-tile:focus-visible { outline: 2px solid var(--butter); outline-offset: 1px; }
.emote-tile.on { border-color: var(--butter); }
.emote-tile.on::after { content: '✓'; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--butter); color: var(--navy-deep); font-size: 13px; font-weight: 700; line-height: 20px; text-align: center; }
.emote-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.emote-empty { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px; }
.emote-hint { margin: auto 0 0; }
.emote-foot { display: flex; justify-content: flex-end; }
@media (max-width: 700px) {
  #emotes-screen .overlay { padding: 0; }
  .sheet.emote-sheet { height: 100dvh; padding: 12px; border: 0; border-radius: 0; }
  .emote-cols { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .emote-box { padding: 10px; }
  .emote-hint { display: none; }
  .emote-all:not(.backs, .avatars) { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .emote-foot .btn { width: 100%; }
}
@media (max-width: 700px) and (max-height: 480px), (max-height: 480px) { /* phones held sideways */
  #emotes-screen .overlay { padding: 0; }
  .sheet.emote-sheet { height: 100dvh; gap: 6px; padding: 8px 12px; border: 0; border-radius: 0; }
  .emote-sheet h2 { font-size: 18px; }
  .emote-cols { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; }
  .emote-box { padding: 8px; gap: 6px; }
  .inv-main { gap: 6px; }
  .inv-tabs button { padding: 4px 14px; }
  .emote-hint { display: none; }
  .emote-foot .btn { width: auto; }
}
.set-sheet { display: grid; gap: 4px; width: min(440px, 100%); padding: 22px; box-sizing: border-box; align-items: stretch; text-align: left; }
.set-sheet h2 { margin: 0 0 8px; font-size: 26px; font-weight: 600; }
.set-sheet > .btn { margin-top: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-height: 52px; border-top: 1px solid var(--line); }
.set-row.off > span { color: var(--muted); }
.set-slider { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; max-width: 220px; }
.set-slider input { flex: 1; min-width: 0; width: auto; padding: 0; height: 24px; border: 0; background: none; accent-color: var(--butter); cursor: pointer; }
.set-slider output { width: 42px; text-align: right; font-weight: 500; color: var(--muted); }
.set-switch { position: relative; width: 50px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 99px; background: rgba(249, 249, 249, .1); cursor: pointer; transition: background .15s; }
.set-switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform .15s var(--ease); }
.set-switch.on { background: var(--butter); border-color: var(--butter); }
.set-switch.on i { transform: translateX(22px); background: var(--navy-deep); }
.set-switch:disabled { opacity: .4; cursor: not-allowed; }
.no-shake .seat.hit { animation-name: hit-squash-still; } /* no sideways movement, the squash stays */
.icon-pair { display: inline-flex; align-items: center; gap: 2px; }
.icon[data-act="mute"] svg { width: 25px; height: 25px; }
.hp .hp-bonus { position: absolute; inset: 0 auto 0 auto; background: #fff; border-radius: 0 99px 99px 0; }
.hp:has(.hp-bonus) i, .hp:has(.hp-lost) i { border-radius: 99px 0 0 99px; } /* real HP and the bonus join in a straight line */

/* the shop: the discounted item on the left, everything else on the right */
.shop-overlay { padding: 0; place-items: stretch; }
.sheet.wide.shop-sheet { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; padding: 18px 24px; border: 0; border-radius: 0; overflow: hidden; }
.shop-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(270px, 360px) minmax(0, 1fr); gap: 12px; }
.shop-top, .shop-list { min-height: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.shop-top { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 14px; overflow: hidden; text-align: left; }
.shop-top .shop-card { align-self: center; flex: 0 1 277px; min-height: 90px; aspect-ratio: 320 / 467; margin: 12px 0 14px; }
.shop-top .shop-card .card-img { display: block; width: 100%; height: 100%; }
.shop-top > .eyebrow, .shop-top > h3, .shop-top > p, .shop-top > .offer-tag, .shop-top-buy { flex: none; }
.shop-top h3, .shop-detail h3 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.15; }
.shop-top p { margin: 0; line-height: 1.45; font-size: 14px; }
.shop-top-buy { width: 100%; padding-top: 8px; display: grid; gap: 6px; }
.shop-top-buy p { text-align: center; }
.shop-buy.wide { width: 100%; }
.shop-buy s { opacity: .6; font-weight: 400; }
.shop-list { display: flex; flex-direction: column; overflow: hidden; }
.shop-tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); }
.shop-tabs { overflow: hidden; } /* the tabs share the width instead of scrolling */
.shop-tabs button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; display: grid; justify-items: center; gap: 3px; flex: 1 1 0; min-width: 0; padding: 9px 6px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: -1px; }
.shop-tabs button:hover { color: var(--ink); }
.shop-tabs button.on { color: var(--butter); border-bottom-color: var(--butter); }
.shop-grid { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; }
/* each section spreads its tiles across the whole width; a tile stays a sensible size and sits in the middle of its column */
.shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 16px; }
.shop-items .shop-frame { max-width: 220px; }
.shop-tile { display: grid; justify-items: center; align-content: start; gap: 8px; padding-top: 12px; min-width: 0; }
.shop-frame { position: relative; display: grid; justify-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 18px 8px 8px; border: 1px solid rgba(239, 233, 153, .7); border-radius: 4px; background: var(--navy-up); color: var(--ink); font: inherit; cursor: pointer; transition: transform .15s var(--ease); }
.shop-frame:hover, .shop-frame:focus-visible { transform: translateY(-3px); }
.shop-name { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 28px); padding: 2px 10px; box-sizing: border-box; border: 1px solid rgba(239, 233, 153, .7); border-radius: 99px; background: var(--navy-deep); color: var(--butter); font-size: 12px; font-weight: 600; line-height: 1.15; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-art { position: relative; display: block; width: 116px; aspect-ratio: 320 / 467; overflow: hidden; border-radius: 6px; background: #fff; }
.shop-art img { display: block; width: 100%; height: 100%; }
.shop-tile.short .shop-art { opacity: .72; }
.shop-price { font-size: 14px; font-weight: 600; color: var(--butter); white-space: nowrap; }
.shop-price s { opacity: .6; font-weight: 400; }
.shop-tile.short .shop-price { color: var(--muted); }
.shop-owned { font-size: 13px; font-weight: 600; color: #8fe0a0; }
.shop-tile-buy { min-width: 76px; border-radius: 99px; }
.shop-grid .shop-more { padding: 8px 0; }
.shop-section { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.shop-section::before, .shop-section::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.shop-end { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-detail-wrap { z-index: 21; }
.shop-detail { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 20px; align-items: center; width: min(600px, 100%); padding: 20px; box-sizing: border-box; text-align: left; }
.shop-detail .card-img { display: block; width: 100%; height: auto; border-radius: 10px; }
@media (max-width: 760px) {
  .sheet.wide.shop-sheet { padding: 14px; overflow: auto; }
  .shop-cols { grid-template-columns: minmax(0, 1fr); flex: none; }
  .shop-top, .shop-list, .shop-grid { overflow: visible; }
  .shop-top .shop-card { flex: none; width: auto; height: min(277px, 42dvh); }
  .shop-items { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .shop-detail { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .shop-detail .card-btn { width: min(190px, 60vw); }
}
/* very short, wide screens: card and text sit side by side, so the card keeps its size and the description and Buy still show */
@media (max-height: 520px) and (min-width: 640px) {
  .sheet.wide.shop-sheet { height: 100dvh; max-height: 100dvh; overflow: hidden; }
  .shop-cols { flex: 1; grid-template-columns: minmax(400px, 520px) minmax(0, 1fr); }
  .shop-top { overflow: hidden; }
  .shop-list { overflow: hidden; }
  .shop-grid { overflow: auto; }
  .shop-top { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; gap: 6px 18px; align-items: start; justify-items: start; }
  .shop-top > * { grid-column: 2; }
  .shop-top .shop-card { grid-column: 1; grid-row: 1 / -1; align-self: center; flex: none; width: auto; height: min(277px, calc(100dvh - 180px)); margin: 0 4px; }
  .shop-top { align-content: center; }
  .shop-top-buy { align-self: start; }
}
@media (max-height: 430px) and (min-width: 640px) { /* phones held sideways */
  .sheet.wide.shop-sheet { gap: 6px; padding: 8px 14px; }
  .shop-top { padding: 10px; }
  .shop-top .shop-card { height: calc(100dvh - 130px); }
  .shop-top h3 { font-size: 18px; }
  .shop-top p { font-size: 13px; line-height: 1.3; }
  .shop-top-buy p { display: none; }
}
@media (max-height: 690px) and (min-height: 521px) and (min-width: 761px) { /* laptops: less chrome, so the card stays above its text at full size */
  .sheet.wide.shop-sheet { gap: 6px; padding: 8px 18px; }
  .shop-top { padding: 10px 14px; gap: 5px; }
  .shop-top .shop-card { margin: 10px 0 12px; }
  .shop-top p { font-size: 13px; line-height: 1.35; }
  .shop-top-buy { padding-top: 2px; gap: 3px; }
}

/* cosmetics in the shop and at the table */
.shop-art.avatar, .shop-art.emote { aspect-ratio: 1; background: none; }
.shop-art.avatar img, .shop-art.emote img { object-fit: contain; }
.shop-top .shop-card.avatar, .shop-top .shop-card.emote { aspect-ratio: 1; flex-basis: 190px; }
.shop-detail .shop-card:not(.card-btn) { display: block; transform: none; }
/* avatars and emotes are square drawings: shown whole, on the panel, not cut to a card shape */
.shop-card.avatar .card-img, .shop-card.emote .card-img { aspect-ratio: 1; height: auto; object-fit: contain; background: none; box-shadow: none; border-radius: 0; }
.shop-detail .shop-card.avatar, .shop-detail .shop-card.emote { justify-self: center; width: 100%; max-width: 220px; padding: 12px; box-sizing: border-box; border-radius: 16px; background: var(--navy-deep); }
.av-img { display: block; flex: none; object-fit: contain; }
.bubble-emote { display: block; width: 44px; height: 44px; object-fit: contain; }
.hp-ring { position: absolute; z-index: 1; pointer-events: none; border-radius: 99px; box-shadow: 0 0 0 6px #fff; }
.hp .hp-lost { position: absolute; inset: 0 auto 0 auto; background: #fff; }

/* HP colours at the table: yours is always green, everyone else's always red, bonus HP white */
.seat .hp i, .seat .hp.hurt i, .seat .hp.crit i { background: var(--red); }
.seat.me .hp i, .seat.me .hp.hurt i, .seat.me .hp.crit i { background: var(--green); }
.seat .hp .ghost { background: #ffc4b8; }
.seat .hp span, .seat .hp.crit span { color: #fff; text-shadow: -1px 0 var(--navy-deep), 1px 0 var(--navy-deep), 0 -1px var(--navy-deep), 0 1px var(--navy-deep); }
.float.block { color: #fff; }
.hp .hp-bonus.fresh { overflow: hidden; }
.hp .hp-bonus.fresh::after { content: ''; position: absolute; inset: 0 35%; background: #ffe27a; transform: skewX(-20deg); animation: bonus-shine .8s ease-out .35s both; }
@keyframes bonus-shine { from { transform: translateX(-260%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }

/* ---------- menus as full pages: /shop, /decks, /inventory, /profile ---------- */
.overlay.page-view { z-index: 20; padding: 0; place-items: stretch; background: var(--navy); backdrop-filter: none; animation: none; }
.overlay.page-view > .sheet { width: 100%; max-width: none; height: 100dvh; max-height: none; box-sizing: border-box; border: 0; border-radius: 0; box-shadow: none; animation: none; }
.overlay.page-view > .profile-sheet, .overlay.page-view > .page-gate, .overlay.page-view > .legal-page { display: grid; gap: 14px; align-content: start; align-items: stretch; padding: 16px max(16px, calc((100vw - 760px) / 2)); overflow: auto; text-align: left; }
.page-gate > .btn { justify-self: start; }
.page-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-back { flex: none; }

/* ---------- not found page (404.html): 4, a card for the 0, 4 ---------- */
.nf { --nf-h: min(38dvh, 46vw, 340px); min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(20px, 5dvh, 44px); padding: 24px 16px; text-align: center; overflow: hidden; }
.nf-code { display: flex; align-items: center; justify-content: center; gap: calc(var(--nf-h) * 0.07); }
.nf-digit { color: var(--butter); font-size: calc(var(--nf-h) * 1.02); font-weight: 700; line-height: 0.8; transform: rotate(-5deg); user-select: none; }
.nf-digit-end { transform: rotate(5deg); }
.nf-card { height: var(--nf-h); aspect-ratio: 320 / 467; padding: 0; border: 0; border-radius: calc(var(--nf-h) * 0.05); background: none; cursor: pointer; perspective: 900px; animation: nf-float 4s ease-in-out infinite; }
.nf-card:focus-visible { outline: 3px solid var(--butter); outline-offset: 5px; }
.nf-flip { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.55s var(--ease); }
.nf-card:hover .nf-flip { transform: rotateY(14deg) scale(1.03); }
.nf-card.flipped .nf-flip { transform: rotateY(180deg); }
.nf-face { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: calc(var(--nf-h) * 0.05); background: var(--navy-deep); box-shadow: var(--shadow); backface-visibility: hidden; }
.nf-face:not(.nf-front) { box-sizing: border-box; border: 2px solid var(--butter); } /* a navy card on a navy page needs an edge */
.nf-front { transform: rotateY(180deg); background: #fff; }
.nf-text { display: grid; justify-items: center; gap: 8px; }
.nf h1 { margin: 0; font-size: clamp(26px, 5dvh, 38px); font-weight: 600; line-height: 1.15; }
.nf p { margin: 0; color: var(--muted); font-size: 16px; text-wrap: balance; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.nf-actions .btn { display: inline-grid; place-items: center; box-sizing: border-box; text-decoration: none; }
.nf-actions .btn.primary { min-width: 190px; color: var(--navy-deep); }
@keyframes nf-float { 0%, 100% { transform: translateY(-1.5%) rotate(-2deg); } 50% { transform: translateY(1.5%) rotate(2deg); } }
@media (max-height: 480px) and (min-width: 560px) { /* phones held sideways */
  .nf { --nf-h: min(62dvh, 26vw); flex-direction: row; gap: 32px; }
  .nf-text { justify-items: start; text-align: left; max-width: 300px; }
  .nf-actions { justify-content: flex-start; margin-top: 8px; }
  .nf h1 { font-size: 24px; }
  .nf p { font-size: 14px; }
}
html.calm .nf-card { animation: none; } html.calm .nf-flip { transition: none; } /* effects off in the game's settings (not the computer's reduced-motion) */

/* Visual effects: Potato. The costly parts go; the game's moments stay. */
.potato .overlay { backdrop-filter: none; }
.potato .fx, .potato .hand-card, .potato .seat, .potato .sheet { box-shadow: none; }
.potato .nf-card { animation: none; }
.set-row .fx-levels button { padding: 6px 9px; }

/* quick chats in the shop: the speech bubble itself is the picture */
.shop-art.phrase, .shop-card.phrase { aspect-ratio: 1; display: grid; place-items: center; padding: 10px; box-sizing: border-box; background: none; overflow: visible; }
.phrase-bubble { position: relative; max-width: 100%; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--navy-deep); font-weight: 600; font-size: 14px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.phrase-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
.shop-card.phrase .phrase-bubble { font-size: 20px; padding: 12px 18px; }
.shop-top .shop-card.phrase { flex-basis: 190px; }
.shop-detail .shop-card.phrase { display: grid; justify-self: center; width: 100%; max-width: 220px; border-radius: 16px; background: var(--navy-deep); }
@media (max-width: 480px) { .shop-tabs button { white-space: normal; font-size: 12px; line-height: 1.1; } } /* five tabs on a phone: a long label takes two lines instead of being cut off */

/* item details: Buy and Close side by side on wider screens; the coins-short note goes under them */
.shop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.shop-actions .shop-buy { margin-top: 0; }
.shop-actions > p { flex-basis: 100%; order: 1; margin: 0; }
@media (max-width: 760px) { .shop-actions { flex-direction: column; align-items: center; } .shop-actions > p { flex-basis: auto; order: 0; } } /* phones: the note stays right under Buy */

/* chat on the results screen: a chat button in the corner, and bubbles in each player's row */
.results { position: relative; }
.results-chat { position: absolute; top: 14px; right: 14px; }
/* the gameplay chat bubble, floating above the player's avatar and name with its tail pointing down, like on a seat */
.row-bubble { position: absolute; z-index: 5; display: inline-flex; align-items: center; max-width: 220px; text-align: center; padding: 4px 12px; border-radius: 12px; background: var(--ink); color: var(--navy-deep); font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; box-shadow: var(--shadow); transform: translate(-50%, -100%); transform-origin: center bottom; animation: chip-pop 0.25s var(--ease); pointer-events: none; }
.row-bubble[hidden] { display: none; }
.row-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
@keyframes chip-pop { from { opacity: 0; transform: translate(-50%, -100%) scale(0.8); } }
/* who's still in the room after the game */
.tag.presence { display: inline-flex; align-items: center; gap: 6px; }
.tag.presence.here i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.tag.presence.left { background: transparent; color: var(--muted); }
.results-list li.gone > :not(.tag) { opacity: .45; }

/* the second tap of a purchase: white, with a soft pulse, so it can't be mistaken for the first */
.btn.primary.confirm, .deck-tile.buy.confirm { background: var(--ink); border-color: var(--ink); color: var(--navy-deep); animation: confirm-pulse 1s ease-in-out infinite; }
.deck-tile.buy.confirm b { color: var(--navy-deep); }
@keyframes confirm-pulse { 50% { box-shadow: 0 0 0 5px rgba(249, 249, 249, 0.22); } }

/* page headers: the title and what belongs to it on the left, Back on the right */
.page-title h2 { white-space: nowrap; }
.page-tools { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.page-view .screen-head { flex-wrap: wrap; row-gap: 10px; } /* no room for the badge and Back beside the title: they move under it, on the right */
.page-tools .pill { display: inline-flex; align-items: center; min-height: 34px; box-sizing: border-box; padding: 0 14px; border: 1.5px solid var(--butter); border-radius: 10px; background: transparent; color: var(--butter); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* My decks: full screen like the shop and Inventory, the decks laid out on one panel */
.overlay.page-view > .sheet.decks-sheet { display: flex; flex-direction: column; gap: 12px; padding: 18px 24px; overflow: hidden; text-align: left; }
.decks-panel { flex: 1; min-height: 0; overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.decks-panel .deck-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.decks-panel .deck-tile { min-height: 230px; align-content: center; gap: 6px; padding: 22px 14px 18px; background: var(--navy-up); }
.decks-panel .deck-tile b { font-size: 17px; }
.decks-panel .deck-pile { width: 84px; height: 122px; margin-bottom: 14px; }
.decks-panel .deck-pile.plus { font-size: 36px; }
/* the main deck: a butter ribbon and a filled star; the other ready decks get an outline star and Set as main */
.deck-tiles > li { position: relative; }
.deck-tiles > li.main .deck-tile { border-color: var(--butter); }
.decks-panel .deck-tiles:has(.main-ribbon) .deck-tile { padding-top: 38px; } /* clear of the ribbon */
.decks-panel .deck-tiles:has(.set-main) .deck-tile { padding-bottom: 58px; } /* room for Set as main, the same on every tile so the piles line up */
.main-ribbon { position: absolute; top: -1px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 0 0 9px 9px; background: var(--butter); color: var(--navy-deep); font-size: 12px; font-weight: 600; white-space: nowrap; }
.fav-star { position: absolute; top: 6px; right: 6px; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; } /* the drawn star (an img); its size is set again below for .ico */
.set-main { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); white-space: nowrap; }
@media (max-width: 760px) {
  .overlay.page-view > .sheet.decks-sheet { padding: 14px; }
  .decks-panel { padding: 12px; }
  .decks-panel .deck-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .decks-panel .deck-tile { min-height: 190px; }
  .decks-panel .deck-pile { width: 70px; height: 102px; }
}

/* Inventory: the last tile of a collection leads to the shop */
.emote-tile.more { display: grid; place-content: center; gap: 4px; border: 2px dashed var(--line); background: none; color: var(--butter); cursor: pointer; }
.emote-tile.more span { font-size: 26px; line-height: 1; }
.emote-tile.more small { color: var(--muted); font-size: 12px; font-weight: 600; }
.emote-tile.more:hover { border-color: var(--butter); background: rgba(249, 249, 249, 0.06); }

/* My decks badge: the full sentence where there's room, a card icon and "2 / 10" on tablets and phones */
.deck-count .short { display: none; align-items: center; gap: 6px; }
@media (max-width: 900px) { .deck-count .long { display: none; } .deck-count .short { display: inline-flex; } }

/* ---------- the tutorial ---------- */
/* the guide is a strip across the top; the table and its dialogs move down to make room (--tut-h is its height) */
.tut-guide {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
  padding: 10px max(14px, calc((100vw - 1180px) / 2)); background: var(--navy-deep); border-bottom: 2px solid var(--butter);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35); animation: tut-in .25s var(--ease);
}
.tut-guide p { flex: 1 1 220px; margin: 0; font-size: 16px; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.tut-row { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tut-progress { position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .4s var(--ease); }
@keyframes tut-in { from { opacity: 0; transform: translateY(-8px); } }
html.tut-on .table { height: calc(100dvh - var(--tut-h, 0px)); margin-top: var(--tut-h, 0px); }
@media (max-width: 980px) { html.tut-on .table { height: auto; min-height: calc(100dvh - var(--tut-h, 0px)); } } /* narrow tables scroll as usual */
html.tut-on #app .overlay { padding-top: calc(16px + var(--tut-h, 0px)); }
#tut .overlay { z-index: 40; }

/* what the guide wants tapped */
.tut-glow { position: relative; z-index: 2; outline: 3px solid var(--butter); outline-offset: 4px; animation: tut-glow 1.3s ease-in-out infinite; }
.hand-card.tut-glow { transform: translateY(-8px); }
@keyframes tut-glow { 50% { outline-color: rgba(239, 233, 153, .35); box-shadow: 0 0 28px rgba(239, 233, 153, .45); } }
.calm .tut-glow { animation: none; }
.close-hint.tut-glow { position: fixed; z-index: auto; padding: 2px 10px; border-radius: 8px; color: var(--butter); }

/* Grumble plays open-handed */
.zones.open .backs i, .zones.open .field-back { width: 46px; height: 66px; border-radius: 5px; background-size: cover; background-position: center; }
.zones.open .backs i + i { margin-left: 4px; }
/* open cards (Grumble in the tutorial, a revealed hand) shrink to fit a narrow seat instead of spilling out of it */
.zones.open { min-width: 0; }
.zones.open .backs { flex: 0 1 auto; min-width: 0; }
.zones.open .backs i, .zones.open .field-back { flex: 0 1 46px; min-width: 0; height: auto; aspect-ratio: 46 / 66; }

.tut-skip { display: grid; gap: 12px; text-align: center; max-width: 380px; }
.tut-skip h2 { margin: 0; font-size: 22px; }
.tut-skip p { margin: 0; }
.tut-skip b { color: var(--butter); font-weight: 600; }
.tut-skip .row, .tut-ready .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* the finish: the cards it taught fan out like a winning hand, then the reward, then what's next */
.tut-ready { display: grid; justify-items: center; gap: 8px; width: min(420px, 100%); padding: 30px 24px 24px; box-sizing: border-box; text-align: center; overflow: hidden; }
.tut-fan { position: relative; width: 100%; height: 112px; margin-bottom: 16px; }
.tut-fan img {
  position: absolute; left: 50%; bottom: 0; width: 60px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
  transform-origin: 50% 160%; transform: translateX(-50%) rotate(calc(var(--i) * 11deg));
  animation: tut-deal .5s var(--ease) both; animation-delay: calc((var(--i) + 2.5) * 70ms);
}
@keyframes tut-deal { from { opacity: 0; transform: translateX(-50%) translateY(40px) rotate(0deg); } }
.tut-ready h2 { margin: 6px 0 0; font-size: 34px; line-height: 1.1; color: var(--butter); }
.tut-ready > p { margin: 0 0 6px; color: var(--muted); }
.tut-ready .tut-reward { flex-wrap: wrap; width: 100%; box-sizing: border-box; text-align: left; }
.tut-ready .tut-reward div { flex: 1 1 150px; min-width: 0; }
.tut-ready .tut-reward .btn { flex: 1 0 auto; white-space: nowrap; } /* beside the text, or its own row on a phone */
.tut-claim { border-color: var(--butter); color: var(--butter); }
.tut-claim:hover { background: rgba(239, 233, 153, .14); }
.tut-reward.added .tut-reward-coin { animation: tut-coin .6s var(--ease); }
@keyframes tut-coin { 40% { transform: scale(1.35) rotate(-12deg); } }
.tut-ready .row { display: flex; flex-wrap: wrap; width: 100%; gap: 10px; margin-top: 10px; }
.tut-ready .row .btn { flex: 1 1 130px; white-space: nowrap; }
.settled .tut-ready, .settled .tut-fan img { animation: none; }
.calm .tut-fan img, .calm .tut-reward-coin { animation: none; }
html.calm .tut-fan img, html.calm .tut-reward-coin { animation: none; } /* effects off in the game's settings (not the computer's reduced-motion) */

/* what the tutorial is, and its reward, before it starts */
.tut-intro { display: grid; gap: 14px; width: min(420px, 100%); padding: 24px; box-sizing: border-box; text-align: left; }
.tut-intro h2 { margin: 0; font-size: 26px; }
.tut-intro-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tut-intro-head h2 { white-space: nowrap; }
.tut-intro-head .pill { flex: none; color: var(--butter); }
.tut-intro p { margin: 0; color: var(--muted); line-height: 1.5; }
.tut-learn { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tut-learn li { display: flex; align-items: center; gap: 10px; }
.tut-learn li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--butter); }
.tut-reward { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(239, 233, 153, .55); border-radius: 14px; background: rgba(239, 233, 153, .1); }
.tut-reward-coin { font-size: 30px; line-height: 1; }
.tut-reward div { display: grid; gap: 2px; }
.tut-reward b { color: var(--butter); font-size: 18px; font-weight: 600; }
.tut-reward small { color: var(--muted); font-size: 13px; }
.tut-intro .tut-reward div { flex: 1; min-width: 0; }
.tut-gap { visibility: hidden; }
.tut-reward.got { border-color: var(--line); background: rgba(249, 249, 249, .05); }
.tut-reward.got b { color: var(--ink); }
.tut-intro .row { display: flex; gap: 10px; flex-wrap: wrap; }
.tut-intro .row .btn { flex: 1; }
.tut-offer { border-color: rgba(239, 233, 153, .55); }
.tut-offer p { margin: 2px 0 0; }
.tut-offer > div { flex: 1 1 200px; text-align: left; }
@media (max-width: 480px) { .tut-offer > .btn { width: 100%; } }

/* How to play now opens from settings */
.set-link { width: 100%; padding: 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.set-link span:last-child { color: var(--muted); font-size: 22px; }
.set-link:hover span:first-child { color: var(--butter); }
.book-foot { display: flex; gap: 10px; flex-wrap: wrap; }
#settings .book-zoom { z-index: 1001; }

/* ---------- your profile page ---------- */
/* Desktop: you and your record on the left; showcase and achievements on the right, filling the screen.
   Tablets: a strip with your details on top, then everything else full width, scrolling.
   Phones: one column with your record straight after you, achievements last, four at a time. */
.overlay.page-view > .sheet.profile-page { display: flex; flex-direction: column; gap: 12px; padding: 18px 24px; overflow: hidden; }
.profile-cols { flex: 1; min-height: 0; display: grid; gap: 16px; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "me show" "me ach" "rec ach"; }
.profile-panel { display: grid; align-content: start; gap: 14px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--navy-deep); }
.profile-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.profile-panel .profile-head { font-size: 15px; font-weight: 600; color: var(--ink); }
.profile-panel .profile-head span { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.profile-panel .profile-head .owned-chip { margin-left: 8px; padding: 2px 9px; border-radius: 99px; background: rgba(239, 233, 153, .14); color: var(--butter); font-size: 12px; font-weight: 600; }
.panel-tools { display: flex; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn svg { width: 14px; height: 14px; }

/* you */
.profile-me { grid-area: me; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 22px 20px; min-height: 0; overflow: auto; text-align: center; }
.profile-me .pic-edit { width: 36px; height: 36px; bottom: 0; right: -4px; border-color: var(--navy-deep); }
.me-text { display: grid; justify-items: center; gap: 14px; width: 100%; }
.me-name { max-width: 100%; font-size: 28px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.me-info { width: 100%; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: rgba(249, 249, 249, .03); text-align: left; }
.me-info li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 14px; }
.me-info li + li { border-top: 1px solid var(--line); }
.me-info span { color: var(--muted); }
.me-info b { min-width: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.me-info .coin { color: var(--butter); }
.me-info small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.profile-me .profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: auto; padding-top: 16px; }
.profile-me .profile-actions .btn { width: 100%; }
.profile-me .delete-box { width: 100%; box-sizing: border-box; text-align: left; }

/* your record */
.profile-record { grid-area: rec; }
.profile-record .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-record .stat { position: relative; padding: 14px 6px 12px; background: var(--navy-up); overflow: hidden; }
.profile-record .stat b { font-size: 24px; line-height: 1.1; }
.stat-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(249, 249, 249, .1); }
.stat-bar::after { content: ''; position: absolute; inset: 0; background: var(--butter); transform-origin: left; transform: scaleX(var(--p, 0)); }
.slots-row { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.slots-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.slots-bar { flex: 1; min-width: 40px; height: 6px; border-radius: 99px; background: rgba(249, 249, 249, .1); overflow: hidden; }
.slots-bar::before { content: ''; display: block; height: 100%; border-radius: inherit; background: var(--butter); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* showcase: cards on a shelf, each at its own small tilt */
.profile-show { grid-area: show; }
.sc-card { position: relative; display: block; width: 100%; aspect-ratio: 5 / 7; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, .4); cursor: pointer; }
.sc-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sc-card.paid { box-shadow: 0 0 0 2px var(--butter), 0 0 20px rgba(239, 233, 153, .35), 0 8px 18px rgba(0, 0, 0, .4); }
.sc-empty { display: grid; place-items: center; width: 100%; aspect-ratio: 5 / 7; padding: 0; border: 2px dashed rgba(249, 249, 249, .22); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 30px; font-weight: 300; cursor: pointer; }
button.sc-empty:hover { border-color: var(--butter); color: var(--butter); }
.shelf { padding: 16px 36px 40px; }
.shelf-row { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 150px)); justify-content: space-evenly; gap: 30px 32px; }
.shelf-row::after { content: ''; position: absolute; left: 2%; right: 2%; bottom: -26px; height: 12px; border-radius: 99px; background: rgba(0, 0, 0, .45); filter: blur(8px); }
.shelf-row > :nth-child(1) { transform: rotate(-4deg) translateY(6px); }
.shelf-row > :nth-child(2) { transform: rotate(2.5deg); }
.shelf-row > :nth-child(3) { transform: rotate(-1.5deg) translateY(-4px); }
.shelf-row > :nth-child(4) { transform: rotate(3deg) translateY(4px); }
.shelf-row > :nth-child(5) { transform: rotate(-2.5deg); }
.shelf-row > :nth-child(6) { transform: rotate(4deg) translateY(6px); }
.shelf-row > * { transition: transform .2s var(--ease); }
.shelf-row > .sc-card:hover { transform: translateY(-6px) scale(1.04); z-index: 1; }
.sc-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* achievements */
.profile-ach { grid-area: ach; display: flex; flex-direction: column; min-height: 0; }
.ach-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-content: start; gap: 12px; padding-right: 4px; }
.ach { display: grid; grid-template-columns: 46px minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: center; gap: 3px 12px; padding: 12px 14px; border-radius: 12px; background: var(--navy-up); }
.ach-icon { grid-row: 1 / 4; display: grid; place-items: center; width: 46px; height: 46px; }
.ach-icon img, .ach-badge i img { width: 100%; height: 100%; object-fit: contain; }
.ach b { font-size: 14px; font-weight: 600; }
.ach small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.ach-bar { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ach-bar i { flex: 1; height: 5px; border-radius: 99px; background: rgba(249, 249, 249, .1); overflow: hidden; }
.ach-bar i::before { content: ''; display: block; width: calc(var(--p) * 100%); height: 100%; border-radius: inherit; background: var(--butter); }
.ach.done { box-shadow: inset 0 0 0 1px rgba(239, 233, 153, .5); }
.ach:not(.done) .ach-icon img, .ach-mini:not(.done) .ach-icon img, .ach-badge:not(.on) i img { filter: grayscale(1); opacity: .45; }
.ach.done .ach-bar { color: var(--butter); font-weight: 600; }
.ach-minis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px 8px; align-content: start; }
.ach-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; min-width: 0; }
.ach-mini .ach-icon { grid-row: auto; flex: none; width: 52px; height: auto; aspect-ratio: 1 / 1; border-radius: 50%; }
.ach-mini b { font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--muted); word-break: keep-all; overflow-wrap: normal; }
.ach-mini.done b { color: var(--ink); }
/* the title on the left and See all on the right, on a phone too */
.profile-ach .profile-panel-head { flex-wrap: nowrap; }
.profile-ach .panel-tools { width: auto; flex: none; margin-left: auto; }

/* laptops: a shorter screen, so the left column tightens to fit */
@media (min-width: 1101px) and (max-height: 820px) {
  .profile-me { gap: 10px; padding: 18px 18px 16px; }
  .profile-me .profile-pic .av { width: 76px; height: 76px; }
  .profile-me .pic-edit { width: 30px; height: 30px; }
  .me-text { gap: 10px; }
  .me-name { font-size: 24px; }
  .me-info li { padding: 8px 12px; font-size: 13px; }
  .profile-me .profile-actions { padding-top: 12px; }
  .profile-record { gap: 10px; padding: 16px 18px; }
  .profile-record .stat { padding: 9px 6px 8px; }
  .profile-record .stat b { font-size: 20px; }
  .slots-row { padding-top: 10px; }
}
/* tablets and phones: one column that scrolls */
@media (max-width: 1100px) {
  .overlay.page-view > .sheet.profile-page { overflow: auto; }
  .profile-cols { flex: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "me" "show" "ach" "rec"; }
  .profile-me { overflow: visible; }
  .profile-record .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shelf-row { grid-template-columns: repeat(3, minmax(0, 140px)); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .profile-me { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 18px 22px; text-align: left; }
  .profile-me .profile-pic .av { width: 88px; height: 88px; }
  .me-text { justify-items: start; gap: 8px; }
  .me-info { border: 0; background: none; }
  .me-info li { justify-content: flex-start; padding: 2px 0; }
  .me-info li + li { border: 0; }
  .me-info b { text-align: left; }
  .profile-me .profile-actions { grid-template-columns: 1fr; width: auto; margin: 0; padding: 0; border: 0; }
  .profile-me .delete-box { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .overlay.page-view > .sheet.profile-page { padding: 14px; }
  .profile-cols { grid-template-areas: "me" "rec" "show" "ach"; }
  .profile-panel { padding: 16px; }
  .profile-record .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slots-row { flex-wrap: wrap; }
  .slots-row .btn { margin-left: auto; }
  .shelf { padding: 10px 6px 30px; }
  .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
  .panel-tools { width: 100%; }
  .ach-grid { gap: 8px; }
  .ach { grid-template-columns: 36px minmax(0, 1fr); padding: 9px 12px; gap: 2px 12px; }
  .ach-icon { width: 36px; height: 36px; }
  /* the how-to line stays on phones too: without it nobody knows how to earn an achievement */
}
@media (max-height: 560px) and (min-width: 1101px) {
  .overlay.page-view > .sheet.profile-page { overflow: auto; }
  .profile-cols { flex: none; }
}

/* the showcase picker */
.sc-picker { display: flex; flex-direction: column; align-items: stretch; gap: 16px; width: min(860px, 100%); max-height: 92dvh; padding: 22px; box-sizing: border-box; text-align: left; }
.sc-picker h2 { margin: 0; font-size: 24px; }
.sc-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.sc-slot { position: relative; }
.sc-num { position: absolute; z-index: 2; top: -8px; left: -8px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--navy-deep); border-radius: 50%; background: var(--butter); color: var(--navy-deep); font-size: 13px; font-weight: 700; pointer-events: none; }
.sc-slots .sc-empty { cursor: default; }
.sc-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-tabs button { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.sc-tabs button.on { border-color: var(--butter); background: var(--butter); color: var(--navy-deep); font-weight: 600; }
.sc-pool { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: max-content; gap: 12px; padding: 8px 4px 4px 8px; }
.sc-pool .sc-card.on { outline: 3px solid var(--butter); outline-offset: 2px; }
.sc-pool .sc-card.on img { filter: brightness(.75); }
.sc-pool .sc-card.locked img { filter: grayscale(1) brightness(.45); }
.sc-foot { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 620px) {
  .sc-picker { max-height: 100dvh; padding: 14px; gap: 12px; }
  .sc-slots { padding: 10px 10px 10px 14px; gap: 8px; }
  .sc-num { width: 20px; height: 20px; top: -7px; left: -7px; font-size: 11px; }
  .sc-empty { font-size: 20px; }
  .sc-foot .btn { flex: 1; }
}

/* Edit profile: the name, locked until Change, then the avatars */
.sheet.avatar-sheet { grid-template-rows: auto auto auto minmax(0, 1fr) auto; height: min(620px, 100%); }
.ep-name { display: grid; gap: 6px; }
.ep-label { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.ep-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; }
.ep-row input { min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-deep); color: var(--ink); font: inherit; font-size: 16px; }
.ep-row input[readonly] { padding-left: 0; border-color: transparent; background: transparent; font-size: 20px; font-weight: 600; cursor: default; outline: none; }
.ep-row input:not([readonly]) { border-color: var(--butter); box-shadow: 0 0 0 3px rgba(239, 233, 153, .15); outline: none; }
.ep-row input:not([readonly]) + .ep-toggle { align-self: stretch; }
.ep-toggle { display: inline-flex; align-items: center; gap: 6px; }
.ep-toggle svg { width: 14px; height: 14px; }
.ep-help { grid-column: 1; display: flex; justify-content: space-between; gap: 12px; }
.ep-help small { color: var(--muted); font-size: 12px; }
.ep-fee b { color: var(--butter); font-weight: 600; }
.ep-fee .warn-text { color: #ff9c8c; }
.ep-fee s, .ep-cost s { opacity: .6; text-decoration-thickness: 1.5px; }
.ep-count { font-variant-numeric: tabular-nums; }
.ep-cost { font-weight: 600; opacity: .8; }
.shop-tile { gap: 6px; }
.shop-tile svg { color: var(--butter); }
.shop-tile small { line-height: 1.25; text-align: center; }

/* ---------- Play: a full screen ---------- */
.overlay.page-view > .sheet.play-screen { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 24px 24px; overflow: auto; text-align: left; }
.play-screen .screen-head h2 { margin: 0; font-size: 28px; font-weight: 700; }
.play-screen .play-name { width: 200px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-deep); color: var(--ink); font: inherit; }
.play-tut { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.play-tut-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: rgba(239, 233, 153, .14); color: var(--butter); }
.play-tut div { flex: 1; min-width: 0; }
.play-tut b { display: block; }
.play-tut small { color: var(--muted); font-size: 13px; }
.play-tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.35fr 1fr; align-content: center; gap: 16px; }
.pt { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: clamp(400px, calc(100dvh - 190px), 540px); padding: 20px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, var(--navy-up), var(--navy-deep) 70%); transition: transform .2s var(--ease), border-color .2s; }
.pt:hover { transform: translateY(-3px); border-color: rgba(239, 233, 153, .5); }
.pt.main { border-color: rgba(239, 233, 153, .55); }
.pt-art { position: absolute; inset: 0 0 auto; height: calc(100% - 214px); z-index: -1; }
.pt-art img { position: absolute; bottom: 12%; width: 104px; border-radius: 10px; box-shadow: var(--shadow); }
.bots .pt-art img:nth-of-type(1) { left: 14%; rotate: -16deg; }
.bots .pt-art img:nth-of-type(2) { left: 50%; translate: -50% 0; rotate: -3deg; width: 112px; z-index: 2; }
.bots .pt-art img:nth-of-type(3) { right: 14%; rotate: 16deg; }
.main .pt-art img { width: 112px; }
.room .pt-art img:nth-of-type(1) { left: 22%; rotate: -10deg; }
.room .pt-art img:nth-of-type(2) { right: 22%; rotate: 10deg; }
.pt-copy { display: grid; grid-template-rows: auto auto 1fr; justify-items: center; align-items: start; gap: 6px; min-height: 214px; text-align: center; }
.pt-copy > :last-child { align-self: end; width: 100%; }
.pt-copy::before { content: ''; position: absolute; inset: 40% 0 0; z-index: -1; background: linear-gradient(180deg, transparent, var(--navy-deep) 40%); }
.pt h3 { margin: 0; font-size: 28px; font-weight: 700; }
.pt.main h3 { font-size: 34px; }
.pt p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.pt .btn { height: 48px; font-size: 16px; }
.pt-stack { display: grid; gap: 8px; }
.pt-stack .join { display: flex; gap: 8px; }
.pt-stack .join input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-deep); color: var(--ink); font: inherit; letter-spacing: .1em; }
.pt-stack .join .btn { height: 44px; }
/* two teams facing off, red against blue, with VS between them */
.main .pt-art img:nth-of-type(1), .team .mode-art img:nth-of-type(1) { left: 4%; rotate: -14deg; box-shadow: 0 0 0 3px var(--red), var(--shadow); }
.main .pt-art img:nth-of-type(2), .team .mode-art img:nth-of-type(2) { left: 17%; rotate: -4deg; box-shadow: 0 0 0 3px var(--red), var(--shadow); }
.main .pt-art img:nth-of-type(3), .team .mode-art img:nth-of-type(3) { right: 17%; rotate: 4deg; box-shadow: 0 0 0 3px #4aa3ff, var(--shadow); }
.main .pt-art img:nth-of-type(4), .team .mode-art img:nth-of-type(4) { right: 4%; rotate: 14deg; box-shadow: 0 0 0 3px #4aa3ff, var(--shadow); }
.vs-mark { position: absolute; left: 50%; bottom: calc(12% + 56px); translate: -50% 0; z-index: 4; pointer-events: none; }
.vs-mark span { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--butter); border-radius: 50%; background: var(--navy-deep); color: var(--butter); font-size: 15px; font-weight: 700; letter-spacing: .04em; line-height: 1; box-shadow: 0 6px 14px rgba(0, 0, 0, .5); }
@media (max-width: 900px) {
  .overlay.page-view > .sheet.play-screen { padding: 14px; gap: 12px; }
  .play-tiles { flex: none; grid-template-columns: minmax(0, 1fr); }
  .pt { height: auto; padding: 16px; }
  .pt-art { display: none; }
  .pt-copy { min-height: 0; grid-template-rows: none; justify-items: stretch; text-align: left; }
  .pt-copy::before { display: none; }
  .pt h3, .pt.main h3 { font-size: 22px; }
  .play-screen .play-name { width: 140px; }
  .play-tut small { display: none; }
}

/* ---------- Multiplayer: pick a mode ---------- */
.mode-overlay { z-index: 30; }
.mode-window { display: grid; gap: 18px; width: min(900px, 100%); max-height: 100%; overflow: auto; padding: 22px; box-sizing: border-box; text-align: left; }
.mode-window .screen-head h2 { margin: 0; font-size: 26px; font-weight: 600; }
.mode-title { display: flex; align-items: center; gap: 12px; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode { --glow: rgba(232, 80, 60, .38); position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 350px; padding: 20px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; isolation: isolate; cursor: pointer;
  background: radial-gradient(90% 60% at 50% 22%, var(--glow), transparent 70%), linear-gradient(180deg, var(--navy-up), var(--navy-deep) 70%);
  transition: transform .2s var(--ease), border-color .2s, opacity .2s, filter .2s; }
.mode.team { --glow: rgba(159, 227, 255, .32); }
.mode:hover, .mode:focus-visible { border-color: rgba(239, 233, 153, .5); transform: translateY(-3px); outline: none; }
.mode.on { cursor: default; transform: none; border-color: var(--butter); box-shadow: 0 0 0 1px var(--butter) inset, 0 0 0 4px rgba(239, 233, 153, .14), var(--shadow); }
.mode.off { opacity: .32; filter: grayscale(.6); }
.mode-art { position: absolute; inset: 0 0 auto; height: 262px; z-index: -1; }
.mode-art img { position: absolute; width: 124px; border-radius: 10px; box-shadow: var(--shadow); }
.ffa .mode-art img:nth-of-type(1) { left: 12%; top: 16%; rotate: -20deg; }
.ffa .mode-art img:nth-of-type(2) { left: 50%; top: 9%; translate: -50% 0; width: 138px; z-index: 2; }
.ffa .mode-art img:nth-of-type(3) { right: 12%; top: 16%; rotate: 20deg; }
.team .mode-art img { width: 110px; z-index: 1; }
.team .mode-art img:nth-of-type(1), .team .mode-art img:nth-of-type(4) { top: 10%; }
.team .mode-art img:nth-of-type(2), .team .mode-art img:nth-of-type(3) { top: 17%; }
.team .mode-art img:nth-of-type(1) { left: 1%; } .team .mode-art img:nth-of-type(4) { right: 1%; }
.team .mode-art img:nth-of-type(2) { left: 14%; } .team .mode-art img:nth-of-type(3) { right: 14%; }
.team .mode-art::before, .team .mode-art::after { content: ''; position: absolute; top: 0; bottom: -20%; width: 50%; pointer-events: none; }
.team .mode-art::before { left: 0; background: radial-gradient(70% 55% at 30% 45%, rgba(232, 80, 60, .26), transparent 70%); }
.team .mode-art::after { right: 0; background: radial-gradient(70% 55% at 70% 45%, rgba(74, 163, 255, .28), transparent 70%); }
.mode .vs-mark { top: 44%; bottom: auto; translate: -50% -50%; }
.mode-copy { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.mode-copy::before { content: ''; position: absolute; inset: -30px -20px -20px; z-index: -1; background: linear-gradient(180deg, transparent, var(--navy-deep) 46%); }
.mode h3 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.05; }
.mode p { margin: 0; color: var(--muted); font-size: 14px; }
.mode-art, .mode-copy { transition: filter .25s, opacity .25s; }
.mode.on .mode-art { filter: blur(2px) brightness(.45); }
.mode.on .mode-copy { opacity: 0; }
.mode-choose { position: absolute; inset: 0; z-index: 5; display: grid; align-content: center; gap: 10px; padding: 22px; background: rgba(15, 21, 44, .62); animation: mode-in .22s var(--ease); }
@keyframes mode-in { from { opacity: 0; transform: scale(.98); } }
.mode-choose-title { justify-self: start; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; }
.mode-choose small { color: var(--muted); font-size: 12px; }
.mode-sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.mode-sizes.team { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-sizes button { height: 50px; border: 1px solid var(--line); border-radius: 10px; background: rgba(249, 249, 249, .08); color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; }
.mode-sizes.team button { height: 56px; font-size: 16px; }
.mode-sizes button:hover { border-color: var(--butter); }
.mode-sizes button.on { border-color: var(--butter); background: var(--butter); color: var(--navy-deep); }
.mode-go { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; font-size: 16px; }
.mode-go svg { width: 18px; height: 18px; }
.mode-go[disabled] { opacity: .45; cursor: default; }
@media (max-width: 700px) {
  .mode-window { padding: 16px; gap: 12px; }
  .modes { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mode { min-height: 262px; padding: 16px; }
  .mode-art { height: 190px; }
  .mode-art img, .team .mode-art img { width: 86px; }
  .ffa .mode-art img:nth-of-type(2) { width: 96px; }
  .mode .vs-mark span { width: 36px; height: 36px; font-size: 13px; }
  .mode-choose { padding: 16px; }
  .mode h3 { font-size: 26px; }
  .mode-sizes button { height: 46px; }
}

/* ---------- team games: red against blue ---------- */
.seat.team-0 { box-shadow: inset 4px 0 0 var(--red); }
.seat.team-1 { box-shadow: inset 4px 0 0 #4aa3ff; }
.seat.team-2 { box-shadow: inset 4px 0 0 var(--green); }
.mine .seat.team-0, .mine .seat.team-1, .mine .seat.team-2 { box-shadow: none; }
.mine:has(.seat.team-0) { border-left: 4px solid var(--red); }
.mine:has(.seat.team-1) { border-left: 4px solid #4aa3ff; }
.mine:has(.seat.team-2) { border-left: 4px solid var(--green); }
.chip-s.ally { background: rgba(249, 249, 249, .14); color: var(--ink); }
.results-list.by-team li.team-0 { box-shadow: inset 3px 0 0 var(--red); }
.results-list.by-team li.team-1 { box-shadow: inset 3px 0 0 #4aa3ff; }
.results-list.by-team li.team-2 { box-shadow: inset 3px 0 0 var(--green); }
.results-list.by-team .place { color: var(--butter); }
.queue-mode { margin: 0; color: var(--butter); font-weight: 600; }
.mode-chips button { width: auto; padding: 0 14px; }
.room-team-note { margin: -4px 0 0; }

/* private team rooms: Red above Blue, two seats each */
.room-seats.teams { gap: 12px; }
.room-seats.teams > li.team-group { display: grid; align-items: stretch; gap: 8px; min-height: 0; padding: 10px 10px 10px 14px; border: 0; border-radius: 14px; background: rgba(249, 249, 249, .03); }
.room-seats.teams > li.team-group.team-0 { box-shadow: inset 4px 0 0 var(--red); }
.room-seats.teams > li.team-group.team-1 { box-shadow: inset 4px 0 0 #4aa3ff; }
.room-seats.teams > li.team-group.team-2 { box-shadow: inset 4px 0 0 var(--green); }
.team-group h4 { margin: 0 2px; font-size: 14px; font-weight: 600; }
.team-group.team-0 h4 { color: #ff8a78; }
.team-group.team-1 h4 { color: #7cc0ff; }

.team-group.team-2 h4 { color: #8fe39a; }
.seat-join { flex: none; }
@media (max-width: 520px) {
  .room-sizes .size-chips { width: 100%; }
  .room-sizes .size-chips button { flex: 1; width: auto; }
  .team-group .room-seats li { flex-wrap: wrap; }
}

/* Void Shield: up on a seat until the end of its owner's next turn */
/* the same size and place as Barrier's effect: centred on the seat, cells 16% of its width (28px at least) */
.void-cells { position: absolute; left: 50%; top: 50%; width: max(114.3%, 200px); aspect-ratio: 200 / 160; transform: translate(-50%, -50%); overflow: visible; pointer-events: none; z-index: 2; transition: opacity .25s; }
.seat.void-hit .void-cells { opacity: 0; } /* the hit effect plays on its own */
.void-cells .edge { fill: none; stroke: #4fe3ff; stroke-opacity: .55; stroke-width: 7; stroke-linejoin: round; }
.void-cells .face { fill: #6fb8ff; fill-opacity: .22; stroke: #eafcff; stroke-width: 2.8; stroke-linejoin: round; }
.void-cells g { opacity: .07; animation: void-flicker 4s ease-in-out infinite; }
@keyframes void-flicker { 0%, 80%, 100% { opacity: .07; } 89% { opacity: .9; } } /* faint most of the time; each cell lights up on its own, then fades */
html.calm .void-cells g { animation: none; opacity: .3; } /* effects off in the game's settings: a still honeycomb (the game's Effects setting decides, not the computer's reduced-motion) */

/* players' connections during a game */
.chip-s.net { display: inline-flex; align-items: center; gap: 5px; }
.chip-s.net.weak { background: rgba(255, 196, 82, .18); color: #ffd27a; }
.chip-s.net.weak i { width: 10px; height: 8px; background: linear-gradient(to right, currentColor 0 2px, transparent 2px 4px, currentColor 4px 6px, transparent 6px 8px, rgba(255, 210, 122, .3) 8px 10px); clip-path: polygon(0 100%, 100% 0, 100% 100%); } /* a signal icon with its top bar out */
.chip-s.net.off { background: rgba(249, 249, 249, .12); color: #d6d9e2; }
.chip-s.net.left { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.seat.is-offline > :not(.seat-body), .seat.is-offline .hp, .seat.is-offline .zones { opacity: .5; }

/* the currency: a crystal beside the number */
img.crystal { display: inline-block; width: 1.15em; height: 1.15em; margin-right: .2em; vertical-align: -.22em; object-fit: contain; }
img.crystal.big { width: 40px; height: 40px; margin: 0; vertical-align: middle; }
/* an achievement's quest reward, top right of its card */
.ach { position: relative; }
.ach-reward { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; object-fit: contain; filter: grayscale(1); opacity: .45; }
.ach.done .ach-reward { filter: none; opacity: 1; }
.ach:has(.ach-reward) b, .ach:has(.ach-reward) small { padding-right: 38px; }

/* buying asks first: the item, its price, what you'll have left */

/* Settings: a coupon code field, with its result underneath */
.set-sheet .coupon-row { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 12px 0; gap: 8px; } /* label, then the field across the whole row */
.coupon-field { display: flex; gap: 8px; min-width: 0; }
.coupon-field .btn { flex: none; }
.coupon-field input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-deep); color: var(--ink); font: inherit; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.coupon-field input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; color: var(--muted); }
.coupon-field input:focus-visible { outline: 2px solid var(--butter); outline-offset: 1px; }
.coupon-field input:disabled { opacity: .5; }
.coupon-msg { margin: 0; font-size: 13px; color: var(--muted); }

.fly-crystal { position: fixed; z-index: 1002; width: 26px; height: 26px; pointer-events: none; }

/* notes: drop in from the top and stack, one per message (a coupon's rewards get one each) */
#notes { position: fixed; z-index: 1003; top: 16px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.note { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 12px; background: var(--ink); color: var(--navy-deep); font-weight: 600; box-shadow: var(--shadow); animation: note-in .35s var(--ease) both; transition: opacity .3s, transform .3s; }
.note::before { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.note.good::before { content: '✓'; background: #3faa4a; }
.note.bad::before { content: '!'; background: var(--red); }
.note.out { opacity: 0; transform: translateY(-12px); }
@keyframes note-in { from { opacity: 0; transform: translateY(-24px); } }
html.calm .note { animation: none; } /* effects off in the game's settings (not the computer's reduced-motion) */

/* ---------- friends and parties ---------- */
/* header: Friends, with your party's faces when you're in one, and a count of requests and invites */
.friends-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(249, 249, 249, .06); color: var(--ink); cursor: pointer; }
.friends-btn:hover, .friends-btn:focus-visible { border-color: var(--butter); }
.party-faces { display: flex; }
.party-faces > * + * { margin-left: -8px; }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.friends-btn .count-badge { position: absolute; top: -6px; right: -6px; }
.dot-badge { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--navy); }

/* the Friends page: party on the left, friends on the right */
.overlay.page-view > .sheet.friends-sheet { display: flex; flex-direction: column; gap: 12px; padding: 18px 24px; overflow: hidden; text-align: left; }
.friends-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.party-panel, .friend-panel { min-height: 0; overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.party-panel { display: grid; align-content: start; gap: 10px; }
.party-top { display: flex; align-items: center; justify-content: space-between; }
.party-top h3, .party-panel h4 { margin: 0; }
.party-panel h4 { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.party-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.party-slot { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 132px; padding: 12px 6px; border: 1.5px solid var(--butter); border-radius: 14px; background: var(--navy-up); text-align: center; }
.party-slot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.party-slot small { min-height: 1em; color: var(--muted); font-size: 11px; }
.party-slot.open { border-style: dashed; border-color: var(--line); background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.party-slot.open:hover, .party-slot.open:focus-visible { border-color: var(--butter); color: var(--butter); }
.party-slot .plus { font-size: 30px; line-height: 1; color: var(--butter); }
.slot-kick { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(249, 249, 249, .1); color: var(--muted); cursor: pointer; }
.slot-kick:hover { background: var(--red); color: #fff; }
.party-panel .size-chips { flex-wrap: wrap; }
.party-panel .btn.wide { width: 100%; margin-top: 8px; }
.party-wait { margin: 8px 0 0; text-align: center; }

.friend-panel { display: flex; flex-direction: column; gap: 12px; }
.friend-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--navy); }
.friend-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.friend-tabs button.on { background: var(--butter); color: var(--navy-deep); }
.friend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.friend { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--navy-up); }
.friend.offline { opacity: .6; }
.friend-who { display: grid; min-width: 0; flex: 1; }
.friend-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; } /* the Keep streak button drops under the name when the row is narrow */
.friend-name > b { min-width: 0; max-width: 100%; }
.streak { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--butter); white-space: nowrap; }
.streak-icon { width: 22px; height: 22px; flex: none; }
.streak.risk { opacity: .7; }
button.streak { font-family: inherit; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border: 1px solid currentColor; border-radius: 999px; background: transparent; cursor: pointer; opacity: .75; }
button.streak:hover, button.streak.armed { opacity: 1; background: rgba(255, 255, 255, .08); }
button.streak:focus-visible { outline: 2px solid var(--butter); outline-offset: 2px; }
.streak-keep { font-weight: 600; }
button.streak.lost { color: var(--muted); } /* a broken streak is grey: the button and its flame */
button.streak.lost .streak-icon { filter: grayscale(1); }
.friend-who small.ask { white-space: normal; display: block; color: var(--ink); } /* the Keep streak question wraps so all of it can be read */
.friend-who small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(249, 249, 249, .3); flex: none; }
.dot.online { background: var(--green); }
.dot.game { background: var(--butter); }
.friend-acts { display: flex; gap: 6px; flex: none; }
.friend-acts .btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.friend-empty { display: grid; justify-items: center; gap: 12px; padding: 30px 10px; text-align: center; }
.friend-add { display: grid; gap: 10px; }
.friend-add p { margin: 0; }
.my-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1.5px dashed var(--butter); border-radius: 12px; }
.my-code b { font-size: 26px; letter-spacing: .18em; color: var(--butter); }
.friend-form { display: flex; gap: 8px; }
.friend-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy); color: var(--ink); font: inherit; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.friend-form input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; color: var(--muted); }
.queue-party { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.queue-party > span:first-child { display: flex; }
@media (max-width: 760px) {
  .overlay.page-view > .sheet.friends-sheet { padding: 14px; overflow: auto; }
  .friends-cols { grid-template-columns: minmax(0, 1fr); flex: none; }
  .party-panel, .friend-panel { overflow: visible; padding: 14px; }
  .party-slot { min-height: 112px; }
}

/* a party invite, top right wherever you are; the bar runs down until it ends */
#invites { position: fixed; z-index: 1004; top: 64px; right: 16px; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.invite { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px 13px; overflow: hidden; border: 1px solid rgba(239, 233, 153, .5); border-radius: 14px; background: var(--navy-up); box-shadow: var(--shadow); animation: note-in .35s var(--ease) both; }
.invite-text { display: grid; flex: 1; min-width: 0; }
.invite-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-text small { color: var(--muted); font-size: 12px; }
.invite-time { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--butter); transform-origin: left; animation: invite-time linear forwards; }
@keyframes invite-time { to { transform: scaleX(0); } }

/* Play screen: the tiles, and your party beside them (above them on phones) */
.play-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
.play-body .play-tiles { min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); }
.play-body { align-items: center; }
.play-body > .party-col { height: clamp(400px, calc(100dvh - 190px), 540px); } /* the tiles' height, side by side */
.pt-stack { width: 100%; }
.pt-stack .join input { width: 0; } /* takes what's left beside Join, however narrow the tile */
.party-col { display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.party-col h4 { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.party-col p { margin: 0; }
.party-col > .btn { align-self: flex-start; }
.party-rows, .party-invites { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.party-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px; border: 1.5px solid var(--butter); border-radius: 12px; background: var(--navy-up); }
.party-row.open { border: 1.5px dashed var(--line); background: transparent; }
.slot-plus { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1.5px dashed var(--line); color: var(--butter); font-size: 20px; flex: none; }
.party-who { display: grid; min-width: 0; flex: 1; }
.party-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-who small { color: var(--muted); font-size: 11px; }
.party-row .slot-kick { position: static; flex: none; }
.party-hint { text-align: center; }
.party-invites li { display: flex; align-items: center; gap: 8px; }
.party-invites b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.party-search { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(239, 233, 153, .12); color: var(--butter); }
.party-search b { flex: 1; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(239, 233, 153, .3); border-top-color: var(--butter); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .play-body { flex: none; grid-template-columns: minmax(0, 1fr); }
  .play-body .play-tiles { grid-template-columns: minmax(0, 1fr); } /* one tile per row: the 3-column rule above would win otherwise */
  .party-col, .play-body > .party-col { order: -1; overflow: visible; height: auto; }
}
/* the Friends page is the friends list on its own now */
.friends-cols { grid-template-columns: minmax(0, 720px); justify-content: center; }

/* Friends (design D): sections down the left, the chosen one on the right */
.friends-d { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.friend-nav { display: grid; align-content: start; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--navy-deep); }
.friend-nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.friend-nav button:hover { background: rgba(249, 249, 249, .06); }
.friend-nav button.on { background: var(--butter); color: var(--navy-deep); }
.friend-nav small { color: var(--muted); font-weight: 600; }
.friend-nav .on small { color: var(--navy-deep); }
.friend-title { margin: 0 0 2px; font-size: 18px; }
.friend-sub { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.friends-d .friend-panel { overflow: auto; }
/* live status in colour: a ring on the avatar, and the dot and words below the name */
.face-ring { display: grid; place-items: center; padding: 2px; border-radius: 13px; box-shadow: 0 0 0 2px transparent; flex: none; }
.face-ring.online { box-shadow: 0 0 0 2px var(--green); }
.face-ring.party { box-shadow: 0 0 0 2px #4aa3ff; }
.face-ring.game { box-shadow: 0 0 0 2px var(--butter); }
.face-ring.offline { box-shadow: 0 0 0 2px rgba(249, 249, 249, .2); }
.status.online { color: var(--green); }
.status.party { color: #7cc0ff; }
.status.game { color: var(--butter); }
.status .dot { background: currentColor; }
.status.offline .dot { background: rgba(249, 249, 249, .3); }
.friend.offline { opacity: .65; }
.rel { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.pill .dot.online { background: var(--green); }
.my-code { align-items: center; }
.my-code > span { display: grid; gap: 2px; }
@media (max-width: 760px) {
  .friends-d { flex: none; grid-template-columns: minmax(0, 1fr); }
  .friend-nav { grid-template-columns: repeat(2, 1fr); }
  .friend-nav button { justify-content: center; }
  .friends-d .friend-panel { overflow: visible; }
  .friend-acts { flex-wrap: wrap; justify-content: flex-end; }
}
.friend-acts { align-items: center; }
@media (max-width: 760px) {
  .friends-d .friend { flex-wrap: wrap; } /* names stay whole: the buttons drop below when there isn't room */
  .friends-d .friend-who { flex: 1 1 140px; }
  .friends-d .friend-acts { margin-left: auto; }
}
/* Recently played: avatar, name, then two fixed action slots, so nothing shifts from row to row */
.friend-list.recent .friend { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.friend-list.recent .friend-acts { display: grid; grid-template-columns: auto 132px; align-items: center; justify-content: end; gap: 8px; }
.rel-slot { display: grid; place-items: center; width: 132px; }
.rel-slot .btn { width: 100%; }
.rel-slot .rel { text-align: center; }
@media (max-width: 760px) {
  .friend-list.recent .friend { grid-template-columns: auto minmax(0, 1fr); }
  .friend-list.recent .friend-acts { grid-column: 1 / -1; }
}

/* another player's achievements, on their profile card */
.ach-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ach-badge { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: rgba(249, 249, 249, .05); color: var(--muted); font-size: 11px; opacity: .55; }
.ach-badge i { display: grid; place-items: center; width: 28px; height: 28px; flex: none; }
.ach-badge b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ach-badge.on { opacity: 1; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(239, 233, 153, .5); }
.ach-badge b { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; } /* long names wrap instead of being cut */
/* the Friends heading, with how many are online on the same line */
.friend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* the profile's sixth badge: how many more, and a tap opens them */
.ach-badge.more { justify-content: center; border: 1px dashed var(--line); background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; opacity: 1; cursor: pointer; }
.ach-badge.more:hover, .ach-badge.more:focus-visible { border-color: var(--butter); color: var(--butter); }

/* the Tutorial's invite: Grumble asks you to a quick match */
.sheet.tut-invite { display: grid; justify-items: center; gap: 14px; width: min(460px, 100%); padding: 24px 24px 18px; box-sizing: border-box; text-align: center; }
.tut-host { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; }
.tut-grumble { flex: none; animation: grumble-in .5s var(--ease) both; }
.tut-bubble { position: relative; margin: 0; padding: 12px 16px; border-radius: 16px; background: var(--ink); color: var(--navy-deep); font-weight: 600; line-height: 1.45; animation: bubble-in .4s .25s var(--ease) both; transform-origin: left center; }
.tut-bubble::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-left: 0; border-right-color: var(--ink); }
.tut-lessons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; margin: 4px 0 0; padding: 0; list-style: none; }
.tut-lessons li { display: grid; justify-items: center; gap: 8px; font-size: 13px; font-weight: 600; animation: lesson-in .45s calc(.4s + var(--i) * .1s) var(--ease) both; }
.tut-lessons .card-img { width: 84px; border-radius: var(--card-r); box-shadow: var(--shadow); transition: transform .2s var(--ease); }
.tut-lessons li:nth-child(1) .card-img { rotate: -6deg; }
.tut-lessons li:nth-child(3) .card-img { rotate: 6deg; }
.tut-lessons li:hover .card-img { transform: translateY(-4px); }
.tut-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tut-time { display: inline-flex; align-items: center; gap: 6px; }
.tut-prize { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid rgba(95, 201, 192, .5); border-radius: 99px; background: rgba(95, 201, 192, .14); color: #bfe9e6; font-weight: 600; }
.tut-prize.got { border-color: var(--line); background: rgba(249, 249, 249, .06); color: var(--muted); }
.tut-note { margin: -6px 0 0; color: var(--muted); font-size: 12px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--butter); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.btn.tut-go { width: 100%; padding: 14px; font-size: 17px; box-shadow: 0 4px 0 #b3ad5d; }
.btn.tut-go:active { transform: translateY(3px); box-shadow: 0 1px 0 #b3ad5d; }
.tut-later { padding: 4px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tut-later:hover { color: var(--ink); }
@keyframes grumble-in { from { opacity: 0; transform: translateY(14px) scale(.8); } 60% { transform: translateY(-4px) scale(1.04); } }
@keyframes bubble-in { from { opacity: 0; transform: scale(.85); } }
@keyframes lesson-in { from { opacity: 0; transform: translateY(18px); } }
html.calm .tut-grumble, html.calm .tut-bubble, html.calm .tut-lessons li { animation: none; } /* effects off in the game's settings (not the computer's reduced-motion) */
.calm .tut-grumble, .calm .tut-bubble, .calm .tut-lessons li { animation: none; }
@media (max-width: 420px) {
  .tut-host { flex-direction: column; text-align: center; }
  .tut-bubble::before { left: 50%; top: -9px; margin: 0 0 0 -9px; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
  .tut-lessons .card-img { width: 70px; }
}
.fav-star:disabled { cursor: default; }
.fav-star.saving { animation: star-saving .7s ease-in-out infinite alternate; } /* waiting on the server */
@keyframes star-saving { to { opacity: .4; } }
.set-main:disabled { opacity: .55; cursor: default; }

.emote-foot.ep-foot { justify-content: space-between; gap: 12px; } /* Cancel bottom left, Save bottom right, never touching */
/* a balance for the moment, on pages that don't show one, while redeemed crystals fly in */
.fly-balance { position: fixed; z-index: 1002; top: 64px; right: 16px; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--navy-up); border: 1px solid var(--line); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); animation: note-in .3s var(--ease) both; transition: opacity .35s, transform .35s; }
.fly-balance.out { opacity: 0; transform: translateY(-10px); }
.fly-flash { position: fixed; z-index: 1002; width: 12px; height: 12px; border-radius: 50%; background: var(--butter); pointer-events: none; } /* the burst's flash */

/* an update on its way: a countdown across the top of every screen */
#update-bar { position: fixed; z-index: 1005; left: 50%; top: 10px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
.update-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 8px 16px; border-radius: 99px; background: var(--butter); color: var(--navy-deep); box-shadow: var(--shadow); font-size: 13px; text-align: center; animation: note-in .35s var(--ease) both; }
.update-bar b { font-variant-numeric: tabular-nums; }
body.has-update #notes { top: 60px; } /* toasts drop in below it */


/* the table while the connection comes back: greyed, with a clear notice on top */
.reconnect-pill { position: fixed; z-index: 60; left: 50%; top: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: var(--navy-up); border: 1px solid #fff; color: #fff; font-weight: 700; box-shadow: var(--shadow); filter: none; }
.reconnect-pill .spinner { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; } /* white, like its text and border */

/* the privacy policy and terms: a plain reading page, one column */
.legal-page { line-height: 1.65; }
.legal-page .legal-date { margin: -6px 0 0; }
.legal-page .legal-lead { margin: 0; font-size: 17px; }
.legal-page section { padding-top: 14px; border-top: 1px solid var(--line); }
.legal-page h3 { margin: 0 0 6px; font-size: 17px; color: var(--butter); }
.legal-page p { margin: 0 0 10px; max-width: 68ch; word-break: keep-all; overflow-wrap: anywhere; }
.legal-page a { color: var(--butter); }
.legal-other { padding: 6px 0 24px; }
.set-legal { display: flex; justify-content: center; gap: 8px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.set-legal .link-btn { color: var(--muted); font-weight: 500; }
.set-legal .link-btn:hover { color: var(--ink); }

/* sign in: Google and Discord as two big tiles, in their own brand colours */
.signin-wrap { z-index: 45; }
.sheet.signin-ask { position: relative; width: min(400px, calc(100vw - 32px)); display: grid; justify-items: center; gap: 14px; padding: 26px 22px 20px; text-align: center; }
.signin-ask h2 { margin: 0; font-size: 22px; }
.signin-ask p { margin: 0; }
.signin-tiles { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.signin-tile { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 112px; padding: 16px 8px; border: 0; border-radius: 14px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .15s var(--ease), filter .15s; }
.signin-tile.google { background: #fff; color: #1f1f1f; }
.signin-tile.discord { background: #5865F2; color: #fff; }
.signin-tile:hover { transform: translateY(-2px); filter: brightness(1.05); }
.signin-tile:active { transform: translateY(1px); filter: brightness(.95); }
.signin-tile:focus-visible { outline: 2px solid var(--butter); outline-offset: 3px; }
html.calm .signin-tile { transition: none; } html.calm .signin-tile:hover, html.calm .signin-tile:active { transform: none; } /* effects off in the game's settings (not the computer's reduced-motion) */

/* What's new: the latest version's notes, earlier versions below on request */
.wn-wrap { z-index: 44; }
.sheet.wn-ask { width: min(440px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 48px)); display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 22px 18px; text-align: left; }
.wn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wn-head h2 { margin: 0; font-size: 22px; }
.wn-tag { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(239, 233, 153, .14); color: var(--butter); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wn-body { min-height: 0; overflow: auto; display: grid; gap: 14px; padding-right: 4px; }
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wn-list li { position: relative; padding-left: 18px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.wn-list li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--butter); }
.wn-more { justify-self: start; font-weight: 600; text-decoration: none; }
.wn-old { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.wn-old h3 { display: flex; align-items: center; gap: 10px; margin: 0; }
.wn-old h3 small { color: var(--muted); font-size: 13px; font-weight: 500; }
.wn-old .wn-list li { color: var(--muted); }
.wn-old .wn-list li::before { background: var(--muted); }
.wn-ok { width: 100%; flex: none; }

/* The Windows app updating itself: full-screen over everything, on the game's own background */
.upd-wrap { z-index: 3000; background: url(ui/main_bg.webp) center / cover no-repeat, var(--navy-deep); backdrop-filter: none; }
.sheet.upd-sheet { width: min(440px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; gap: 14px; padding: 22px; text-align: left; }
.upd-sheet:focus { outline: none; }
.upd-sheet h2 { margin: 0; font-size: 22px; }
.upd-sheet p { margin: 0; }
.upd-logo { width: 120px; height: auto; align-self: center; }
.upd-sheet .wn-body { max-height: 28dvh; }
.upd-acts { display: grid; gap: 10px; }
.upd-acts a.btn { text-decoration: none; text-align: center; }
.upd-bar.ind i { width: 35%; animation: upd-slide 1.1s var(--ease) infinite alternate; }
@keyframes upd-slide { to { transform: translateX(185%); } }
html.calm .upd-bar.ind i { animation: none; width: 100%; }
.upd-wrap .upd-sheet { animation: upd-in calc(.4s / var(--pace, 1)) var(--ease) both; } /* once: .settled (the shared guard) turns it off on later steps */
.upd-wrap.settled .upd-sheet > :not(.upd-logo) { animation: upd-swap calc(.28s / var(--pace, 1)) ease-out both; } /* a new step: its content fades in where the old one was */
.upd-wrap.chk .upd-logo { animation: upd-breathe 2.8s ease-in-out infinite; } /* checking: the logo breathes, slowly (opacity only: the line work is never scaled) */
.upd-bar:not(.ind) i { transform-origin: left; transition: transform calc(.4s / var(--pace, 1)) var(--ease); } /* percent glides (scaleX, like the bar's fill, never width) */
@keyframes upd-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes upd-swap { from { opacity: 0; } }
@keyframes upd-breathe { 50% { opacity: .6; } }
html.calm .upd-wrap .upd-sheet, html.calm .upd-wrap.settled .upd-sheet > *, html.calm .upd-wrap.chk .upd-logo { animation: none; } /* effects off in the game's settings (not the computer's reduced-motion) */
html.calm .upd-bar:not(.ind) i, .potato .upd-bar:not(.ind) i { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .upd-wrap .upd-sheet { animation: upd-swap .2s ease-out both; }
  .upd-wrap.settled .upd-sheet > :not(.upd-logo) { animation: none; }
  .upd-wrap.chk .upd-logo { animation: none; }
  .upd-bar:not(.ind) i { transition: none; }
}

/* the game's Discord server: a top-left button beside What's new, filled in Discord's own blurple */
.discord-btn { gap: 8px; padding: 0 14px 0 11px; background: #5865F2; border-color: #5865F2; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.discord-btn:hover, .discord-btn:focus-visible { border-color: #fff; filter: brightness(1.08); }
/* The title screen's top bar is always one row: the left group (gift, What's new, Discord) and the right group (sound,
   settings, account) keep at least 16px between them and never wrap. Up to 768px Discord is just its logo, the same
   size as its neighbours; on the narrowest phones every button tightens a little so both groups still fit */
.title-top { flex-wrap: nowrap; gap: 16px; }
.title-top .title-left, .title-top .title-settings, .title-top .account { flex-wrap: nowrap; flex: none; }
@media (max-width: 768px) {
  .discord-btn { padding: 0 9px; }
  .discord-btn svg { width: 20px; height: 16px; }
  .discord-btn span { display: none; }
}
@media (max-width: 420px) {
  .title-top { padding: 12px; gap: 12px; }
  .title-top .title-left, .title-top .title-settings, .title-top .account { gap: 5px; }
  .title-top .friends-btn { min-width: 34px; height: 34px; padding: 0 7px; border-radius: 10px; }
  .title-top .friends-btn svg { width: 18px; height: 18px; }
  .title-top .icon-pair .icon { width: 32px; height: 32px; }
  .title-top .coins-pill { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; min-height: 30px; font-size: 13px; }
  .title-top .avatar-btn .av { width: 34px; height: 34px; }
}
@media (max-width: 370px) { /* the smallest phones, 360px Androids included */
  .title-top { padding: 10px 8px; gap: 8px; }
  .title-top .title-left, .title-top .title-settings, .title-top .account { gap: 4px; }
  .title-top .friends-btn { min-width: 30px; height: 30px; padding: 0 5px; }
  .title-top .friends-btn svg { width: 16px; height: 16px; }
  .title-top .icon-pair .icon { width: 28px; height: 28px; }
  .title-top .coins-pill { padding: 0 6px; font-size: 12px; }
  .title-top .avatar-btn .av { width: 30px; height: 30px; }
}

/* "What's your name?" after the first sign-in: like the other small windows, with the letter count inside the box */
.name-ask-overlay { z-index: 1000; } /* above every page and window, under toasts so "Enter your name first" shows */
.sheet.name-ask { width: min(360px, calc(100vw - 32px)); display: grid; justify-items: center; gap: 10px; padding: 24px 20px 20px; box-sizing: border-box; text-align: center; }
.name-ask h2 { margin: 2px 0 0; font-size: 24px; color: var(--butter); }
.name-ask label { font-size: 14px; }
.name-ask-av { display: grid; }
.name-ask-av .av { width: 84px; height: 84px; }
.name-ask-field { position: relative; width: 100%; }
.name-ask-field input { width: 100%; box-sizing: border-box; padding: 11px 64px 11px 14px; border: 1px solid var(--butter); border-radius: 10px; background: var(--navy-deep); color: var(--ink); font: inherit; font-size: 16px; box-shadow: 0 0 0 3px rgba(239, 233, 153, .15); outline: none; }
.name-ask-count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.name-ask .btn { width: 100%; height: 46px; margin-top: 4px; }

/* the tutorial waiting for Next: the table's buttons look switched off, so the guide's Next is the only one that stands out */
html.tut-wait .table .actions .btn, html.tut-wait .table .my-field .btn { background: transparent; border-color: var(--line); color: var(--muted); box-shadow: none; opacity: .5; pointer-events: none; transition: none; }

/* end-of-game awards: a sticker that lands on the player's row with the impact star, its name beside it */
.results-list li > span:not(.tag):not(.award) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.award { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--butter); font-size: 12px; }
.award b { font-weight: 600; white-space: nowrap; }
.award-pic { position: relative; display: grid; place-items: center; width: 28px; height: 28px; }
.award-icon { position: relative; width: 28px; height: 28px; }
.award-star { position: absolute; width: 46px; height: 46px; opacity: 0; pointer-events: none; }
.award.land .award-icon, .award.land b { animation: award-pop .5s cubic-bezier(.2, 1.4, .4, 1) var(--d) both; }
.award.land .award-star { animation: award-star .45s ease-out var(--d) both; }
@keyframes award-pop { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 45% { transform: scale(1.15) rotate(3deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes award-star { 0% { transform: scale(.2); opacity: 1; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }
@media (max-width: 420px) { .award b { font-size: 11px; } }

.results-list { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; scrollbar-gutter: stable; } /* the award's impact star can poke past a row: never a sideways scroll, and the scrollbar never sits on an award's name */

/* the last hit: everything but the knocked-out seat sinks into the dark while the table zooms in on it (under the effects layer) */
html.last-hit::after { content: ''; position: fixed; inset: 0; z-index: 15; pointer-events: none; background: radial-gradient(circle at var(--lx, 50%) var(--ly, 50%), transparent 0, transparent 90px, rgba(8, 12, 30, .82) 60vmax); animation: fade .4s ease-out both; }
.field-back.open[data-act] { cursor: zoom-in; } /* a face-up field card opens big when tapped */
.field-back.open[data-act]:hover, .field-back.open[data-act]:focus-visible { outline: 2px solid var(--butter); outline-offset: 2px; }

/* effects that ride a seat (the stuck Javelin): a zero-size layer inside the seat, its frames drawn in screen pixels */
.fx-seat { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.fx-frame { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.fx-frame .fx { position: absolute; }
.emote-all.phrases { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.emote-all.phrases .emote-tile { aspect-ratio: auto; min-height: 56px; padding: 10px 8px 14px; display: grid; place-items: center; }
.emote-all.phrases .phrase-bubble { font-size: 13px; padding: 7px 10px; }
.emote-all.phrases .emote-tile:not(.on) .phrase-bubble { opacity: 0.45; }
.emote-slots.phrases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emote-slots.phrases .emote-tile, .emote-slots.phrases .emote-empty { aspect-ratio: auto; min-height: 56px; }
.emote-slots.phrases .emote-tile { display: grid; place-items: center; padding: 8px 8px 14px; }
.emote-slots.phrases .phrase-bubble { font-size: 13px; padding: 7px 10px; }
.emote-all.phrases .emote-tile:not(.on) .phrase-bubble { opacity: 1; }

.fx.flip { transform-style: preserve-3d; background: none; box-shadow: none; will-change: transform; }
.fx.flip i { position: absolute; inset: 0; border-radius: var(--card-r); background-size: cover; backface-visibility: hidden; box-shadow: var(--shadow); }
.fx.flip i.back { transform: rotateY(180deg); }

/* Shout: the shouter's seat pulses red with a badge until their next turn */
.seat.is-taunt { border-color: #e2564a; }
.seat.is-taunt::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: 0 0 0 8px rgba(226, 86, 74, 0.9); animation: taunt-pulse 0.9s ease-out infinite; }
@keyframes taunt-pulse { from { opacity: 0.9; transform: scale(0.97); } to { opacity: 0; transform: none; } }
html.calm .seat.is-taunt::before { animation: none; }
html.calm .seat.is-taunt { animation: none; box-shadow: 0 0 0 3px rgba(226, 86, 74, 0.6); }
.taunt-badge { position: absolute; top: -11px; right: -9px; z-index: 2; line-height: 0; animation: taunt-in 0.32s var(--ease) both; }
@keyframes taunt-in { from { transform: scale(0); } 60% { transform: scale(1.3); } to { transform: scale(1); } }
.fx.ring.shout { width: 90px; height: 90px; box-shadow: 0 0 0 2px #10160c, inset 0 0 0 2px #10160c; } /* Shout's rings: bigger than a hit's */

/* a chat from a seat that's scrolled out of view: a chip at the edge it's past */
.edge-chip { position: fixed; z-index: 17; display: flex; align-items: center; gap: 6px; max-width: min(72vw, 280px); padding: 5px 10px; background: var(--ink); color: var(--navy-deep); font-size: 14px; font-weight: 500; line-height: 1.25; box-shadow: var(--shadow); pointer-events: none; animation: pop 0.25s var(--ease); }
.edge-chip.left { left: 0; border-radius: 0 12px 12px 0; }
.edge-chip.right { right: 0; border-radius: 12px 0 0 12px; }
.edge-chip.right i { order: 3; }
.edge-chip i { font-style: normal; font-size: 20px; line-height: 1; }
.edge-chip b { flex: none; font-weight: 600; }
.edge-chip b::after { content: ':'; }
.edge-chip span { min-width: 0; overflow-wrap: anywhere; }
.edge-chip .bubble-emote { width: 28px; height: 28px; }

/* Buy confirms on the button: the label changes and a bar runs down while it waits for the second tap */
.btn.armed, .deck-tile.buy.armed { position: relative; overflow: hidden; background: var(--butter); color: var(--navy-deep); border-color: var(--butter); } /* the Buy button's own yellow: the label and the draining bar tell it apart */
.btn.armed .lab { position: relative; z-index: 1; }
.buy-fill { position: absolute; inset: 0; background: rgba(16, 22, 56, 0.35); transform-origin: right center; animation: buy-drain linear forwards; pointer-events: none; }
@keyframes buy-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
html.calm .buy-fill { animation: none; transform: scaleX(0); }
.buy-left { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); text-align: center; }
.deck-tile.buy.armed > * { position: relative; z-index: 1; }
/* the deck slot tile while confirming: the small text and the + take the title’s dark colour, so they read on the yellow */
.deck-tile.buy.armed, .deck-tile.buy.armed *, .btn.armed, .btn.armed * { color: var(--navy-deep); }
.deck-tile.buy.armed .deck-pile { border-color: rgba(24, 34, 63, 0.35); }
.room-invite { margin-top: 14px; display: grid; gap: 8px; }
.room-invite h4 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.float.freeze { color: var(--ice); }

/* the card labels (+1 card, −1 card, Empty hand): cartoon lettering. Three copies of the text stacked: a thick white one, a black one
   a little thinner on top of it, and the colour on top of that, so the black sits inside the white */
.float.tag { right: auto; left: 50%; top: 0; display: grid; white-space: nowrap; font-size: 21px; font-weight: 800; letter-spacing: 0.05em; translate: -50% 0; z-index: 7; text-shadow: none; }
.float.tag > * { grid-area: 1 / 1; font-style: normal; font-weight: inherit; paint-order: stroke fill; }
.float.tag > i:first-child { color: #fff; -webkit-text-stroke: 10px #fff; }
.float.tag > i:nth-child(2) { color: #10160c; -webkit-text-stroke: 5px #10160c; }
.float.tag.hit > b { color: #ff6a55; }
.float.tag.heal > b { color: #7dff94; }
.float.tag.empty > b { color: #d9dde6; }
.float.tag.freeze > b { color: var(--ice); }
.float.tag.block > b { color: #9db8ff; }
/* damage and heal numbers: the same lettering, popping up in an arc */
.float.tag.num { left: auto; right: 0; top: 0; translate: none; font-size: 30px; animation: num-pop var(--t, 1050ms) ease-out forwards; }
@keyframes num-pop { 0% { transform: translate(0, 8px) scale(.3) rotate(-10deg); opacity: 0; } 14% { transform: translate(-3px, -6px) scale(1.4) rotate(4deg); opacity: 1; } 28% { transform: translate(-8px, -14px) scale(.95) rotate(-2deg); opacity: 1; } 62% { transform: translate(-13px, -30px) scale(1) rotate(0); opacity: 1; } 100% { transform: translate(-16px, -48px) scale(.9); opacity: 0; } }
@keyframes num-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* the Buy label (with its crystal) sits in the middle of the button, both ways */
.shop-buy { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; line-height: 1.2; }
.shop-buy .lab { display: inline-flex; align-items: center; gap: 6px; }

/* our own dropdown, in place of the browser's <select> */
.dd { position: relative; min-width: 0; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(10, 16, 40, 0.35); text-align: left; }
.dd-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn svg { flex: none; color: var(--muted); transition: transform 0.15s var(--ease); }
.dd.open .dd-btn, .dd-btn:focus-visible { border-color: var(--butter); outline: none; }
.dd.open .dd-btn svg { transform: rotate(180deg); color: var(--butter); }
.dd-list { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(320px, 86vw); max-height: 240px; overflow: auto; margin: 0; padding: 6px; list-style: none; display: grid; gap: 2px; border-radius: 12px; border: 1.5px solid var(--butter); background: var(--navy-deep); box-shadow: var(--shadow); animation: dd-in 0.15s var(--ease); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-list button { width: 100%; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; text-align: left; font-size: 15px; }
.dd-list button:hover:not(:disabled), .dd-list button:focus-visible { background: rgba(249, 249, 249, 0.1); outline: none; }
.dd-list button.on { color: var(--butter); font-weight: 600; }
.dd-list button:disabled { opacity: 0.4; }
.seats .dd-btn { min-height: 36px; padding: 0 8px 0 10px; font-size: 14px; }
.room-seats .dd { max-width: 150px; }
@media (max-width: 760px) { .team-group .room-seats .dd { flex: 1 1 100%; max-width: none; } }
:root[lang="th"] .cf-name { top: 16%; }

/* detail follows size: a small card keeps what a glance needs (icon, name) and drops lines that would only be noise */
@container (max-width: 190px) {
  .cf-story { display: none; }
  .cf-name { font-size: calc(13cqw * var(--fit, 1)); top: 14%; }
  :root[lang="th"] .cf-name { font-size: calc(11cqw * var(--fit, 1)); }
  .cf-rule { top: 66%; font-size: 6.4cqw; line-height: 1.22; }
  :root[lang="th"] .cf-rule { font-size: 5.4cqw; }
  .cf-null { top: 40%; font-size: 8cqw; }
}
@container (max-width: 110px) {
  .cf-rule, .cf-null { display: none; }
  :root .cf-type:not(.event), :root[lang="th"] .cf-type:not(.event) { font-size: 0; }
  .cf-name { font-size: calc(16cqw * var(--fit, 1)); top: 16%; }
  :root[lang="th"] .cf-name { font-size: calc(14cqw * var(--fit, 1)); }
}

/* the hand as a fan (desktop and tablet) once you hold more than one card: they tilt from their bottom edge and overlap a little; the one you point at or pick straightens and rises. A single card sits straight. */
@media (min-width: 621px) {
  .hand-card { transform-origin: 50% 100%; transition: transform 0.18s var(--ease), rotate 0.18s var(--ease), opacity 0.15s; }
  .hand { padding-top: 14px; } /* always, so the hand doesn't change height when it fans */
  .hand:has(.hand-card + .hand-card) { gap: 0; }
  .hand:has(.hand-card + .hand-card) > .hand-card + .hand-card { margin-left: -14px; }
  .hand:has(.hand-card + .hand-card) > .hand-card:nth-child(1) { rotate: -5deg; }
  .hand:has(.hand-card + .hand-card) > .hand-card:nth-child(2) { rotate: 5deg; }
  .hand-card:hover { transform: translateY(-12px); rotate: 0deg; z-index: 2; }
  .hand-card.sel { transform: translateY(-16px); rotate: 0deg; z-index: 2; }
}
/* an opponent's face-down cards fan the same way */
.backs:has(i + i) i:nth-child(1) { rotate: -9deg; transform-origin: 50% 100%; }
.backs:has(i + i) i:nth-child(2) { rotate: 9deg; transform-origin: 50% 100%; }

/* shop: a discounted tile says by how much */
.shop-sale { position: absolute; top: 6px; right: 6px; z-index: 1; padding: 1px 8px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
/* deck builder: the reason Save is off, and the owned-only switch beside the type tabs */
.deck-foot { align-items: center; }
.deck-why { order: -1; margin-right: auto; min-width: 0; text-align: left; font-size: 13px; color: #ff9c8c; }
/* tabs on the left, the owned-only switch on the right; they wrap onto two lines when the pool is narrow, and keep clear of the edge */
.deck-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-right: 14px; }
.deck-filter .dd { flex: none; width: 150px; }
.deck-filter .dd-btn { min-height: 38px; }
.deck-search { flex: 1 1 130px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; box-sizing: border-box; border-radius: 12px; border: 1.5px solid var(--line); color: var(--muted); }
.deck-search:focus-within { border-color: var(--butter); color: var(--ink); }
.deck-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; }
.deck-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }
.deck-nomatch { margin: 8px 0; }
.deck-owned { margin-left: auto; }
.deck-owned { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.deck-owned:hover, .deck-owned.on { color: var(--ink); }
.deck-owned i { position: relative; width: 32px; height: 18px; flex: none; border-radius: 99px; background: rgba(249, 249, 249, 0.18); transition: background .15s; }
.deck-owned i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease), background .15s; }
.deck-owned.on i { background: var(--butter); }
.deck-owned.on i::after { transform: translateX(14px); background: var(--navy-deep); }
.deck-card[hidden], .deck-nomatch[hidden] { display: none; }

/* title: the Play button says when a reward is waiting; the play screen's header says which day's gift */
.title-play { position: relative; }
.daily-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; padding: 5px 14px 5px 10px; border: 1.5px solid var(--butter); border-radius: 99px; background: rgba(239, 233, 153, 0.14); color: var(--butter); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: transform .15s var(--ease), background .15s; }
.daily-chip:hover { transform: scale(1.03); background: rgba(239, 233, 153, 0.24); }
.daily-chip:active { transform: translateY(2px) scale(.99); }
.daily-chip:focus-visible { outline: 2px solid var(--butter); outline-offset: 3px; }
.daily-chip .crystal { width: 16px; height: 16px; }
.screen-head .daily-chip { flex: none; margin-right: auto; }
@media (max-width: 480px) { .daily-chip { margin-left: 8px; padding-inline: 8px; font-size: 12px; } }


/* mode tiles: a yellow-rimmed frame (like the buttons) with a faint corner shine, and the mode's name on a tab hanging from the top edge */
@media (min-width: 901px) {
  .play-tiles .pt { border: 2px solid var(--butter); box-shadow: 0 0 0 3px var(--navy-deep), var(--shadow); }
  .play-tiles .pt::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 96px; background: rgba(239, 233, 153, .1); clip-path: polygon(0 0, 100% 0, 100% 36%, 0 100%); pointer-events: none; } /* the corner shine: a flat, faint wedge across the top */
  .play-tiles .pt:hover { border-color: var(--butter); }
  .play-tiles .pt h3 { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; padding: 4px 26px 6px; border-radius: 0 0 12px 12px; background: var(--butter); color: var(--navy-deep); font-size: 19px; white-space: nowrap; box-shadow: 0 4px 10px rgba(5, 10, 30, .35); }
  .play-tiles .pt.main h3 { font-size: 21px; padding-inline: 32px; }
  .play-tiles .pt-copy { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
  .play-tiles .pt-copy > p { text-align: center; }
}


/* the "New here?" strip on the Play screen: a rimmed banner with a solid star badge, the reward, and the tutorial button */
.play-tut { position: relative; gap: 12px; margin-inline: 10px; padding: 10px 14px; border: 1.5px dashed var(--butter); background: var(--navy-deep); }
/* a ticket: two notches in the sides, and the reward and button on the stub behind a dashed tear line */
.play-tut::before, .play-tut::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--navy); box-sizing: border-box; }
.play-tut::before { left: -10px; border-right: 1.5px dashed var(--butter); }
.play-tut::after { right: -10px; border-left: 1.5px dashed var(--butter); }
.play-tut-stub { align-self: stretch; flex: none; display: flex; align-items: center; gap: 10px; padding-left: 14px; margin: -10px 0; border-left: 1.5px dashed rgba(239, 233, 153, .5); }
.play-tut-icon { width: 40px; height: 40px; background: var(--butter); color: var(--navy-deep); box-shadow: 0 0 0 4px rgba(239, 233, 153, .18); animation: tut-star 2.4s ease-in-out infinite; }
@keyframes tut-star { 50% { box-shadow: 0 0 0 7px rgba(239, 233, 153, .06); } }
.calm .play-tut-icon, html.calm .play-tut-icon { animation: none; }
.play-tut b { font-size: 16px; font-weight: 600; }
.play-tut-prize { flex: none; padding: 4px 11px; font-size: 14px; font-variant-numeric: tabular-nums; border-color: rgba(233, 196, 106, .55); background: rgba(233, 196, 106, .14); color: #f3d98a; gap: 5px; }
.play-tut-prize .crystal { width: 18px; height: 18px; }
.play-tut-go { flex: none; border-color: var(--butter); color: var(--butter); font-weight: 600; transition: transform .15s var(--ease), background .15s; }
.play-tut-go:hover { transform: scale(1.03); background: rgba(239, 233, 153, .14); }
.play-tut-go:active { transform: translateY(2px) scale(.99); }
@media (max-width: 620px) { .play-tut-prize { display: none; } }
@media (max-width: 480px) { .play-tut { gap: 9px; padding: 9px 10px; } .play-tut-stub { gap: 7px; padding-left: 9px; margin-block: -9px; } .play-tut-icon { width: 34px; height: 34px; } .play-tut b { font-size: 15px; } .play-tut-prize { padding: 3px 8px; font-size: 13px; } }

/* hover, Play screen: the cards on a tile spread out left and right, past the frame's side edges, and grow a little */
@media (hover: hover) and (min-width: 901px) {
  /* the cards may spread past the frame's side edges; the hovered tile goes above its neighbours, and the shine and text fade keep the frame's rounded corners */
  .play-tiles .pt { overflow: visible; }
  .play-tiles .pt:hover, .play-tiles .pt:focus-within { z-index: 3; }
  .play-tiles .pt::after { border-radius: 14px 14px 0 0; }
  .play-tiles .pt-copy::before { border-radius: 0 0 14px 14px; }
  .play-tiles .pt-art img { transition: transform .3s var(--ease); }
  .play-tiles .pt:hover .pt-art img, .play-tiles .pt:focus-within .pt-art img { transform: scale(1.12); }
  .play-tiles .bots:hover .pt-art img:nth-of-type(1), .play-tiles .bots:focus-within .pt-art img:nth-of-type(1) { transform: translateX(-26%) scale(1.12); }
  .play-tiles .bots:hover .pt-art img:nth-of-type(3), .play-tiles .bots:focus-within .pt-art img:nth-of-type(3) { transform: translateX(26%) scale(1.12); }
  .play-tiles .bots:hover .pt-art img:nth-of-type(2), .play-tiles .bots:focus-within .pt-art img:nth-of-type(2) { transform: scale(1.18); }
  .play-tiles .main:hover .pt-art img:nth-of-type(1), .play-tiles .main:focus-within .pt-art img:nth-of-type(1) { transform: translateX(-30%) scale(1.1); }
  .play-tiles .main:hover .pt-art img:nth-of-type(2), .play-tiles .main:focus-within .pt-art img:nth-of-type(2) { transform: translateX(-12%) scale(1.1); }
  .play-tiles .main:hover .pt-art img:nth-of-type(3), .play-tiles .main:focus-within .pt-art img:nth-of-type(3) { transform: translateX(12%) scale(1.1); }
  .play-tiles .main:hover .pt-art img:nth-of-type(4), .play-tiles .main:focus-within .pt-art img:nth-of-type(4) { transform: translateX(30%) scale(1.1); }
  .play-tiles .room:hover .pt-art img:nth-of-type(1), .play-tiles .room:focus-within .pt-art img:nth-of-type(1) { transform: translateX(-22%) scale(1.14); }
  .play-tiles .room:hover .pt-art img:nth-of-type(2), .play-tiles .room:focus-within .pt-art img:nth-of-type(2) { transform: translateX(22%) scale(1.14); }
}
/* hover, Multiplayer window: the cards rise out of the frame's top edge */
@media (hover: hover) {
  .modes .mode { overflow: visible; }
  .modes .mode-copy::before { inset: -30px 0 -20px; border-radius: 0 0 17px 17px; }
  .modes .mode-choose { border-radius: 17px; }
  .modes .mode-art img { transition: transform .3s var(--ease); }
  .modes .mode:not(.on):not(.off):hover .mode-art, .modes .mode:not(.on):not(.off):focus-visible .mode-art { z-index: 5; }
  .modes .mode:not(.on):not(.off):hover .mode-art img, .modes .mode:not(.on):not(.off):focus-visible .mode-art img { transform: translateY(-28px) scale(1.03); }
}
.mode-window { overflow-x: hidden; } /* the cards that rise on hover must not add a scrollbar */
.overlay.page-view > .sheet.play-screen { overflow-x: hidden; }

.friend-count { margin: 0 0 6px; text-align: right; font-variant-numeric: tabular-nums; }

/* the Windows app's "Leave the game?" */
#quit-ask .overlay { z-index: 2000; }
.quit-sheet { display: grid; gap: 12px; max-width: 380px; text-align: center; }
.quit-sheet h2, .quit-sheet p { margin: 0; }
.quit-sheet .row { display: flex; gap: 10px; justify-content: center; }

/* ---------- soft cartoon pass, every screen ----------
   Outlines are a lighter or darker shade of each thing's own colour (no black), panels carry a faint dot grain and a soft
   highlight along the top, and what can be pressed has a darker band of its own colour underneath. Rings and bands are
   box-shadow only, so no size or position changes anywhere. */
:root { --ink-edge: #10172f; --edge-deep: #0e1630; --butter-edge: #9a9547; --edge: #5a6db2; --edge-soft: #384c88; --face-shade: #b2ac55; --night: #18223f; --dots: radial-gradient(rgba(255, 255, 255, .13) 1.5px, transparent 2px); --fade: linear-gradient(180deg, rgba(32, 46, 86, 0) 0%, rgba(32, 46, 86, .55) 45%, var(--navy) 100%); }

.sheet h2, .screen-head h2, .set-sheet h2 { color: #fff; -webkit-text-stroke: .12em var(--edge); paint-order: stroke fill; }

/* buttons: a dark outline, and a solid band underneath in the button's own darker colour; they press flat */
.btn { box-shadow: 0 0 0 3px var(--ink-edge), 0 7px 0 0 var(--edge-deep); }
.btn.primary { box-shadow: 0 0 0 3px var(--ink-edge), 0 7px 0 0 var(--butter-edge); }
.btn.danger { box-shadow: 0 0 0 3px var(--ink-edge), 0 7px 0 0 #a8321f; }
.btn.ghost, .btn.ghost.small { box-shadow: 0 0 0 2px var(--ink-edge); }
.btn.small { box-shadow: 0 0 0 2px var(--ink-edge), 0 5px 0 0 var(--edge-deep); }
.btn.primary.small { box-shadow: 0 0 0 2px var(--ink-edge), 0 5px 0 0 var(--butter-edge); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 3px var(--ink-edge); }
.btn.primary:active:not(:disabled) { box-shadow: 0 0 0 3px var(--ink-edge); }
.btn:disabled { box-shadow: 0 0 0 2px var(--ink-edge); }

/* panels, sheets, menus */
.sheet { background-image: var(--fade), var(--dots); background-size: 100% 100%, 9px 9px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), 0 0 0 2px var(--edge), 0 6px 0 2px var(--night), var(--shadow); }
.pop, .dd-list { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .15), 0 0 0 2px var(--edge), 0 5px 0 2px var(--night); }
.party-col, .mine, .log { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 2px var(--edge-soft), 0 5px 0 2px var(--night); }
.seat { box-shadow: 0 0 0 2px var(--edge-soft), 0 4px 0 2px var(--night); }

/* small things */
.pill, .chip, .chip-s, .phases li, .turn-banner { box-shadow: 0 0 0 2px var(--edge-soft); }
.set-switch, .lang { box-shadow: 0 0 0 2px var(--edge-soft); }
.pile .count { box-shadow: 0 0 0 3px var(--edge-soft); }
.hp { box-shadow: 0 0 0 2px var(--edge-soft); }
.hp i { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), inset 0 2px 0 rgba(255, 255, 255, .25); }
input[type="text"], input[type="search"], input:not([type]), textarea { box-shadow: inset 0 3px 0 rgba(0, 0, 0, .25); }
.mode-sizes button { box-shadow: 0 0 0 2px var(--edge-soft); }
.friend, .party-row { box-shadow: 0 0 0 2px var(--edge-soft); }
.shop-frame, .deck-tile { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 2px var(--edge-soft), 0 4px 0 2px var(--night); }

/* cards: a pale outline and a soft edge underneath */
.card-img { box-shadow: 0 0 0 2px #cdd5ec, 0 3px 0 2px rgba(0, 0, 0, .28); }

/* the Play screen's mode tiles and the Multiplayer window's: grain, and a sunken slot behind the cards */
@media (min-width: 901px) {
  .play-tiles .pt { background-image: linear-gradient(180deg, rgba(24, 34, 63, 0) 0%, rgba(24, 34, 63, .6) 42%, var(--navy-deep) 70%), var(--dots), linear-gradient(180deg, var(--navy-up), var(--navy-deep) 70%); background-size: 100% 100%, 9px 9px, auto; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 3px var(--navy-deep), 0 8px 0 3px var(--navy-deep); }
  .play-tiles .pt-art::before { content: ''; position: absolute; inset: 22px 14px 14px; border-radius: 14px; background: #202e5e; box-shadow: 0 0 0 2px var(--edge-soft), inset 0 3px 0 rgba(0, 0, 0, .3); opacity: .75; }
}
.mode { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 3px var(--navy-deep), 0 8px 0 3px var(--navy-deep); }
.mode.on { box-shadow: 0 0 0 3px var(--navy-deep), 0 8px 0 3px var(--navy-deep), 0 0 0 7px rgba(239, 233, 153, .14); }
.mode::before { content: ''; position: absolute; left: 14px; right: 14px; top: 18px; height: 236px; z-index: -2; border-radius: 14px; background: #202e5e; box-shadow: 0 0 0 2px var(--edge-soft), inset 0 3px 0 rgba(0, 0, 0, .3); opacity: .75; }
@media (max-width: 700px) { .mode::before { height: 164px; } }

/* ---------- the title screen, in the same style ---------- */
.title::before { content: ''; position: absolute; inset: 0; background-image: var(--dots); background-size: 9px 9px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 65%); mask-image: linear-gradient(180deg, #000, transparent 65%); pointer-events: none; }
.title-card { box-shadow: 0 0 0 2px #cdd5ec, 0 4px 0 2px rgba(0, 0, 0, .28); }
.title-links { gap: 12px 14px; }
.title-links button { background: rgba(24, 34, 63, .55); opacity: .95; padding: 8px 18px; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 2px var(--edge-soft), 0 4px 0 2px var(--night); transition: opacity .15s, background .15s, transform .12s var(--ease); }
.title-links button:hover, .title-links button:focus-visible { background: rgba(56, 76, 136, .6); }
.title-links button:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 0 0 2px var(--edge-soft); }
.title-top .icon, .title-top .friends-btn { box-shadow: 0 0 0 2px var(--edge-soft), 0 3px 0 2px var(--night); }
.title-top .icon { background: rgba(24, 34, 63, .55); }
.discord-btn { box-shadow: 0 0 0 2px var(--ink-edge), 0 5px 0 0 #3a45c4; }
.rejoin { box-shadow: 0 0 0 2px var(--ink-edge), 0 5px 0 0 var(--edge-deep); background: rgba(24, 34, 63, .7); }

/* ---------- buttons from the hand-drawn art: yellow (primary), red (danger) and blue (the rest) ----------
   The pictures are used whole, with their white margin: drawn black outline, white band, then one more black outline around it.
   The picture sits on a layer behind the label. Ghost (outline-only) buttons keep their CSS look. */
.btn.primary, .btn.danger, .btn:not(.primary):not(.ghost):not(.danger) { position: relative; isolation: isolate; background: none; border-color: transparent; box-shadow: none; }
.btn.primary::before, .btn.danger::before, .btn:not(.primary):not(.ghost):not(.danger)::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url(ui/button_blue.webp) center / 100% 100% no-repeat; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.btn.primary::before { background-image: url(ui/button_yellow.webp); }
.btn.danger::before { background-image: url(ui/button_red.webp); }
.btn.primary:hover:not(:disabled)::before, .btn.danger:hover:not(:disabled)::before, .btn:not(.primary):not(.ghost):not(.danger):hover:not(:disabled)::before { filter: brightness(1.1); }
.btn.primary:disabled::before, .btn.danger:disabled::before, .btn:not(.primary):not(.ghost):not(.danger):disabled::before { filter: grayscale(.7); }
.btn.primary:active:not(:disabled), .btn.danger:active:not(:disabled), .btn:not(.primary):not(.ghost):not(.danger):active:not(:disabled) { box-shadow: none; }

/* the title screen's link buttons (Tutorial, Shop, Decks...) use the blue drawn button too */
.title-links button { position: relative; isolation: isolate; min-height: 40px; padding: 8px 24px; background: none; box-shadow: none; opacity: 1; border-radius: 0; }
.title-links button::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url(ui/button_blue.webp) center / 100% 100% no-repeat; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.title-links button:hover, .title-links button:focus-visible { background: none; }
.title-links button:hover::before, .title-links button:focus-visible::before { filter: brightness(1.1); }
.title-links button:active { transform: translateY(3px); box-shadow: none; }

/* ---------- tabs and pickers on the drawn buttons: blue when idle, yellow when chosen ---------- */
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) :is(button, button.on) { position: relative; isolation: isolate; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); }
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) :is(button, button.on)::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url(ui/button_blue.webp) center / 100% 100% no-repeat; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) button.on { color: var(--navy-deep); }
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) button.on::before { background-image: url(ui/button_yellow.webp); }
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) button:hover::before { filter: brightness(1.1); }
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) button:active { transform: translateY(2px); }
/* room for the outer outline: the rows no longer clip it, and the buttons sit a little apart */
.quest-tabs { gap: 12px; padding: 3px; }
.inv-tabs { gap: 12px; padding: 3px 3px 8px; border-bottom: 0; }
.shop-tabs { overflow: visible; gap: 10px; padding: 4px 4px 10px; border-bottom: 0; }
.friend-nav { gap: 12px; padding: 14px; }
.mode-sizes { gap: 10px; }
.lang { overflow: visible; border: 0; gap: 10px; box-shadow: none; }
.shop-top-buy { padding: 4px; } /* room for the buy button's outer outline */

/* no band or ring under the drawn buttons: small, disabled and pressed ones included (they had their own shadows) */
.btn.small:not(.ghost), .btn.primary.small, .btn.danger.small, .btn:disabled:not(.ghost), .btn:active:not(:disabled):not(.ghost) { box-shadow: none; }

/* the round-ish buttons at the top (sound, settings, friends, announcements, daily gift) and the crystals pill: the blue drawn button, with its
   corners kept at their drawn size (a 9-slice), since a wide picture stretched into a small square would thin out its outline */
.title-top .icon, .title-top .friends-btn:not(.discord-btn), .coins-pill { position: relative; isolation: isolate; background: none; border: 0; border-radius: 0; box-shadow: none; }
.title-top .icon::before, .title-top .friends-btn:not(.discord-btn)::before, .coins-pill::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.title-top .icon:hover::before, .title-top .friends-btn:not(.discord-btn):hover::before, .coins-pill:hover::before { filter: brightness(1.1); }
.title-top .icon:hover, .title-top .friends-btn:not(.discord-btn):hover { background: none; }

/* disabled buttons: the grey drawn button, at full strength with dark grey text (no more faded colours) */
.btn.primary:disabled::before, .btn.danger:disabled::before, .btn:not(.primary):not(.ghost):not(.danger):disabled::before { background-image: url(ui/button_grey.webp); filter: none; }
.btn:disabled:not(.ghost) { opacity: 1; color: #565c70; }

/* ---------- one more pass on the drawn buttons ---------- */
/* outline-only (ghost) buttons use the drawn blue too (Profile, the little x, Back, Close...) */
.btn.ghost { position: relative; isolation: isolate; background: none; border-color: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: none; border-color: transparent; }
.btn.ghost::before { content: ''; position: absolute; inset: 0; z-index: -1; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.btn.ghost:hover:not(:disabled)::before { filter: brightness(1.1); }
.btn.ghost:active:not(:disabled) { transform: translateY(2px); }

/* every drawn button is a 9-slice: its corners and outline keep the drawn thickness at any size, so a small square one doesn't thin out */
.btn.primary::before, .btn.danger::before, .btn.ghost::before, .btn:not(.primary):not(.ghost):not(.danger)::before,
:is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) button::before, .title-links button::before {
  background: none; box-sizing: border-box; border: 6px solid transparent; border-image-slice: 16 fill; border-image-width: 6px; border-image-repeat: stretch;
  border-image-source: url(ui/button_blue.webp);
}
.btn.primary::before, :is(.quest-tabs, .inv-tabs, .shop-tabs, .friend-nav, .mode-sizes, .lang, .deck-view) button.on::before { border-image-source: url(ui/button_yellow.webp); }
.btn.danger::before { border-image-source: url(ui/button_red.webp); }
.btn:disabled::before { border-image-source: url(ui/button_grey.webp); filter: none; }
.btn.ghost:disabled { opacity: 1; color: #565c70; }
.btn.primary.title-play::before { border-width: 9px; border-image-width: 9px; }

/* the buttons at the top: one height, one minimum width, and room between them for the outlines */
.title-top .icon, .title-top .friends-btn:not(.discord-btn), .title-top .pill, .title-top .coins-pill { height: 40px; min-width: 48px; box-sizing: border-box; }
.title-top .pill, .title-top .coins-pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; font-weight: 600; }
.title-settings, .title-top .account, .title-left { gap: 14px; }
.title-top .icon-pair { display: flex; gap: 14px; }
.title-top { gap: 14px; } .title-top .title-settings { gap: 14px; }

.back-arrow { width: 14px; height: 16px; margin-right: 7px; vertical-align: -3px; }

/* the deck builder's - and + buttons and every dropdown button: the drawn buttons too (blue, yellow while a dropdown is open, grey when disabled) */
.deck-sheet .deck-count button, .dd-btn { position: relative; isolation: isolate; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); }
.deck-sheet .deck-count button::before, .dd-btn::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.deck-sheet .deck-count button:not(:disabled):hover::before, .dd-btn:hover::before { filter: brightness(1.1); }
.deck-sheet .deck-count button:not(:disabled):active { transform: translateY(2px); }
.deck-sheet .deck-count button:disabled { opacity: 1; color: #565c70; cursor: not-allowed; }
.deck-sheet .deck-count button:disabled::before { border-image-source: url(ui/button_grey.webp); }
.dd.open .dd-btn { color: var(--navy-deep); }
.dd.open .dd-btn::before { border-image-source: url(ui/button_yellow.webp); }
.dd.open .dd-btn svg { color: var(--navy-deep); }
.deck-sheet .deck-count { gap: 12px; }

/* ---------- batch: deck builder layout, bars and switches in the button style, disabled grey, tutorial fixes ---------- */
/* the - and + under each card: smaller, centred, the same size every time */
.deck-sheet .deck-count { justify-content: center; gap: 12px; padding: 6px 0 2px; }
.deck-sheet .deck-count button { flex: 0 0 54px; width: 54px; min-height: 34px; padding: 0; font-size: 18px; }

/* disabled really is grey, for every kind of drawn button (the earlier rule lost to the colour rules' specificity) */
.btn.primary:disabled::before, .btn.danger:disabled::before, .btn:not(.primary):not(.ghost):not(.danger):disabled::before, .btn.ghost:disabled::before { border-image-source: url(ui/button_grey.webp); filter: none; }

/* bars (deck meters, health) and info pills: a dark inner line, a white band, one more dark outline, like the buttons */
.deck-meter i, .hp { background: #19234a; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); }
.deck-meter i { margin: 4px 2px 6px; }
.seat-body { gap: 9px; }
.hp { margin: 2px; }
.pill:not(.coins-pill) { background: none; border-radius: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); background-color: #1c2f5c; }

/* switches and the search box: the same white band and outline */
.deck-search { border: 2px solid var(--ink-edge); border-radius: 4px; background: #19234a; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); }
.deck-search:focus-within { border-color: var(--ink-edge); box-shadow: 0 0 0 2px var(--butter), 0 0 0 4px var(--ink-edge); }
.deck-owned i, .set-switch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); }
.deck-sheet #deckname { border: 2px solid var(--ink-edge); border-radius: 4px; background: #19234a; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); }

/* the target banner's Cancel button: readable text on the blue button */
.banner .btn { color: var(--ink); }

/* the table's header icons, the room's Join seat button and the settings rows that open a screen: the drawn blue button too */
.top .icon, .seat-join, .set-link { position: relative; isolation: isolate; background: none; border: 0; border-radius: 0; box-shadow: none; }
.top .icon::before, .seat-join::before, .set-link::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.top .icon:hover::before, .seat-join:hover::before, .set-link:hover::before { filter: brightness(1.1); }
.top { gap: 12px; }
.top .icon { min-width: 40px; }

/* short windows: no room for the turn banner over the piles, so the header says it again */
@media (min-width: 981px) and (max-height: 780px) {
  .turn-banner { display: none; }
  .center { padding-top: 0; }
  .top .status { display: block; }
}

/* ---------- batch 2 ---------- */
/* the search box: no curved shadow inside (the page-wide input shadow showed through) */
.deck-search input { box-shadow: none; background: none; }

/* Settings rows that open a screen: back to plain rows (not drawn buttons) */
.set-link { position: static; isolation: auto; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.set-link::before { content: none; }

/* deck tiles: the white band and outline, like the pills and bars; Set as main stays inside its tile */
.deck-tile { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); }
.deck-tiles { gap: 18px; padding: 6px; }
.deck-tiles .btn.set-main { position: absolute; }
.book > .btn { position: sticky; }

/* tutorial pills: the same design side by side */
.tut-prize { border: 0; border-radius: 0; background-color: #1c2f5c; color: var(--ink); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); }
.tut-prize.got { background-color: #1c2f5c; color: var(--muted); border: 0; }
.tut-facts { gap: 16px; }

/* more room between the pills, and between the table header's buttons (the outlines need it) */
.phases { gap: 12px; }
@media (min-width: 981px) { .top { gap: 16px; } .top .icon-pair { gap: 16px; } }
@media (max-width: 980px) { .top .icon-pair { gap: 10px; } }

/* the room's pickers (difficulty, game type, team size) and the seat's remove button: drawn buttons, yellow when chosen */
.size-chips { gap: 12px; flex-wrap: wrap; padding: 3px; }
.size-chips button { position: relative; isolation: isolate; width: auto; min-width: 44px; padding: 0 16px; background: none; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); }
.size-chips button::before, .slot-kick::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.size-chips button.on { color: var(--navy-deep); }
.size-chips button.on::before { border-image-source: url(ui/button_yellow.webp); }
.size-chips button:disabled::before { border-image-source: url(ui/button_grey.webp); }
.size-chips button:disabled:not(.on) { opacity: 1; color: #565c70; }
.size-chips button:hover:not(:disabled)::before, .slot-kick:hover::before { filter: brightness(1.1); }
.slot-kick { isolation: isolate; background: none; border-radius: 0; box-shadow: none; }

/* every other icon button (the room's sound and settings, close buttons...): the drawn blue button; a leave button that's armed is red */
.icon { position: relative; isolation: isolate; background: none; border: 0; border-radius: 0; box-shadow: none; }
.icon::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); transition: filter .12s; }
.icon.leave.armed::before { border-image-source: url(ui/button_red.webp); }
.icon:hover::before { filter: brightness(1.1); }
.icon:hover, .icon[aria-expanded="true"] { background: none; }
.title-settings, .room-top .icon-pair, .icon-pair { gap: 14px; }

/* ---------- batch 3 ---------- */
/* Set as main hangs over the tile's bottom edge again, as it did before */
.deck-tiles .btn.set-main { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 55%); z-index: 2; }
.deck-tiles .btn.set-main:active:not(:disabled) { transform: translate(-50%, calc(55% + 3px)); }
.decks-panel .deck-tiles:has(.set-main) .deck-tile { padding-bottom: 28px; }
.deck-tiles { padding-bottom: 22px; }

/* the room's top bar: its buttons are one height, with the same gap between them */
.room-top { gap: 12px 16px; }
.room-top .icon, .room-top .btn { min-height: 40px; }
.room-top .icon { min-width: 48px; }
.room-top .icon-pair { gap: 14px; }

/* results: the buttons wrap instead of squeezing, all one height */
.results-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.results-actions .btn { flex: 1 1 auto; min-width: 118px; min-height: 44px; white-space: nowrap; }

/* ---------- phones: the title screen's top row has to fit ---------- */
@media (max-width: 480px) {
  .title-top { gap: 8px; padding: 10px 10px; }
  .title-left, .title-settings, .title-top .account, .title-top .icon-pair { gap: 8px; }
  .title-top .icon, .title-top .friends-btn:not(.discord-btn), .title-top .icon-pair .icon { min-width: 38px; width: 38px; height: 36px; padding: 0; }
  .title-top .pill, .title-top .coins-pill { min-width: 38px; height: 36px; padding: 0 9px; font-size: 13px; }
  .title-top .friends-btn { height: 36px; }
  .discord-btn { min-width: 38px; width: 38px; height: 36px; padding: 0; }
}
.decks-panel .deck-tiles { row-gap: 36px; }
@media (max-width: 700px) { .deck-sheet .deck-count { gap: 8px; } .deck-sheet .deck-count button { flex: 0 0 38px; width: 38px; } }

/* ---------- batch 4 ---------- */
/* two icon buttons are placed by their own rules (my icon style had put them back into the flow): the daily window's close, and the results screen's Chat, now with its name on it so it's easy to find on every device */
.icon.daily-x { position: absolute; top: 10px; right: 10px; }
.icon.results-chat { position: absolute; top: 14px; right: 14px; width: auto; min-width: 48px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; z-index: 2; }
.results-chat span { white-space: nowrap; }

@media (max-width: 700px) {
  /* results: Rematch (or Play again) across the full width, the other two side by side below it */
  .results-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .results-actions > :first-child:nth-last-child(3) { grid-column: 1 / -1; }
  .results-actions .btn { min-width: 0; padding: 0 10px; }
  /* deck builder: the name on its own line, the two buttons side by side under it, bigger + and - with room between them */
  .deck-title input { flex: 1 1 100%; }
  .deck-title .btn { flex: 1 1 calc(50% - 8px); min-height: 40px; padding: 0 8px; font-size: 14px; white-space: normal; line-height: 1.2; }
  .deck-title { gap: 14px 12px; }
  .deck-sheet .deck-count { gap: 10px; }
  .deck-sheet .deck-count button { flex: 0 0 44px; width: 44px; min-height: 38px; }
}

/* ---------- batch 5 ---------- */
/* close buttons in the log and in the sign-in and daily windows: smaller, so they sit in proportion with their titles */
.icon.daily-x, .icon.log-x { width: 30px; height: 30px; min-width: 0; padding: 0; }
.icon.daily-x::before, .icon.log-x::before { border-width: 4px; border-image-width: 4px; box-shadow: 0 0 0 2px var(--ink-edge); }
.icon.daily-x svg, .icon.log-x svg { width: 16px; height: 16px; }
.icon.daily-x { top: 14px; right: 14px; }
/* the open log: room to breathe, a rule under its title, the close button inside it */
@media (min-width: 981px) {
  .log.open { padding: 18px 20px 20px; }
  .log.open > h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
  .log.open > ol { padding-right: 6px; gap: 6px; }
}
/* quick chats: drawn blue like every other button */
.chat-phrases button, .pop .chat-edit { position: relative; isolation: isolate; background: none; border-color: transparent; box-shadow: none; }
.chat-phrases button::before, .pop .chat-edit::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); }
.chat-phrases button:hover::before, .pop .chat-edit:hover::before { filter: brightness(1.1); }
.chat-phrases button:active, .pop .chat-edit:active { transform: translateY(2px); }
.chat-phrases { gap: 8px; }
/* the answer prompt on phones: the cards share one row so Use and Pass stay on screen */
@media (max-width: 700px) {
  .prompt .duel { flex-wrap: nowrap; gap: 8px; }
  .prompt .duel figure { min-width: 0; flex: 1 1 0; }
  .prompt .duel .card-img { width: 100%; max-width: 130px; }
  .prompt .duel figcaption { font-size: 11px; text-align: center; }
  .prompt h2 { font-size: 18px; }
  .prompt .row { flex-direction: column; align-items: stretch; gap: 10px; }
}

/* pressed art: while a drawn button is held down it swaps to its drawn "pressed" picture */
:is(.btn, .icon, .title-links button, .quest-tabs button, .inv-tabs button, .shop-tabs button, .friend-nav button, .mode-sizes button, .lang button, .deck-view button, .deck-count button, .dd-btn, .size-chips button, .chat-phrases button, .pop .chat-edit, .seat-join, .set-link, .slot-kick, .friends-btn, .coins-pill):is(:active, .pressing):not(:disabled)::before { border-image-source: url(ui/button_blue_down.webp); filter: none; }
:is(.btn.primary, .quest-tabs button.on, .inv-tabs button.on, .shop-tabs button.on, .friend-nav button.on, .mode-sizes button.on, .lang button.on, .deck-view button.on, .size-chips button.on, .dd.open .dd-btn):is(:active, .pressing):not(:disabled)::before { border-image-source: url(ui/button_yellow_down.webp); }
:is(.btn.danger, .icon.leave.armed):is(:active, .pressing):not(:disabled)::before { border-image-source: url(ui/button_red_down.webp); }

/* pressing a button tears it: a piece of art of a fixed size (as tall as the button) sits over the normal pressed button, step 1 and then step 2, so it never stretches with the width */
:is(.btn, .icon, .title-links button, .quest-tabs button, .inv-tabs button, .shop-tabs button, .friend-nav button, .mode-sizes button, .lang button, .deck-view button, .deck-count button, .dd-btn, .size-chips button, .chat-phrases button, .pop .chat-edit, .seat-join, .set-link, .slot-kick, .friends-btn, .coins-pill):is(:active, .pressing):not(:disabled)::after { content: ''; position: absolute; z-index: -1; inset: 0; background: url(ui/tear_step1.webp) 72% 50% / auto 100% no-repeat; animation: btn-tear .2s steps(1, end) both; pointer-events: none; }
.icon:is(:active, .pressing):not(:disabled)::after { background-position: 50% 50%; }
@keyframes btn-tear { 0% { background-image: url(ui/tear_step1.webp); } 50%, 100% { background-image: url(ui/tear_step2.webp); } }

/* results screen, wide: the chat is the same card as the results, beside it */
#chatbox.on-results { padding: 24px; gap: 14px; border-radius: 20px; background: var(--navy-up); align-content: space-between; overflow: auto; }
#chatbox.on-results .chat-side { gap: 10px; }
#chatbox.on-results .chat-emotes { gap: 10px; }
#chatbox.on-results .chat-phrases { gap: 10px; }
.chat-beside .overlay:has(.results) { padding-right: calc(440px + 24px + 16px); }

/* sticker doodles around the winner on the results card */
.results-hero { position: relative; }
.doodles { position: absolute; inset: -6px -10px 0; pointer-events: none; z-index: 0; }
.doodles .doodle { position: absolute; width: 56px; height: 56px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.results-av, .results-hero h2, .results-coins { position: relative; z-index: 1; }
.doodle.star { left: 6px; top: 6px; transform: rotate(-14deg); width: 62px; height: 62px; }
.doodle.confetti1 { left: 78px; top: 78px; transform: rotate(20deg); width: 40px; height: 40px; }
.doodle.confetti2 { right: 78px; top: 4px; transform: rotate(-30deg); width: 40px; height: 40px; }
.doodle.doll { right: 4px; top: 56px; transform: rotate(12deg); width: 66px; height: 66px; }
.doodle.coconut { left: 4px; top: 90px; transform: rotate(-6deg); width: 54px; height: 54px; }
@media (prefers-reduced-motion: no-preference) { .doodle.star { animation: doodle-bob 3.6s ease-in-out infinite; } .doodle.doll { animation: doodle-bob 4.4s ease-in-out -1.2s infinite; } }
@keyframes doodle-bob { 50% { translate: 0 -5px; } }
@media (max-width: 480px) { .doodle.confetti1, .doodle.coconut { display: none; } .doodle { width: 44px; height: 44px; } }

/* title screen: stickers scattered around the logo, behind everything */
.doodles.on-title { position: absolute; inset: 0; z-index: 0; }
.on-title .doodle { width: 84px; height: 84px; }
.on-title .star { left: calc(50% - 300px); top: 24%; transform: rotate(-14deg); }
.on-title .confetti1 { left: calc(50% - 215px); top: 58%; width: 54px; height: 54px; transform: rotate(24deg); }
.on-title .confetti2 { left: calc(50% + 210px); top: 22%; width: 54px; height: 54px; transform: rotate(-28deg); }
.on-title .doll { left: calc(50% + 250px); top: 52%; width: 96px; height: 96px; transform: rotate(14deg); }
.on-title .coconut { left: calc(50% - 360px); top: 66%; width: 88px; height: 88px; transform: rotate(-6deg); }
.on-title { inset: 0; }
@media (max-width: 1100px) { .on-title { display: none; } }
/* Play screen: a star and a confetti next to the heading */
.doodles.on-head { position: relative; inset: auto; flex: none; width: 70px; height: 40px; align-self: center; margin-left: -4px; }
.on-head .doodle { width: 38px; height: 38px; top: 0; }
.on-head .star { left: 0; transform: rotate(-12deg); }
.on-head .confetti2 { left: 34px; top: 4px; width: 28px; height: 28px; transform: rotate(-30deg); }
@media (max-width: 480px) { .doodles.on-head { display: none; } }

/* duplicates: the same sticker again, smaller and turned the other way */
.results .doodle.star-b { right: 40px; top: 118px; left: auto; width: 40px; height: 40px; transform: rotate(18deg); }
.results .doodle.confetti1-b { left: 132px; top: 4px; width: 30px; height: 30px; transform: rotate(-50deg); }
.on-title .star-b { left: calc(50% + 330px); top: 74%; width: 64px; height: 64px; transform: rotate(16deg); }
.on-title .confetti1-b { left: calc(50% + 120px); top: 74%; width: 44px; height: 44px; transform: rotate(-40deg); }
.on-title .confetti2-b { left: calc(50% - 300px); top: 82%; width: 46px; height: 46px; transform: rotate(40deg); }
.on-title .doll-b { left: calc(50% - 150px); top: 8%; width: 70px; height: 70px; transform: rotate(-20deg); }
.on-title .coconut-b { left: calc(50% + 330px); top: 8%; width: 64px; height: 64px; transform: rotate(8deg); }
@media (max-width: 480px) { .results .doodle.star-b, .results .doodle.confetti1-b { display: none; } }

/* heads: a row of stickers after the title, one every 32px */
.doodles.on-head { width: auto; min-width: 70px; height: 40px; display: inline-block; }
.page-title { display: flex; align-items: center; gap: 4px; }
.on-head .doodle { width: 34px; height: 34px; left: calc(var(--i) * 30px); top: 2px; transform: rotate(-12deg); }
.on-head .doodle:nth-child(even) { transform: rotate(16deg); top: 6px; width: 28px; height: 28px; }
.on-head .doodle:nth-child(3n) { transform: rotate(-30deg); top: 0; }
.doodles.on-head { width: calc(var(--n, 3) * 30px + 8px); }
/* more confetti around the stickers */
.results .doodle.confetti2-b { left: 60px; top: 112px; right: auto; width: 34px; height: 34px; transform: rotate(35deg); }
.results .doodle.confetti1-c { right: 118px; top: 98px; left: auto; width: 32px; height: 32px; transform: rotate(-20deg); }
.on-title .confetti1-c { left: calc(50% - 90px); top: 90%; width: 40px; height: 40px; transform: rotate(60deg); }
.on-title .confetti2-c { left: calc(50% + 40px); top: 6%; width: 42px; height: 42px; transform: rotate(-10deg); }
.on-title .confetti1-d { left: calc(50% + 300px); top: 40%; width: 44px; height: 44px; transform: rotate(-60deg); }
.on-title .confetti2-d { left: calc(50% - 330px); top: 44%; width: 46px; height: 46px; transform: rotate(20deg); }
@media (max-width: 480px) { .results .doodle.confetti2-b, .results .doodle.confetti1-c { display: none; } }
@media (max-width: 480px) { .doodles.on-head { display: none; } }

/* the drawn background shows on every full screen: pages (shop, decks, quests...) and the title sit straight on it; small panels keep their dim */
.overlay.page-view { background: url(ui/main_bg.webp) center / cover no-repeat fixed, var(--navy); }
.overlay.page-view > .sheet { background: none; }

/* the dotted fade over the background: behind the content on the table and title, and on top of the background on full pages */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: var(--dots); background-size: 9px 9px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 65%); mask-image: linear-gradient(180deg, #000, transparent 65%); opacity: .8; }
.overlay.page-view::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: var(--dots); background-size: 9px 9px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 65%); mask-image: linear-gradient(180deg, #000, transparent 65%); opacity: .8; }
.overlay.page-view > .sheet { position: relative; z-index: 1; }
/* the Tutorial reward uses the drawn blue like the buttons beside it */
.tut-prize, .tut-prize.got { position: relative; isolation: isolate; background: none; border: 0; box-shadow: none; color: var(--ink); }
.tut-prize::before { content: ''; position: absolute; inset: 0; z-index: -1; box-sizing: border-box; border: 6px solid transparent; border-image: url(ui/button_blue.webp) 16 fill / 6px stretch; box-shadow: 0 0 0 3px var(--ink-edge); }
.tut-prize.got::before { border-image-source: url(ui/button_grey.webp); }
.tut-prize { padding: 6px 14px; color: #f3d98a; }
.tut-prize.got { color: #202e56; } /* collected: dark navy on the grey drawn pill (was white on grey) */

/* Quests progress bars: the same thin flat bars, framed like the buttons (white band, then the dark outline) */
.q-bar, .ach-bar i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-edge); background-color: #1c2f5c; margin: 3px 0; }
.q-bar { height: 10px; border-radius: 3px; }
.q-bar i { border-radius: 3px; }
.ach-bar i { height: 8px; border-radius: 99px; }

/* page stickers: scattered over the background behind everything on the page */
.doodles.on-page { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; width: auto; height: auto; }
.doodles.on-page .doodle { left: var(--x); top: var(--y); right: auto; width: var(--s); height: var(--s); transform: rotate(var(--r)); opacity: .9; animation: none; }
.page-title { display: flex; }

/* the confirm ("Tap again") button: the drawn yellow button itself, with its square-ish corners, not a pill behind it */
.btn.armed { background: none; border-color: transparent; border-radius: 4px; overflow: visible; box-shadow: none; }
.btn.armed .buy-fill { inset: 4px; border-radius: 3px; }

/* support the creator */
button.coins-pill { font: inherit; color: inherit; cursor: pointer; }
.support-btn { gap: 6px; display: inline-flex; align-items: center; }
.support-btn svg { color: #ff8a9a; }
.support-sheet { display: grid; gap: 12px; justify-items: center; text-align: center; width: min(400px, 100%); }
.support-sheet h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.support-sheet h2 svg { color: #ff8a9a; width: 22px; height: 22px; }
.support-sheet p { margin: 0; }
#support-ask { z-index: 1000; }
.support-sheet a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; box-sizing: border-box; padding: 0 24px; }

/* Cold Wave: a note under the event card */
.pile .event-note { margin-top: 2px; padding: 1px 8px; border-radius: 99px; background: rgba(159, 227, 255, .2); color: #bfefff; font-size: 11px; font-weight: 600; white-space: nowrap; }

/* drawn icon stickers (ui/icons) */
.ico { display: block; width: 28px; height: 28px; object-fit: contain; pointer-events: none; flex: none; }
.title-top .ico { width: 30px; height: 30px; }
@media (max-width: 480px) { .title-top .ico { width: 26px; height: 26px; } }
.support-label { display: inline-flex; align-items: center; gap: 10px; }
.support-label svg { flex: none; width: 18px; height: 18px; color: #ff8a9a; }
.icon.daily-x .ico, .icon.log-x .ico { width: 18px; height: 18px; }
.log-rail .ico { width: 24px; height: 24px; }

/* drawn tick, pencil and favourite stickers */
.step .check { width: 34px; height: 34px; object-fit: contain; }
.pic-edit .ico { width: 20px; height: 20px; }
.ep-toggle .ico { width: 15px; height: 15px; }
.pic-edit { background: none; border: 0; }
.pic-edit .ico { width: 100%; height: 100%; }
.fav-star .ico { width: 42px; height: 42px; }

/* the profile picture: a round frame with the white band and dark outline of the buttons */
.profile-pic .av { box-sizing: border-box; padding: 9%; border-radius: 50%; background: #1c2f5c; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink-edge); object-fit: contain; margin: 6px; }
.profile-pic .pic-edit { right: -10px; bottom: -4px; }

/* profile picture, final: the art fills a round frame with a thick white edge (no black ring); the pencil is a small round badge on its bottom-right edge */
.profile-pic .av { padding: 0; margin: 6px; object-fit: cover; background: #2a3a6c; box-shadow: 0 0 0 3px #fff; }
.profile-me .profile-pic .pic-edit, .profile-pic .pic-edit { right: 2px; bottom: 2px; width: 36px; height: 36px; border: 3px solid #fff; border-radius: 50%; background: #2a3a6c; box-shadow: none; display: grid; place-items: center; }
.profile-pic .pic-edit .ico { width: 20px; height: 20px; }
@media (max-width: 700px) { .profile-me .profile-pic .pic-edit, .profile-pic .pic-edit { width: 30px; height: 30px; right: 0; bottom: 0; } .profile-pic .pic-edit .ico { width: 17px; height: 17px; } }
.icon-btn .ico { width: 17px; height: 17px; }
.shop-tabs .tab-ico { width: 24px; height: 24px; }
.inv-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.inv-tabs .tab-ico { width: 24px; height: 24px; }

/* the computer's reduce-motion: the new flourishes become a plain fade or nothing */
@media (prefers-reduced-motion: reduce) {
  .seat.hit { animation: none; }
  .float.tag.num { animation-name: num-fade; }
  #spot.show figure { animation-name: spot-pop-lite; }
  .results-list.rows-in li, .results.win-in .doodle { animation: none; }
}

/* Windows app: Quit game sits in the title screen's bottom-right corner (was a top-right icon) */
.btn.quit-corner { position: fixed; z-index: 2; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px 0 9px; font-size: 14.4px; font-weight: 600; white-space: nowrap; } /* about 10% smaller than the first version */
.btn.quit-corner .ico { width: 25px; height: 25px; }
.btn.quit-corner:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }

/* Sign in (title screen, top right): the drawn yellow button, the same height as the other top buttons */
.title-top .account > .btn.primary { box-sizing: border-box; height: 40px; min-height: 40px; min-width: 48px; padding: 0 18px; font-size: 14px; }
@media (max-width: 480px) { .title-top .account > .btn.primary { height: 36px; min-height: 36px; padding: 0 12px; font-size: 13px; } }
