/* Ludo Stars — vibrant "starry night" theme */
:root {
  --bg: #e8287f;     /* gameflare-style hot pink */
  --bg-d: #b9145f;
  --night: #2d1b4e;
  --night2: #3a1c8f;
  --violet: #6b3cf0;
  --violet-d: #4a22b8;
  --ink: #23164f;
  --muted: #7a6fa3;
  --panel: #ffffff;
  --soft: #f3effd;
  --line: #e4ddf8;
  --star: #ffc93c;
  --star-d: #e0a100;
  --red: #ff4757;   --red-d: #c9283a;
  --green: #2ed573; --green-d: #1a9e50;
  --yellow: #ffc312;--yellow-d: #d39b00;
  --blue: #1e90ff;  --blue-d: #1565c0;
  --orange: #ff8a2a;--orange-d: #d4600a;
  --radius: 22px;
  --font: "Nunito", "Arial Rounded MT Bold", "Segoe UI Black", "Segoe UI", system-ui, sans-serif;
  --hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Marker Felt", "Comic Sans MS", cursive;
  font-family: var(--font);
  color: var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* No scrollbar line, no pull-to-refresh, and when the page is dragged past
   its ends you see the theme colours (not white). */
html {
  /* no background here: body's solid colour then becomes the page canvas,
     which browsers also use for overscroll and their own top/bottom bars */
  scrollbar-width: none; overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { width: 0; height: 0; display: none; }
.log, .modal, .tx { scrollbar-width: none; }
/* Pink lobby: a soft tilted checker with a glow in the middle, painted on the page itself
   (not on a layer pinned to the screen). The page background is what phones draw under
   their status bar and the browser's bottom bar, so the checker runs right to the screen
   edges there too, instead of those areas turning into flat pink bands. The tile is an
   exactly repeating 655px square of the checker tilted by atan(2/7) ≈ 16°, so it has no seams. */
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; overscroll-behavior: none;
  background:
    radial-gradient(70vmax 55vmax at 50% 42%, #ff7cc04d, transparent 70%) no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='655' height='655'%3E%3Cpattern id='c' width='90' height='90' patternUnits='userSpaceOnUse' patternTransform='scale(0.99968) rotate(-15.9454)'%3E%3Cpath d='M45 0h45v45H45zM0 45h45v45H0z' fill='%23fff' fill-opacity='.078'/%3E%3C/pattern%3E%3Crect width='655' height='655' fill='url(%23c)'/%3E%3C/svg%3E") 0 0 / 655px 655px,
    var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}
button, .tok, .pbadge, .die, .emo-tray { touch-action: manipulation; }
.game, .pbadge, .die, .chip, .btn, .gtile { -webkit-user-select: none; user-select: none; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -.01em; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10;
  padding: calc(10px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 10px max(22px, env(safe-area-inset-left));
  background: #c8156a8c; -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: 0 3px 0 #0000002a;
}
/* Phones and tablets: the header sits on the checker like on the start page. A bar stuck
   to the top makes the phone's browser paint its status bar in that bar's flat colour. */
@media (hover: none), (max-width: 960px) {
  .top { position: relative; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.me-chip { padding: 4px 12px 4px 4px; }
.ava.sm { width: 30px; height: 30px; font-size: 16px; background: var(--violet); box-shadow: inset 0 -2px 0 #0003; }
.ava-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0 18px; }
.ava-pick { aspect-ratio: 1; border-radius: 18px; border: 0; background: var(--soft); font-size: 28px; cursor: pointer; box-shadow: inset 0 -4px 0 #0000000f; transition: transform .15s cubic-bezier(.3,1.6,.5,1), background .15s; }
.ava-pick:hover { transform: scale(1.1) rotate(-6deg); }
.ava-pick.on { background: var(--star); box-shadow: 0 4px 0 var(--star-d); transform: scale(1.08); }
button.ava { border: 0; padding: 0; cursor: pointer; position: relative; font: inherit; font-weight: 900; font-size: 22px; color: #fff; aspect-ratio: 1; }
button.ava .pen { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--violet); font-size: 12px; font-style: normal; display: grid; place-items: center; box-shadow: 0 2px 0 #0003; text-shadow: none; }
button.ava:hover { transform: scale(1.08) rotate(-5deg); }
.seat .ava { font-size: 22px; width: 44px; height: 44px; border: 2.5px solid var(--ink); border-radius: 50%; }
/* your own picture keeps its pencil badge outside the circle; the photo is clipped round itself */
button.ava.mine { overflow: visible; }
button.ava.mine .ava-img { border-radius: 50%; }
/* reconnecting pill */
.net-status { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 40; background: #fff; color: var(--ink); font-weight: 900; font-size: 14px; padding: 8px 16px; border-radius: 999px; box-shadow: 0 4px 0 var(--orange-d), 0 10px 30px #0005; border: 3px solid var(--orange); transition: opacity .25s, transform .25s; }
.net-status.show { opacity: 1; transform: translate(-50%, 0); }
.net-status::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--orange); animation: blink 1s infinite; vertical-align: 0; }
@keyframes blink { 50% { opacity: .2; } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; text-decoration: none; color: #fff; text-shadow: 0 3px 0 #0004; }
.brand .accent { color: var(--star); }
.logo { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 34px; height: 34px; padding: 5px; border-radius: 11px; background: #fff; box-shadow: 0 4px 0 #0003; transform: rotate(-8deg); }
.logo i { border-radius: 50%; }
.logo .r { background: var(--red); } .logo .g { background: var(--green); } .logo .b { background: var(--blue); } .logo .y { background: var(--yellow); }
.top-right { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 0; background: #ffffff1f; color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: inset 0 0 0 2px #ffffff26; }
.chip:hover { background: #ffffff2e; }
.chip.stars { background: linear-gradient(#ffd75e, var(--star)); color: #4a2f00; box-shadow: 0 3px 0 var(--star-d); }
.chip.icon { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 18px; }
/* settings: a square button with a gear, and a panel with two volume sliders */
.chip.icon.set-btn { border-radius: 12px; }
.set-btn svg { display: block; transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.set-btn:hover svg { transform: rotate(60deg); }
.acct { margin-top: 18px; padding-top: 14px; border-top: 2.5px dashed #23164f33; }
.acct-title { display: block; font-size: 15px; letter-spacing: .04em; }
.acct p { margin: 4px 0 12px; }
.acct-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.acct-btns .btn { flex: 1 1 140px; }
.acct-btns .btn.again { --c: #ff2a3d; animation: againPulse .6s ease-in-out infinite alternate; }
.acct-btns .btn.ghost.again { background: #ffe1e4; color: #c9283a; }
@keyframes againPulse { to { transform: scale(1.04); } }
.vol-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 14px; border-radius: 18px; background: var(--soft); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.vol-ico { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--blue); color: #fff; border: 2.5px solid var(--ink); }
.vol-row + .vol-row .vol-ico { background: var(--green); }
.vol-row.zero .vol-ico { background: #b9b2d3; }
.vol-main { flex: 1; min-width: 0; }
.vol-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; margin-bottom: 6px; }
.vol-head b { font-size: 16px; letter-spacing: .04em; }
.vol-head span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
input.vol { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 14px; margin: 6px 0; border-radius: 999px; border: 2px solid var(--ink); cursor: pointer; touch-action: none;
  background: linear-gradient(90deg, var(--star) var(--p, 50%), #fff var(--p, 50%)); }
input.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
input.vol::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
input.vol::-moz-range-track { background: transparent; }
input.vol:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.star { color: var(--star-d); }
.chip.stars .star { color: #fff; text-shadow: 0 1px 0 #b57d00; }
.username { color: #fffc; font-size: 14px; font-weight: 800; }

/* ---------- layout ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 18px 22px 60px; }
.loading { color: #fffa; padding: 60px 0; text-align: center; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: 0 6px 0 #d7cdf5, 0 18px 40px #0005; padding: 20px; }
.card h2 { font-size: 20px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; font-weight: 700; }
.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-size: 12px; font-weight: 900; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
hr.sep { border: 0; border-top: 2px dashed var(--line); margin: 18px 0; }

/* ---------- chunky buttons ---------- */
.btn { --c: var(--violet); --d: var(--violet-d); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 16px; border: 0; background: linear-gradient(#ffffff38, #fff0 55%), var(--c); color: #fff; font-weight: 900; letter-spacing: .02em; cursor: pointer; box-shadow: 0 5px 0 var(--d), 0 8px 14px #0003; text-shadow: 0 2px 0 #0003; transition: transform .08s, box-shadow .08s, filter .15s; position: relative; top: 0; }
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--d), 0 3px 6px #0003; }
.btn:disabled { filter: grayscale(.7) opacity(.55); cursor: not-allowed; }
.btn.green { --c: var(--green); --d: var(--green-d); }
.btn.orange { --c: var(--orange); --d: var(--orange-d); }
.btn.gold { --c: var(--star); --d: var(--star-d); color: #4a2f00; text-shadow: 0 1px 0 #fff6; }
.btn.red { --c: var(--red); --d: var(--red-d); }
.btn.blue { --c: var(--blue); --d: var(--blue-d); }
.btn.ghost { --c: #fff; --d: #d7cdf5; color: var(--ink); text-shadow: none; background: #fff; }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 20px; font-size: 18px; border-radius: 18px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 12px; box-shadow: 0 3px 0 var(--d); }
.btn.sm:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--d); }
.input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; color: var(--ink); outline: none; font-weight: 800; -webkit-text-fill-color: var(--ink); font-size: 16px; /* 16px+ stops iPhones zooming in when typing */ }
.input::placeholder { color: #b3a9d3; -webkit-text-fill-color: #b3a9d3; letter-spacing: .12em; }
.input:focus { box-shadow: 0 0 0 4px #ffc93c88; }
.input.code { text-transform: uppercase; letter-spacing: .25em; font-weight: 900; font-size: 20px; text-align: center; }
.seg { display: inline-flex; background: var(--soft); border-radius: 14px; padding: 4px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 11px; cursor: pointer; font-weight: 900; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--violet); color: #fff; box-shadow: 0 3px 0 var(--violet-d); }
.seg button:disabled { cursor: default; }
.toggle { position: relative; width: 52px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #d9d2f0; cursor: pointer; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.6,.5,1); box-shadow: 0 2px 0 #0002; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(22px); }
.toggle input:disabled + span { cursor: default; opacity: .7; }
.pct { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pct label { font-size: 12px; color: var(--muted); font-weight: 900; }
.pct .input { padding: 9px 10px; }

/* ---------- home ---------- */
.earn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.earn .card { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.earn .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: inset 0 -4px 0 #0002; }
.earn .ico.a { background: #fff3c4; } .earn .ico.b { background: #ffe0ec; } .earn .ico.c { background: #dff1ff; }
.earn .big { font-size: 28px; font-weight: 900; line-height: 1.1; }
.earn .txt { flex: 1; min-width: 0; }
.earn .txt .muted { font-weight: 700; }
.tile { border-radius: 26px; padding: 22px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 7px 0 var(--d), 0 20px 40px #0005; }
.tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 0% 0%, #ffffff40, transparent 55%); pointer-events: none; }
.tile h2 { font-size: 28px; text-shadow: 0 3px 0 #0003; }
.tile p { margin: 4px 0 16px; font-weight: 700; opacity: .92; }
.tile .emoji { position: absolute; right: 14px; top: 8px; font-size: 64px; filter: drop-shadow(0 6px 0 #0003); transform: rotate(10deg); }
.tile.bots { background: linear-gradient(150deg, #8f5bff, #5b2fd6); --d: #3d1aa0; }
.tile.friends { background: linear-gradient(150deg, #3ee08a, #12a85a); --d: #0c7a40; }
.tile .label { color: #ffffffc0; }
.tile .seg { background: #00000026; }
.tile .seg button { color: #ffffffc0; }
.tile .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #0003; }
.tile .hint { font-size: 13px; font-weight: 700; opacity: .85; margin: 0 0 14px; }
.or { text-align: center; margin: 14px 0 10px; font: 700 17px var(--hand); display: flex; align-items: center; gap: 10px; }
.or::before, .or::after { content: ""; flex: 1; height: 0; border-top: 2.5px dashed #ffffff80; }

/* ---------- lobby ---------- */
.codebox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.code-big { font-size: 44px; font-weight: 900; letter-spacing: .16em; color: var(--violet); text-shadow: 0 4px 0 #e0d6ff; }
.seats { display: flex; flex-direction: column; gap: 10px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--soft); }
.seat.empty { background: transparent; border: 3px dashed var(--line); color: var(--muted); font-weight: 800; justify-content: center; padding: 14px; }
.ava { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #fff; flex: none; box-shadow: 0 3px 0 #0003, inset 0 -3px 0 #0002; text-shadow: 0 2px 0 #0003; }
.ava.red { background: var(--red); } .ava.green { background: var(--green); } .ava.yellow { background: var(--yellow); } .ava.blue { background: var(--blue); }
.badge { font-size: 11px; font-weight: 900; padding: 4px 8px; border-radius: 8px; background: #fff; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.badge.ok { background: var(--green); color: #fff; }
.badge.wait { background: #ffe9a8; color: #8a6400; }
.badge.host { background: var(--violet); color: #fff; }
.offline { opacity: .5; }
.lobby-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 18px; }
.terms { background: #fff7d6; border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 700; }

/* ---------- game ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.table { max-width: max(320px, min(680px, calc(100vh - 270px))); max-width: max(320px, min(680px, calc(100svh - 270px))); width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
/* phone held sideways: players beside the board instead of above and below it */
@media (orientation: landscape) and (max-height: 540px) {
  .table { display: grid; max-width: none; grid-template-columns: minmax(0, 1fr) min(calc(100vh - 116px), 58vw) minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr) min(calc(100svh - 116px), 58vw) minmax(0, 1fr);
    grid-template-areas: "tl board tr" "bl board br" ". hint ."; column-gap: 12px; row-gap: 4px; align-items: center; }
  .table .badges { display: contents; }
  .pslot[data-corner="tl"] { grid-area: tl; } .pslot[data-corner="tr"] { grid-area: tr; }
  .pslot[data-corner="bl"] { grid-area: bl; } .pslot[data-corner="br"] { grid-area: br; }
  .pslot:not(.right) { justify-content: flex-end; } .pslot.right { justify-content: flex-start; }
  .table .board-stage { grid-area: board; margin: 0; }
  .table .turn-hint { grid-area: hint; }
}
.badges { display: flex; justify-content: space-between; gap: 10px; min-height: 66px; }
.pslot { flex: 1; display: flex; }
.pslot.right { justify-content: flex-end; }
.pbadge { --pc: var(--violet); display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; background: #ffffff1c; border-radius: 999px; color: #fff; box-shadow: inset 0 0 0 2px #ffffff22; transition: background .25s, transform .25s, box-shadow .25s; max-width: 100%; }
.pslot.right .pbadge { flex-direction: row-reverse; padding: 7px 7px 7px 10px; text-align: right; }
.pbadge.turn { background: #fff; color: var(--ink); transform: scale(1.04); box-shadow: 0 5px 0 #0003, 0 0 0 4px var(--pc), 0 0 28px var(--pc); }
.pbadge.out { opacity: .45; }
.pbadge .ring { --t: 0; width: 52px; height: 52px; border-radius: 50%; padding: 4px; flex: none; background: conic-gradient(var(--pc) calc(var(--t) * 1turn), #ffffff30 0); }
.pbadge.turn .ring { background: conic-gradient(var(--pc) calc(var(--t) * 1turn), #ece6fb 0); }
.pbadge .ava { width: 44px; height: 44px; background: var(--pc); font-size: 20px; }
.pbadge .pname { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.pbadge .pmeta { font-size: 12px; font-weight: 800; opacity: .75; }
.pbadge .homepips { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 2px; }
.pbadge .homepips i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .25; }
.pbadge .homepips i.on { background: var(--pc); opacity: 1; }
.dice-slot { width: 0; transition: width .2s; display: grid; place-items: center; }
.dice-slot:not(:empty) { width: 62px; }
.board-wrap { border-radius: 30px; padding: 12px; background: linear-gradient(160deg, #8c5cff, #4b23c2); box-shadow: 0 10px 0 #2d1380, 0 30px 60px #0007, inset 0 2px 0 #ffffff55; position: relative; }
#board { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 0 #0002); overflow: visible; }
.boom-word { font: 900 1.25px var(--font); fill: #ffe14d; stroke: #4a1500; stroke-width: .12px; paint-order: stroke; letter-spacing: .03px; }
/* player status, taunts */
.pbadge { cursor: pointer; position: relative; }
.pbadge .ring { position: relative; }
.pbadge .net { position: absolute; right: -4px; top: -4px; font-size: 13px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); display: none; place-items: center; box-shadow: 0 2px 0 #0003; animation: blink 1.2s infinite; }
.pbadge.offline .net { display: grid; }
.pbadge.offline .ava, .pbadge.auto .ava { filter: grayscale(.6); }
.taunt-hint { position: absolute; top: -8px; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.pslot:not(.right) .taunt-hint { left: 34px; } .pslot.right .taunt-hint { right: 34px; }
.pbadge:hover .taunt-hint { opacity: 1; transform: translateY(-3px) rotate(-10deg); }
/* troll mode, host only: a clown on everyone else's picture says "tap me to prank" (phones too) */
.taunt-hint.troll { opacity: 1; z-index: 2; top: -10px; font-size: 17px; filter: drop-shadow(0 2px 0 #0006); animation: trollHint 1.6s ease-in-out infinite; }
@keyframes trollHint { 0%, 100% { transform: rotate(-10deg); } 50% { transform: translateY(-3px) rotate(8deg); } }
.prank-face { position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 30px; line-height: 1; pointer-events: none; z-index: 3; filter: drop-shadow(0 3px 0 #0005); animation: prankFace 1.4s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes prankFace { 0% { transform: scale(.2); opacity: 0; } 15% { transform: scale(1.3); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(1) translateY(-14px); opacity: 0; } }
.emo-tray { position: fixed; z-index: 45; display: flex; gap: 4px; padding: 6px; background: #fff; border-radius: 20px; box-shadow: 0 5px 0 #d7cdf5, 0 16px 40px #0006; animation: pop .25s cubic-bezier(.3,1.6,.5,1); }
.emo-tray::after { content: ""; position: absolute; left: 50%; width: 14px; height: 14px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.emo-tray.down::after { top: -6px; } .emo-tray.up::after { bottom: -6px; }
.emo-tray button { position: relative; z-index: 1; width: 46px; height: 46px; border: 0; border-radius: 14px; background: var(--soft); font-size: 26px; cursor: pointer; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.emo-tray button:hover, .emo-tray button:active { transform: scale(1.25) rotate(-8deg); background: #fff1bf; }
.emo-fly { position: fixed; left: 0; top: 0; z-index: 46; font-size: 34px; line-height: 1; pointer-events: none; filter: drop-shadow(0 4px 4px #0006); will-change: transform; }
.turn-hint { text-align: center; color: #fff; font-weight: 900; font-size: 17px; min-height: 24px; text-shadow: 0 2px 0 #0004; }
.side { display: flex; flex-direction: column; gap: 14px; }
.side .card { padding: 16px; }
.die { width: 58px; height: 58px; border-radius: 14px; border: 0; background: linear-gradient(145deg, #fff, #ece6f7); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 9px; cursor: default; box-shadow: 0 5px 0 #c9bfe6, 0 8px 12px #0003, inset 0 -2px 0 #0000000d; }
.die.can { cursor: pointer; animation: nudge 1s ease-in-out infinite; box-shadow: 0 5px 0 #c9bfe6, 0 0 0 4px var(--star), 0 0 22px var(--star); }
.die.rolling { animation: tumble .5s ease-out; }
.die i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; box-shadow: inset 0 2px 0 #0004; }
.die.six i { background: var(--red); }
.die i.on { visibility: visible; }
@keyframes tumble { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(-200deg) scale(1.25) translateY(-8px); } 60% { transform: rotate(-320deg) scale(.95); } 100% { transform: rotate(-360deg) scale(1); } }
@keyframes nudge { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-6deg); } }
.pot { display: flex; align-items: center; gap: 12px; }
.pot .big { font-size: 32px; font-weight: 900; }
.pot .ico { font-size: 34px; }
.split { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.split span { font-size: 12px; font-weight: 900; padding: 5px 9px; border-radius: 9px; background: var(--soft); }
.split span:first-child { background: #fff1bf; }
.log { max-height: 240px; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.log div { color: var(--muted); }
.log div:last-child { color: var(--ink); }

/* The pawns. Each one is its own little layer (one board square big, placed on its spot
   with a transform), so the graphics chip slides, hops and bobs them on its own: the board
   and the other pawns are never redrawn while one moves. Sizes and moves are in % of a
   square, so it all scales with the board. */
#tokens { position: absolute; inset: 0; }
#tokens .tok { position: absolute; left: 0; top: 0; width: calc(100% / 15); height: calc(100% / 15); transform-origin: 0 0; will-change: transform; pointer-events: none; transition: transform .32s cubic-bezier(.3, .7, .3, 1); }
#tokens .tok > *, #tokens .body > *, #tokens .pawn > * { position: absolute; }
#tokens .body, #tokens .pawn, #tokens .marker { left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
#tokens .body, #tokens .pawn { will-change: transform; }
#tokens .gshadow { left: -43.5%; top: 9%; width: 95.7%; height: 31.9%; border-radius: 50%; background: rgba(30, 10, 70, .32); will-change: transform; }
#tokens svg { display: block; overflow: visible; pointer-events: none; }
#tokens .pic { left: -55%; top: -100%; width: 110%; height: 140%; }
#tokens .ring { left: -100%; top: -105.5%; width: 200%; height: 200%; opacity: 0; transform-origin: 50% 50%; }
#tokens .marker { display: none; }
#tokens .marker svg { position: absolute; left: -32%; top: -130%; width: 64%; height: 55%; }
/* tap target: a circle over the pawn (only for the ones you can move) */
#tokens .hit { left: -50%; top: -80%; width: 100%; height: 100%; border-radius: 50%; }
#tokens .tok.movable .hit { pointer-events: auto; cursor: pointer; }
#tokens .tok.movable .ring { opacity: 1; animation: tokPulse .9s ease-in-out infinite; }
#tokens .tok.movable .pawn { animation: tokBob .9s ease-in-out infinite; }
#tokens .tok.movable .marker { display: block; animation: tokArrow .6s ease-in-out infinite alternate; }
@keyframes tokBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12%); } }
@keyframes tokArrow { from { transform: translateY(-12%); } to { transform: translateY(6%); } }
@keyframes tokPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .35; } }

/* pop-up banner over the board */
.banner { --bc: var(--violet); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.5); padding: 12px 26px; border-radius: 20px; background: #fff; color: var(--ink); font-weight: 900; font-size: clamp(18px, 4vw, 28px); white-space: nowrap; box-shadow: 0 6px 0 var(--bc), 0 18px 40px #0006; border: 4px solid var(--bc); opacity: 0; pointer-events: none; z-index: 3; }
.banner.show { animation: bannerPop 1.5s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes bannerPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-4deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(1deg); }
  24% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(.95); }
}
.die { position: relative; }
.die .dstar { position: absolute; inset: 0; display: none; place-items: center; font-size: 34px; line-height: 1; color: var(--star); text-shadow: 0 2px 0 var(--star-d); }
.die.ready i { visibility: hidden; }
.die.ready .dstar { display: grid; animation: twinkle 1s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .35; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.12px); } }

/* ---------- modal ---------- */
.modal-root:empty { display: none; }
.modal-root { position: fixed; inset: 0; background: #12082fb3; display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; backdrop-filter: blur(3px); }
.modal { background: var(--panel); border-radius: 28px; width: min(460px, 100%); max-height: 90vh; overflow: auto; padding: 26px; box-shadow: 0 8px 0 #d7cdf5, 0 30px 80px #0008; animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); }
.modal h2 { font-size: 26px; margin-bottom: 6px; }
.modal .close { float: right; position: relative; z-index: 3; border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); font-weight: 900; }
.modal .trophy { font-size: 72px; text-align: center; line-height: 1; filter: drop-shadow(0 6px 0 #0002); animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.tx { display: flex; flex-direction: column; margin-top: 12px; }
.tx div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 2px solid var(--soft); font-size: 14px; font-weight: 700; }
.tx .plus { color: var(--green-d); font-weight: 900; }
.tx .minus { color: var(--red-d); font-weight: 900; }
.results { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.results .r { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--soft); font-weight: 800; }
.results .r.first { background: linear-gradient(#fff4c4, #ffe58a); box-shadow: 0 4px 0 #f0c94a; }
.results .place { font-weight: 900; width: 34px; }
.ad-box { aspect-ratio: 16 / 9; border-radius: 18px; background: linear-gradient(135deg, #2a1b62, #5b2fd6); color: #fff; display: grid; place-items: center; text-align: center; margin: 14px 0; padding: 20px; }
.ad-box .count { font-size: 46px; font-weight: 900; }
.progress { height: 10px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--star), var(--orange)); width: 0; transition: width .25s linear; }
.lb { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 700; }
.lb td, .lb th { padding: 9px 6px; border-bottom: 2px solid var(--soft); text-align: left; }
.lb th { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.lb td.n { text-align: right; font-variant-numeric: tabular-nums; }
.lb tr:nth-child(2) td:first-child::before { content: "🥇 "; }
.lb tr:nth-child(3) td:first-child::before { content: "🥈 "; }
.lb tr:nth-child(4) td:first-child::before { content: "🥉 "; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; }
.toast { background: #fff; color: var(--ink); padding: 12px 18px; border-radius: 16px; font-size: 15px; font-weight: 800; box-shadow: 0 5px 0 #d7cdf5, 0 12px 30px #0005; animation: pop .3s cubic-bezier(.3, 1.5, .5, 1); }
.toast.err { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-d), 0 12px 30px #0005; }

/* ---------- hand-made skin: ink outlines + hard sticker shadows ---------- */
.card { border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.btn { border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); background: linear-gradient(#ffffff30, #fff0 50%), var(--c); text-shadow: none; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.sm { border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
.btn.sm:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.gold, .btn.ghost { color: var(--ink); }
.btn.ghost { background: #fff; }
.seg button.on { box-shadow: 0 3px 0 var(--ink); outline: 2.5px solid var(--ink); outline-offset: -2.5px; }
.tile { border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink); }
.tile.bots { transform: rotate(-.6deg); }
.tile.friends { transform: rotate(.6deg); }
.tile::before { background: radial-gradient(120% 80% at 0% 0%, #ffffff2a, transparent 55%); }
.tile h2 { text-shadow: 0 3px 0 var(--ink); }
.tile .art { position: absolute; right: 16px; top: 10px; display: flex; align-items: flex-end; gap: 2px; }
.tile .art .doodle { filter: drop-shadow(0 4px 0 #0003); }
.tile p { max-width: 70%; }
.tile .seg { background: #0000002e; }
.tile .seg button.on { background: #fff; color: var(--ink); }
.tile .hint { min-height: 34px; }
.earn .card { box-shadow: 0 5px 0 var(--ink); }
.earn .ico { border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transform: rotate(-4deg); }
.earn .card:nth-child(2) .ico { transform: rotate(5deg); }
.earn .opt { font: 700 12px var(--hand); text-transform: none; letter-spacing: 0; color: var(--violet); }
.modal { border: 3px solid var(--ink); box-shadow: 0 8px 0 var(--ink); }
.toast { border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.board-wrap { border: 3px solid var(--ink); box-shadow: 0 9px 0 var(--ink), 0 24px 50px #0006, inset 0 2px 0 #ffffff55; }
.die { border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.die.can { box-shadow: 0 4px 0 var(--ink), 0 0 0 4px var(--star); }
.pbadge.turn { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px var(--ink), 0 0 0 7px var(--pc); }
.chip.stars { border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.seat { border: 2.5px solid var(--line); }
.ava { border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.pbadge .ava { border-width: 2px; }
.code-big { color: var(--ink); text-shadow: 3px 3px 0 var(--star); font-variant-numeric: tabular-nums; }
.emo-tray { border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.emo-tray::after { border: 3px solid var(--ink); }
.emo-tray.down::after { border-right: 0; border-bottom: 0; top: -9px; }
.emo-tray.up::after { border-left: 0; border-top: 0; bottom: -9px; }

.bob1 { animation: bob1 3.2s ease-in-out infinite; }
.bob2 { animation: bob2 2.7s ease-in-out infinite; }
@keyframes bob1 { 50% { translate: 0 -7px; } }
@keyframes bob2 { 50% { translate: 0 -5px; rotate: 6deg; } }
@media (prefers-reduced-motion: reduce) { .bob1, .bob2 { animation: none; } }

/* never let the page slide sideways on a phone: the game column may shrink below its content */
html, body { overflow-x: clip; }
/* no zoom on double-tap anywhere (phones only zoom on a double-tap where this is missing);
   pinching to zoom still works */
html, body, body * { touch-action: manipulation; }
.table, .badges, .pslot, .pbadge { min-width: 0; }
.pbadge .pmeta { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 960px) {
  .game { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; }
  .side #potCard { flex: 1 1 100%; }
  .side .log-card { display: none; }
  .side #leaveGame { flex: 1; }
  .lobby-grid { grid-template-columns: 1fr; }
  .earn { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: 8px 10px 40px; }
  .top { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .top-right { gap: 6px; }
  .me-chip { padding: 3px; }
  .ava-grid { grid-template-columns: repeat(5, 1fr); }
  .emo-tray button { width: 42px; height: 42px; font-size: 24px; }
  .table { gap: 6px; }
  .turn-hint { font-size: 15px; }
  .brand { font-size: 18px; }
  .username { display: none; }
  .chip.lbtxt { display: none; }
  .board-wrap { padding: 7px; border-radius: 20px; }
  .pbadge { gap: 6px; }
  .pbadge .ring { width: 42px; height: 42px; padding: 3px; }
  .pbadge .ava { width: 36px; height: 36px; font-size: 16px; }
  .pbadge .pname { font-size: 13px; max-width: 84px; }
  .pbadge .pmeta { font-size: 11px; }
  .pbadge .homepips i { width: 6px; height: 6px; }
  .dice-slot:not(:empty) { margin-left: -2px; }
  .die { width: 48px; height: 48px; padding: 7px; }
  .die i { width: 8px; height: 8px; }
  .dice-slot:not(:empty) { width: 52px; }
  .tile .art { transform: scale(.75); transform-origin: right top; right: 8px; }
  .tile p { max-width: 64%; }
  .code-big { font-size: 34px; }
}

/* =========================================================================
   Gameflare-style skin: glossy chunky buttons, all-caps outlined labels,
   big square tiles, dark name plates, wooden 3D board.
   ========================================================================= */
.outline, .gtile .glabel, .btn:not(.ghost):not(.gold), .glogo span, .mtitle {
  text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink);
}
.btn { text-transform: uppercase; letter-spacing: .03em; border-radius: 18px;
  background: linear-gradient(#ffffff55, #ffffff00 52%), var(--c);
  box-shadow: inset 0 0 0 3px #ffffff40, inset 0 -5px 0 #00000026, 0 5px 0 var(--ink); }
.btn:active:not(:disabled) { box-shadow: inset 0 0 0 3px #ffffff40, inset 0 -3px 0 #00000026, 0 1px 0 var(--ink); }
.btn.sm { box-shadow: inset 0 0 0 2px #ffffff40, 0 3px 0 var(--ink); }
.btn.gold { --c: #ffd23c; }
.btn.green { --c: #3cc43a; }
.btn.blue { --c: #2b8cf0; }
.btn.orange { --c: #ff8b1f; }
.btn:not(.ghost):not(.gold) { color: #fff; }
.chip { border: 2.5px solid var(--ink); background: #00000030; box-shadow: 0 3px 0 var(--ink); }
.chip:hover { background: #00000045; }
.card h2, .modal h2 { text-transform: uppercase; letter-spacing: .02em; }
.modal-root { background: #4a0a2fc0; }
.banner { text-transform: uppercase; border-color: var(--ink); box-shadow: 0 6px 0 var(--ink); color: #fff; background: var(--bc);
  text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink); }
.turn-hint { text-transform: uppercase; letter-spacing: .04em; text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink); }

/* home */
.ghome { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.ghome-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.profile { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: #fff; cursor: pointer; text-align: left; padding: 0; min-width: 0; }
.profile .pava { width: 54px; height: 54px; flex: none; border-radius: 16px; background: linear-gradient(#5a3bb8, #3a2384); border: 3px solid var(--ink); box-shadow: inset 0 0 0 3px #ffffff30, 0 4px 0 var(--ink); display: grid; place-items: center; font-size: 30px; font-weight: 900; }
.profile b { display: block; font-size: 19px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink); }
.profile small { font-size: 11px; font-weight: 900; color: #ffe14d; letter-spacing: .06em; text-shadow: 0 2px 0 var(--ink); }
.profile:active .pava { transform: translateY(3px); box-shadow: inset 0 0 0 3px #ffffff30, 0 1px 0 var(--ink); }
.starbox { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 16px; background: #00000038; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); color: #fff; font-weight: 900; font-size: 21px; cursor: pointer; text-shadow: 0 2px 0 var(--ink); }
.starbox .s { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a0, #ffc93c 55%, #e09a00); color: #fff; display: grid; place-items: center; border: 2.5px solid var(--ink); font-size: 18px; text-shadow: 0 1px 0 #a66b00; }
.glogo-wrap { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 4px 0 2px; }
.glogo { display: flex; flex-direction: column; align-items: center; line-height: .82; margin: 0; transform: rotate(-3deg); }
.glogo .w1 { font-size: clamp(66px, 18vw, 108px); color: #8ef05c; letter-spacing: .02em;
  text-shadow: -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), 0 -3px 0 var(--ink), 0 3px 0 var(--ink), -3px 0 0 var(--ink), 3px 0 0 var(--ink), 0 9px 0 var(--ink); }
.glogo .w2 { font-size: clamp(42px, 11vw, 66px); color: #5ccfff; letter-spacing: .06em;
  text-shadow: -2.5px -2.5px 0 var(--ink), 2.5px -2.5px 0 var(--ink), -2.5px 2.5px 0 var(--ink), 2.5px 2.5px 0 var(--ink), 0 -2.5px 0 var(--ink), 0 2.5px 0 var(--ink), 0 7px 0 var(--ink); }
.glogo-art .doodle { filter: drop-shadow(0 5px 0 #0003); }
.gtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gtiles.three { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gtile { --c1: #ffd84a; --c2: #ff8b1f; position: relative; border: 3px solid var(--ink); border-radius: 24px; padding: 10px 6px 12px; cursor: pointer; color: #fff; font: inherit;
  background: linear-gradient(var(--c1), var(--c2)); box-shadow: inset 0 0 0 4px #ffffff55, inset 0 -7px 0 #00000022, 0 7px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; overflow: hidden; transition: transform .08s, box-shadow .08s; }
.gtile::before { content: ""; position: absolute; left: 7px; right: 7px; top: 6px; height: 40%; border-radius: 18px 18px 50% 50% / 18px 18px 30% 30%; background: linear-gradient(#ffffff80, #ffffff00); pointer-events: none; }
.gtile:hover { filter: brightness(1.05); }
.gtile:active { transform: translateY(5px); box-shadow: inset 0 0 0 4px #ffffff55, inset 0 -7px 0 #00000022, 0 2px 0 var(--ink); }
.gtile.big { aspect-ratio: 1 / 1; }
.gtiles.three .gtile { aspect-ratio: 1 / 1.05; border-radius: 20px; }
.gtile .gart { flex: 1; display: flex; align-items: flex-end; justify-content: center; position: relative; filter: drop-shadow(0 4px 0 #00000030); }
.gtile .gart.emo { font-size: clamp(30px, 9vw, 44px); align-items: center; }
.gtile .glabel { position: relative; font-weight: 900; font-size: clamp(16px, 4.6vw, 23px); line-height: 1.02; text-align: center; letter-spacing: .02em; }
.gtiles.three .glabel { font-size: clamp(13px, 3.6vw, 17px); }
.gtile.orange { --c1: #ffd84a; --c2: #ff8b1f; }
.gtile.green { --c1: #b8f552; --c2: #36bd3a; }
.gtile.purple { --c1: #c592ff; --c2: #7444e0; }
.gtile.pink { --c1: #ffa8d6; --c2: #ff4f9e; }
.gtile.blue { --c1: #86e0ff; --c2: #2b8cf0; }
.gtile.done { filter: saturate(.35) brightness(.92); }
.gbadge { position: absolute; top: 7px; right: 7px; z-index: 1; background: #fff; color: var(--ink); font-weight: 900; font-size: 12px; padding: 2px 7px; border-radius: 10px; border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
/* option sheets */
.mtitle { text-align: center; color: #fff; font-size: 24px !important; margin: 0 0 14px !important; }
.modal .mtitle { color: var(--star); }
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pick button { border: 3px solid var(--ink); border-radius: 16px; background: var(--soft); padding: 8px 4px; cursor: pointer; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pick button b { font-size: 26px; line-height: 1.1; }
.pick button small { font-size: 11px; font-weight: 900; letter-spacing: .05em; color: var(--muted); }
.pick button.on { background: linear-gradient(#ffe46b, #ffc312); box-shadow: inset 0 0 0 3px #ffffff70, 0 4px 0 var(--ink); }
.pick button.on small { color: var(--ink); }
.pick button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.mhint { text-align: center; font-weight: 900; color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.mhint.fm-hint { margin: 18px 0 0; line-height: 1.3; }
.gbadge.timer { right: 50%; transform: translateX(50%); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* leaderboard */
.lb-head, .lb-row { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) 34px 44px; align-items: center; gap: 6px; }
.lb-head { padding: 0 8px 6px; font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .04em; }
.lb-head span:first-child { grid-column: 1 / 4; padding-left: 4px; }
.lb-head span:not(:first-child), .lb-n { text-align: right; }
.lb-list { display: grid; gap: 7px; }
.lb-row { padding: 6px 8px; border-radius: 16px; background: var(--soft); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-weight: 900; }
.lb-row.me { background: #fff3c4; }
.lb-rank { text-align: center; font-size: 17px; color: var(--ink); }
.lb-ava { width: 34px; height: 34px; font-size: 17px; background: var(--violet); }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); line-height: 1.15; }
.lb-you { display: block; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
@media (max-width: 420px) { .modal:has(.lb-list) { padding: 22px 14px; } }
.lb-n { font-variant-numeric: tabular-nums; color: var(--ink); }
#joinBox { min-height: 62px; }
.modal .or { color: var(--muted); font-family: var(--font); font-weight: 900; font-size: 14px; }
.modal .or::before, .modal .or::after { border-color: var(--line); }
.input.code { font-size: 22px; text-align: center; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.input.code::placeholder { color: #c9c0e6; letter-spacing: .35em; }
.pot-now { font-size: 17px; font-weight: 900; margin-bottom: 4px; }

/* name plates around the board */
.pbadge { background: #2d1b4e; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.pbadge .pname { text-transform: uppercase; letter-spacing: .03em; }
.pbadge.turn { background: #fff; }
.pbadge .ring { background: conic-gradient(var(--pc) calc(var(--t) * 1turn), #ffffff26 0); }

/* the board: wooden table frame, tilted back a little for a 3D feel */
.board-stage { position: relative; perspective: 1200px; perspective-origin: 50% 30%; margin: 2px 0 10px; }
.board-tilt { transform: rotateX(14deg); transform-origin: 50% 100%; transform-style: preserve-3d; }
.board-wrap { padding: 12px; border-radius: 26px; border: 3px solid var(--ink);
  background:
    repeating-linear-gradient(92deg, #ffffff12 0 3px, transparent 3px 22px),
    repeating-linear-gradient(88deg, #0000000d 0 2px, transparent 2px 31px),
    linear-gradient(#e7a866, #c98345);
  box-shadow: inset 0 3px 0 #ffffff55, inset 0 -3px 0 #0000002a, 0 10px 0 #8a5427, 0 10px 0 3px var(--ink), 0 30px 40px #0000004d; }
#board { border-radius: 12px; filter: drop-shadow(0 2px 0 #0000004d); }
@media (prefers-reduced-motion: reduce) { .board-tilt { transform: none; } }

@media (max-width: 560px) {
  .ghome { gap: 12px; }
  .gtiles { gap: 10px; }
  .gtile { border-radius: 20px; }
  .board-wrap { padding: 7px; border-radius: 18px; }
  .board-tilt { transform: rotateX(12deg); }
  .profile .pava { width: 48px; height: 48px; font-size: 26px; }
  .profile b { font-size: 17px; max-width: 46vw; }
}body.on-home #walletBtn, body.on-home #meBtn { display: none; }
.pbadge .pmeta { white-space: nowrap; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.pot-table { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 800; }
.pot-table td { padding: 5px 6px; }
.pot-table td:nth-child(2) { text-align: right; white-space: nowrap; }
.pot-table td:last-child { text-align: right; }
.pot-table tr.now td { background: #ffe46b; }
.pot-table tr.now td:first-child { border-radius: 10px 0 0 10px; }
.pot-table tr.now td:last-child { border-radius: 0 10px 10px 0; }

/* profile pictures: uploaded photos fill the circle */
.ava { overflow: hidden; }
.ava-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; pointer-events: none; }
.profile .pava { overflow: hidden; }
.profile .pava .ava-img { border-radius: 12px; }
.prof-preview { display: flex; justify-content: center; margin: -4px 0 12px; }
.prof-ava { width: 96px; height: 96px; font-size: 52px; background: var(--violet); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.ava-grid { grid-template-columns: repeat(4, 1fr); margin: 6px 0 14px; }
.upload-btn { cursor: pointer; }
.crop-wrap { width: min(300px, 70vw); margin: 0 auto 12px; border-radius: 18px; overflow: hidden; background: #1a1030; border: 3px solid var(--ink); }
.crop-wrap canvas { width: 100%; height: auto; display: block; touch-action: none; cursor: grab; }
.crop-wrap canvas:active { cursor: grabbing; }
.zoom-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.zoom-row input { flex: 1; accent-color: var(--violet); }

/* ================= troll mode ================= */
.troll-row { align-items: flex-start; gap: 12px; border-radius: 16px; padding: 10px; margin: 0 -10px; transition: background .2s; }
.troll-row.on { background: #fff3c4; }
.emo-tray.troll { flex-wrap: wrap; max-width: 320px; justify-content: center; }
.prank-row { display: flex; gap: 6px; width: 100%; position: relative; z-index: 1; }
.emo-tray .prank-row .prank-btn { flex: 1; width: auto; height: 40px; font: 900 14px var(--font); color: var(--ink); background: #ffe14d; border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.emo-tray .prank-row .prank-btn:hover, .emo-tray .prank-row .prank-btn:active { transform: scale(1.05); background: #ffd000; }
/* the 3D capture gags live inside the tilted board */
/* troll mode: the host's gag picker */
.gag-pick { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: #1b103099; animation: gpIn .2s ease-out; transition: opacity .2s; }
.gag-pick.watch { background: none; pointer-events: none; place-items: start center; padding-top: 16vh; }
.gag-pick.out { opacity: 0; }
@keyframes gpIn { from { opacity: 0; } }
.gp-card { background: #fff; border-radius: 22px; padding: 16px 16px 14px; width: min(92vw, 380px); text-align: center; border: 4px solid var(--ink); box-shadow: 0 7px 0 var(--ink), 0 24px 50px #0007; animation: gpPop .3s cubic-bezier(.3,1.6,.5,1); }
.gag-pick.watch .gp-card { width: auto; max-width: 92vw; padding: 10px 18px 12px; }
@keyframes gpPop { from { transform: scale(.6); } }
.gp-title { font-weight: 900; font-size: 22px; color: var(--ink); letter-spacing: .02em; text-transform: uppercase; }
.gag-pick.watch .gp-title { font-size: 15px; margin-bottom: 8px; }
.gp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 12px; }
.gp-btn { --c: #ff8a2a; border: 3px solid var(--ink); border-radius: 16px; padding: 10px 4px 8px; font: 900 15px var(--font); color: #fff; cursor: pointer; display: grid; gap: 2px; justify-items: center; background: linear-gradient(#ffffff38, #fff0 55%), var(--c); box-shadow: 0 5px 0 var(--ink); position: relative; top: 0; text-shadow: 0 2px 0 #0004; transition: opacity .2s, transform .15s; }
.gp-btn:nth-child(2) { --c: #2b8cf0; } .gp-btn:nth-child(3) { --c: #3cc43a; } .gp-btn:nth-child(4) { --c: #a35cff; }
.gp-row { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gp-btn { font-size: 14px; padding: 9px 2px 8px; }
.gp-ico { font-size: 34px; }
.gp-btn:active { top: 3px; box-shadow: 0 2px 0 var(--ink); }
.gp-ico { font-size: 40px; line-height: 1.15; filter: drop-shadow(0 3px 0 #0003); }
.gag-pick.sent .gp-btn:not(.on) { opacity: .3; }
.gp-btn.on { transform: scale(1.08); }
.gp-bar { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.gp-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ff4757, #ffc93c); border-radius: inherit; transform-origin: left; }
.gp-hint { margin-top: 8px; font-weight: 900; color: var(--muted); font-size: 13px; letter-spacing: .06em; }

/* troll mode: the full-screen 3D gag */
.cut3d { position: fixed; inset: 0; z-index: 80; overflow: hidden; background: linear-gradient(#5a2fd6, #a35cff 36%, #ff8fd0 60%, #ffd6ee); animation: cutIn .18s ease-out; transition: opacity .25s; }
.cut3d.out { opacity: 0; }
/* built during the zoom, nearly invisible, so it's all drawn before it's shown */
.cut3d.warm { opacity: .01; animation: none; pointer-events: none; }
.cut3d.warm .cut-bars, .cut3d.warm .cut-title, .cut3d.warm .cut-flash { display: none; }
.cut3d:not(.warm) .parked { opacity: 0; }
.cut3d.asleep .parked { visibility: hidden; }
@keyframes cutIn { from { opacity: 0; } }
.cut3d .cut-cam { position: absolute; inset: 0; transform-style: preserve-3d; }
.cut3d .cut-world { position: absolute; left: 50%; top: 56%; width: 0; height: 0; transform-style: preserve-3d; }
.cut3d .c-floor { position: absolute; background: repeating-linear-gradient(92deg, #ffffff12 0 3px, transparent 3px 22px), repeating-linear-gradient(88deg, #0000000d 0 2px, transparent 2px 31px), #d9965a;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, #0000); mask-image: radial-gradient(closest-side, #000 62%, #0000); }
.cut3d .c-floor.bmp { background: none; -webkit-mask-image: none; mask-image: none; display: block; }
.cut3d .c-board { position: absolute; display: block; background: #fff; border-radius: 6px; box-shadow: 0 0 0 3px var(--ink), 0 0 0 9px #c98345, 0 0 0 11px var(--ink); }
.cut3d .c-obj, .cut3d .c-pawn, .cut3d .c-b3 { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.cut3d .c-pawn > i { position: absolute; left: 0; top: 0; border-radius: 50%; background: radial-gradient(circle at 30% 75%, var(--l), var(--c) 45%, var(--d)); }
.cut3d .c-face { position: absolute; left: 0; top: 0; backface-visibility: hidden; }
/* the smooth drawn pawns: a picture standing up and facing the camera, with a face that moves round */
.cut3d .c-bill { position: absolute; transform-origin: 50% 100%; }
.cut3d .c-art { position: absolute; inset: 0; transform-origin: 50% 100%; }
.cut3d .c-pimg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.cut3d .c-pf, .cut3d .c-pb, .cut3d .c-bat { position: absolute; pointer-events: none; }
.cut3d .c-pf svg, .cut3d .c-pb svg, .cut3d .c-bat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cut3d .c-bat { filter: drop-shadow(0 2px 0 #0003); }
.cut3d .c-face svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cut3d .c-shadow { position: absolute; left: 0; top: 0; border-radius: 50%; background: radial-gradient(closest-side, #2d1b4e77, #2d1b4e00); }
.cut3d .c-b3 > i { position: absolute; left: 0; top: 0; display: block; box-shadow: inset 0 0 0 1px #0002; }
.cut3d .c-wheel { position: absolute; border-radius: 50%; background: radial-gradient(circle, #e4e4ee 0 26%, #2a2536 29% 100%); box-shadow: inset 0 0 0 3px #110d1a; }
.cut3d .c-prop { position: absolute; border-radius: 50%; background: conic-gradient(#3a3348 0 24deg, #0000 24deg 180deg, #3a3348 180deg 204deg, #0000 204deg), radial-gradient(circle, #3a3348 0 13%, #ffffff28 15%); }
.cut3d .c-sprite { position: absolute; left: 0; top: 0; border-radius: 50%; display: grid; place-items: center; }
.cut3d .c-flash { background: radial-gradient(circle, #fff 0 30%, #fff0 70%); }
.cut3d .c-fire { background: radial-gradient(circle, #fff7c2 0 16%, #ffc23a 34%, #ff6a1f 56%, #ff3d1f00 71%); }
.cut3d .c-smoke { background: radial-gradient(circle at 40% 38%, #9a91b5, #5d5478 52%, #5d547800 71%); }
.cut3d .c-smoke.light { background: radial-gradient(circle at 40% 38%, #fff, #d9d3ea 50%, #d9d3ea00 71%); }
.cut3d .c-puff { background: radial-gradient(circle at 38% 36%, #f1ffc8, #9edc55 44%, #5f9e2b 62%, #5f9e2b00 71%); }
.cut3d .c-stink svg { width: 60%; height: 100%; }
.cut3d .c-twinkle { color: #fff; text-shadow: 0 0 12px #fff, 0 0 30px #ffe14d; border-radius: 0; }
.cut3d .c-chunk { position: absolute; left: 0; top: 0; border-radius: 3px; box-shadow: inset 0 0 0 2px #0003; }
.cut3d .c-ring { position: absolute; left: 0; top: 0; border-radius: 50%; border-style: solid; border-color: #fff; }
.cut3d .c-word { position: absolute; left: 0; top: 0; width: 0; height: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-family: var(--font); font-weight: 900; line-height: 1; letter-spacing: .02em;
  -webkit-text-stroke: .07em var(--ink); paint-order: stroke fill; text-shadow: 0 .08em 0 var(--ink); }
.cut3d .cut-bars::before, .cut3d .cut-bars::after { content: ''; position: absolute; left: 0; right: 0; height: 9vh; background: #0d0718; animation: barIn .3s ease-out; }
.cut3d .cut-bars::before { top: 0; } .cut3d .cut-bars::after { bottom: 0; --from: 100%; }
@keyframes barIn { from { transform: translateY(var(--from, -100%)); } }
.cut3d .cut-title { position: absolute; left: 50%; top: calc(9vh + 14px); translate: -50% 0; white-space: nowrap; padding: 8px 18px; border-radius: 16px; background: #fff; color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); font: 900 clamp(18px, 5vw, 30px) var(--font); animation: titleIn .45s cubic-bezier(.3,1.7,.5,1) .15s backwards; }
@keyframes titleIn { from { transform: scale(.2) rotate(-12deg); opacity: 0; } }
.cut3d .cut-flash { position: absolute; inset: 0; background: #fff; pointer-events: none; animation: cutFlash .35s ease-out forwards; }
@keyframes cutFlash { from { opacity: .95; } to { opacity: 0; } }
/* jumpscare: covers the screen for a moment, but taps go straight through */
.scare { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: grid; place-items: center; background: radial-gradient(circle, #6a0014d9, #000000ee 70%); }
.scare-face { width: min(86vw, 520px); }
.scare-face svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 30px #000); }
.scare-word { position: absolute; bottom: 10%; font: 900 clamp(48px, 16vw, 120px) var(--font); color: #fff; letter-spacing: .05em; text-shadow: 0 0 24px #f00, 0 6px 0 #600; }
/* prank pop-up: looks like a system warning, plays like a joke */
.prank-pop { position: fixed; z-index: 85; left: 50%; top: 38%; transform: translate(-50%, -50%); width: min(330px, 88vw); background: #f4f2fb; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 8px 0 var(--ink), 0 30px 60px #0008; overflow: hidden;
  animation: prankIn .45s cubic-bezier(.3,1.6,.5,1), prankWiggle .5s .5s ease-in-out 2; transition: opacity .25s, scale .25s; }
.prank-pop.out { opacity: 0; scale: .85; }
.pp-bar { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(#3d6cff, #2347c9); color: #fff; font: 900 14px var(--font); padding: 6px 8px 6px 12px; }
.pp-bar button { width: 26px; height: 26px; border-radius: 6px; border: 2px solid #fff; background: #ff4757; color: #fff; font-weight: 900; line-height: 1; cursor: pointer; padding: 0; }
.pp-body { padding: 14px 16px 12px; text-align: center; color: var(--ink); }
.pp-icon { font-size: 44px; line-height: 1; }
.pp-body p { font-weight: 800; margin: 8px 0 12px; }
.pp-from { margin-top: 8px; font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
/* ================= home: bigger icons on the two big tiles, more air between rows ================= */
.ghome { gap: 22px; }
.glogo-wrap { margin: 16px 0 12px; }
.gtiles.three { margin-top: 2px; }
.gtile.big { padding-top: 14px; }
.gtile.big .gart { align-items: center; }
.gtile.big .gart > svg { transform-origin: 50% 60%; }
.gtile.big .gart > svg.doodle { scale: 1.45; }
.gtile.big .glabel { margin-top: 6px; }
@media (max-width: 560px) {
  .ghome { gap: 20px; }
  .gtiles { gap: 12px; }
  .glogo-wrap { margin: 14px 0 10px; }
}
@keyframes prankIn { from { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; } }
@keyframes prankWiggle { 25% { transform: translate(-50%, -50%) rotate(-3deg); } 75% { transform: translate(-50%, -50%) rotate(3deg); } }

/* ================= home v2: fills the screen, drawn icons, roomier tiles ================= */
/* The page edges are plain pink + checker (no darker/lighter glow at the very top or bottom),
   so they match the phone's own status bar and bottom bar, which are tinted with that pink. */
/* on the start page the top bar melts into the checker instead of being a darker strip */
body.on-home .top { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; position: relative; }
/* The start page is one column that scales as a whole, so it looks the same on every
   screen: everything inside is sized from the column's width (cqw = 1% of it), and the
   column is only as wide as the screen's height allows, so it is exactly one screen tall
   and never scrolls. On tall phones the board behind the logo gets the spare room. */
body.on-home main { padding-bottom: 20px; }
.ghome { gap: 16px; container-type: inline-size; width: 100%; max-width: 540px; margin: 0 auto; }
/* the logo sits on a little tilted Ludo board */
.glogo-wrap { position: relative; height: 200px; height: 56cqw; margin: 0; padding: 0; z-index: 0; }
@media (min-height: 520px) {
  /* at least one screen tall; if a phone still has too little room (browser bars, the guest
     strip, a banner) the page scrolls just enough to reach the bottom tiles, never cuts them */
  body.on-home { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; box-sizing: border-box; }
  body.on-home main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  body.on-home main { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; }
  body.on-home .ghome { flex: 1 1 auto; min-height: 0; width: min(100%, 540px, calc((100dvh - var(--home-fixed, 214px)) / var(--home-k, 1.47))); }
  .glogo-wrap { flex: 1 0 auto; height: auto; min-height: 56cqw; max-height: 86cqw; }
}
/* sizes that follow the column's width (phones without this keep the older sizes) */
.glogo .w1 { font-size: 18cqw; }
.glogo .w2 { font-size: 11cqw; }
.glogo-wrap > .glogo-art.left svg { width: 16cqw; height: auto; }
.glogo-wrap > .glogo-art.right svg { width: 13.5cqw; height: auto; }
.glogo-wrap > .glogo { position: relative; z-index: 1; }
/* the die and the pawn sit on the board's corners, so the logo stays dead center */
.glogo-wrap > .glogo-art { position: absolute; top: 50%; translate: 0 -50%; z-index: 1; margin-top: 14px; }
.glogo-wrap > .glogo-art.left { left: max(4px, calc(50% - 168px)); left: 4.5cqw; }
.glogo-wrap > .glogo-art.right { right: max(8px, calc(50% - 162px)); right: 6cqw; }
.gboard { position: absolute; left: 50%; top: 50%; height: 100%; aspect-ratio: 1; max-width: 100%; translate: -50% -50%; perspective: 700px; pointer-events: none; z-index: 0; }
.gboard-tilt { width: 100%; height: 100%; transform: translate(-5%, -5%) rotateX(42deg) rotateZ(-10deg) scale(1.05); transform-origin: 50% 50%; filter: drop-shadow(0 10px 0 #23164f) drop-shadow(0 22px 18px #0000004d); animation: gboardBob 6s ease-in-out infinite; }
.gboard-svg { width: 100%; height: 100%; display: block; }
@keyframes gboardBob { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .gboard-tilt { animation: none; } }
.gtiles { gap: 14px; }
.gtiles.three { gap: 12px; margin-top: 8px; }
.gtile.big { aspect-ratio: 1 / 1.1; padding: 12px 8px 16px; border-radius: 26px; }
.gtiles.three .gtile { aspect-ratio: 1 / 1.14; padding: 8px 5px 13px; border-radius: 22px; gap: 4px; }
.gtile .gart { align-self: stretch; filter: drop-shadow(0 4px 0 #00000033); }
.gtile .gart > svg.art { position: absolute; inset: 0; width: 100%; height: 100%; scale: none; overflow: visible; }
.gtile.big .gart > svg.art { inset: 0; width: 100%; height: 100%; }
.gtile .glabel { font-size: clamp(17px, 5vw, 25px); font-size: 5.3cqw; }
.gtiles.three .glabel { font-size: clamp(13px, 3.7vw, 18px); font-size: 3.9cqw; }
/* soft light rays behind each icon */
.gtile .rays { position: absolute; left: 50%; top: 40%; width: 125%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(#ffffff3d 0 9deg, #ffffff00 9deg 18deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, #0000); mask-image: radial-gradient(closest-side, #000 20%, #0000); }
.gtiles.three .gbadge { top: 6px; right: 6px; }
/* DAILY BONUS waiting: a dark countdown pill with a little clock, centered at the top of the tile */
.gtiles.three .gbadge.timer { left: 50%; right: auto; top: 7px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: #2d1b4e; color: #fff; border-color: var(--ink); box-shadow: 0 2px 0 var(--ink);
  font-size: 12px; font-size: 3.3cqw; letter-spacing: .03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gtiles.three .gbadge.timer::before { content: ""; flex: none; width: 1em; height: 1em; box-sizing: border-box; border-radius: 50%; border: 2px solid #ffe14d;
  background: linear-gradient(#ffe14d, #ffe14d) 50% 20% / 2px 35% no-repeat, linear-gradient(#ffe14d, #ffe14d) 68% 50% / 32% 2px no-repeat; }
/* the waiting tile is greyed out, but its countdown stays bright and easy to read */
.gtile.done { filter: none; }
.gtile.done > :not(.gbadge) { filter: saturate(.3) brightness(.9); }
.gtile.done { background: linear-gradient(#b9b3c9, #8a83a0); }
@media (max-width: 560px) {
  .ghome { gap: 14px; }
  .gtiles { gap: 12px; }
  .gtiles.three { gap: 10px; }
}
.gtiles { gap: 3.5cqw; }
.gtiles.three { gap: 3cqw; margin-top: 2cqw; }

/* pawns live in their own layer over the board, with no filter or rounded corners, so a
   tall pawn on the top row can stand up past the board's edge instead of being cut off */
.board-inner { position: relative; }
#pieces { position: absolute; inset: 0; pointer-events: none; }
#fxl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }

/* room between the board and the player badges (a glowing "your turn" badge never
   touches the board), and the turn text sits in the middle of the gap below */
.board-stage { margin: 12px 0 24px; }
.turn-hint { margin: 6px 0 4px; }

/* ================= game: a bigger board ================= */
.table { max-width: max(320px, min(760px, calc(100vh - 230px))); max-width: max(320px, min(760px, calc(100svh - 230px))); }
@media (max-width: 560px) {
  .table { margin: 0 -6px; width: calc(100% + 12px); }
  .board-wrap { padding: 4px; border-radius: 16px; }
  .board-tilt { transform: rotateX(8deg); }
  .board-stage { margin: 10px 0 22px; }
}

/* ================= desktop: the board fills the screen height ================= */
/* On a big screen the four player cards stand beside the board's corners instead of in
   rows above and below it, so the whole board fits on screen without scrolling and gets
   all the height there is. Phones and tablets keep the layout above. */
@media (min-width: 1180px) and (min-height: 600px) {
  body:has(.game) main { max-width: 1640px; padding: 12px 28px 16px; }
  .game { grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
  .table { max-width: none; display: grid; column-gap: 22px; row-gap: 0;
    grid-template-columns: minmax(158px, 1fr) minmax(0, calc(100vh - 150px)) minmax(158px, 1fr);
    grid-template-columns: minmax(158px, 1fr) minmax(0, calc(100svh - 150px)) minmax(158px, 1fr);
    grid-template-rows: 1fr 1fr auto; }
  .table .badges { display: contents; }
  .board-stage { grid-area: 1 / 2 / 3 / 3; margin: 6px 0 22px; }
  .turn-hint { grid-area: 3 / 2; margin: 0; }
  .pslot { min-width: 0; }
  .pslot[data-corner="tl"] { grid-area: 1 / 1; align-self: start; justify-content: flex-end; padding-top: 14px; }
  .pslot[data-corner="bl"] { grid-area: 2 / 1; align-self: end; justify-content: flex-end; padding-bottom: 30px; }
  .pslot[data-corner="tr"] { grid-area: 1 / 3; align-self: start; justify-content: flex-start; padding-top: 14px; }
  .pslot[data-corner="br"] { grid-area: 2 / 3; align-self: end; justify-content: flex-start; padding-bottom: 30px; }
  /* each player is an upright card: picture on top, name under it, the die below */
  .table .pbadge, .table .pslot.right .pbadge { flex-direction: column; text-align: center; width: 158px; padding: 14px 10px 14px; gap: 8px; border-radius: 26px; }
  .table .pbadge .ring { width: 78px; height: 78px; padding: 5px; }
  .table .pbadge .ava { width: 68px; height: 68px; font-size: 32px; }
  .table .pbadge .pname { font-size: 16px; max-width: 136px; }
  .table .pbadge .pmeta { font-size: 11px; }
  .table .pbadge .homepips i { width: 8px; height: 8px; }
  .table .dice-slot, .table .dice-slot:not(:empty) { width: auto; }
  .table .dice-slot:not(:empty) { margin: 2px 0 0; }
  .table .pbadge .die { width: 64px; height: 64px; padding: 10px; }
  .table .pbadge .die i { width: 11px; height: 11px; }
  .table .pbadge .net { right: 0; top: 0; }
  .table .pslot .taunt-hint { left: auto; right: 10px; }
  .side { position: sticky; top: 12px; }
  .side .log { max-height: calc(100vh - 420px); max-height: calc(100svh - 420px); }
}

/* Top bar: a bigger logo and title in the same chunky ink-outlined style as the buttons
   and tiles. It steps down a little on narrow phones, so it always fits beside the buttons. */
.brand { gap: 12px; font-size: 29px; letter-spacing: .01em; line-height: 1;
  text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), 0 4px 0 var(--ink); }
.logo { width: 46px; height: 46px; padding: 7px; gap: 4px; border-radius: 14px; border: 3px solid var(--ink); box-shadow: inset 0 -3px 0 #0000001a, 0 4px 0 var(--ink); flex: none; }
.logo i { box-shadow: inset 0 -2px 0 #00000026; }
@media (max-width: 560px) {
  .brand { font-size: 25px; gap: 10px; }
  .logo { width: 42px; height: 42px; padding: 6px; border-radius: 13px; }
}
@media (max-width: 400px) {
  .brand { font-size: 22px; gap: 9px; }
  .logo { width: 38px; height: 38px; padding: 5px; gap: 3px; border-radius: 12px; }
}
@media (max-width: 400px) { body:not(.on-home) .brand { font-size: 20px; } }

/* emoji / letter pictures: a box exactly one line tall, centered in its frame (round or the
   rounded square at the top left), so the emoji's own font spacing can't push it off center */
.ava-e { display: block; width: max-content; line-height: 1; text-align: center; white-space: nowrap; pointer-events: none; }
.ava-e.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 400; text-shadow: none; }
.pava, .ava { display: grid; place-items: center; }

/* Long names never run into the stars: the name gets only the room the star box leaves
   (the star box never shrinks) and ends in "…" when that runs out. Long names also
   get a slightly smaller font, so more of them fits. */
.ghome-top { display: flex; }
.ghome-top .profile { flex: 1 1 0; min-width: 0; }
.ghome-top .profile .ptxt { display: block; min-width: 0; overflow: hidden; padding: 2px 4px 4px 2px; margin: -2px -4px -4px -2px; }
.ghome-top .profile b { max-width: none; }
.ghome-top .profile b.long { font-size: 15px; }
.ghome-top .starbox { flex: none; }
/* on short, wide windows the column narrows to fit the screen's height; the top row
   (name, present, stars) keeps the full width so the name still has room */
.ghome-top { width: max(100%, min(540px, calc(100vw - 40px))); max-width: none; align-self: center; box-sizing: border-box; }
.ghome-top .profile small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat { min-width: 0; }
.seat > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat > .badge, .seat > .btn, .seat > .ava, .seat > .muted { flex: none; }

/* ================= board themes: the frame around the board (and in the shop) ================= */
[data-board="classic"] { --frame-side: #3d2210;
  background: repeating-linear-gradient(91deg, #ffffff10 0 2px, transparent 2px 19px), repeating-linear-gradient(89deg, #0000001a 0 3px, transparent 3px 27px), linear-gradient(#8a5130, #5e3219) !important; }
[data-board="candy"] { --frame-side: #d9558f;
  background: repeating-linear-gradient(45deg, #ff8cc4 0 12px, #fff4fa 12px 24px) !important; }
[data-board="night"] { --frame-side: #0b0722;
  background: linear-gradient(#2d2170, #150e38) !important; }
[data-board="royal"] { --frame-side: #7d5a08;
  background: linear-gradient(135deg, #fff0a8, #e3b23c 30%, #b88512 60%, #f5d26b 85%, #c4941c) !important; }
.board-wrap[data-board]:not([data-board="standard"]) { box-shadow: inset 0 3px 0 #ffffff55, inset 0 -3px 0 #0000002a, 0 10px 0 var(--frame-side), 0 10px 0 3px var(--ink), 0 30px 40px #0000004d; }
.board-wrap[data-board="night"] { box-shadow: inset 0 0 0 2px #7a66ff88, 0 0 26px #7a66ff66, 0 10px 0 var(--frame-side), 0 10px 0 3px var(--ink), 0 30px 40px #0000004d; }

/* home: the daily bonus is the little present next to the stars */
.topstars { display: flex; align-items: center; gap: 8px; flex: none; }
.giftbtn { position: relative; width: 48px; height: 48px; flex: none; padding: 0; border-radius: 16px; background: linear-gradient(#86e0ff, #2b8cf0); border: 3px solid var(--ink); box-shadow: inset 0 0 0 3px #ffffff40, 0 4px 0 var(--ink); cursor: pointer; display: grid; place-items: center; }
.giftbtn[hidden] { display: none; }
.giftbtn .gift-svg { width: 34px; height: 34px; display: block; }
.giftbtn:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px #ffffff40, 0 1px 0 var(--ink); }
.gift-badge { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); white-space: nowrap; background: #fff; color: var(--ink); font-weight: 900; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 9px; border: 2.5px solid var(--ink); font-variant-numeric: tabular-nums; pointer-events: none; }
.gift-badge:empty { display: none; }
.giftbtn.ready { animation: giftHop 2.4s ease-in-out infinite; }
.giftbtn.ready .gift-badge { background: #ffe14d; }
.giftbtn.ready::after { content: ""; position: absolute; inset: -7px; border-radius: 20px; border: 3px solid #ffe14d; opacity: 0; animation: giftRing 2.4s ease-out infinite; pointer-events: none; }
.giftbtn.done { background: linear-gradient(#b9b3c9, #8a83a0); }
.giftbtn.done .gift-svg { filter: saturate(.3) brightness(.9); }
.gift-badge.timer { font-size: 10px; padding: 3px 5px; }
@keyframes giftHop { 0%, 70%, 100% { transform: none; } 76% { transform: translateY(-5px) rotate(-6deg); } 84% { transform: translateY(0) rotate(5deg); } 90% { transform: rotate(-3deg); } }
@keyframes giftRing { 0%, 65% { opacity: 0; transform: scale(.85); } 72% { opacity: .9; } 100% { opacity: 0; transform: scale(1.15); } }
@media (max-width: 380px) { .giftbtn { width: 42px; height: 42px; border-radius: 14px; } .giftbtn .gift-svg { width: 30px; height: 30px; } .topstars { gap: 6px; } .starbox { font-size: 18px; padding-right: 10px; } }
@media (prefers-reduced-motion: reduce) { .giftbtn.ready, .giftbtn.ready::after { animation: none; } }

/* the 3D movie pawns' hats */
.cut3d .c-hat { position: absolute; display: block; pointer-events: none; max-width: none; }
#tokens .pic { overflow: visible; }

/* ---------- the star shop ---------- */
.modal.shop { width: min(560px, 100%); padding: 22px 20px 18px; }
.shop-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.shop-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-tabs button { font: inherit; font-weight: 900; font-size: 13px; letter-spacing: .05em; padding: 8px 12px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.shop-tabs button.on { background: linear-gradient(#86e0ff, #2b8cf0); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.shop-tabs button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.shop-bal { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-size: 18px; color: var(--ink); white-space: nowrap; }
.shop-stage { display: grid; place-items: center; min-height: 200px; padding: 14px; border-radius: 20px; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 35%, #ffffff, #e9e1fb 70%); box-shadow: inset 0 -6px 0 #0000000f; }
.shop-board { width: min(260px, 70vw); aspect-ratio: 1; padding: 10px; border-radius: 18px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--frame-side, #c4b9dc), 0 6px 0 3px var(--ink); }
.shop-board img { width: 100%; height: 100%; display: block; border-radius: 8px; }
.shop-pawns { display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 6px 0 10px; }
.pfig { position: relative; display: inline-block; flex: none; }
.pfig > img, .pfig > .pf { position: absolute; display: block; max-width: none; pointer-events: none; }
.pfig > .pf svg { width: 100%; height: 100%; display: block; overflow: visible; }
.shop-pawns .pfig::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: -4px; height: 16%; border-radius: 50%; background: radial-gradient(#0000003a, transparent 70%); }
.shop-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 2px 12px; }
.shop-info > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-info b { font-size: 19px; font-weight: 900; color: var(--ink); letter-spacing: .03em; }
.shop-info span { font-size: 13px; color: var(--muted); font-weight: 700; }
.shop-act { flex: none; white-space: nowrap; }
.shop-act.short { filter: saturate(.4); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.shop-item { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); cursor: pointer; color: var(--ink); }
.shop-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.shop-item.sel { background: #fff7d1; outline: 3px solid #ffc93c; outline-offset: -7px; }
.si-art { height: 66px; display: grid; place-items: end center; overflow: hidden; }
.si-art > img { width: 60px; height: 60px; border-radius: 8px; display: block; }
.si-name { font-size: 11px; font-weight: 900; letter-spacing: .03em; text-align: center; line-height: 1.1; }
.si-price { font-size: 12px; font-weight: 900; color: #b07800; }
.si-price.own { color: var(--muted); }
.si-price.on { color: #1a9e50; }
.shop-note { margin: 12px 2px 0; font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }
@media (max-width: 420px) { .modal.shop { padding: 18px 12px 14px; } .shop-grid { grid-template-columns: repeat(3, 1fr); } .shop-info { flex-wrap: wrap; } .shop-act { width: 100%; } .shop-tabs button { padding: 7px 9px; font-size: 12px; } }

/* guests: one banner ad under the header (never in a game). Labelled, with room around it
   so it can't be tapped by mistake, and it folds away when Google has no ad to show. */
.ad-top { display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 6px auto 4px; padding: 0 8px; max-width: 100%; overflow: hidden; }
.ad-top[hidden] { display: none; }
.ad-label { font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #ffffffb3; }
.ad-top ins { border-radius: 6px; max-width: 100%; }
/* no ad came: the spot stays (so nothing jumps), just empty */
.ad-top:has(ins[data-ad-status="unfilled"]) .ad-label { visibility: hidden; }
/* the start page fits the screen exactly (see fitHome): no little scroll, no rubber band */
html:has(body.on-home.home-fit), body.on-home.home-fit { overflow: hidden; overscroll-behavior: none; }

/* lobby: bot level picker (only once a bot is in the room) next to + BOT */
#botAdd { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bot-level { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .05em; color: var(--muted); }
.bot-level .input { width: auto; padding: 6px 8px; font-weight: 900; }

/* ---------- sign in (email code or guest) ---------- */
.auth-wrap { max-width: 430px; margin: 28px auto; padding: 0 4px; }
.auth-card { text-align: left; }
.auth-title { text-align: center; font-size: 18px !important; line-height: 1.15; margin-bottom: 12px !important; }
.auth-title span { font-size: 30px; color: #7444e0; letter-spacing: .03em; }
.auth-card .or { color: var(--muted); }
.auth-card .or::before, .auth-card .or::after { border-top-color: #d7cdf5; }
.auth-back { margin-top: 10px; }
.auth-foot { margin: 16px 0 0; }
.auth-foot a, .acct a { color: #7444e0; font-weight: 900; }
.ef-links { justify-content: space-between; margin-top: 10px; }
#efNum { letter-spacing: .45em; }
.modal #addEmailBox .sub { color: var(--muted); font-weight: 700; font-size: 14px; }
.modal #addEmailBox .field > label { color: var(--muted); }
/* home: a reminder strip for guests and accounts without an email */
.gnote { display: flex; flex-direction: column; align-items: center; width: 100%; margin: 12px 0 0; padding: 8px 12px; border-radius: 14px; border: 3px solid var(--ink); background: linear-gradient(#ffe14d, #ffc93c); box-shadow: 0 4px 0 var(--ink); color: var(--ink); cursor: pointer; font-weight: 900; }
.gnote b { font-size: 14px; letter-spacing: .04em; }
.gnote span { font-size: 11px; letter-spacing: .05em; opacity: .8; }
.gnote:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.gnote[hidden] { display: none; }
/* on the start page it's one slim line, as wide as the top row (it doesn't shrink with the column) */
.ghome > .gnote { flex-direction: row; justify-content: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden;
  width: max(100%, min(540px, calc(100vw - 40px))); align-self: center; box-sizing: border-box; margin: -6px 0 -4px; padding: 7px 12px; }
.ghome > .gnote b { font-size: 13px; }
.ghome > .gnote span { font-size: 11px; opacity: .85; overflow: hidden; text-overflow: ellipsis; }

/* ---------- privacy page ---------- */
.doc-page { overflow: auto; }
.doc { max-width: 720px; margin: 24px auto 60px; background: var(--panel); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: 0 6px 0 var(--ink); padding: 24px 28px; line-height: 1.55; font-weight: 600; }
.doc h1 { font-size: 30px; text-transform: uppercase; margin: 8px 0 10px; }
.doc h2 { font-size: 18px; text-transform: uppercase; margin: 22px 0 6px; }
.doc ul { padding-left: 20px; margin: 6px 0; }
.doc li { margin: 6px 0; }
.doc a { color: #7444e0; font-weight: 900; }
.doc-back { text-decoration: none; }
.doc-date { color: var(--muted); font-size: 13px; margin-top: 24px; }
@media (max-width: 560px) { .doc { margin: 10px; padding: 18px; } }

/* texts removed with the text editor (texts.js) */
.tx-gone { display: none !important; }


/* the room page (lobby): centred, a little tighter; on a computer app.js shrinks it to fit the window */
.lobby { max-width: 1040px; margin: 0 auto; }
.lobby .card { padding: 16px 18px; }
.lobby .code-big { font-size: 38px; }
.lobby .lobby-grid { margin-top: 14px; gap: 14px; }
.lobby .seats { gap: 8px; }
.lobby .seat { padding: 8px 10px; }
@media (max-width: 560px) {
  .lobby .card { padding: 14px; }
  .lobby .codebox { gap: 8px; }
  .lobby .code-big { font-size: 32px; }
  .lobby .codebox .btn { padding: 8px 12px; font-size: 13px; }
  .lobby .codebox .spacer { display: none; }
}
@media (min-width: 761px) { .lobby .lobby-grid { align-items: start; } .lobby #lSettings { max-height: calc(100vh - 200px); overflow-y: auto; } }
.lobby { width: 100%; box-sizing: border-box; } .lobby .lobby-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .lobby .lobby-grid > *, .lobby .card { min-width: 0; box-sizing: border-box; } @media (max-width: 960px) { .lobby .lobby-grid { grid-template-columns: minmax(0, 1fr); } .lobby #lSettings { max-height: none; } }
@media (min-width: 961px) { .lobby .lobby-grid > .card { max-height: calc(100vh - 280px); overflow-y: auto; } .lobby #lSettings { max-height: calc(100vh - 280px); } }

/* The dice's space is kept in every player's box, so the board never moves when the dice
   goes to the next player. */
.dice-slot { width: 0; height: 58px; }
@media (max-width: 560px) { .dice-slot { height: 48px; } }
@media (min-width: 961px) { .table .dice-slot { height: 66px; } }
.turn-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Phones colour their top and bottom browser bars from fixed things at the screen's edges:
   give them a solid colour (the 3D scene's sky) and take the hidden "Reconnecting" pill away
   completely while it isn't showing. */
/* iPhone Safari (iOS 26) colours its status bar and bottom bar from full-screen fixed layers,
   even nearly invisible ones (the 3D movie is built ahead while the pawn walks): give them
   the page's pink as their colour, so the bars never turn white */
.cut3d { background-color: var(--bg); }
.gag-pick.watch { inset: 16vh 0 auto 0; padding-top: 0; }
.net-status:not(.show) { visibility: hidden; }
.prank-btn.cooling { opacity: .55; }

/* new capture movies: NUKE, QUICKSAND, LAURENT */
.cut3d .cut-white { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cut3d .c-decal { position: absolute; left: 0; top: 0; display: block; }
.cut3d .c-decal svg, .cut3d .c-stand .c-art > svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cut3d .c-stand { clip-path: inset(-300% -100% 0 -100%); }
.cut3d .c-art.grab .la-up, .cut3d .c-art:not(.grab) .la-grab { display: none; }
.cut3d .c-bomb { border-radius: 0; }
.cut3d .c-bomb svg { height: 100%; width: auto; display: block; }
.cut3d .c-cap { background: radial-gradient(circle at 42% 38%, #fff1b8, #ffb347 22%, #e8642a 42%, #7a3b2a 58%, #4a2a2a00 71%); }
.cut3d .c-cap.dark { background: radial-gradient(circle at 42% 36%, #d8b494, #9a6e56 32%, #5e4040 56%, #4a343400 71%); }
.cut3d .c-dust { background: radial-gradient(circle at 40% 38%, #eed6ae, #b9926a 50%, #b9926a00 71%); }
.cut3d .c-ember { background: radial-gradient(circle, #fff3b0 0 20%, #ff8a2a 45%, #ff4d1f00 70%); }
.cut3d .c-sand { background: radial-gradient(circle at 40% 38%, #f3d9a6, #c99a5a 52%, #c99a5a00 71%); }
.cut3d .c-bubble { background: radial-gradient(circle at 34% 30%, #fff 0 14%, #f3dfb066 32%, #b98c5000 70%); box-shadow: inset 0 0 0 2px #fff9; }
.cut3d .c-ring.soft { border-color: #ffffffd0; }
.cut3d .c-twinkle { background: radial-gradient(circle, #ffe14d66, #ffe14d00 62%); }
.cut3d .c-twinkle svg { width: 70%; height: 70%; display: block; }
/* the troll picker: 7 movies, drawn icons */
.gp-card { width: min(94vw, 440px); }
.gp-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gp-btn { flex: 0 0 calc(25% - 6px); font-size: 12px; letter-spacing: .01em; }
.gp-btn:nth-child(5) { --c: #e8384f; } .gp-btn:nth-child(6) { --c: #d2a050; } .gp-btn:nth-child(7) { --c: #6d58b8; }
.gp-ico { font-size: 0; line-height: 0; }
.gp-ico svg { width: 40px; height: 40px; display: block; }
.gp-btn.long { font-size: 10px; line-height: 1.05; padding-left: 1px; padding-right: 1px; }
/* 9 movies: five in the first row, four in the second */
.gp-row { gap: 7px; }
.gp-btn { flex-basis: calc(20% - 6px); font-size: 11px; padding-top: 8px; padding-bottom: 7px; }
.gp-btn.long { font-size: 9px; }
.gp-ico svg { width: 36px; height: 36px; }
.gp-btn:nth-child(8) { --c: #f0a81c; } .gp-btn:nth-child(9) { --c: #17a86b; }

/* STAIRWAY and YEFFRY */
.cut3d .c-sky { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.cut3d .c-sky.heaven { background: radial-gradient(circle at 50% 18%, #fff 0, #fff6cf 26%, #ffe08f 52%, #ffc4e6 100%); }
.cut3d .c-sky.hell { background: linear-gradient(#000 0, #160202 42%, #4d0b02 72%, #a3260a 100%); }
.cut3d .c-sky.day { background: linear-gradient(#3f9dff 0, #a9dcff 55%, #eaf7ff 100%); }
.cut3d .c-step i { position: absolute; display: block; transform-origin: 0 0; }
.cut3d .c-step .st-top { background: linear-gradient(#fff6c4, #ffd24a 55%, #f5b524); box-shadow: inset 0 0 0 3px #b8740f, 0 0 18px #fff3a0; border-radius: 3px; }
.cut3d .c-step .st-rise { background: linear-gradient(#f2a21e, #c26a0a); box-shadow: inset 0 0 0 3px #8a4a06; }
.cut3d .c-decal.c-darkfloor { border-radius: 50%; background: radial-gradient(closest-side, #090101f2 0 52%, #09010100); opacity: 0; }
.cut3d .c-phone { position: absolute; pointer-events: none; filter: drop-shadow(0 2px 0 #0004); }
.cut3d .c-phone svg { width: 100%; height: 100%; display: block; }
.cut3d .c-tower i, .cut3d .c-tower canvas { position: absolute; left: 0; top: 0; display: block; transform-origin: 0 0; }
/* the skyscraper is made of wood, like the board's frame: planks, grain and joints */
.cut3d .c-wall { background:
  linear-gradient(90deg, #4a2a12 0 1.5px, #0000 1.5px) 0 0 / 13px 100%,
  linear-gradient(#4a2a12 0 1.5px, #0000 1.5px) 0 0 / 100% 46px,
  repeating-linear-gradient(90deg, #ffffff10 0 2px, #0000 2px 5px, #00000014 5px 6px, #0000 6px 9px),
  linear-gradient(#e0a060, #c98345 30%, #9a5c2c 75%, #6e3f1c); }
.cut3d .c-wall.b0 { background: linear-gradient(90deg, #5a3a2a 0 3px, #0000 3px) 0 0 / 9px 100%, linear-gradient(#5a3a2a 0 3px, #0000 3px) 0 0 / 100% 8px, linear-gradient(#ffe0b0, #d99a62 60%, #8a5a3a); }
.cut3d .c-wall.b1 { background: linear-gradient(90deg, #39404e 0 2px, #0000 2px) 0 0 / 8px 100%, linear-gradient(#39404e 0 3px, #0000 3px) 0 0 / 100% 8px, linear-gradient(#eef2f8, #b5bfcf 60%, #6c7688); }
.cut3d .c-wall.b2 { background: linear-gradient(90deg, #2c5a46 0 3px, #0000 3px) 0 0 / 10px 100%, linear-gradient(#2c5a46 0 3px, #0000 3px) 0 0 / 100% 9px, linear-gradient(#c8f5dc, #6cc49a 60%, #2f7a5a); }
.cut3d .c-broof { background: #59606e; box-shadow: inset 0 0 0 3px #3a404c; }
.cut3d .c-city { background: radial-gradient(closest-side, #0000 30%, #d6ecff 100%), linear-gradient(90deg, #8b909b 0 2px, #0000 2px) 0 0 / 16px 16px, linear-gradient(#8b909b 0 2px, #0000 2px) 0 0 / 16px 16px, linear-gradient(135deg, #7fbf6a, #9ccf7e 50%, #86b874); }
.cut3d .c-cloud { background: radial-gradient(closest-side, #fff, #ffffffb0 45%, #fff0); }
