/* ───── buttons ─────
   Tactile "toy" buttons: a fill, an ink outline and a hard shadow that the button sinks into when pressed. */
.btn { --b: var(--surface); --c: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 16px; border: 2px solid var(--edge); background: var(--b); color: var(--c); font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .01em; box-shadow: var(--pop); transition: transform .12s ease, box-shadow .12s ease, filter .15s; position: relative; white-space: nowrap; user-select: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--edge); filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn[disabled] { opacity: .5; pointer-events: none; box-shadow: 0 2px 0 var(--edge); }
.btn svg.ico { width: 1.15em; height: 1.15em; }
.btn-primary { --b: var(--coral); --c: #fff; }
.btn-sky { --b: var(--sky); --c: #fff; }
.btn-grape { --b: var(--grape); --c: #fff; }
.btn-mint { --b: var(--mint); --c: #08352a; }
.btn-sun { --b: var(--sun); --c: #3b2700; }
.btn-ghost { --b: var(--surface); --c: var(--ink); }
.btn-lg { min-height: 60px; padding: 0 32px; font-size: 21px; border-radius: 20px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 12px; box-shadow: 0 3px 0 var(--edge); }
.btn-sm:hover { box-shadow: 0 4px 0 var(--edge); } .btn-sm:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn-icon { width: 48px; padding: 0; }
.btn-block { width: 100%; }
.iconbtn { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line2); position: relative; color: var(--ink); transition: border-color .15s, transform .15s var(--spring), background .15s; flex: none; }
.iconbtn:hover { border-color: var(--edge); transform: translateY(-1px); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 22px; height: 22px; }
.badge { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--coral); color: #fff; font: 800 12px/18px var(--font); text-align: center; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--edge); }
.badge.ok { background: var(--mint); color: #08352a; }
.ico { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }

/* ───── pills & chips ───── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--surface3); color: var(--ink); font-weight: 800; font-size: 13px; white-space: nowrap; }
.pill.soft { background: var(--fill); font-weight: 700; }
.pill.live { background: var(--mint-soft); color: #0b6b50; }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(47, 212, 163, .7); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(47, 212, 163, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 212, 163, 0); } }
.stars-pill { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 8px; border-radius: 99px; background: var(--sun-soft); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--ink); transition: transform .15s var(--spring); }
.stars-pill:hover { transform: translateY(-1px); }
.stars-pill .st { width: 28px; height: 28px; }
.stars-pill.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.18) rotate(-3deg); } }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 99px; background: var(--surface); border: 2px solid var(--line2); color: var(--ink); font-weight: 800; font-size: 15px; transition: border-color .15s, transform .15s var(--spring), background .15s; }
.chip:hover { border-color: var(--edge); transform: translateY(-1px); }
.chip.on { background: var(--coral); border-color: var(--coral); color: #fff; }
.chip .emoji { font-size: 19px; }
.rarity { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.rarity.common { background: var(--surface3); color: #5d5785; }
.rarity.rare { background: var(--sky-soft); color: #0d63b0; }
.rarity.epic { background: var(--grape-soft); color: #5a2fd6; }
.rarity.legendary { background: var(--sun-soft); color: #8a5300; box-shadow: inset 0 0 0 1.5px #f2b322; }

/* ───── cards and sections ─────
   .card is a passive container (soft outline). Things you tap get the ink outline + hard shadow. */
.card { background: var(--surface); border-radius: var(--r-lg); border: 2px solid var(--line2); box-shadow: 0 3px 0 var(--line2); padding: 20px; }
.section { margin: 40px 0 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(22px, 2.6vw, 28px); }
.section-head > :last-child:not(h2):not(.sh-ic) { margin-left: auto; }
.section-head a, .section-head button.link { color: var(--sky); font-weight: 800; font-size: 15px; white-space: nowrap; }
.section-head a:hover, .section-head button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sh-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; border: 2px solid var(--edge); background: var(--sun-soft); flex: none; transform: rotate(-4deg); }
.sh-ic.coral { background: var(--coral-soft); } .sh-ic.mint { background: var(--mint-soft); } .sh-ic.sky { background: var(--sky-soft); } .sh-ic.grape { background: var(--grape-soft); } .sh-ic.pink { background: var(--pink-soft); }

/* ───── game card ───── */
.gcard { --accent: var(--grape); position: relative; display: block; text-align: left; border-radius: 22px; background: var(--surface); border: 2px solid var(--edge); box-shadow: var(--pop); padding: 6px; transition: transform .25s var(--spring), box-shadow .2s; cursor: pointer; isolation: isolate; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.gcard:hover, .gcard:focus-visible { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 9px 0 var(--edge); }
.gcard:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--edge); }
.gcard .art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 16px; background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.gcard .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gcard:hover .art img { transform: scale(1.06); }
.gcard .cat { position: absolute; left: 8px; top: 8px; z-index: 2; background: var(--surface); border: 1.5px solid var(--edge); font-size: 12px; padding: 3px 10px; }
.gcard .cat .dim3 { color: var(--grape); }
.gcard .kidtag { position: absolute; left: 8px; bottom: 8px; z-index: 2; background: var(--sun); color: #2a1f00; border: 1.5px solid var(--edge); font-size: 11.5px; padding: 2px 9px; }
.kidszone .gcard .kidtag, .hub-kids .gcard .kidtag { display: none; }
.gcard .fav { position: absolute; right: 8px; top: 8px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--edge); color: var(--ink); transition: transform .2s var(--spring); }
.gcard .fav:hover { transform: scale(1.12); }
.gcard .fav svg { width: 19px; height: 19px; }
.gcard .fav.on svg { fill: var(--coral); stroke: var(--coral); animation: heart .5s var(--spring); }
@keyframes heart { 40% { transform: scale(1.5); } }
.gcard .playchip { position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: #fff; border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); cursor: pointer; transform: translateY(10px) scale(.6); opacity: 0; transition: .25s var(--spring); }
.gcard:hover .playchip, .gcard:focus-visible .playchip { transform: none; opacity: 1; }
@media (hover: none) { .gcard .playchip { transform: none; opacity: 1; } }   /* phones and tablets: the play button is always there, no hover needed */
.gcard .playchip svg { width: 20px; height: 20px; margin-left: 2px; }
.gcard .info { padding: 12px 8px 6px; }
.gcard h3 { font-size: 19px; margin-bottom: 4px; }
.gcard .desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.gcard .meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.gcard .meta .online, .gcard .gstats .online { color: var(--good); display: inline-flex; align-items: center; gap: 6px; }
.gcard .meta .online::before, .gcard .gstats .online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--mint-soft); }
.gcard .meta .soft { color: var(--faint); }
.gcard.compact { width: 260px; flex: none; scroll-snap-align: start; }
.gcard.compact .info { padding: 10px 8px 6px; }
.gcard.compact h3 { font-size: 17px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.hscroll { display: flex; gap: 18px; overflow-x: auto; padding: 6px 4px 24px; margin: 0 -4px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }

/* the age badge (components/agebadge.js): used on game cards, game pages, the developer portal and the admin panel */
.agebadge { --age: var(--fill2); --agefg: var(--muted); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none; box-sizing: border-box; background: var(--age); color: var(--agefg); border: 2px solid var(--edge); font-family: var(--display); font-weight: 700; line-height: 1; white-space: nowrap; }
.agebadge.b3 { --age: #2fd4a3; --agefg: var(--ink); } .agebadge.b5 { --age: #3cc8ee; --agefg: var(--ink); } .agebadge.b7 { --age: #2f7fe8; --agefg: #fff; } .agebadge.b9 { --age: #7c4dff; --agefg: #fff; }
.agebadge.b12 { --age: #ff8a3d; --agefg: var(--ink); } .agebadge.b15 { --age: #e0334d; --agefg: #fff; } .agebadge.b18 { --age: #251e52; --agefg: #fff; border-color: #fff; box-shadow: 0 0 0 2px #251e52; }
.agebadge.s-s { height: 24px; min-width: 38px; padding: 0 8px; border-radius: 999px; font-size: 13px; }
.agebadge.s-m { height: 30px; min-width: 46px; padding: 0 10px; border-radius: 999px; font-size: 16px; }
.agebadge.s-l { width: 84px; height: 84px; border-radius: 50%; font-size: 34px; box-shadow: var(--pop); }
.agebadge.s-l::after { content: 'years'; margin-top: 4px; font: 800 11px var(--font); letter-spacing: .08em; text-transform: uppercase; }
.agebadge.none.s-l { box-shadow: none; }
/* on a game card it sits on the picture, bottom left */
.agepill { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: inline-flex; }
.agepill-d { display: inline-flex; align-items: center; gap: 8px; background: var(--surface2); color: var(--ink); font-weight: 800; padding-left: 4px; }
.gcard .by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard.blocked .art img { filter: grayscale(.85) brightness(.75); }
.gcard.blocked .playchip { display: none; }
.agelock { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; color: #fff; font-weight: 800; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); text-align: center; padding: 8px; }

/* Game stats (components/gamestats.js): card line, game-page strip, like / dislike buttons */
.gcard .gstats { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.gcard .gstats .gs-score { color: var(--good); }
.gd-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.gd-stat { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; background: var(--surface2); border: 2px solid var(--line2); text-align: center; min-width: 0; }
.gd-stat b { font: 600 22px var(--display); line-height: 1.1; }
.gd-stat small { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.gd-stat.score b { color: #c98400; } .gd-stat.up b { color: var(--good); } .gd-stat.down b { color: var(--bad); }
.vote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vote-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 18px; border-radius: 99px; border: 2px solid var(--edge); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 var(--edge); transition: transform .12s, box-shadow .12s, background .15s; }
.vote-btn .ve { font-size: 20px; line-height: 1; }
.vote-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--edge); }
.vote-btn:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.vote-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; border-color: var(--line2); }
.vote-btn.like.on { background: var(--mint); }
.vote-btn.dislike.on { background: var(--coral-soft); }
.vote-hint { flex-basis: 100%; }
.vote.compact { margin-top: 8px; }
.pm-vote { padding: 14px; border-radius: 18px; background: var(--surface2); border: 2px solid var(--line2); }
@media (max-width: 560px) {
  .gd-stats { gap: 6px; } .gd-stat { padding: 8px 4px; } .gd-stat b { font-size: 17px; } .gd-stat small { font-size: 9px; }
}

/* ───── tiles (home page, games list): small cards, as many as fit the column ───── */
.page.wide { width: min(100%, 1560px); }
.grid.tiles { --cols: 2; gap: 20px 16px; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
@container main (min-width: 540px) { .grid.tiles { --cols: 3; } }
@container main (min-width: 860px) { .grid.tiles { --cols: 4; } }
@container main (min-width: 1180px) { .grid.tiles { --cols: 5; } }
@container main (min-width: 1440px) { .grid.tiles { --cols: 6; } }
.gcard.tile { border-radius: 20px; padding: 5px; }
.gcard.tile .art { aspect-ratio: 16 / 9; border-radius: 15px; }
.gcard.tile .info { padding: 8px 7px 5px; }
.gcard.tile h3 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard.tile .gstats { margin-top: 2px; gap: 8px; flex-wrap: wrap; row-gap: 0; }
.gcard.tile .cat { left: 6px; top: 6px; transform: scale(.88); transform-origin: left top; }
.gcard.tile .fav { width: 32px; height: 32px; right: 6px; top: 6px; } .gcard.tile .fav svg { width: 16px; height: 16px; }
.gcard.tile .playchip { width: 40px; height: 40px; right: 6px; bottom: 6px; } .gcard.tile .playchip svg { width: 17px; height: 17px; }
.gcard.tile .agepill { left: 6px; bottom: 6px; transform: scale(.9); transform-origin: left bottom; }
.gcard.tile.compact { width: 210px; }
/* "Recommended For You": exactly two rows, whatever the number of columns */
@container main (max-width: 1439px) { .grid.tiles.two-rows > :nth-child(n+11) { display: none; } }
@container main (max-width: 1179px) { .grid.tiles.two-rows > :nth-child(n+9) { display: none; } }
@container main (max-width: 859px) { .grid.tiles.two-rows > :nth-child(n+7) { display: none; } }

/* ───── avatars: 3D snapshots (js/avatars.js) in a bubble tinted with the shirt colour until the picture is ready ───── */
.av { --av: #b39dff; position: relative; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; border: 2px solid var(--edge);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--av) 30%, var(--surface2)) 0 45%, color-mix(in srgb, var(--av) 55%, var(--surface2))); }
.av img { width: 108%; height: 108%; max-width: none; object-fit: contain; margin-top: 8%; }
.av.sq { border-radius: 30%; }
.av.nb { --nb: var(--coral); background: var(--nb); border-color: color-mix(in srgb, var(--nb) 60%, #000); color: #fff; container-type: size; }
.av.nb > span { font-weight: 900; font-size: 46cqh; line-height: 1; text-shadow: 0 1px 0 rgba(0,0,0,.25); user-select: none; }
.av.s32 { width: 32px; height: 32px; border-width: 1.5px; } .av.s44 { width: 44px; height: 44px; } .av.s56 { width: 56px; height: 56px; } .av.s72 { width: 72px; height: 72px; } .av.s120 { width: 120px; height: 120px; }
img.avpic { opacity: 0; transition: opacity .25s; } img.avpic.ready { opacity: 1; }
.dot { width: 13px; height: 13px; border-radius: 50%; background: #5d5878; border: 2.5px solid var(--surface); flex: none; }
.dot.on { background: var(--mint); }
.dot.play { background: var(--sky); }

/* ───── forms ───── */
.input { width: 100%; height: 50px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--line2); background: var(--surface); outline: none; font-weight: 700; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: var(--faint); }
.input:focus { border-color: var(--edge); box-shadow: 0 0 0 4px var(--sky-soft); }
.input::placeholder { color: var(--faint); font-weight: 600; }
.code-input { text-align: center; letter-spacing: .3em; font-family: var(--display); font-size: 24px; text-transform: uppercase; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 16px; background: var(--surface3); flex-wrap: wrap; }
.seg button { padding: 8px 16px; border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--muted); border: 2px solid transparent; transition: .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); border-color: var(--edge); box-shadow: 0 2px 0 var(--edge); }
.switch { width: 60px; height: 36px; border-radius: 99px; background: var(--line2); border: 2px solid var(--edge); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--edge); transition: transform .3s var(--spring); }
.switch.on { background: var(--mint); }
.switch.on::after { transform: translateX(24px); }
select.input { appearance: none; padding-right: 36px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }

/* ───── modal / sheet / toast ───── */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(37, 30, 82, .42); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fade .2s both; }
.modal { width: min(100%, 460px); max-height: 90dvh; overflow: auto; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r-xl); padding: 28px 22px 24px; box-shadow: var(--shadow); animation: pop .4s var(--spring) both; text-align: center; }
.modal h3 { font-size: 27px; margin-bottom: 8px; }
.modal p { color: var(--muted); }
.modal .actions { display: flex; gap: 10px; margin-top: 22px; justify-content: center; flex-wrap: wrap; }
.modal .actions .btn { flex: 1 1 140px; }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 14px); display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
/* while a game is on screen the toasts must never sit between a finger and the game's own buttons (Back, Back home…) */
body[data-layout="game"] .toast { pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 5px 0 var(--edge), var(--soft); font-weight: 800; animation: toastIn .45s var(--spring) both; }
.toast.out { animation: toastOut .3s ease both; }
.toast .ti { font-size: 26px; line-height: 1; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--sun-soft); flex: none; }
.toast small { display: block; color: var(--muted); font-weight: 700; font-size: 13px; }
.toast.good .ti { background: var(--mint-soft); }
.toast.bad .ti { background: var(--coral-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.95); } }
.confetti { position: fixed; z-index: 400; top: 0; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: confetti 2.2s var(--ease) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: .9; } }

/* drawers / sheets */
.drawer-wrap { position: fixed; inset: 0; z-index: 150; background: rgba(37, 30, 82, .32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s both; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(100%, 420px); background: var(--bg); border-left: 2px solid var(--edge); box-shadow: -18px 0 50px -20px rgba(37, 30, 82, .45); display: flex; flex-direction: column; animation: slideIn .35s var(--ease) both; padding-top: var(--safe-t); }
.drawer.pop-top { right: 16px; left: auto; top: calc(var(--topbar-h) + var(--safe-t) + 4px); bottom: auto; max-height: min(78dvh, 640px); border-radius: var(--r-lg); border: 2px solid var(--edge); width: min(calc(100% - 32px), 400px); box-shadow: var(--shadow); animation: pop .3s var(--spring) both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.drawer-head h3 { font-size: 25px; }
.drawer-body { flex: 1; overflow: auto; padding: 4px 16px 22px; -webkit-overflow-scrolling: touch; }
@keyframes slideIn { from { transform: translateX(100%); } }
@media (max-width: 720px) {
  .drawer { width: 100%; border-left: 0; }
  .drawer.pop-top { right: 0; left: 0; top: auto; bottom: 0; width: 100%; max-height: 82dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; border-width: 2px 0 0; animation: sheetUp .38s var(--ease) both; padding-bottom: var(--safe-b); }
}
@keyframes sheetUp { from { transform: translateY(100%); } }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); font-weight: 700; }
.empty .big { font-size: 48px; margin-bottom: 8px; }
.skeleton { background: linear-gradient(100deg, var(--surface3) 30%, var(--surface) 50%, var(--surface3) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 3px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 16px; border-radius: 14px; font-weight: 800; color: var(--muted); transition: .15s; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; border: 2px solid transparent; }
.tab:hover { color: var(--ink); background: var(--fill); }
.tab.on { color: #fff; background: var(--coral); border-color: var(--coral); }
.progress { height: 14px; border-radius: 99px; background: var(--surface3); border: 2px solid var(--edge); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: repeating-linear-gradient(-45deg, var(--mint) 0 10px, #4ee0b5 10px 20px); transition: width .8s var(--ease); }

/* ───── player card (tap somebody in a plaza) and the "where shall we play?" picker ───── */
.pcard { display: grid; gap: 10px; justify-items: center; }
.pcard-stage { position: relative; width: 150px; height: 130px; display: grid; place-items: center; }
.pcard-pet { position: absolute; right: -14px; bottom: -6px; width: 64px; height: 64px; }
.pcard h3 { margin: 0; }
.pcard-about { margin: 0; color: var(--muted); font-size: 15px; }
.pcard .actions { width: 100%; margin-top: 8px; }
.gpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; margin-top: 14px; max-height: 50dvh; overflow: auto; padding: 4px 2px 6px; }
.gpick-i { --accent: var(--grape); display: grid; gap: 6px; justify-items: center; padding: 8px 6px 10px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line2); color: inherit; cursor: pointer; transition: transform .2s var(--spring), border-color .15s; }
.gpick-i:hover, .gpick-i:focus-visible { transform: translateY(-3px); border-color: var(--edge); }
.gpick-i img, .gpick-sq { width: 84px; height: 56px; object-fit: cover; border-radius: 10px; display: grid; place-items: center; font-size: 30px; background: var(--surface3); }
.gpick-i b { font-size: 13px; line-height: 1.15; text-align: center; }

/* quick chat: the bubble of things to say that pops up next to your character (components/quick-chat.js) */
.qchat { position: fixed; inset: 0; z-index: 900; }
.qchat-panel { position: fixed; width: min(340px, calc(100vw - 16px)); max-height: min(60vh, 420px); overflow-y: auto; padding: 10px; border-radius: 22px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 4px 0 var(--edge), 0 18px 40px -12px rgba(30, 20, 70, .45); animation: qchat-pop .16s var(--spring, ease-out); }
.qchat-panel::after { content: ''; position: absolute; left: calc(var(--tail, 50%) - 9px); bottom: -10px; width: 16px; height: 16px; background: var(--surface); border-right: 2px solid var(--edge); border-bottom: 2px solid var(--edge); transform: rotate(45deg); }
.qchat-panel.below::after { bottom: auto; top: -10px; transform: rotate(225deg); }
@keyframes qchat-pop { from { transform: scale(.85) translateY(8px); opacity: 0; } }
.qchat-row { display: flex; flex-wrap: wrap; gap: 6px; }
.qchat-row + .qchat-row, .qchat-head { margin-top: 8px; }
.qchat-head { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.qchat-head + .qchat-row { margin-top: 4px; }
.qchat-emoji { justify-content: space-between; }
.qchat-emo { width: 46px; height: 46px; font-size: 26px; border-radius: 14px; background: var(--surface3); display: grid; place-items: center; }
.qchat-emo:active, .qchat-phrase:active { transform: scale(.94); }
.qchat-phrase { min-height: 40px; padding: 6px 12px; border-radius: 99px; background: var(--surface3); color: var(--ink); font-weight: 800; font-size: 14px; border: 2px solid transparent; }
.qchat-phrase.game { background: var(--sun-soft); border-color: var(--line2); }
