/*
VOICE  cozy night-market: warm, playful, chunky sticker UI
IDEA   a lantern-lit food stall table; every button is a sticker you can press
PICTURE the hot pot table (SVG on the hub, 3D in the game)
COLOUR plum night ground, cream stickers, lantern yellow, chili red, mint
TYPE   Fredoka for display, Nunito for text
*/
:root {
  --plum: #2a1422; --plum2: #3d1f33; --line: #5a3249; --dash: #6b3d58;
  --cream: #fff4e2; --ink: #3b2219; --chili: #e5543b; --lantern: #ffb547; --mint: #7ed3b2; --pink: #ff8fab;
  --muted: #e0bccd; --soft: #f3d9c4; --deep: #160a12;
  --fd: 'Fredoka', 'Nunito', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; }
body { background: var(--plum); color: var(--cream); font: 17px/1.55 'Nunito', system-ui, sans-serif; overflow-x: clip; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--lantern); }
h1, h2, h3 { font-family: var(--fd); font-weight: 600; margin: 0; line-height: 1.08; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- sticker buttons ---------- */
.btn {
  font-family: var(--fd); font-weight: 600; font-size: 17px; color: var(--ink); background: var(--lantern);
  border: 3px solid var(--ink); border-radius: 16px; padding: 10px 20px; min-height: 48px; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform .12s cubic-bezier(.3, 1.6, .5, 1), box-shadow .12s, filter .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; user-select: none;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.big { font-size: 21px; padding: 14px 28px; min-height: 58px; border-radius: 18px; }
.btn.m { background: var(--mint); } .btn.w { background: #fff; } .btn.p { background: var(--pink); }
.btn.r { background: var(--chili); color: #fff; }
.btn.ghost { background: transparent; color: var(--cream); border-color: var(--dash); box-shadow: none; }
.btn.ghost:hover { box-shadow: none; background: #ffffff10; }
.chip { font-family: var(--fd); font-weight: 600; background: var(--plum2); border: 3px solid var(--line); border-radius: 999px; padding: 5px 14px; white-space: nowrap; }
.round { width: 46px; height: 46px; border-radius: 50%; padding: 0; background: var(--plum2); border: 3px solid var(--line); color: var(--cream); font-family: var(--fd); font-weight: 700; font-size: 19px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s; }
.round:hover { transform: scale(1.08); } .round:active { transform: scale(.92); }
.avatar { width: var(--s, 52px); height: var(--s, 52px); border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 40%, #fff4e2); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--fd); font-weight: 700; font-size: calc(var(--s, 52px) * .42); color: var(--ink); flex: none; }
.field { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; font-family: var(--fd); font-weight: 600; font-size: 18px; min-height: 50px; }
.field::placeholder { color: #a48a7e; }

/* ---------- hub ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px max(4vw, 16px); border-bottom: 3px solid var(--plum2); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--fd); font-weight: 700; font-size: 27px; color: var(--cream); text-decoration: none; }
.brand .steam path { animation: steam 2.4s ease-in-out infinite; }
.brand b { color: var(--lantern); font-weight: 700; } .sitelogo { overflow: visible; flex: none; }
.navl { display: flex; gap: 22px; font-family: var(--fd); font-weight: 500; }
.navl a { color: var(--cream); text-decoration: none; } .navl a:hover { color: var(--lantern); }
.me { display: flex; align-items: center; gap: 10px; background: var(--plum2); border: 3px solid var(--line); border-radius: 999px; padding: 4px 16px 4px 4px; font-family: var(--fd); font-weight: 600; cursor: pointer; color: var(--cream); min-height: 48px; }
.me small { opacity: .6; font-weight: 400; font-size: 15px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 max(4vw, 16px); }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding-block: 44px 28px; }
.hero > div { flex: 1 1 420px; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 54px); font-weight: 700; line-height: 1.04; }
.hero p { margin: 0; font-size: 19px; color: var(--soft); max-width: 34em; }
.hero .art { flex: 1 1 380px; height: clamp(300px, 40vw, 430px); }
.tableart { width: 100%; height: 100%; display: block; }
.tableart .orbit { animation: bob 3.2s ease-in-out infinite; animation-delay: var(--d); }
.tableart .bub { animation: bub 2.4s ease-out infinite; animation-delay: var(--d); opacity: 0; transform-box: fill-box; transform-origin: center; }
.tableart .wisp { animation: wisp 3s ease-in-out infinite; animation-delay: var(--d); opacity: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.codeform { align-self: flex-start; display: flex; gap: 8px; align-items: center; background: var(--plum2); border: 3px solid var(--line); border-radius: 18px; padding: 6px 6px 6px 16px; }
.codeform label { font-family: var(--fd); font-size: 15px; color: var(--soft); }
.livestats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 15px; color: var(--muted); min-height: 1.4em; }
.livestats b { color: var(--cream); font-family: var(--fd); font-weight: 600; }
.livestats .on i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(126,211,178,.22); animation: livepulse 2s ease-in-out infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 6px rgba(126,211,178,0); } }
@media (prefers-reduced-motion: reduce) { .livestats .on i { animation: none; } }
.code-in { width: 104px; text-align: center; letter-spacing: 5px; text-transform: uppercase; font-size: 22px; font-weight: 700; padding: 6px 8px; }
section h2 { font-size: 32px; margin-bottom: 18px; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.gcard { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 7px 0 var(--deep); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.gcard:hover { transform: translateY(-4px) rotate(-.4deg); }
.gcard .pic { height: 150px; background: var(--chili); border-bottom: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; }
.gcard .pic .card:nth-child(1) { transform: rotate(-10deg); } .gcard .pic .card:nth-child(3) { transform: rotate(10deg); }
.gcard .pic .card:nth-child(2) { transform: translateY(-6px); }
.gcard:hover .pic .card:nth-child(1) { transform: rotate(-16deg) translateX(-6px); } .gcard:hover .pic .card:nth-child(3) { transform: rotate(16deg) translateX(6px); }
.gcard .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.gcard h3 { font-size: 26px; font-weight: 700; }
.gcard p { margin: 0; font-size: 16px; }
.tag { font-weight: 800; font-size: 14px; background: #ffe2a8; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.soon { border: 3px dashed var(--dash); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px; text-align: center; color: var(--muted); min-height: 280px; }
.soon svg { opacity: .5; }
.soon h3 { color: var(--cream); font-size: 22px; }
.soon p { margin: 0; font-size: 15px; }
.tables { display: flex; flex-direction: column; gap: 12px; }
.trow { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; background: var(--plum2); border: 3px solid var(--line); border-radius: 18px; padding: 12px 16px; animation: popin .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.trow .who { flex: 1 1 180px; } .trow .who b { font-family: var(--fd); font-weight: 600; font-size: 19px; display: block; }
.trow .who span { font-size: 14px; color: var(--muted); }
.dots { display: flex; gap: 6px; } .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--cream); } .dots i.on { background: var(--cream); }
.tcode { font-family: var(--fd); font-weight: 700; letter-spacing: 3px; color: var(--lantern); font-size: 18px; }
.empty { border: 3px dashed var(--dash); border-radius: 18px; padding: 22px; text-align: center; color: var(--muted); }
footer { padding: 22px; text-align: center; font-size: 14px; color: #a97b93; border-top: 3px solid var(--plum2); margin-top: 48px; }

.gcard .pic.marblepic { background: #3d1f33; padding: 0; }
.gcard .pic.marblepic svg { width: 100%; height: 100%; display: block; }
.gcard .pic.ladderpic { background: #3d1f33; padding: 0; }
.gcard .pic.ladderpic svg { width: 100%; height: 100%; display: block; }
.marblepic .roll { animation: bob 2.2s ease-in-out infinite; animation-delay: var(--d); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: #160a12cc; backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .2s both; }
.sheet { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 9px 0 var(--deep); padding: 28px; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 18px; animation: popin .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.sheet h2 { font-size: 30px; color: var(--ink); }
.sheet .rules + h2 { margin-top: 6px; }
.sheet p { margin: 0; color: #6b4a3c; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); background: var(--c); cursor: pointer; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.swatches button[aria-pressed=true] { transform: scale(1.18); box-shadow: 0 0 0 4px var(--cream), 0 0 0 7px var(--ink); }
.preview { display: flex; align-items: center; gap: 14px; }
.rules { font-size: 16px; line-height: 1.55; color: #5a3d31; }
.rules ol { padding-left: 1.2em; margin: 0; display: grid; gap: 6px; }
.rules b { font-family: var(--fd); font-weight: 600; color: var(--ink); }

.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.spin { animation: popin .4s cubic-bezier(.3, 1.6, .5, 1); }
.sheet:has(.creator) { width: min(720px, 100%); }
.creator .preview { position: sticky; top: -28px; z-index: 2; background: var(--cream); padding: 10px 0; border-bottom: 3px dashed #e6cfbd; }
.cgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.crow.wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .cgrid { grid-template-columns: minmax(0, 1fr); } }
.creator { display: flex; flex-direction: column; gap: 14px; }
.creator .preview { align-items: center; gap: 18px; }
.creator .namecol { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.creator .namecol label, .crow b { font-family: var(--fd); font-weight: 600; font-size: 15px; color: #6b4a3c; }
.creator .namecol .field { width: 100%; }
.btn.sm { font-size: 15px; padding: 5px 14px; min-height: 40px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.crow { display: flex; flex-direction: column; gap: 6px; }
.creator .swatches { gap: 8px; }
.creator .swatches button { width: 34px; height: 34px; }
.sheet .pills button { color: var(--ink); border-color: #c9a99a; min-height: 40px; padding: 5px 13px; font-size: 15px; }

/* ---------- lobby ---------- */
.lobby { display: flex; flex-wrap: wrap; gap: 28px; padding-block: 36px 48px; }
.lobby .main { flex: 999 1 520px; display: flex; flex-direction: column; gap: 24px; }
.lobby aside { flex: 1 1 320px; background: var(--plum2); border: 3px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 20px; align-self: flex-start; }
.crumb { display: flex; align-items: center; gap: 10px; font-family: var(--fd); font-weight: 600; font-size: 19px; color: var(--muted); }
.codetiles { display: flex; gap: 8px; }
.codetiles span { width: clamp(50px, 12vw, 64px); height: clamp(60px, 14vw, 76px); display: flex; align-items: center; justify-content: center; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--deep); font-family: var(--fd); font-weight: 700; font-size: clamp(32px, 8vw, 44px); animation: popin .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.codetiles span:nth-child(2) { animation-delay: .06s; } .codetiles span:nth-child(3) { animation-delay: .12s; } .codetiles span:nth-child(4) { animation-delay: .18s; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.seat { display: flex; align-items: center; gap: 14px; border-radius: 20px; padding: 14px; min-height: 92px; }
.seat.full { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--deep); animation: popin .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.seat.full b { font-family: var(--fd); font-weight: 700; font-size: 21px; display: block; }
.seat.full span { font-size: 15px; color: #7a5545; }
.seat.open { border: 3px dashed var(--dash); color: var(--muted); }
.seat.open b { font-family: var(--fd); font-weight: 600; font-size: 19px; color: var(--cream); display: block; }
.seat.open svg { opacity: .55; flex: none; }
.offline { opacity: .5; }
.opt b { font-family: var(--fd); font-weight: 500; display: block; margin-bottom: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { font-family: var(--fd); font-weight: 600; font-size: 16px; padding: 8px 16px; min-height: 44px; border-radius: 12px; border: 3px solid var(--dash); background: transparent; color: var(--cream); cursor: pointer; transition: transform .12s; }
.pills button[aria-pressed=true] { border-color: var(--ink); background: var(--lantern); color: var(--ink); }
.pills button:not(:disabled):active { transform: scale(.94); }
.pills button:disabled { cursor: default; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--fd); font-weight: 500; cursor: pointer; }
.toggle input { appearance: none; width: 58px; height: 34px; border-radius: 999px; background: var(--dash); border: 3px solid var(--ink); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.toggle input:checked { background: var(--mint); } .toggle input:checked::after { transform: translateX(23px); }
.howto { background: var(--plum); border-radius: 16px; padding: 16px; font-size: 15px; color: var(--soft); }
.howto b { font-family: var(--fd); font-weight: 600; color: var(--lantern); }

/* ---------- toasts / connection ---------- */
#toasts { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 16px; font-family: var(--fd); font-weight: 600; box-shadow: 0 5px 0 var(--deep); animation: toast 2.8s cubic-bezier(.3, 1.6, .5, 1) both; display: flex; align-items: center; gap: 8px; }
.toast svg { width: 30px; height: 30px; flex: none; }
.toast.bad { background: #ffd4cc; }
#conn { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90; background: var(--chili); color: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 6px 16px; font-family: var(--fd); font-weight: 600; }
#conn.replaced { background: var(--ink); }
#conn button { margin-left: 8px; font: inherit; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; cursor: pointer; }

/* ---------- chat & reactions ---------- */
#chat { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chatbtn { background: var(--pink); position: relative; }
.chatbtn .badge { position: absolute; top: -10px; right: -8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--chili); color: #fff; border: 3px solid var(--ink); font-size: 13px; display: flex; align-items: center; justify-content: center; padding: 0 4px; animation: popin .3s cubic-bezier(.3, 1.6, .5, 1); }
.chatpanel { width: min(340px, calc(100vw - 16px)); height: min(430px, 62vh); background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 7px 0 var(--deep); display: flex; flex-direction: column; overflow: hidden; animation: popin .25s cubic-bezier(.3, 1.6, .5, 1) both; transform-origin: bottom right; }
.chathead { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; background: var(--pink); border-bottom: 3px solid var(--ink); font-family: var(--fd); font-size: 19px; }
.chathead .round { width: 36px; height: 36px; background: var(--cream); color: var(--ink); border-color: var(--ink); }
.chatlog { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cl { display: flex; gap: 8px; align-items: flex-start; animation: popin .25s both; }
.cl p { margin: 0; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 4px 14px 14px 14px; padding: 4px 10px; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.cl p b { font-family: var(--fd); font-weight: 600; margin-right: 4px; color: #a8452f; }
.cl.own { flex-direction: row-reverse; } .cl.own p { background: #ffe9b8; border-radius: 14px 4px 14px 14px; } .cl.own p b { display: none; }
.cl .avatar { border-width: 2.5px; margin-top: 2px; }
.chatempty { margin: auto; color: #8a6a5c; font-size: 15px; }
.chatemoji { display: flex; justify-content: space-between; padding: 6px 10px; border-top: 3px dashed #e6cfbd; }
.chatemoji button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; font-size: 24px; cursor: pointer; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.chatemoji button:hover { transform: scale(1.3) rotate(-8deg); } .chatemoji button:active { transform: scale(.85); }
.chatform { display: flex; gap: 6px; padding: 8px; border-top: 3px solid var(--ink); background: #ffe9d0; }
.chatform .field { flex: 1; min-height: 44px; padding: 6px 12px; font-size: 16px; font-family: inherit; font-weight: 600; }
.chatform .btn { min-height: 44px; padding: 6px 14px; box-shadow: 0 3px 0 var(--ink); }
.chatpeek { max-width: min(300px, 80vw); animation: popin .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.chatpeek .cl p { box-shadow: 0 4px 0 var(--deep); }
.floaty { position: fixed; z-index: 45; width: 64px; height: 64px; pointer-events: none; animation: floaty 1.6s cubic-bezier(.3, 1.4, .5, 1) both; filter: drop-shadow(0 4px 0 #0006); }
.floaty svg { width: 100%; height: 100%; }
.floaty .emo { font-size: 52px; line-height: 64px; display: block; text-align: center; }
@keyframes floaty { 0% { opacity: 0; transform: translateY(20px) scale(.3); } 20% { opacity: 1; transform: translateY(-10px) scale(1.15); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-110px) scale(.9) rotate(12deg); } }

/* ---------- cards ---------- */
.card {
  --w: var(--cw, 92px); width: var(--w); height: calc(var(--w) * 1.38); background: var(--cream); border: 3px solid var(--ink);
  border-radius: calc(var(--w) * .15); box-shadow: 0 5px 0 var(--ink); display: flex; flex-direction: column; align-items: center;
  overflow: hidden; flex: none; color: var(--ink); padding: 0; position: relative;
}
.card::before { content: ''; position: absolute; left: 9%; right: 9%; top: 23%; aspect-ratio: 1; border-radius: 50%; background: var(--c); opacity: .17; }
.card > * { position: relative; }
.card .band { width: 100%; background: linear-gradient(#ffffff38, #ffffff00 60%), var(--c); color: #fff; font-family: var(--fd); font-weight: 600; font-size: calc(var(--w) * .12); text-align: center; padding: 2px 0; border-bottom: 3px solid var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 #3b221955; }
.card svg { width: 82%; height: auto; margin-top: 2%; }
.card .nm { font-family: var(--fd); font-weight: 600; font-size: calc(var(--w) * .13); text-align: center; line-height: 1.05; padding: 0 3px; }
.card.back { background: radial-gradient(circle, #ffffff2e 18%, transparent 20%) 0 0 / calc(var(--w) * .2) calc(var(--w) * .2), var(--chili); justify-content: center; }
.card.back::before { left: 12%; right: 12%; top: auto; background: #fff4e2; opacity: .2; }
.card.back svg { width: 80%; margin: 0; }
/* little signs of life in the ingredient art (icons.js): blinking eyes, twinkling sparkles, beating hearts */
.fx-eyes, .fx-sp, .fx-hrt { transform-box: fill-box; transform-origin: center; }
.fx-eyes { animation: fxblink 4.6s steps(1) infinite; } /* steps: a few repaints a second instead of sixty */
.fx-sp { animation: fxtwinkle 2.4s steps(1) infinite; } .fx-sp + .fx-sp { animation-delay: -.9s; }
.fx-hrt { animation: fxbeat 2.4s steps(1) infinite; }
.card:nth-child(3n) .fx-eyes { animation-delay: -1.4s; } .card:nth-child(3n+1) .fx-eyes { animation-delay: -3.1s; } .card:nth-child(2n) .fx-sp { animation-delay: -.5s; }
@keyframes fxblink { 0%, 96%, 100% { transform: none; } 93% { transform: scaleY(.08); } }
@keyframes fxtwinkle { 0%, 100% { transform: none; } 50% { transform: scale(.6) rotate(45deg); } }
@keyframes fxbeat { 0%, 100% { transform: none; } 50% { transform: scale(1.25); } }
@keyframes fxbob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3%) rotate(-1.5deg); } }
@keyframes fxwiggle { 0%, 100% { transform: rotate(0) scale(1.06); } 25% { transform: rotate(-7deg) scale(1.1); } 75% { transform: rotate(7deg) scale(1.1); } }

/* keyframes */
@keyframes steam { 0%, 100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(-4px); opacity: .5; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes bub { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: .55; } 80% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes wisp { 0% { opacity: 0; transform: translateY(10px); } 40% { opacity: .35; } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes popin { 0% { opacity: 0; transform: scale(.6) translateY(12px); } 100% { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes toast { 0% { opacity: 0; transform: translateY(-14px) scale(.8); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 600px) {
  .navl { display: none; }
  .hero { padding-top: 24px; }
  .codeform { width: 100%; } .codeform label { flex: 1; }
  .sheet { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- ranks, XP and scoreboards ---------- */
.lv { display: inline-flex; align-items: center; gap: 4px; font-family: var(--fd); font-weight: 700; font-size: 14px; line-height: 1; background: var(--lantern); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 9px; white-space: nowrap; vertical-align: middle; }
.lvslot:empty { display: none; }
.mecard { background: var(--plum2); border: 3px solid var(--line); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.rankrow { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.rankicon { font-size: 40px; line-height: 1; width: 68px; height: 68px; display: grid; place-items: center; background: var(--cream); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--deep); flex: none; }
.rankname { flex: 1 1 200px; } .rankname b { font-family: var(--fd); font-weight: 600; font-size: 26px; display: block; line-height: 1.1; }
.rankname span, .xpnote { font-size: 14px; color: var(--muted); }
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.acct b { color: var(--cream); }
.btn.sm.ghost { box-shadow: none; }
.xpbar { height: 18px; background: var(--deep); border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.xpbar i { display: block; height: 100%; min-width: 6px; background: linear-gradient(90deg, var(--mint), var(--lantern)); border-radius: 999px; transition: width .6s cubic-bezier(.3, 1.2, .5, 1); }
.xpnote { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stats div { background: var(--plum); border-radius: 16px; padding: 12px 14px; }
.stats b { font-family: var(--fd); font-weight: 600; font-size: 28px; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 14px; color: var(--muted); }
.pergame { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 15px; }
.pergame b { font-family: var(--fd); font-weight: 600; margin-right: 8px; } .pergame span { color: var(--muted); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.board li { display: flex; align-items: center; gap: 10px; background: var(--plum); border-radius: 14px; padding: 8px 12px; }
.board li:first-child { outline: 2px solid var(--lantern); }
.board .pos { font-family: var(--fd); font-weight: 700; width: 18px; text-align: center; color: var(--lantern); flex: none; }
.board li > b { font-family: var(--fd); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .num { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; } .board .num b { color: var(--cream); font-family: var(--fd); }
.authform { display: flex; flex-direction: column; gap: 8px; }
.authform label { font-family: var(--fd); font-weight: 600; margin-top: 6px; }
.authform .btn.big { margin-top: 10px; }
.autherr { color: #b3261e !important; font-weight: 700; }
.authform h3 { font-family: var(--fd); font-size: 19px; margin: 8px 0 0; }
.authform + .authform { margin-top: 18px; padding-top: 14px; border-top: 2px dashed rgba(127, 127, 127, .3); }
.rcode { font: 700 22px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; text-align: center; padding: 14px 10px;
  border: 2px dashed currentColor; border-radius: 14px; user-select: all; word-break: break-all; margin: 14px 0; }
.btn.ghost-ink { background: transparent; border-color: transparent; box-shadow: none; text-decoration: underline; }
.btn.ghost-ink:hover:not(:disabled) { box-shadow: none; transform: none; }

/* ---------- results: play-again voting (shared by every game) ---------- */
.again { display: flex; flex-direction: column; gap: 12px; }
.again .row { display: flex; flex-wrap: wrap; gap: 12px; }
.again .tally { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); border: 3px solid #c9a99a; border-radius: 999px; padding: 4px 16px 4px 6px; font-family: var(--fd); font-weight: 600; min-height: 44px; }
.again .tally b { font-size: 20px; }
.again .tally.all { background: #e3f7ee; border-color: var(--mint); }
/* Results overlays sit over live 3D scenes: no backdrop blur there, because the browser must redo it every frame the
   scene moves (it made the scene behind stutter). A deeper tint keeps the sheet readable instead. */
.results, .hh .gate { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background-color: #160a12c4 !important; }
/* Coins column on every results screen (paidHtml in again.js): one badge at the end of each player's row. */
.paid { flex: none; grid-column: 5; grid-row: 1 / 3; align-self: center; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 74px; padding: 3px 8px; margin-left: 4px; border-radius: 12px; background: #fff6d8; border: 2.5px solid #d9a441; color: var(--ink); font-family: var(--fd); line-height: 1.05; text-align: center; white-space: nowrap; }
.paid b { display: inline-flex; align-items: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.paid b .cn { margin-right: .2em; }
.paid small { font-size: 11px !important; font-weight: 600; color: #8a6a3c !important; letter-spacing: .3px; text-transform: uppercase; grid-row: auto !important; grid-column: auto !important; text-align: center !important; }
.paid.none, .paid.wait { background: #f4ede6; border-color: #cdbdb0; }
.paid.down { background: #fde5df; border-color: #e5a090; }
.paid.bot { background: #eee9f2; border-color: #b8abc6; border-style: dashed; font-weight: 700; font-size: 14px; color: #5a4a6a; }
.paid.bot small { color: #7a6a8a !important; }
.won .paid:not(.bot):not(.none) { background: #fff; border-color: var(--ink); }
@media (max-width: 480px) { .paid { min-width: 0; padding: 3px 7px; margin-left: 0; border-width: 2px; } .paid b { font-size: 15px; } .paid small { display: none; } .paid.bot { font-size: 13px; } }
.again .faces { display: inline-flex; }
.again .faces:empty { display: none; }
.again .face { margin-left: -8px; animation: popin .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.again .face:first-child { margin-left: 0; }
.again .face .avatar { box-shadow: 0 0 0 2px #fff; }
.again .wait { font-size: 15px; }
.sheet .chip { background: #fff; color: var(--ink); border-color: #c9a99a; }

.board li { flex-wrap: wrap; row-gap: 2px; } .board li > b { min-width: 5em; }
.boardnote { margin: 0; font-size: 14px; color: var(--muted); }
.chatbtns { display: flex; gap: 8px; align-items: flex-end; }
body:has(.lobby) .scorebtn { display: none; }
.scorepanel { height: auto; max-height: min(430px, 62vh); }
.scorebody { padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.scorepanel .board li { background: #f6e3cb; } .scorepanel .board .pos { color: var(--chili); }
.scorepanel .board .num, .scorepanel .boardnote { color: #7a5545; } .scorepanel .board .num b { color: var(--ink); }
.scorepanel .board li:first-child { outline-color: var(--ink); }
@media (max-width: 760px) { body.in-game .scorebtn .lbl { display: none; } body.in-game .scorebtn { padding: 6px 10px; min-height: 40px; } }
@media (max-width: 1150px) { body:has(.mr) .scorebtn .lbl { display: none; } }
/* watcher bar: shown over a game to people who joined mid-game */
#watchbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 12px;
  background: #fff; color: var(--ink); border: 3px solid #c9a99a; border-radius: 999px; padding: 5px 5px 5px 18px; font-family: var(--fd); font-weight: 600;
  box-shadow: 0 6px 18px #0004; max-width: calc(100vw - 32px); }
#watchbar[hidden] { display: none; }
#watchbar .btn { min-height: 40px; padding: 6px 16px; white-space: nowrap; }
@media (max-width: 560px) { #watchbar { left: 16px; right: 16px; bottom: max(8px, env(safe-area-inset-bottom)); transform: none; justify-content: space-between; font-size: 14px; padding-left: 14px; } }
.gcard .pic.pokerpic { background: #2b7a5e; padding: 0; }
.gcard .pic.pokerpic svg { width: 100%; height: 100%; display: block; }
.pokerpic .fan { animation: bob 2.6s ease-in-out infinite; animation-delay: var(--d); }

.gcard .pic.ludopic { background: #3d1f33; padding: 0; }
.gcard .pic.ludopic svg { width: 100%; height: 100%; display: block; }
.gcard .pic.golfpic { background: #8fd6f7; padding: 0; }
.gcard .pic.golfpic svg { width: 100%; height: 100%; display: block; }
.gfmill { animation: gfmill 6s steps(24) infinite; }
@keyframes gfmill { to { transform: rotate(360deg); } }
.gcard .pic.farmpic { background: #bfe8ff; padding: 0; }
.gcard .pic.farmpic svg { width: 100%; height: 100%; display: block; }
.gcard .pic.stackpic { background: #bfe8ff; padding: 0; }
.gcard .pic.stackpic svg { width: 100%; height: 100%; display: block; }
.gcard .pic.dicepic { background: #bfe8ff; padding: 0; }
.gcard .pic.dicepic svg { width: 100%; height: 100%; display: block; }
.dicepic .dcup { animation: dcup 2.8s ease-in-out infinite; }
.dicepic .ddie { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.gcard .pic.pawpic { background: #bfe8ff; padding: 0; }
.gcard .pic.pipspic { background: #bfe8ff; padding: 0; }
.gcard .pic.pipspic svg { width: 100%; height: 100%; display: block; }
.pipspic .pdie { animation: bob 2.4s ease-in-out infinite; animation-delay: var(--d); transform-box: fill-box; transform-origin: center; }
.gcard .pic.tyspic { background: #b8433f; padding: 0; }
.gcard .pic.tyspic svg { width: 100%; height: 100%; display: block; }
.tyspic .fan { animation: bob 2.6s ease-in-out infinite; animation-delay: var(--d); }
.gcard .pic.panpic { background: #bfe8ff; padding: 0; }
.gcard .pic.panpic svg { width: 100%; height: 100%; display: block; }
.panpic .pfan { animation: bob 2.6s ease-in-out infinite; }
.gcard .pic.digpic { background: #bfe8ff; padding: 0; }
.gcard .pic.haypic { background: #bfe8ff; padding: 0; }
.gcard .pic.haypic svg { width: 100%; height: 100%; display: block; }
.haypic .hbale { animation: hhtoss 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hhtoss { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 70% { transform: translateY(-14px) rotate(-14deg); } 85% { transform: translateY(-4px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .haypic .hbale { animation: none; } }
.gcard .pic.digpic svg { width: 100%; height: 100%; display: block; }
.digpic .dgem { animation: bob 2.2s ease-in-out infinite; }
.gcard .pic.dartspic { background: #bfe8ff; padding: 0; }
.gcard .pic.dartspic svg { width: 100%; height: 100%; display: block; }
.dartspic .dtfly { animation: dtfly 2.4s ease-in infinite; }
@keyframes dtfly { 0% { transform: translate(-70px, 34px); opacity: 0; } 12% { opacity: 1; } 30%, 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dartspic .dtfly { animation: none; } }
.gcard .pic.beanpic { background: #bfe8ff; padding: 0; }
.gcard .pic.beanpic svg { width: 100%; height: 100%; display: block; }
.beanpic .bbhop { animation: bob 1.1s ease-in-out infinite; }
.beanpic .bbstorm { animation: bob 2.6s ease-in-out infinite; }
.gcard .pic.pawpic svg { width: 100%; height: 100%; display: block; }
.gcard .pic.kitchenpic { background: #bfe8ff; padding: 0; }
.gcard .pic.kitchenpic svg { width: 100%; height: 100%; display: block; }
.kitchenpic .krsteam { animation: bob 2.4s ease-in-out infinite; }
.kitchenpic .krbun { animation: dcup 3s ease-in-out infinite; }
.pawpic .pwbun { animation: bob 2.4s ease-in-out infinite; }
.pawpic .pwbone { animation: dcup 3s ease-in-out infinite; }
.gcard .pic.brickspic { background: #bfe8ff; padding: 0; }
.gcard .pic.brickspic svg { width: 100%; height: 100%; display: block; }
.brickspic .sbfall { animation: bob 1.6s steps(4) infinite; }
.brickspic .sbstone { animation: dcup 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.gcard .pic.kartpic { background: #8fd6f7; padding: 0; }
.gcard .pic.kartpic svg { width: 100%; height: 100%; display: block; }
.kartpic .krkart { animation: bob 1.4s steps(6) infinite; }
.kartpic .krbox { animation: bob 2.2s steps(8) infinite; transform-box: fill-box; transform-origin: center; }
body.sky.night:not(.in-game) .gcard .pic.kartpic { background: #2b2d6e; }
@keyframes dcup { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-5deg); } }

/* ---------- avatar creator: 3D preview on the left, tabs of options on the right ---------- */
.avatar { background-size: cover; background-position: center; }
.sheet:has(.creator) { width: min(860px, 100%); }
.creator .cmain { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 18px; align-items: start; }
.creator .pvcol { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.creator .pv3d { aspect-ratio: 4 / 5; border-radius: 18px; border: 3px solid var(--ink); background: linear-gradient(#ffe9d2, #ffd3b8); overflow: hidden; touch-action: pan-y; cursor: grab; display: flex; align-items: center; justify-content: center; }
.creator .pv3d canvas { width: 100%; height: 100%; display: block; }
.creator .pvbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.creator .pvseg { display: inline-flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
.creator .pvseg button { font-family: var(--fd); font-weight: 600; font-size: 15px; padding: 5px 12px; min-height: 36px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.creator .pvseg button[aria-pressed=true] { background: var(--ink); color: var(--cream); }
.creator .optcol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.creator .ctabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 3px dashed #e6cfbd; padding-bottom: 10px; }
.creator .ctabs button { font-family: var(--fd); font-weight: 600; font-size: 16px; padding: 6px 14px; min-height: 40px; border-radius: 12px; border: 3px solid transparent; background: transparent; color: #6b4a3c; cursor: pointer; }
.creator .ctabs button[aria-selected=true] { background: var(--ink); color: var(--cream); }
.creator .crows { display: flex; flex-direction: column; gap: 12px; }
.creator .pills { gap: 6px; }
.creator .pills button { min-height: 36px; padding: 3px 11px; font-size: 14.5px; border-width: 2.5px; }
.creator button:focus-visible { outline: 3px solid var(--chili); outline-offset: 2px; }
@media (max-width: 700px) {
  .creator .cmain { grid-template-columns: minmax(0, 1fr); }
  .creator .pvcol { top: -28px; z-index: 2; background: var(--cream); padding: 8px 0; border-bottom: 3px dashed #e6cfbd; flex-direction: row; align-items: center; }
  .creator .pv3d { width: 132px; flex: none; }
  .creator .pvbar { flex-direction: column; align-items: flex-start; }
}

/* friends */
.me.frbtn { position: relative; margin-left: auto; margin-right: 8px; padding: 0 16px; } .top .me.frbtn + .me { margin-left: 0; }
.frbadge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--chili, #e0452f); color: #fff; border: 2px solid var(--ink); font-size: 13px; font-weight: 700; line-height: 18px; text-align: center; }
.frbody { display: flex; flex-direction: column; gap: 12px; } .frbody h3 { margin: 4px 0 0; font-size: 18px; color: var(--ink); }
.fradd { display: flex; gap: 8px; } .fradd .field { flex: 1; min-width: 0; }
.frlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.frlist li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 10px; }
.frname { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; } .frname b { font-family: var(--fd); font-weight: 600; font-size: 18px; color: var(--ink); } .frname small { font-size: 13px; color: #6b4a3c; }
.frdot { font-size: 13px; font-weight: 700; color: #8a7468; } .frdot::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c9b8ab; margin-right: 5px; } .frdot.on { color: #2f8f4e; } .frdot.on::before { background: #3fbf68; }
.fract { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- coins and the avatar shop ---------- */
.cn { display: inline-block; width: .95em; height: .95em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe58a, #ffc93c 55%, #d99a1e); box-shadow: inset 0 0 0 2px #b97c12; vertical-align: -.12em; margin-right: .25em; flex: none; }
.coinbtn { font-variant-numeric: tabular-nums; }
.creator .shoptab { color: #a5670b; }
.creator .shopnote { margin: 0; font-size: 14.5px; color: #6b4a3c; }
.creator .pills button.lk { border-style: dashed; }
.creator .pills button .pr { font-size: 12.5px; opacity: .85; white-space: nowrap; }
.creator .swatches button { position: relative; }
.creator .swatches button.lk::after { content: attr(data-p); position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font: 700 10.5px/1 var(--fd); background: #ffc93c; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 4px; }
.creator .swatches:has(.lk) { padding-bottom: 6px; }
.creator .cart:empty { display: none; }
.creator .cart { display: flex; flex-direction: column; gap: 6px; background: #fff3d6; border: 3px dashed #e6b860; border-radius: 16px; padding: 10px 12px; }
.creator .cart small { font-size: 13.5px; color: #6b4a3c; }
.creator .cartlist { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.creator .cartlist > b { font-family: var(--fd); font-weight: 600; color: #6b4a3c; }
.creator .cartitem { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.creator .cartitem .btn { white-space: nowrap; }
.creator .cartitem .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); display: inline-block; }
.me.coinbtn { padding: 0 14px; margin-right: 8px; gap: 2px; } .top .me.coinbtn + .me { margin-left: 0; }
@media (max-width: 560px) { .me.coinbtn small { display: none; } }
.creator .cart { position: sticky; bottom: -18px; z-index: 3; box-shadow: 0 -8px 0 var(--cream); }
.creator .cartitem .btn .cn { margin-right: .3em; }

/* ---------- global rankings on the hub ---------- */
.rkcard { background: var(--plum2); border: 3px solid var(--line); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.rktabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px 4px; }
.rktabs::-webkit-scrollbar { display: none; }
.rktabs button { flex: none; font-family: var(--fd); font-weight: 600; font-size: 15px; padding: 8px 14px; min-height: 44px; border-radius: 12px; border: 3px solid var(--dash); background: transparent; color: var(--cream); cursor: pointer; white-space: nowrap; }
.rktabs button[aria-selected=true] { border-color: var(--ink); background: var(--lantern); color: var(--ink); }
.rknote { margin: 0; font-size: 14px; color: var(--muted); }
.rk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rk li { display: grid; grid-template-columns: 30px 36px minmax(0, 1fr) auto; grid-template-areas: "pos av who main" "pos av who sub"; align-items: center; column-gap: 12px; row-gap: 2px; background: var(--plum); border-radius: 14px; padding: 8px 14px 8px 10px; min-height: 56px; }
.rk li.you { outline: 3px solid var(--lantern); background: var(--deep); }
.rk li.gap { display: block; min-height: 0; padding: 0; background: none; text-align: center; color: var(--muted); letter-spacing: 4px; }
.rk .pos { grid-area: pos; font-family: var(--fd); font-weight: 700; font-size: 18px; text-align: center; color: var(--lantern); font-variant-numeric: tabular-nums; }
.rk .avatar { grid-area: av; }
.rk .who { grid-area: who; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rk .who > b { font-family: var(--fd); font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .who em { font-style: normal; color: var(--lantern); font-weight: 600; }
.rk .who > span { display: flex; gap: 6px; align-items: center; }
.rk .who i { font-style: normal; font-size: 12px; color: var(--muted); border: 1px solid var(--dash); border-radius: 999px; padding: 1px 7px; }
.rk .lv { font-size: 12px; padding: 2px 7px; }
.rk .main { grid-area: main; justify-self: end; align-self: end; font-family: var(--fd); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk .sub { grid-area: sub; justify-self: end; align-self: start; font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) {
  .rkcard { padding: 12px; border-radius: 20px; }
  .rk li { grid-template-columns: 24px 36px minmax(0, 1fr) auto; grid-template-areas: "pos av who main" "pos av sub sub"; column-gap: 8px; padding: 8px 10px 8px 6px; }
  .rk .pos { font-size: 16px; }
  .rk .main { font-size: 16px; align-self: center; }
  .rk .sub { justify-self: start; font-size: 12px; white-space: normal; }
}


/* ---------- sky look for the hub, waiting room and pop-ups (matches the 3D games: daytime sky, floating islands, cream stickers) ---------- */
body.sky:not(.in-game) {
  --sky1: #6fbdf2; --sky2: #bfe6ff; --sky3: #e3f5ff; --grass: #7cc35a; --earth: #c98a5a; --rock: #857a72;
  --pan: #fff4e2; --pan2: #ffe9cf; --muted2: #8a6a5c; --edge: #e3c7ad; --tx: #3b2219; --tx2: #2f4a63; --chip: #fff; --you: #fff0c9; --glass: #ffffff4d;
  background: linear-gradient(180deg, var(--sky1) 0, var(--sky2) 900px, var(--sky3) 1600px) fixed;
  color: var(--tx); color-scheme: light; transition: background .4s;
}
body.sky:not(.in-game)::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .95;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520'%3E%3Cg fill='%23ffffff'%3E%3Cpolygon points='60,120 110,82 170,90 210,60 280,78 320,118 300,140 80,140'/%3E%3Cpolygon points='520,300 560,270 620,276 650,250 720,262 760,300 740,320 540,320' opacity='.85'/%3E%3Cpolygon points='300,430 330,410 380,414 400,396 450,406 470,440 320,440' opacity='.7'/%3E%3C/g%3E%3Cg fill='%23d9effc'%3E%3Cpolygon points='80,140 300,140 320,118 260,132 150,128'/%3E%3Cpolygon points='540,320 740,320 760,300 700,312 600,310' opacity='.85'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1300' height='760'%3E%3Cg fill='%23ffffff' opacity='.6'%3E%3Cpolygon points='900,90 930,70 980,74 1000,56 1050,66 1075,96 920,96'/%3E%3Cpolygon points='160,560 190,540 240,546 262,528 310,540 330,574 180,574'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: 0 40px, 0 140px; animation: skydrift 140s linear infinite; }
@keyframes skydrift { to { background-position: 900px 40px, -1300px 140px; } }
@media (prefers-reduced-motion: reduce) { body.sky:not(.in-game)::before { animation: none; } }
body.sky:not(.in-game) .top { border-bottom: 0; }
body.sky:not(.in-game) .brand, body.sky:not(.in-game) section h2, body.sky:not(.in-game) .sidehead h2 { color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink); letter-spacing: .5px; }
body.sky:not(.in-game) .brand { -webkit-text-stroke-width: 5px; }
body.sky:not(.in-game) .rk .who em { color: #d9532f; }
body.sky:not(.in-game) .navl a { color: #fff; font-weight: 600; text-shadow: 0 2px 0 #3b221999; } body.sky:not(.in-game) .navl a:hover { color: #fff6a8; }
body.sky:not(.in-game) .me { background: var(--pan); border-color: var(--tx); color: var(--tx); box-shadow: 0 4px 0 var(--ink); }
body.sky:not(.in-game) .hero h1 { color: #fff; paint-order: stroke fill; -webkit-text-stroke: 7px var(--ink); text-shadow: 0 5px 0 var(--ink); letter-spacing: 1px; }
body.sky:not(.in-game) .hero p { color: var(--tx2); font-weight: 600; }
body.sky:not(.in-game) .codeform { background: var(--pan); border-color: var(--tx); box-shadow: 0 5px 0 var(--ink); } body.sky:not(.in-game) .codeform label { color: var(--tx); }
body.sky:not(.in-game) .livestats { color: var(--tx2); } body.sky:not(.in-game) .livestats b { color: var(--tx); }
body.sky:not(.in-game) .hero .art.sky3d { position: relative; min-height: 340px; }
body.sky:not(.in-game) .hero3d { position: absolute; inset: -30px -20px -10px; width: calc(100% + 40px); height: calc(100% + 40px); display: block; cursor: pointer; touch-action: pan-y; }
/* cream sticker panels */
body.sky:not(.in-game) .mecard, body.sky:not(.in-game) .rkcard, body.sky:not(.in-game) .trow { background: var(--pan); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); color: var(--tx); }
body.sky:not(.in-game) .rankname span, body.sky:not(.in-game) .xpnote, body.sky:not(.in-game) .acct, body.sky:not(.in-game) .stats span, body.sky:not(.in-game) .pergame span, body.sky:not(.in-game) .rknote, body.sky:not(.in-game) .trow .who span { color: var(--muted2); }
body.sky:not(.in-game) .acct b { color: var(--tx); }
body.sky:not(.in-game) .stats div { background: var(--pan2); border: 2px solid var(--edge); }
body.sky:not(.in-game) .xpbar { background: var(--edge); }
body.sky:not(.in-game) .rankicon { box-shadow: 0 4px 0 var(--ink); }
body.sky:not(.in-game) .btn.ghost { color: var(--tx); border-color: var(--edge); } body.sky:not(.in-game) .btn.ghost:hover { background: #3b22190d; }
body.sky:not(.in-game) .dots i { border-color: var(--tx); } body.sky:not(.in-game) .dots i.on { background: var(--ink); }
body.sky:not(.in-game) .tcode { color: #d9532f; }
body.sky:not(.in-game) .sidenote { color: var(--tx2); font-weight: 600; }
body.sky:not(.in-game) .empty { border-color: #ffffffcc; color: var(--tx2); background: var(--glass); }
body.sky:not(.in-game) .rktabs button { color: var(--tx); border-color: var(--edge); background: var(--chip); }
body.sky:not(.in-game) .rktabs button[aria-selected=true] { border-color: var(--tx); background: var(--lantern); box-shadow: 0 3px 0 var(--ink); }
body.sky:not(.in-game) .rk li { background: var(--chip); border: 2px solid var(--edge); }
body.sky:not(.in-game) .rk li.you { outline: 3px solid var(--ink); background: var(--you); border-color: transparent; }
body.sky:not(.in-game) .rk .pos { color: #d9532f; } body.sky:not(.in-game) .rk .sub, body.sky:not(.in-game) .rk .who i { color: var(--muted2); } body.sky:not(.in-game) .rk .who i { border-color: var(--edge); }
body.sky:not(.in-game) .rk li.gap { background: none; border: 0; }
/* game cards float like little islands: a strip of grass and a rocky underside */
body.sky:not(.in-game) .games { row-gap: 64px; padding-bottom: 30px; }
body.sky:not(.in-game) .gcard { position: relative; overflow: visible; box-shadow: 0 6px 0 var(--ink), 0 14px 0 var(--grass), 0 17px 0 var(--ink); animation: cardbob 5s ease-in-out infinite; }
body.sky:not(.in-game) .gcard:nth-child(2n) { animation-delay: -1.6s; } body.sky:not(.in-game) .gcard:nth-child(3n) { animation-delay: -3.1s; }
body.sky:not(.in-game) .gcard .pic { border-radius: 19px 19px 0 0; overflow: hidden; }
body.sky:not(.in-game) .gcard::after { content: ''; position: absolute; left: 14%; right: 14%; top: calc(100% + 17px); height: 46px; z-index: -1;
  background: linear-gradient(180deg, var(--earth) 0 38%, var(--rock) 38%); clip-path: polygon(0 0, 100% 0, 86% 45%, 74% 52%, 62% 100%, 48% 70%, 36% 82%, 22% 46%, 10% 40%); filter: drop-shadow(0 0 0 var(--ink)); }
body.sky:not(.in-game) .gcard:hover { transform: translateY(-6px); }
@keyframes cardbob { 50% { translate: 0 -5px; } }
@media (prefers-reduced-motion: reduce) { body.sky:not(.in-game) .gcard { animation: none; } }
body.sky:not(.in-game) .soon { border-color: #ffffffcc; background: var(--glass); color: var(--tx2); } body.sky:not(.in-game) .soon h3 { color: var(--tx); }
body.sky:not(.in-game) footer { color: #4d6a84; border-top-color: #ffffff99; }

/* the pieces at the edges of the hub look up at the sky too */
body.sky:not(.in-game) .gcard .pic.marblepic, body.sky:not(.in-game) .gcard .pic.ladderpic, body.sky:not(.in-game) .gcard .pic.ludopic { background: #bfe8ff; }
body.sky:not(.in-game) .round { background: var(--pan); border-color: var(--tx); color: var(--tx); }
body.sky:not(.in-game) .chip { background: var(--pan); border-color: var(--tx); color: var(--tx); }
/* waiting room */
body.sky:not(.in-game) .lobby aside { background: var(--pan); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); color: var(--tx); }
body.sky:not(.in-game) .crumb { color: var(--tx2); }
body.sky:not(.in-game) .lobby .main [style*="color:var(--muted)"] { color: var(--tx2) !important; }
body.sky:not(.in-game) .codetiles span { box-shadow: 0 6px 0 var(--ink); }
body.sky:not(.in-game) .seats { row-gap: 40px; padding-bottom: 18px; }
body.sky:not(.in-game) .seat.full { position: relative; box-shadow: 0 6px 0 var(--ink), 0 12px 0 var(--grass), 0 15px 0 var(--ink); }
body.sky:not(.in-game) .seat.full::after { content: ''; position: absolute; left: 22%; right: 22%; top: calc(100% + 15px); height: 26px; z-index: -1;
  background: linear-gradient(180deg, var(--earth) 0 40%, var(--rock) 40%); clip-path: polygon(0 0, 100% 0, 84% 50%, 68% 100%, 50% 62%, 32% 90%, 14% 44%); }
body.sky:not(.in-game) .seat.full { background: var(--pan); color: var(--tx); }
body.sky:not(.in-game) .seat.full span { color: var(--muted2); }
body.sky:not(.in-game) .codetiles span { color: var(--ink) !important; background: #fff4e2; }
body.sky:not(.in-game) .seat.full .lv, body.sky:not(.in-game) .rk .lv, body.sky:not(.in-game) .me .lv { color: var(--ink); }
body.sky:not(.in-game) .seat.open { border-color: #ffffffcc; background: var(--glass); color: var(--tx2); }
body.sky:not(.in-game) .seat.open b { color: var(--tx); }
body.sky:not(.in-game) .pills button { color: var(--tx); border-color: var(--edge); background: var(--chip); }
body.sky:not(.in-game) .pills button[aria-pressed=true] { border-color: var(--tx); background: var(--lantern); box-shadow: 0 3px 0 var(--ink); }
body.sky:not(.in-game) .toggle input { background: var(--edge); }
body.sky:not(.in-game) .howto { background: var(--pan2); color: var(--tx); border: 2px solid var(--edge); }
body.sky:not(.in-game) .howto b { color: #d9532f; }
/* pop-ups, toasts and chat: cream stickers with ink shadows on a soft blue veil */
body.sky:not(.in-game) .modal { background: var(--tx2)99; }
body.sky:not(.in-game) .sheet, body.sky:not(.in-game) .toast, body.sky:not(.in-game) .chatpanel, body.sky:not(.in-game) .chatpeek .cl p { box-shadow: 0 7px 0 var(--ink); }
body.sky:not(.in-game) .floaty { filter: drop-shadow(0 4px 0 #3b221955); }
body.sky:not(.in-game) .rktabs button[aria-selected=true], body.sky:not(.in-game) .pills button[aria-pressed=true] { color: var(--ink); }
body.sky:not(.in-game) .boardnote { color: var(--muted2); }
body.sky:not(.in-game) .howto a { color: #d9532f; }
body.sky:not(.in-game) .btn.ghost { color: var(--tx); }
body.sky:not(.in-game) .lobby .opt b, body.sky:not(.in-game) .toggle { color: var(--tx); }

/* ---------- night: the same world after dark (the day/night switch in the top bar) ---------- */
body.sky.night:not(.in-game) {
  /* one cool indigo family: panels sit a step lighter than the sky, outlines are near-black navy, text is soft white,
     secondary text stays above 7:1 on the panels, lantern yellow is the only warm accent */
  --sky1: #110e2b; --sky2: #221b48; --sky3: #352760;
  --pan: #2b2856; --pan2: #201d44; --edge: #4d4a8c; --chip: #1c1a3a; --you: #3a3479; --glass: #ffffff12;
  --tx: #f5f2ff; --tx2: #dcdcff; --muted2: #bcbfeb; --ink: #0e0c22;
  color-scheme: dark;
}
body.sky.night:not(.in-game)::before { opacity: .16; }
body.sky.night:not(.in-game)::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(1.6px 1.6px at 20px 30px, #fff, transparent), radial-gradient(1.2px 1.2px at 140px 90px, #fff9, transparent), radial-gradient(2px 2px at 260px 50px, #ffe9a8, transparent), radial-gradient(1.2px 1.2px at 330px 160px, #fffc, transparent), radial-gradient(1.6px 1.6px at 90px 200px, #fff8, transparent), radial-gradient(1px 1px at 210px 240px, #fff, transparent);
  background-size: 380px 280px; animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.sky.night:not(.in-game)::after { animation: none; } }
body.sky.night:not(.in-game) .navl a { text-shadow: 0 2px 0 #000a; }
body.sky.night:not(.in-game) .tcode, body.sky.night:not(.in-game) .rk .pos, body.sky.night:not(.in-game) .rk .who em { color: var(--lantern); }
/* in a game at night the room code sits straight on the dark sky, so it turns lantern gold like the hub's codes */
body.night .tr .tcode, body.night .pw .tcode { color: var(--lantern); }
body.sky.night:not(.in-game) .rk li.you { outline-color: var(--lantern); }
body.sky.night:not(.in-game) .dots i { border-color: var(--tx); } body.sky.night:not(.in-game) .dots i.on { background: var(--tx); }
body.sky.night:not(.in-game) .modal { background: #0b061899; }
body.sky.night:not(.in-game) .howto a { color: var(--lantern); }
/* the switch itself */
.themebtn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer;
  background: var(--plum2); border: 3px solid var(--line); color: var(--cream); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.themebtn:hover { transform: rotate(-14deg) scale(1.06); } .themebtn:active { transform: scale(.9); }
body.sky:not(.in-game) .themebtn { background: var(--pan); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
/* game cards: title and player tag always share one line, and the buttons sit at the bottom so a row of cards lines up */
.gcard .body { flex: 1; }
.gcard .body > .row:first-child { flex-wrap: nowrap; gap: 8px; }
.gcard .body > .row:first-child h3 { flex: 1 1 auto; min-width: 0; font-size: clamp(20px, 1.6vw + 8px, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .body > .row:first-child .tag { flex: none; font-size: 13px; padding: 3px 8px; }
.gcard .body > .row:last-child { margin-top: auto; padding-top: 4px; }
/* day/night switch animation: the circle reveal is drawn by the view transition, so turn off its default crossfade */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
/* browsers without view transitions: colours fade across instead */
body.theming, body.theming * { transition: background-color .6s ease, color .6s ease, border-color .6s ease, box-shadow .6s ease, fill .6s ease !important; }
body.theming::before, body.theming::after { transition: opacity .6s ease !important; }
.themebtn { transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
body.night .themebtn { transform: rotate(360deg); }

/* night: disabled and read-only controls stay readable (no fading to 45%) but look flat and quiet */
body.sky.night:not(.in-game) .btn:disabled { opacity: 1; background: var(--pan2); color: var(--muted2); border-color: var(--edge); box-shadow: none; }
body.sky.night:not(.in-game) .pills button:disabled:not([aria-pressed=true]) { color: var(--muted2); }
body.sky.night:not(.in-game) .offline { opacity: .7; }
body.sky.night:not(.in-game) footer { color: var(--muted2); border-top-color: var(--edge); }
body.sky.night:not(.in-game) .me small { opacity: .85; }
body.sky.night:not(.in-game) .tag { background: #ffe2a8; color: #3b2219; }
/* night: pop-ups go dark with the rest instead of staying cream */
body.sky.night:not(.in-game) .sheet { background: var(--pan); color: var(--tx); }
body.sky.night:not(.in-game) .sheet h2, body.sky.night:not(.in-game) .rules b, body.sky.night:not(.in-game) .frname b { color: var(--tx); }
body.sky.night:not(.in-game) .sheet p, body.sky.night:not(.in-game) .rules, body.sky.night:not(.in-game) .creator .namecol label, body.sky.night:not(.in-game) .crow b,
body.sky.night:not(.in-game) .creator .shopnote, body.sky.night:not(.in-game) .creator .cart small, body.sky.night:not(.in-game) .frname small { color: var(--muted2); }
body.sky.night:not(.in-game) .sheet .field { background: var(--chip); color: var(--tx); border-color: var(--edge); }
body.sky.night:not(.in-game) .sheet .field::placeholder { color: #8d8fc4; }
body.sky.night:not(.in-game) .creator .preview, body.sky.night:not(.in-game) .creator .pvcol { background: var(--pan); }
body.sky.night:not(.in-game) .creator .preview, body.sky.night:not(.in-game) .creator .ctabs, body.sky.night:not(.in-game) .creator .pvcol { border-color: var(--edge); }
body.sky.night:not(.in-game) .creator .ctabs button { color: var(--tx); }
body.sky.night:not(.in-game) .creator .ctabs button[aria-selected=true], body.sky.night:not(.in-game) .creator .pvseg button[aria-pressed=true] { background: var(--lantern); color: #3b2219; }
body.sky.night:not(.in-game) .creator .pvseg { border-color: var(--edge); } body.sky.night:not(.in-game) .creator .pvseg button { color: var(--tx); }
body.sky.night:not(.in-game) .creator .pv3d { border-color: var(--edge); background: linear-gradient(#3a3479, #2b2856); }
body.sky.night:not(.in-game) .sheet .pills button { border-color: var(--edge); }
body.sky.night:not(.in-game) .creator .shoptab { color: var(--lantern); }
body.sky.night:not(.in-game) .creator .cart { background: #2f2a1c; border-color: #8a6d2a; }
body.sky.night:not(.in-game) .sheet .chip, body.sky.night:not(.in-game) .frlist li { background: var(--chip); color: var(--tx); border-color: var(--edge); }
body.sky.night:not(.in-game) .sheet .btn.ghost-ink { color: var(--tx); }
body.sky.night:not(.in-game) .autherr { color: #ff9b8a !important; }
body.sky.night:not(.in-game) .chatpanel { background: var(--pan); color: var(--tx); }
body.sky.night:not(.in-game) .cl p { background: var(--chip); color: var(--tx); border-color: var(--edge); } body.sky.night:not(.in-game) .cl.own p { background: #3a3479; }
body.sky.night:not(.in-game) .cl p b { color: var(--lantern); } body.sky.night:not(.in-game) .chatempty { color: var(--muted2); }
body.sky.night:not(.in-game) .chatform { background: var(--pan2); } body.sky.night:not(.in-game) .chatform .field { background: var(--chip); color: var(--tx); border-color: var(--edge); }
body.sky.night:not(.in-game) .chatemoji { border-color: var(--edge); }
body.sky.night:not(.in-game) .toast { background: var(--pan); color: var(--tx); } body.sky.night:not(.in-game) .toast.bad { background: #5a2333; }
body.sky.night:not(.in-game) .howto b { color: var(--lantern); }

/* the day/night switch inside the games sits in the game's own row of round buttons; the emoji needs no stroke colour */
.gamesw { font-size: 19px; line-height: 1; }
/* phones: the switch stays on the right end of the second row of the top bar */
@media (max-width: 600px) { .top .me[data-act=profile] > small { display: none; } .top .themebtn { width: 44px; height: 44px; font-size: 20px; } }

/* night: the game cards are night panels too, and their pictures get a night sky (art.js tags sky, clouds, sea) */
.artstars { display: none; }
body.sky.night:not(.in-game) .gcard { background: var(--pan); color: var(--tx); }
body.sky.night:not(.in-game) .gcard p { color: var(--tx2); }
body.sky.night:not(.in-game) .gcard .tag { background: var(--chip); color: var(--tx); border-color: var(--edge); }
body.sky.night:not(.in-game) .gcard .pic .artsky { fill: #2b2d6e; }
body.sky.night:not(.in-game) .gcard .pic .artcloud { fill: #6d72b4; }
body.sky.night:not(.in-game) .gcard .pic .artsea { fill: #3d4d9a; }
body.sky.night:not(.in-game) .gcard .pic .artstars { display: inline; }
body.sky.night:not(.in-game) .gcard .pic.marblepic, body.sky.night:not(.in-game) .gcard .pic.ladderpic, body.sky.night:not(.in-game) .gcard .pic.ludopic,
body.sky.night:not(.in-game) .gcard .pic.golfpic, body.sky.night:not(.in-game) .gcard .pic.farmpic, body.sky.night:not(.in-game) .gcard .pic.stackpic,
body.sky.night:not(.in-game) .gcard .pic.pipspic, body.sky.night:not(.in-game) .gcard .pic.dicepic, body.sky.night:not(.in-game) .gcard .pic.kitchenpic, body.sky.night:not(.in-game) .gcard .pic.digpic,
body.sky.night:not(.in-game) .gcard .pic.dartspic, body.sky.night:not(.in-game) .gcard .pic.beanpic, body.sky.night:not(.in-game) .gcard .pic.brickspic { background: #2b2d6e; }
body.sky.night:not(.in-game) .gcard .pic.panpic, body.sky.night:not(.in-game) .gcard .pic.haypic { background: #2b2d6e; }
body.sky.night:not(.in-game) .gcard .pic:not([class*="pic "]) { background: #b8442f; }

/* ---------- hub chat (left column, under open tables) ---------- */
.hccard { display: flex; flex-direction: column; background: var(--pan, var(--plum2)); color: var(--tx, var(--cream)); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 6px 0 var(--ink); overflow: hidden; }
.hclog { height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.hcl { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 8px; padding: 4px 26px 2px 2px; border-radius: 12px; }
.hcl:not(.cont) { margin-top: 8px; } .hcl:first-child { margin-top: 0; }
.hcl:hover { background: var(--glass, #ffffff12); }
.hcav .avatar { border-width: 2.5px; }
.hcmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.hcname { font-family: var(--fd); font-weight: 600; font-size: 15px; color: #c2492b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hcl.own .hcname { color: #2f7d4f; }
.hcmeta .lv { font-size: 11px; padding: 1px 6px; }
.hcmeta time { font-size: 12px; color: var(--muted2, var(--muted)); font-variant-numeric: tabular-nums; }
.hcl p { margin: 1px 0 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; color: var(--tx, var(--cream)); }
.hcdel { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border: 0; border-radius: 8px; background: transparent; color: var(--muted2, var(--muted)); font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; }
.hcl:hover .hcdel, .hcdel:focus-visible { opacity: 1; } .hcdel:hover { background: var(--chip, #0002); color: var(--tx); }
@media (hover: none) { .hcdel { opacity: .6; } }
.hcempty { margin: auto; text-align: center; padding: 12px; font-size: 15px; color: var(--muted2, var(--muted)); }
.hcfoot { border-top: 3px solid var(--ink); background: var(--pan2, var(--plum)); }
.hcfoot:empty { display: none; }
.hcform { display: flex; gap: 6px; padding: 8px; }
.hcform .field { flex: 1; min-width: 0; min-height: 44px; padding: 6px 12px; font-size: 16px; font-family: inherit; font-weight: 600; background: var(--chip, #fff); color: var(--tx, var(--ink)); border-color: var(--edge, var(--ink)); }
.hcform .field::placeholder { color: var(--muted2, #8a6a5c); opacity: .85; }
.hcform .btn { min-height: 44px; padding: 6px 14px; box-shadow: 0 3px 0 var(--ink); }
.hcguest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--tx2, var(--cream)); }
.hcguest span { flex: 1 1 100%; }
body.sky.night:not(.in-game) .hcname { color: var(--lantern); } body.sky.night:not(.in-game) .hcl.own .hcname { color: #8fe3b0; }
@media (max-width: 600px) { .hclog { height: 300px; } }
/* seasonal drops in the avatar shop */
.creator .crow.drop { border: 2.5px solid var(--edge, #c9a99a); border-radius: 14px; padding: 9px 11px 11px; background: var(--chip, #fff7ec); }
.creator .crow.drop b small { display: block; font: 500 13px/1.3 var(--fb, inherit); color: var(--tx2, #6b4a3c); }
.creator .crow.drop.off { border-style: dashed; background: transparent; }
.creator .crow.drop.off .pills button:disabled { opacity: 1; border-style: dotted; color: var(--muted2, #8a7468); }

/* ---------- open tables pager ---------- */
.tpager { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--tx2, var(--muted)); }
.tpager:empty { display: none; }
.tpager .btn { min-width: 44px; min-height: 40px; padding: 4px 12px; font-size: 20px; line-height: 1; }
.tpager b { color: var(--tx, var(--cream)); }
/* ---------- account style: name colours, frames, titles (public/cosmetics.js) ---------- */
/* Name colours are gradients clipped to the text. They sit on light and dark panels alike, so each keeps mid-tone colours. */
.nmfx { background: var(--g) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; font-weight: 700; }
.nm1 { --g: linear-gradient(90deg, #f0692f, #e0388a, #f0692f); } .nm2 { --g: linear-gradient(90deg, #1f8fd6, #19b3a6, #1f8fd6); }
.nm3 { --g: linear-gradient(90deg, #1fa36a, #5cb82e, #1fa36a); } .nm4 { --g: linear-gradient(90deg, #e84a9a, #8a63e0, #2aa7d8, #e84a9a); }
.nm5 { --g: linear-gradient(90deg, #c98a0c, #f2c230, #a86e08, #f2c230, #c98a0c); animation: nmslide 3s linear infinite; }
.nm6 { --g: linear-gradient(90deg, #e02a1f, #ff9a1f, #f2c230, #e02a1f); animation: nmslide 1.6s linear infinite; }
.nm7 { --g: linear-gradient(90deg, #e8392f, #f08a1f, #d9b10c, #2fa84f, #1f8fd6, #8a63e0, #e8392f); animation: nmslide 4s linear infinite; }
.nm8 { --g: linear-gradient(90deg, #8a63e0, #e84a9a 30%, #fff3b0 45%, #e84a9a 60%, #8a63e0); animation: nmslide 2.2s linear infinite; }
.nm9 { --g: linear-gradient(90deg, #2a8fd0, #7fc8ee, #2a8fd0); animation: nmslide 5s linear infinite; }
.nm10 { --g: linear-gradient(90deg, #e8731f, #7a3fc0, #2fa84f, #e8731f); animation: nmslide 5s linear infinite; }
@keyframes nmslide { to { background-position: -200% 0; } }
.ttl { display: inline-block; font: 600 12px/1.2 var(--fd); letter-spacing: .02em; color: var(--tx, var(--ink)); background: color-mix(in srgb, var(--lantern, #ffb84a) 45%, transparent); border: 1.5px solid currentColor; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.ttl.none { opacity: .55; background: transparent; border-style: dashed; }
.seat.full .ttl { display: table; font-size: 12.5px; color: var(--tx, var(--ink)); margin: 2px 0 3px; }
/* Frames are drawn art laid over the round picture (::before, and ::after for the rainbow), so they never change its size or the layout.
   The art is in public/frames: each is an SVG with the picture's edge at radius 42 of a 120 box. */
.avatar.frm { position: relative; overflow: visible; box-shadow: 0 0 calc(var(--s, 52px) * .22) calc(var(--s, 52px) * .05) var(--f3, transparent); }
.avatar.frm > svg { border-radius: 50%; }
.avatar.frm::before, .avatar.fr7::after { content: ''; position: absolute; inset: calc(var(--s, 52px) * -.215 - 3px); background: var(--fa) center / contain no-repeat; pointer-events: none; }
.fr1 { --f3: #ffffffaa; --fa: url("frames/f1.svg"); }
.fr2 { --f3: #7ed37a66; --fa: url("frames/f2.svg"); }
.fr3 { --f3: #ff8fab88; --fa: url("frames/f3.svg"); }
.fr4 { --f3: #ffd23f88; --fa: url("frames/f4.svg"); }
.fr5 { --f3: #ffc93caa; --fa: url("frames/f5.svg"); }
.fr6 { --f3: #ff6a1faa; --fa: url("frames/f6.svg"); }
.fr7 { --f3: #b48cff88; --fa: url("frames/f7.svg"); }
.fr8 { --f3: #bfe6ffcc; --fa: url("frames/f8.svg"); }
.avatar.fr7::before { background: conic-gradient(#ff5a5a, #ffb03a, #ffe24a, #5fd46e, #4ab6ff, #8a6cff, #ff6ad0, #ff5a5a); border-radius: 50%; inset: calc(var(--s, 52px) * -.075 - 3px);
  -webkit-mask: radial-gradient(closest-side, #0000 calc(100% - var(--s, 52px) * .105), #000 calc(100% - var(--s, 52px) * .105 + .6px)); mask: radial-gradient(closest-side, #0000 calc(100% - var(--s, 52px) * .105), #000 calc(100% - var(--s, 52px) * .105 + .6px)); animation: frspin 6s linear infinite; }
.fr7::after { animation: frtwinkle 2.4s ease-in-out infinite alternate; }
.fr4::before { animation: frspin 40s linear infinite; }
.fr6::before { animation: frflick .9s ease-in-out infinite alternate; }
.fr5 { animation: frglow 2.6s ease-in-out infinite alternate; }
@keyframes frspin { to { transform: rotate(360deg); } }
@keyframes frflick { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.045) rotate(2deg); } }
@keyframes frtwinkle { from { opacity: .55; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }
@keyframes frglow { from { box-shadow: 0 0 calc(var(--s, 52px) * .16) calc(var(--s, 52px) * .02) #ffc93c66; } to { box-shadow: 0 0 calc(var(--s, 52px) * .3) calc(var(--s, 52px) * .08) #ffd95ccc; } }
@media (prefers-reduced-motion: reduce) { .nmfx, .avatar.frm, .avatar.frm::before, .avatar.frm::after { animation: none; } }
/* the Style pop-up */
.sheet.wide { width: min(760px, 100%); }
.stylecard { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border: 3px solid var(--ink); border-radius: 18px; background: var(--chip, #fff); }
.stylecard > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.stylecard b { font: 700 24px/1.15 var(--fd); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .stylecard small { font-size: 13.5px; color: var(--tx2, #6b4a3c); }
.stylebox .crow b small { font: 500 13px/1.3 var(--fb, inherit); color: var(--tx2, #6b4a3c); margin-left: 6px; }
.stylebox .pills button.goal:disabled { opacity: 1; border-style: dotted; color: var(--muted2, #8a7468); }
.stylebox .pills button .stk { letter-spacing: 1px; margin-left: 2px; }
.stylebox .cartitem small { font-weight: 500; }
.creator .tostyle { align-self: flex-start; }
.me.stylebtn { padding: 0 13px; margin-right: 8px; font-size: 20px; } .top .me.stylebtn + .me { margin-left: 0; }
.chatemoji.more { flex-wrap: wrap; justify-content: flex-start; max-height: 96px; overflow-y: auto; }
/* win effects (public/winfx.js) */
.winfx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; pointer-events: none; }
.winfxtag { position: fixed; left: 50%; top: 16%; transform: translateX(-50%); z-index: 81; pointer-events: none; font: 700 clamp(22px, 5vw, 40px)/1.1 var(--fd); color: #fff; background: #3b2219cc; border: 3px solid #fff; border-radius: 999px; padding: 8px 22px; animation: popin .4s cubic-bezier(.3, 1.6, .5, 1) both; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1500px) { .top .me[data-act=profile] > small { display: none; } }
@media (max-width: 1340px) { .top .coinbtn > small { display: none; } }
body.sky.night:not(.in-game) .creator .cart { box-shadow: 0 -8px 0 var(--pan); }
@media (max-width: 600px) { .top .me.stylebtn, .top .me.coinbtn { margin-right: 0; padding: 0 10px; } .top .me[data-act=profile] { padding-right: 10px; gap: 6px; max-width: 46vw; overflow: hidden; } }
.rk .who > span { flex-wrap: wrap; }

/* Pet Farm companion beside the player in a waiting room, and its picker in Your style */
.petpal { flex: none; margin-left: -22px; align-self: flex-end; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .18)); animation: palhop 2.6s ease-in-out infinite; pointer-events: auto; }
.petpal:not([src]), .palpic:not([src]) { visibility: hidden; }
.stylecard .petpal { margin-left: -26px; }
.palpills button { display: inline-flex; align-items: center; gap: 6px; } .palpic { margin: -6px 0 -6px -6px; }
@keyframes palhop { 0%, 78%, 100% { transform: translateY(0); } 86% { transform: translateY(-7px); } 93% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .petpal { animation: none; } }

/* Your style: the card and the table kit stay in view while the rows scroll, so a choice far down the list is seen at once */
.styletop { display: flex; flex-direction: column; gap: 10px; background: inherit; }
.sheet:has(.styletop) { background-clip: padding-box; }
@media (min-height: 720px) { .styletop { position: sticky; top: -28px; z-index: 3; padding: 10px 0 8px; margin: -10px 0 -8px; background: var(--sheetbg, var(--cream)); box-shadow: 0 8px 8px -8px rgba(0, 0, 0, .25); } body.sky.night:not(.in-game) .styletop { --sheetbg: var(--pan); } }
.stylekit { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stylekit figure { margin: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border: 2.5px solid var(--edge, #c9a99a); border-radius: 14px; background: var(--chip, #fff7ec); min-width: 0; }
.stylekit figure.try { border-style: dashed; border-color: var(--lantern, #ffb84a); }
.stylekit img { width: 54px; height: 54px; flex: none; object-fit: contain; } .stylekit img:not([src]) { visibility: hidden; }
.stylekit figcaption { font: 700 14px/1.2 var(--fd); color: var(--tx, var(--ink)); min-width: 0; } .stylekit figcaption small { display: block; font: 500 12px/1.3 var(--fb, inherit); color: var(--tx2, #6b4a3c); }
@media (max-width: 640px) { .stylekit { grid-template-columns: repeat(2, 1fr); } .stylekit img { width: 48px; height: 48px; } }

/* ---------- Mystery Pet: the daily guess-the-pet puzzle (public/daily.js) ---------- */
/* Its own colours, so the pop-up and the hub card read well by day and by night. */
.mp, .dailycard { --mpb: #fff; --mpl: #e6d3bf; --mpt: var(--ink); --mps: #7a5a4c; --mpok: #7fd08f; --mpnear: #ffd766; --mpno: #f29a8e; }
body.night .mp, body.night .dailycard { --mpb: var(--chip, #2b2a55); --mpl: var(--edge, #4a4a86); --mpt: var(--tx, #f1eeff); --mps: var(--muted2, #b9b6e6); }
.dailycard { display: flex; align-items: center; gap: 18px; margin-top: 14px; padding: 18px 22px; background: var(--pan, var(--plum2)); color: var(--tx, var(--cream)); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 var(--ink); }
.dailycard .dcart { flex: none; width: 96px; height: 96px; border-radius: 22px; background: linear-gradient(160deg, #ffe9a8, #ffc2d6); border: 3px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.dailycard.done .dcart { background: linear-gradient(160deg, #c9f2c6, #a8e0f5); }
.dailycard .dcbody { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dailycard h3 { font-size: 26px; } .dailycard h3 small { font-size: 17px; opacity: .7; font-weight: 500; }
.dailycard p { margin: 0; color: var(--tx2, var(--muted)); }
.dcstate { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.dcpill { font-size: 14px; padding: 3px 11px; border-radius: 999px; background: var(--mpb); color: var(--mpt); border: 2px solid var(--mpl); white-space: nowrap; }
.dailycard > .btn { flex: none; }
@media (max-width: 700px) { .dailycard { flex-wrap: wrap; padding: 16px; } .dailycard .dcart { width: 72px; height: 72px; } .dailycard .dcart svg { width: 72px; height: 72px; } .dailycard .dcbody { flex-basis: calc(100% - 92px); } .dailycard > .btn { width: 100%; } }

.sheet.mpsheet { width: min(900px, 100%); position: relative; }
.mpclose { position: sticky; top: 0; align-self: flex-end; margin: -10px -10px -46px 0; z-index: 3; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 700 24px/1 var(--fd); cursor: pointer; }
.mp { display: flex; flex-direction: column; gap: 18px; color: var(--mpt); }
.mp h3 { font-size: 21px; color: var(--mpt); } .mp h3 small, .mp h2 small { font-size: .6em; font-weight: 500; opacity: .65; }
.mp .mpload, .mp .mpnone { color: var(--mps); margin: 0; }
.mphead { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; padding-right: 40px; }
.mphead > div:first-child { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.mpstats { display: flex; gap: 8px; flex-wrap: wrap; }
.mpstat { display: flex; flex-direction: column; align-items: center; min-width: 86px; padding: 7px 12px; border-radius: 16px; background: var(--mpb); border: 2px solid var(--mpl); line-height: 1.2; }
.mpstat b { font: 600 19px var(--fd); white-space: nowrap; } .mpstat small { font-size: 12px; color: var(--mps); white-space: nowrap; }
.mpguest { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--mpb); border: 2px solid var(--mpl); }
.mppic { width: 56px; height: 56px; display: block; flex: none; object-fit: contain; }
.mppic:not([src]), .mppic[src=""] { visibility: hidden; }
.mppic.sil { filter: brightness(0); opacity: .82; } body.night .mppic.sil { filter: brightness(0) invert(1); opacity: .7; }
.mppic.blur { filter: blur(7px) saturate(1.15); }
.mphints { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mphint { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 6px; border-radius: 18px; background: var(--mpb); border: 2px dashed var(--mpl); line-height: 1.25; }
.mphint.open { border-style: solid; border-color: var(--mint); }
.mphint b { font: 600 15px var(--fd); } .mphint small { font-size: 12.5px; color: var(--mps); }
.mpframe { width: 92px; height: 92px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(160deg, #dff3ff, #fff3d6); }
body.night .mpframe { background: linear-gradient(160deg, #34336b, #4a3f7a); }
.mpframe .mppic { width: 92px; height: 92px; } .mpframe span { font: 700 40px var(--fd); color: var(--mps); opacity: .55; }
.mpframe.big { width: 150px; height: 150px; flex: none; } .mpframe.big .mppic { width: 150px; height: 150px; animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.mpfind { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.mpfind label { font: 600 17px var(--fd); } .mpfind label small { font: 400 14px 'Nunito', sans-serif; color: var(--mps); margin-left: 6px; }
.mp .field { width: 100%; }
.mppick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 268px; overflow: auto; padding: 8px 4px 8px 0; margin-top: 8px; }
.mppet { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 7px; border-radius: 16px; border: 2px solid var(--mpl); background: var(--mpb); color: var(--mpt); cursor: pointer; transition: transform .12s, border-color .12s; }
.mppet b { font: 600 13.5px var(--fd); overflow-wrap: anywhere; text-align: center; line-height: 1.15; }
.mppet:hover:not(:disabled), .mppet:focus-visible { transform: translateY(-2px); border-color: var(--ink); }
.mppet:disabled { opacity: .38; cursor: default; }
.mplegend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: var(--mps); margin-bottom: 10px; }
.mplegend .mpc { min-height: 0; padding: 2px 10px; flex-direction: row; font: 600 13px var(--fd); }
.mplist, .mpboard ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mpg { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.mpwho { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; column-gap: 6px; padding: 4px 8px 4px 4px; border-radius: 16px; background: var(--mpb); border: 2px solid var(--mpl); line-height: 1.15; }
.mpwho .mppic { grid-row: span 2; } .mpwho b { font: 600 15px var(--fd); align-self: end; overflow-wrap: anywhere; } .mpwho small { font-size: 12px; color: var(--mps); align-self: start; }
.mpcells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.mpc { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 64px; padding: 6px 8px; border-radius: 14px; color: #3b2219; border: 2px solid #3b221933; line-height: 1.15; }
.mpc.ok { background: var(--mpok); } .mpc.near { background: var(--mpnear); } .mpc.no { background: var(--mpno); }
.mpc small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; } .mpc b { font: 600 14.5px var(--fd); overflow-wrap: anywhere; }
.mpc .mpmark { position: absolute; top: 4px; right: 7px; font: 700 12px var(--fd); font-style: normal; opacity: .7; } .mparrow { font-style: normal; font-size: .85em; }
.mpg.new .mpc { animation: mpflip .5s both; } .mpg.new .mpc:nth-child(2) { animation-delay: .12s; } .mpg.new .mpc:nth-child(3) { animation-delay: .24s; } .mpg.new .mpc:nth-child(4) { animation-delay: .36s; } .mpg.new .mpc:nth-child(5) { animation-delay: .48s; } .mpg.new .mpc:nth-child(6) { animation-delay: .6s; }
@keyframes mpflip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mpg.new .mpc, .mpframe.big .mppic { animation: none; } }
.mpwin { display: flex; gap: 18px; align-items: center; padding: 16px; border-radius: 20px; background: var(--mpb); border: 2px solid var(--mint); }
.mpwin > div:last-child { display: flex; flex-direction: column; gap: 8px; } .mpwin h3 { font-size: 27px; } .mp .mpwin p { margin: 0; color: var(--mps); } .mp .mpwin .mpgot { color: var(--mpt); }
.mpgrid { margin: 4px 0 0; line-height: 0; font-size: 0; white-space: pre; }
.mpgrid i { display: inline-block; width: 15px; height: 15px; margin: 0 3px 3px 0; border-radius: 4px; background: #f29a8e; } .mpgrid i.g { background: #5fbf74; } .mpgrid i.y { background: #ffd04a; }
.hcl .mpgrid i { width: 12px; height: 12px; margin: 0 2px 2px 0; border-radius: 3px; } .mpmore { font-size: 12px; opacity: .7; }
.mpboard li { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 8px; border-radius: 14px; background: var(--mpb); border: 2px solid var(--mpl); }
.mpboard li.me { border-color: var(--mint); } .mpboard li > b { flex: 1; font: 600 16px var(--fd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mpboard li small { font: 400 12px 'Nunito', sans-serif; color: var(--mps); }
.mppos { width: 24px; text-align: center; font: 600 15px var(--fd); color: var(--mps); } .mpn { font-size: 14px; white-space: nowrap; } .mpfire { font-size: 13px; white-space: nowrap; }
.mpboard h3 { margin-bottom: 10px; }
@media (max-width: 760px) {
  .mpg { grid-template-columns: 1fr; gap: 5px; } .mpcells { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mpc { min-height: 54px; }
  .mpwin { flex-direction: column; align-items: flex-start; } .mpframe { width: 76px; height: 76px; } .mpframe .mppic { width: 76px; height: 76px; }
  .mppick { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); } .mpstat { min-width: 0; flex: 1 1 auto; padding: 7px 8px; } .mpstat b { font-size: 16px; }
}

/* A player's profile card (click a player anywhere): their isle on the left, what they have done on the right */
[data-prof] { cursor: pointer; }
.palno { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px/1 var(--fd); font-style: normal; }
.sheet.psheet { width: min(880px, 100%); }
.profcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: stretch; }
.pisle { position: relative; min-height: 380px; border-radius: 22px; border: 3px solid var(--ink); overflow: hidden; background: linear-gradient(#8fd0f7, #d9f1ff); display: flex; flex-direction: column; }
body.night .pisle { background: linear-gradient(#1c1a4a, #3a3478); }
.pisle .art { position: relative; flex: 1; min-height: 300px; display: grid; place-items: center; }
.pisle .hero3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: pan-y; }
.ppets { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; justify-content: center; background: color-mix(in srgb, var(--pan, #fff4e2) 82%, transparent); border-top: 3px solid var(--ink); }
.ppets span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border-radius: 999px; background: var(--chip, #fff); border: 2px solid var(--edge, #c9a99a); color: var(--tx, var(--ink)); font-size: 14px; } .ppets .palpic { margin: 0; }
.pinfo { display: flex; flex-direction: column; gap: 12px; min-width: 0; color: var(--tx, var(--ink)); }
.pinfo h3 { font-size: 18px; margin: 4px 0 -4px; color: var(--tx, var(--ink)); }
.phead { display: flex; align-items: center; gap: 22px; padding: 14px 8px 6px 16px; } .phead > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.phead h2 { font-size: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .phead small { font-size: 13.5px; color: var(--tx2, #6b4a3c); }
.phead .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9aa; margin-right: 5px; } .phead .dot.on { background: #3fbf6a; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pstats span { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 14px; background: var(--chip, #fff7ec); border: 2.5px solid var(--edge, #c9a99a); font-size: 12.5px; color: var(--tx2, #6b4a3c); }
.pstats b { font: 700 20px/1.2 var(--fd); color: var(--tx, var(--ink)); }
.ptop { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ptop li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; border-radius: 12px; background: var(--chip, #fff7ec); border: 2px solid var(--edge, #c9a99a); font-size: 14.5px; } .ptop span { color: var(--tx2, #6b4a3c); }
.pkit { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .profcard { grid-template-columns: 1fr; } .pisle { min-height: 300px; } .pisle .art { min-height: 230px; } }

/* Name tags inside the games: the player's name colour and, small, their title */
[class*="-tag"] .ttl { display: inline-block; background: #ffe1a0; color: #3b2219; border-color: #3b2219; font-size: 10.5px; line-height: 1.25; padding: 0 6px; margin: 0 0 0 5px; vertical-align: middle; white-space: nowrap; }
body.in-game .ttl { background: #ffe1a0; color: #3b2219 !important; border-color: #3b2219; font-size: 11.5px !important; width: fit-content; }

.pfriend { align-self: center; font: 700 17px var(--fd); padding: 8px 16px; }
.pfnote { align-self: center; font-size: 14px; opacity: .8; max-width: 260px; }
.psheet .row { flex-wrap: wrap; align-items: center; }

/* ---------- the Wardrobe: avatar, shop and account style in one place ---------- */
.sheet.wdsheet { width: min(1120px, 100%); height: min(800px, calc(100dvh - 32px)); max-height: none; padding: 18px 20px; overflow: hidden; }
.sheet.wdsheet:has(.wd.first) { width: min(900px, 100%); }
.wd.creator { flex: 1; min-height: 0; display: grid; gap: 12px 16px; grid-template-columns: 270px 172px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "head head head" "side rail body" "side cart cart"; }
.wd.creator.first { grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "head head" "intro intro" "side rail" "side body" "foot foot"; }
.wdhead { grid-area: head; display: flex; align-items: center; gap: 12px; } .wdhead h2 { flex: 1; font-size: 28px; }
.wdintro { grid-area: intro; }
.wdcoins { display: inline-flex; align-items: center; font-size: 17px; font-variant-numeric: tabular-nums; }
.wdhead .wdx { width: 44px; height: 44px; background: var(--chip, #fff); color: var(--tx, var(--ink)); border-color: var(--tx, var(--ink)); }
.wdside { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.wd.creator .pv3d { flex: 1; min-height: 120px; aspect-ratio: auto; }
.wdme { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wdplate { display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 16px; border: 3px solid var(--tx, var(--ink)); border-radius: 16px; background: var(--chip, #fff); min-height: 76px; }
.wdplate > div { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; flex: 1; }
.wdplate b { font: 700 19px/1.15 var(--fd); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; } .wdplate small { font-size: 12.5px; color: var(--tx2, #6b4a3c); }
.wdplate .petpal { flex: none; }
.wd.creator .namecol { flex: none; flex-direction: row; align-items: center; gap: 10px; } .wd.creator .namecol .field { min-width: 0; padding-top: 8px; padding-bottom: 8px; }
.wd.creator .pvbar { flex-wrap: nowrap; justify-content: flex-start; } .wd .pvseg button { min-height: 40px; }
.wdrail { grid-area: rail; display: flex; flex-direction: column; gap: 2px; overflow: auto; padding-right: 10px; border-right: 3px dashed var(--edge, #e6cfbd); }
.wdrail button { font: 600 16px/1.2 var(--fd); text-align: left; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--tx, var(--ink)); cursor: pointer; flex: none; }
.wdrail button:hover { background: var(--pan2, #ffe9cf); }
.wdrail button[aria-pressed=true] { background: var(--tx, var(--ink)); color: var(--pan, var(--cream)); }
.wdrail .dropb { background: color-mix(in srgb, #6fb7e8 30%, transparent); }
.wdgrp { font: 800 11.5px/1 var(--fb, inherit); letter-spacing: .08em; text-transform: uppercase; color: var(--muted2, #8a6a5c); padding: 10px 12px 4px; }
.wdbody { grid-area: body; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.wdsub { display: flex; align-items: flex-start; gap: 8px; } .wdchips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.wdchips button { font: 600 15px/1 var(--fd); min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2.5px solid var(--edge, #c9a99a); background: var(--chip, #fff); color: var(--tx, var(--ink)); cursor: pointer; }
.wdchips button[aria-pressed=true] { border-color: var(--ink); background: var(--lantern); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.wd .wdfilt { flex: none; border-radius: 999px; }
.wdhint { font-size: 13.5px; } .wdhint:empty { display: none; }
.wdgrid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; align-content: start; grid-auto-rows: max-content; padding: 2px 6px 6px 2px; scrollbar-width: thin; }
.wdgrid.sws { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.wdnone { grid-column: 1 / -1; padding: 18px 4px; }
.wdtile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 6px 4px 7px; min-height: 44px; border: 2.5px solid var(--edge, #e3c7ad); border-radius: 14px;
  background: var(--chip, #fff); color: var(--tx, var(--ink)); font: 600 13.5px/1.15 var(--fd); cursor: pointer; text-align: center; transition: transform .12s; }
.wdtile:not(:disabled):active { transform: scale(.95); }
.wdtile img[data-ip], .wdtile img[data-kit] { width: 76px; height: 76px; object-fit: contain; } .wdtile img:not([src]) { visibility: hidden; } .wdgrid.nopic img[data-ip] { display: none; }
.wdtile b { font-weight: 600; overflow-wrap: anywhere; } .wdtile small { font: 700 12px/1.2 var(--fb, inherit); color: var(--muted2, #8a6a5c); min-height: 14px; }
.wdtile small .cn { margin-right: .2em; }
.wdtile.lk { border-style: dashed; }
.wdtile[aria-pressed=true] { border-style: solid; border-color: var(--ink); background: var(--you, #fff0c9); box-shadow: 0 3px 0 var(--ink); }
.wdtile.try[aria-pressed=true], .wdtile.try { border-style: dashed; border-color: #c46a00; background: var(--you, #fff7e0); box-shadow: none; }
.wdtile:disabled { cursor: default; border-style: dotted; } .wdtile:disabled img, .wdtile:disabled .avatar, .wdtile:disabled .wdemo { opacity: .55; }
.wdtile.sw { padding: 8px 4px 5px; } .wdsw { width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); }
.wdtxt { min-height: 46px; display: grid; place-items: center; font: 700 17px/1.1 var(--fd); padding: 0 2px; overflow-wrap: anywhere; } .wdtxt .ttl { white-space: normal; font-size: 12.5px; }
.wdemo { font-size: 36px; line-height: 60px; } .wdemo.sm { font-size: 19px; line-height: 1.5; letter-spacing: 1px; max-width: 84px; }
.wdtile.cos .avatar { margin: 8px 0; }
.wdtile.pet .palno { position: absolute; top: 5px; left: 5px; } .wdtile.pet .palpic { margin: 0; }
.wd.creator .cart { grid-area: cart; position: static; box-shadow: none; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; max-height: 150px; overflow: auto; }
.wd .cartact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; } .wd .cartact .btn { white-space: nowrap; min-height: 44px; }
.wd .cartitem small { font-weight: 500; } .wd.creator .cartlist > b { color: var(--tx, #6b4a3c); }
.wd .cartitem:not(:last-child)::after { content: '·'; margin-left: 2px; opacity: .5; }
.wdfoot { grid-area: foot; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wd button:focus-visible { outline: 3px solid var(--chili); outline-offset: 2px; }
body.sky.night:not(.in-game) .wdtile[aria-pressed=true], body.sky.night:not(.in-game) .wdchips button[aria-pressed=true] { border-color: var(--lantern); }
body.sky.night:not(.in-game) .wdrail button[aria-pressed=true] { background: var(--lantern); color: #3b2219; }
body.sky.night:not(.in-game) .wdsw { border-color: var(--edge); }
@media (max-width: 860px) {
  .modal:has(.wdsheet) { padding: 0; }
  .sheet.wdsheet { width: 100%; height: 100dvh; border-radius: 0; border-width: 0; padding: 12px; }
  .wd.creator, .wd.creator.first { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; grid-template-areas: "head" "side" "rail" "body" "cart" "foot"; gap: 8px; }
  .wd.creator.first { grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; grid-template-areas: "head" "intro" "side" "rail" "body" "foot"; }
  .wdhead h2 { font-size: 22px; } .wdintro { font-size: 14px; }
  .wdside { flex-direction: row; align-items: stretch; }
  .wd.creator .pv3d { flex: none; width: 118px; height: 150px; min-height: 0; }
  .wdme { flex: 1; gap: 6px; justify-content: space-between; } .wdplate { min-height: 0; padding: 5px 8px; } .wdplate .petpal { display: none; }
  .wd.creator .namecol label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wd.creator .pvbar { flex-direction: row; align-items: center; gap: 6px; } .wd .pvbar .btn.sm { padding: 5px 9px; font-size: 14px; }
  .wdrail { flex-direction: row; border-right: 0; border-bottom: 3px dashed var(--edge, #e6cfbd); padding: 0 0 6px; gap: 2px; scrollbar-width: none; }
  .wdrail button { white-space: nowrap; padding: 6px 11px; font-size: 15px; } .wdgrp { display: none; }
  .wdsub { align-items: center; } .wdchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .wdchips button { flex: none; padding: 0 12px; }
  .wd .wdfilt button { min-height: 40px; padding: 5px 9px; font-size: 14px; }
  .wdgrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .wd.creator .cart { max-height: none; overflow: visible; padding: 8px 10px; flex-wrap: nowrap; gap: 8px; } .wd .cartact small, .wd .cartitem .btn { display: none; }
  .wd .cartlist { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 6px 10px; font-size: 14px; } .wd .cartlist > b { display: none; }
  .wd .cartact { flex: none; flex-wrap: nowrap; gap: 6px; } .wd .cartact .btn { padding-left: 12px; padding-right: 12px; font-size: 15px; }
}
.wd .cartitem { flex: none; }
.wd.creator.first .wdrail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 3px dashed var(--edge, #e6cfbd); padding: 0 0 8px; overflow: visible; }

/* ---------- profile isle variants ---------- */
/* Bought skies behind the isle: the frame round the 3D isle takes the sky's colours (public/isle3d.js draws the rest). */
.isk1, body.night .isk1, .wd.creator .pvisle.isk1, body.sky.night:not(.in-game) .creator .pv3d.isk1 { background: linear-gradient(#4b3a8f, #ff7a6a 58%, #ffc27a); }
.isk2, body.night .isk2, .wd.creator .pvisle.isk2, body.sky.night:not(.in-game) .creator .pv3d.isk2 { background: linear-gradient(#0c1236, #2d2b63 60%, #4a3f8a); }
.isk3, body.night .isk3, .wd.creator .pvisle.isk3, body.sky.night:not(.in-game) .creator .pv3d.isk3 { background: linear-gradient(#06142e, #123a55 55%, #2b2856); }
.isk4, body.night .isk4, .wd.creator .pvisle.isk4, body.sky.night:not(.in-game) .creator .pv3d.isk4 { background: linear-gradient(#6ec0f5, #bfe6ff 60%, #eaf8ff); }
.wd.creator .pvisle { background: linear-gradient(#8fd0f7, #d9f1ff); position: relative; cursor: pointer; }
body.sky.night:not(.in-game) .wd.creator .pvisle:not([class*=isk]) { background: linear-gradient(#1c1a4a, #3a3478); }
.wd.creator .pvisle .hero3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wd.creator .pv3d[hidden] { display: none; }
.wd.isleview .pvbar .pvseg { visibility: hidden; }
.wdtile img.islepic { width: 92px; height: 92px; object-fit: contain; border-radius: 12px; }
.wdtile img.islepic[class*=isk], .wdtile img.islepic[data-isle^="ik:0"] { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.wdtile img.islepic[data-isle^="ik:0"] { background: linear-gradient(#8fd0f7, #d9f1ff); }
/* ---------- hub layout: open tables + chat | hero + games | today + rankings ---------- */
/* Desktop (1100px and up) is three columns with both side columns always in view. Below that the hub is one
   column and a tab bar at the bottom switches between Games, Tables, Chat and Rankings. */
.wrap.hubgrid { max-width: 1760px; display: grid; column-gap: 28px; align-items: start; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "right" "mid" "left"; }
.hubgrid > .hero { grid-area: hero; } .hubgrid > .hubmid { grid-area: mid; }
.hubgrid > .hubside.left { grid-area: left; } .hubgrid > .hubside.right { grid-area: right; }
.hubside { display: flex; flex-direction: column; gap: 22px; }
.hubside > section { display: flex; flex-direction: column; gap: 10px; }
.sidehead { display: flex; align-items: center; gap: 10px; } .sidehead h2, .ghead h2 { margin: 0; font-size: 28px; }
.tcount:not(:empty) { font-family: var(--fd); font-weight: 700; font-size: 14px; font-style: normal; background: var(--mint); color: #3b2219; border: 2px solid var(--ink); border-radius: 999px; padding: 0 9px; }
.sidenote { margin: -2px 0 2px; font-size: 14px; color: var(--muted2, var(--muted)); }
.livedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 7px; vertical-align: 1px; }
.btn.tall { align-self: stretch; }

/* top bar: brand, coins, account, day/night */
.top .me.coinbtn { margin-left: auto; }
.me.acctbtn { position: relative; gap: 8px; }
.me.acctbtn .aname { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me.acctbtn .acaret { font-size: 13px; opacity: .7; transition: transform .2s; } .me.acctbtn[aria-expanded=true] .acaret { transform: rotate(180deg); }
.me.acctbtn .frbadge { top: -6px; left: 28px; right: auto; }
.acctwrap { position: fixed; inset: 0; z-index: 40; }
.acctmenu { position: absolute; top: var(--at, 76px); right: var(--ar, 16px); width: min(310px, calc(100vw - 16px)); max-height: calc(100dvh - var(--at, 76px) - 12px); overflow-y: auto; padding: 12px;
  background: var(--pan, var(--cream)); color: var(--tx, var(--ink)); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink), 0 18px 40px #0004; display: flex; flex-direction: column; gap: 8px; animation: popin .22s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: top right; }
.awho { display: flex; align-items: center; gap: 10px; } .awho > div { display: flex; flex-direction: column; min-width: 0; }
.awho b { font-family: var(--fd); font-weight: 600; font-size: 19px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.awho span, .axp { font-size: 13px; color: var(--muted2, #8a6a5c); margin: 0; }
.acctmenu .xpbar { height: 14px; background: var(--edge, #e3c7ad); }
.amini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.amini div { background: var(--pan2, #ffe9cf); border-radius: 12px; padding: 5px 4px; display: flex; flex-direction: column; line-height: 1.2; }
.amini b { font-family: var(--fd); font-weight: 600; font-size: 19px; font-variant-numeric: tabular-nums; } .amini span { font-size: 12px; color: var(--muted2, #8a6a5c); }
.aitems { display: flex; flex-direction: column; gap: 2px; border-top: 2px dashed var(--edge, #e3c7ad); padding-top: 8px; }
.aitems hr { width: 100%; border: 0; border-top: 2px dashed var(--edge, #e3c7ad); margin: 6px 0; }
.aitems button { white-space: nowrap; position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 12px; background: none; color: inherit; font-family: var(--fd); font-weight: 500; font-size: 17px; text-align: left; cursor: pointer; }
.aitems button:hover, .aitems button:focus-visible { background: var(--pan2, #ffe9cf); }
.aitems small { margin-left: auto; font: 600 12px 'Nunito', system-ui, sans-serif; color: var(--muted2, #8a6a5c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20ch; }
.aitems .aico { width: 24px; text-align: center; flex: none; }
.aitems .frbadge { position: static; margin-left: auto; }
.sheet.statsheet .mecard { margin-top: 12px; }

/* hero: one band */
.hubgrid .hero { padding-block: 20px 6px; gap: 20px; flex-wrap: nowrap; }
.hubgrid .hero > div:first-child { gap: 14px; flex: 1 1 0; }
.hubgrid .hero h1 { font-size: clamp(30px, 2.6vw, 44px); }
.hubgrid .hero p { font-size: 17px; }
.hubgrid .herorow { gap: 12px; flex-wrap: nowrap; } .hubgrid .herorow .btn.big { min-height: 54px; padding: 8px 20px; font-size: 19px; white-space: nowrap; }
.hubgrid .codeform { padding: 4px 4px 4px 12px; gap: 6px; flex: 0 0 auto; } .hubgrid .codeform label { font-size: 14px; white-space: nowrap; } .hubgrid .code-in { width: 88px; font-size: 19px; letter-spacing: 4px; min-height: 42px; } .hubgrid .codeform .btn { min-height: 42px; padding: 6px 14px; }
.hubgrid .livestats { margin: 0; }
.hubgrid .hero .art, body.sky:not(.in-game) .hubgrid .hero .art.sky3d { flex: 0 0 clamp(160px, 15vw, 250px); height: clamp(170px, 16vw, 240px); min-height: 0; }

/* games: compact cards with filters */
.ghead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 22px 0 14px; }
.gfilt { display: flex; flex-wrap: wrap; gap: 8px; }
.gfilt button { font-family: var(--fd); font-weight: 600; font-size: 15px; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 3px solid var(--ink); background: var(--chip, #fff); color: var(--tx, var(--ink)); cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform .12s; }
.gfilt button i { font-style: normal; font-size: 12px; opacity: .7; }
.gfilt button[aria-pressed=true] { background: var(--lantern); color: #3b2219; transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.field.gfind { margin-left: auto; flex: 0 1 190px; width: 120px; min-height: 40px; padding: 4px 14px; font-size: 15px; border-radius: 999px; background: var(--chip, #fff); color: var(--tx, var(--ink)); }
.games.mini, body.sky:not(.in-game) .games.mini { grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); gap: 30px 16px; row-gap: 30px; padding-bottom: 10px; }
.gmini[hidden] { display: none; }
.gmini { border-radius: 18px; }
body.sky:not(.in-game) .gmini { box-shadow: 0 5px 0 var(--ink), 0 10px 0 var(--grass), 0 13px 0 var(--ink); }
body.sky:not(.in-game) .gmini::after { display: none; }
.gmini .pic, body.sky:not(.in-game) .gmini .pic { position: relative; height: 104px; border-radius: 15px 15px 0 0; }
.gmini .body { padding: 10px 12px 12px; gap: 8px; align-items: flex-start; }
.gmini h3 { font-size: 18px; line-height: 1.15; }
.gmini .tag { font-size: 12px; padding: 2px 8px; }
.gmini .btn { align-self: stretch; margin-top: auto; }
.gopen { position: absolute; top: 8px; left: 8px; font-family: var(--fd); font-weight: 700; font-size: 12px; background: var(--mint); color: #3b2219; border: 2px solid var(--ink, #3b2219); border-radius: 999px; padding: 0 8px; }
.ghelp { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #3b2219; background: #fffd; color: #3b2219; font-family: var(--fd); font-weight: 700; font-size: 15px; line-height: 1; cursor: pointer; opacity: .85; }
.ghelp:hover, .ghelp:focus-visible { opacity: 1; transform: scale(1.1); }
.ghelp::after { content: ''; position: absolute; inset: -8px; } /* a comfortable tap target */

/* left column: open tables, then chat */
:is(.hubside, .tlist) .trow { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-areas: "av who btn" "av dots code"; gap: 4px 10px; padding: 10px 12px; align-items: center; }
:is(.hubside, .tlist) .trow > .avatar { grid-area: av; align-self: start; width: 42px; height: 42px; } :is(.hubside, .tlist) .trow .who { grid-area: who; }
:is(.hubside, .tlist) .trow .who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.hubside, .tlist) .trow .who span { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.hubside, .tlist) .trow .dots { grid-area: dots; gap: 3px; flex-wrap: wrap; } :is(.hubside, .tlist) .trow .dots i { width: 10px; height: 10px; border-width: 2px; }
:is(.hubside, .tlist) .trow .tcode { grid-area: code; justify-self: end; font-size: 14px; }
:is(.hubside, .tlist) .trow .btn { grid-area: btn; min-height: 36px; padding: 4px 14px; align-self: start; }
.empty.tnone { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 15px; text-align: left; }
.sheet.listsheet { width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
.sheet.listsheet .tlist .trow, .sheet.listsheet .rk li { background: var(--pan2, #ffe9cf); border: 2px solid var(--edge, #e3c7ad); color: var(--tx, var(--ink)); box-shadow: none; }
.sheet.listsheet .trow .who span, .sheet.listsheet .rk .sub, .sheet.listsheet .rknote { color: var(--muted2, #8a6a5c); }
.sheet.listsheet .dots i { border-color: var(--tx, var(--ink)); } .sheet.listsheet .dots i.on { background: var(--tx, var(--ink)); }
.sheet.listsheet .tcode, .sheet.listsheet .rk .pos { color: #d9532f; } body.night .sheet.listsheet .tcode, body.night .sheet.listsheet .rk .pos { color: var(--lantern); }
.sheet.listsheet .rk li.you { background: var(--you, #fff0c9); outline: 3px solid var(--ink); }
.sheet.listsheet .rk li[data-prof] { cursor: pointer; }
.rkall { display: flex; flex-direction: column; gap: 10px; }

/* right column: today, then rankings */
.today { display: flex; flex-direction: column; gap: 10px; }
.ttile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--pan, var(--plum2)); color: var(--tx, var(--cream)); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
.ttile .tpic { flex: none; width: 54px; height: 54px; border-radius: 14px; border: 3px solid var(--ink); overflow: hidden; display: grid; place-items: center; background: #bfe8ff; }
.ttile .tpic svg { width: auto; height: 100%; max-width: none; display: block; }
.ttile.t-mp .tpic { background: linear-gradient(160deg, #ffe9a8, #ffc2d6); } .ttile.t-mp.done .tpic { background: linear-gradient(160deg, #c9f2c6, #a8e0f5); }
.ttile.t-hay .tpic { background: linear-gradient(160deg, #fff1b8, #ffd08a); } .ttile.t-farm .tpic { background: linear-gradient(160deg, #d6f5c4, #a8e0f5); }
.ttile .tpic svg { height: 84%; }
.ttile .tbody { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ttile .tbody b { font-family: var(--fd); font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ttile .tbody b small { font-size: 13px; font-weight: 500; opacity: .7; }
.ttile .tbody span { font-size: 13px; color: var(--muted2, var(--muted)); }
.ttile .tbody .ok { font-style: normal; font-weight: 800; color: #2f8a4b; } body.night .ttile .tbody .ok { color: #8fe3b0; }
.ttile .btn { flex: none; min-width: 64px; }
.rkcard .field.rksel { width: 100%; min-height: 44px; padding: 6px 12px; font-size: 16px; border-radius: 14px; background: var(--chip, #fff); color: var(--tx, var(--ink)); cursor: pointer; }
.hubside .rkcard { padding: 12px; border-radius: 20px; gap: 10px; }
.hubside #rk-body { display: flex; flex-direction: column; gap: 10px; }
.hubside .rk li { grid-template-columns: 24px 36px minmax(0, 1fr) auto; grid-template-areas: "pos av who main" "pos av sub sub"; column-gap: 8px; padding: 7px 10px 7px 6px; min-height: 0; }
.hubside .rk .pos { font-size: 16px; } .hubside .rk .main { font-size: 16px; align-self: center; }
.hubside .rk .sub { justify-self: start; font-size: 12px; white-space: normal; }

/* the phone tab bar */
.hubtabs { display: none; }

@media (min-width: 1100px) {
  .wrap.hubgrid { padding-inline: 24px; grid-template-columns: 290px minmax(0, 1fr) 330px; grid-template-areas: "left hero right" "left mid right"; }
  .hubside { grid-row: 1 / span 2; position: sticky; top: 12px; padding-top: 20px; }
  .hubside.left { height: calc(100vh - 104px); } /* tables take what they need, the chat fills the rest with its send box on screen */
  .hubside.left #hubchat { flex: 1 1 0; min-height: 260px; }
  .hubside.left .hccard { flex: 1; min-height: 0; } .hubside.left .hclog { height: auto; flex: 1; min-height: 0; }
  .hubside.right { max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-width: thin; padding-inline: 4px; margin-inline: -4px; padding-bottom: 10px; }
}
@media (min-width: 1100px) and (max-width: 1299px) {
  .wrap.hubgrid { grid-template-columns: 250px minmax(0, 1fr) 290px; column-gap: 20px; padding-inline: 16px; }
  .hubgrid .hero .art { display: none; }
  .ttile .tpic { width: 46px; height: 46px; } .ttile { gap: 9px; padding: 9px 10px; }
}
@media (min-width: 1800px) {
  .wrap.hubgrid { max-width: 2400px; padding-inline: 40px; column-gap: 40px; grid-template-columns: 360px minmax(0, 1fr) 420px; }
  .games.mini, body.sky:not(.in-game) .games.mini { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .gmini .pic, body.sky:not(.in-game) .gmini .pic { height: 124px; } .gmini h3 { font-size: 21px; }
}
@media (max-width: 1099px) {
  .wrap.hubgrid { padding-bottom: 96px; }
  .hubgrid:not([data-tab=games]) > .hero, .hubgrid:not([data-tab=games]) > .hubmid, .hubgrid:not([data-tab=games]) #today { display: none; }
  .hubgrid:not([data-tab=tables]) #tables, .hubgrid:not([data-tab=chat]) #hubchat, .hubgrid:not([data-tab=rank]) #rankings { display: none; }
  .hubgrid[data-tab=games] > .hubside.left, .hubgrid[data-tab=tables] > .hubside.right, .hubgrid[data-tab=chat] > .hubside.right, .hubgrid[data-tab=rank] > .hubside.left { display: none; }
  .hubgrid:not([data-tab=games]) > .hubside { padding-top: 18px; }
  .hubgrid[data-tab=chat] .hclog { height: calc(100dvh - 330px); min-height: 220px; }
  .hubgrid .hero { padding-block: 12px 0; } .hubgrid .hero .art { display: none; }
  .hubgrid .hero h1 { font-size: clamp(26px, 6vw, 38px); line-height: 1.14; } .hubgrid .hero p { font-size: 15px; }
  .hubgrid .herorow { flex-wrap: wrap; } .hubgrid .codeform label { display: none; } .hubgrid .codeform { padding-left: 4px; }
  .hubside.right { margin-top: 18px; }
  .today { flex-direction: row; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * max(4vw, 16px)); padding: 2px max(4vw, 16px) 8px; scroll-snap-type: x proximity; }
  .today::-webkit-scrollbar { display: none; }
  .today .ttile { flex: 0 0 min(300px, 82vw); scroll-snap-align: center; }
  .gfilt { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * max(4vw, 16px)); padding: 2px max(4vw, 16px) 6px; flex: 1 1 100%; } .gfilt::-webkit-scrollbar { display: none; }
  .gfilt button { flex: none; }
  .field.gfind { margin-left: 0; flex: 1 1 100%; width: auto; order: 3; }
  .games.mini, body.sky:not(.in-game) .games.mini { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 12px; }
  .gmini .pic, body.sky:not(.in-game) .gmini .pic { height: 84px; } .gmini h3 { font-size: 16px; }
  body.sky footer { margin-bottom: 84px; }
  .hubtabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 6px max(4px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
    background: var(--pan, var(--cream)); border-top: 3px solid var(--ink); }
  .hubtabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 52px; padding: 2px; border: 0; background: none; cursor: pointer; font-family: var(--fd); font-weight: 600; font-size: 12.5px; color: var(--muted2, #8a6a5c); }
  .hubtabs button span { font-size: 22px; line-height: 1.2; filter: grayscale(.5); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
  .hubtabs button[aria-selected=true] { color: var(--tx, var(--ink)); } .hubtabs button[aria-selected=true] span { filter: none; transform: translateY(-2px) scale(1.12); }
  .hubtabs button[aria-selected=true]::before { content: ''; position: absolute; top: -9px; width: 36px; height: 5px; border-radius: 0 0 5px 5px; background: var(--lantern); border: 2px solid var(--ink); border-top: 0; }
  .hubtabs .tcount { position: absolute; top: 0; left: calc(50% + 8px); font-size: 11px; padding: 0 6px; }
  /* the account menu slides up as a sheet above the tab bar */
  .acctwrap { background: #160a1288; z-index: 44; }
  .acctmenu { top: auto; right: 0; left: 0; bottom: 0; width: auto; max-height: calc(100dvh - 60px); border-radius: 24px 24px 0 0; border-bottom: 0; padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); box-shadow: 0 -5px 0 var(--ink); animation: sheetup .25s cubic-bezier(.3, 1.2, .5, 1) both; }
  .top .me.acctbtn .aname, .top .me.acctbtn .acaret { display: none; } .top .me.acctbtn { padding-right: 8px; }
}
@keyframes sheetup { from { transform: translateY(40%); opacity: 0; } }
@media (max-width: 600px) { .top .me.acctbtn .lvslot { display: none; } .top .me.acctbtn { padding: 3px; } .top .me.coinbtn { margin-right: 0; } .top { gap: 8px; } .brand { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .acctmenu { animation: none; } }

/* ---------- card backgrounds (cosmetics.js, kind pb): the picture behind a player's name on their card ----------
   The card gets .haspb and an <i class="pbg pbN"> as its first child. The art is on the <i>; ::before is the layer that
   moves (transform and opacity only, so it never repaints), ::after is a wash in the card's own colour that keeps the
   name readable in both day and night. Dark art (.pbd on the card) turns the text light instead. */
.haspb { position: relative; --pbs: var(--pan, var(--cream)); } .haspb > :not(.pbg) { position: relative; z-index: 1; }
.pbg { position: absolute; inset: 0; z-index: 0; border-radius: var(--pbr, 13px); overflow: hidden; pointer-events: none; background: right center / cover no-repeat; }
.pbg::before, .pbg::after { content: ''; position: absolute; inset: 0; }
.pbg::after { background: linear-gradient(90deg, color-mix(in srgb, var(--pbs) 86%, transparent) 0 40%, color-mix(in srgb, var(--pbs) 62%, transparent) 66%, color-mix(in srgb, var(--pbs) 8%, transparent) 96%); }
.haspb .ttl { background: color-mix(in srgb, var(--lantern, #ffb84a) 45%, var(--pbs)); } .haspb > div > span:not(.ttl), .haspb small { text-shadow: 0 0 3px var(--pbs), 0 0 3px var(--pbs), 0 0 6px var(--pbs); }
.wdplate.haspb { --pbs: var(--chip, #fff); } .seat.haspb { --pbr: 17px; }
.haspb.pbd { --pbs: #17143a; --tx: #f7f3ff; --tx2: #dcdcff; --muted2: #c9ccf0; color: var(--tx); } .seat.full.haspb.pbd span:not(.ttl):not(.nmfx):not(.lv), .haspb.pbd small { color: var(--muted2); }
.haspb.pbd .ttl, .haspb.pbd h2, .haspb.pbd b { color: #f7f3ff; } .phead.haspb.pbd, .wdplate.haspb.pbd { border-color: #0e0c22; }
.phead.haspb { border: 3px solid var(--tx, var(--ink)); border-radius: 18px; padding: 14px 16px; --pbr: 15px; }
.awho.haspb { padding: 8px 10px; border: 2.5px solid var(--edge, #e3c7ad); border-radius: 14px; --pbr: 11px; }
/* patterns: soft shapes on a light tint of the card's own colour, no wash needed */
.pb1, .pb2, .pb3, .pb4, .pb5 { background: color-mix(in srgb, var(--pt) 20%, transparent); }
.pb1::before, .pb3::before, .pb4::before, .pb5::before { background: var(--pi) 0 0 / var(--ps) repeat; opacity: .5; }
.pb1::after, .pb2::after, .pb3::after, .pb4::after, .pb5::after { background: linear-gradient(90deg, color-mix(in srgb, var(--pbs) 45%, transparent) 30%, transparent 80%); }
.pb1 { --pt: #f2a65a; --pi: url(cardbg/paws.svg); --ps: 60px; }
.pb2 { --pt: #7ed3b2; } .pb2::before { background: conic-gradient(var(--pt) 25%, transparent 0 50%, var(--pt) 0 75%, transparent 0) 0 0 / 30px 30px; opacity: .3; }
.pb3 { --pt: #b9a2f2; --pi: url(cardbg/stars.svg); --ps: 56px; }
.pb4 { --pt: #ff8fab; --pi: url(cardbg/hearts.svg); --ps: 54px; }
.pb5 { --pt: #ffd166; --pi: url(cardbg/confetti.svg); --ps: 72px; } .pb5::before { opacity: .7; }
/* game scenes */
.pb6 { background-image: url(cardbg/hotpot.svg); } .pb7 { background-image: url(cardbg/bean.svg); } .pb8 { background-image: url(cardbg/farm.svg); }
.pb9 { background-image: url(cardbg/kart.svg); } .pb10 { background-image: url(cardbg/cards.svg); }
/* animated: one sliding or blinking layer each */
.pb11 { background: linear-gradient(#8fd0ff, #d6f0ff); }
.pb11::before { right: -360px; background: url(cardbg/clouds.svg) 0 50% / 360px 120px repeat; animation: pbslide 38s linear infinite; will-change: transform; }
.pb12 { background-image: url(cardbg/petals-base.svg); }
.pb12::before { top: -240px; background: url(cardbg/petals.svg) 100% 0 / 180px 240px repeat; animation: pbfall 9s linear infinite; will-change: transform; }
.pb13 { background-image: url(cardbg/night-base.svg); }
.pb13::before { background: url(cardbg/night-stars.svg) 100% 0 / 180px 120px repeat; animation: pbtwinkle 1.9s ease-in-out infinite alternate; will-change: opacity; }
.pb13::after { background: linear-gradient(90deg, color-mix(in srgb, var(--pbs) 55%, transparent) 0 30%, transparent 75%); }
@keyframes pbslide { to { transform: translateX(-360px); } }
@keyframes pbfall { to { transform: translateY(240px); } }
@keyframes pbtwinkle { from { opacity: .2; } to { opacity: 1; } }
/* earned */
.pb14 { background-image: url(cardbg/podium.svg); } .pb16 { background-image: url(cardbg/eggs.svg); } .pb17 { background-image: url(cardbg/parade.svg); }
.pb15 { background-image: url(cardbg/gold.svg); }
.pb15::before { left: -40%; right: auto; width: 26%; background: linear-gradient(90deg, transparent, #ffffffb0, transparent); transform: skewX(-20deg); animation: pbshine 4.2s ease-in-out infinite; will-change: transform; }
@keyframes pbshine { 0%, 45% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(700%) skewX(-20deg); } }
/* the wardrobe tile */
.wdbg { position: relative; width: 92px; height: 54px; margin: 6px 0 4px; border: 2.5px solid var(--tx, var(--ink)); border-radius: 12px; background: var(--chip, #fff); --pbs: var(--chip, #fff); --pbr: 9px; }
.wdbg.none { border-style: dashed; opacity: .6; }
.wdbg .pbg::after { opacity: .35; }
.wdbg em { position: absolute; right: 3px; bottom: 3px; z-index: 1; font: 700 10px/1 var(--fb, inherit); font-style: normal; letter-spacing: .03em; padding: 2px 5px; border-radius: 999px; background: var(--ink); color: #fff; }
.wdtile:disabled .wdbg { opacity: .7; }

/* ---------- rank emblems (rankicons.js) ---------- */
.rkic { display: block; width: 1em; height: 1em; flex: none; overflow: visible; }
.lv .rkic { width: 1.25em; height: 1.25em; }
.lv .lvst { font-style: normal; font-size: .78em; background: var(--ink); color: #fff4e2; border-radius: 999px; padding: 1px 5px; }
.rankicon .rkic { width: 52px; height: 52px; }
.toast .tic { display: inline-block; vertical-align: -.3em; font-size: 1.5em; }
.ladder summary { cursor: pointer; font-family: var(--fd); font-weight: 700; }
.ladder ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ladder li { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 10px 6px; border: 2px solid var(--edge, var(--line)); border-radius: 16px; opacity: .55; }
.ladder li .rkic { width: 44px; height: 44px; filter: grayscale(1); }
.ladder li span { font-size: 12px; }
.ladder li.got { opacity: 1; } .ladder li.got .rkic { filter: none; }
.ladder li.now { border-color: var(--lantern); box-shadow: 0 0 0 2px var(--lantern); }
.ladder li.more { grid-column: 1 / -1; opacity: 1; flex-direction: row; justify-content: center; font-size: 13px; }

/* ---------- language switch (PL / EN) ---------- */
/* A two-letter pill beside the day/night switch: the language you are in is filled, the other one is what a tap gives you. */
.langbtn { display: inline-flex; align-items: center; gap: 2px; height: 48px; padding: 0 5px; border-radius: 24px; cursor: pointer; font: 700 14px/1 var(--fd, inherit); letter-spacing: .03em;
  background: var(--plum2); border: 3px solid var(--line); color: var(--cream); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.langbtn b, .langbtn span { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 16px; }
.langbtn b { background: var(--ink); color: #fff; } .langbtn span { opacity: .7; }
.langbtn:hover { transform: scale(1.05); } .langbtn:hover span { opacity: 1; } .langbtn:active { transform: scale(.94); }
body.sky:not(.in-game) .langbtn { background: var(--pan); border-color: var(--ink); color: var(--tx, var(--ink)); box-shadow: 0 4px 0 var(--ink); }
body.sky.night:not(.in-game) .langbtn b { background: var(--lantern); color: #1b1030; }
.wdhead .langbtn { height: 44px; box-shadow: none; }
/* On phones the top bar has no room for it: the language is in the account sheet (the You tab) and on the welcome window. */
@media (max-width: 600px) { .top .langbtn { display: none; } }
/* Polish words run longer: let a Today tile's title take two lines instead of being cut off. */
html[lang=pl] .ttile .tbody b { white-space: normal; line-height: 1.1; font-size: 17px; }

/* the optional Ko-fi link in the hub footer */
footer .kofi { display: inline-block; margin-top: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
footer .kofi:hover { color: var(--tx, var(--ink)); }
/* the Support window */
.suppics { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 10px 0; }
.suppics figure { margin: 0; text-align: center; }
.suppics img { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--pan2, #ffe9cf); border: 2px solid var(--edge, #e3c7ad); display: block; }
.suppics figcaption { font: 600 11px/1.2 'Nunito', system-ui, sans-serif; margin-top: 3px; color: var(--muted2, #8a6a5c); overflow-wrap: anywhere; }
.supsteps { margin: 8px 0; padding-left: 22px; display: grid; gap: 8px; }
.supname { border: 2px dashed var(--edge, #e3c7ad); border-radius: 10px; background: var(--pan2, #ffe9cf); color: inherit; font: inherit; padding: 2px 10px; cursor: pointer; }
.suprow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.suprow a.btn { text-decoration: none; text-align: center; }
.supok { font-weight: 700; }
.supclaim { border-top: 2px dashed var(--edge, #e3c7ad); margin: 6px 0 12px; padding-top: 4px; }
@media (max-width: 560px) { .suppics { grid-template-columns: repeat(4, 1fr); } }
