:root { --blush:#F7C6D0; --butter:#F9E79F; --mint:#BDE5D1; --lilac:#CDB4DB; --sky:#A2D2FF; --ink:#5a4a5e; --paper:#fffaf7; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fbeef0; color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; border-radius: 999px; background: #fff; padding: 10px 16px; min-height: 44px;
  box-shadow: 0 2px 0 rgba(90,74,94,.12), 0 6px 18px rgba(90,74,94,.10); }
button:active { transform: translateY(1px); }
button.primary { background: var(--ink); color: #fff; font-weight: 700; }
kbd { font: 600 11px/1 system-ui, sans-serif; border: 1px solid currentColor; border-radius: 5px; padding: 2px 5px; margin-left: 6px; opacity: .6; }
.touch-only, .mouse-only, .pad-only { display: none; }
body.touch .touch-only { display: inline; }
body.mouse .mouse-only { display: inline; }
body.pad .pad-only { display: inline; }
body.pad .touch-only, body.pad .mouse-only { display: none !important; }

#hud { position: fixed; left: 0; right: 0; top: 0; padding: max(10px, env(safe-area-inset-top)) 14px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; }
#hud > * { pointer-events: auto; }
#title h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; font-weight: 800; color: var(--ink); }
#title [data-wefav-mark] { display: block; margin-top: 2px; font-size: 12px; opacity: .8; }
#toyname { position: fixed; left: 0; right: 0; top: calc(max(10px, env(safe-area-inset-top)) + 64px); text-align: center; font-weight: 700; font-size: 15px; opacity: .75; pointer-events: none; }
#mute { font-size: 13px; padding: 8px 14px; }
#hint { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); width: min(92vw, 420px); text-align: center; font-weight: 700; font-size: 16px; line-height: 1.3;
  background: rgba(255,255,255,.75); border-radius: 18px; padding: 10px 14px; pointer-events: none; transition: opacity .5s; }
#hint.gone { opacity: 0; }
#hint .pl, #hint.pull .sq { display: none; }
#hint.pull .pl { display: inline; }
#toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; pointer-events: none; font-weight: 800; font-size: 22px; line-height: 1.15;
  text-shadow: 0 2px 0 #fff, 0 0 18px #fff; white-space: nowrap; animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
#toast small { display: block; font-size: 14px; font-weight: 700; opacity: .8; margin-top: 4px; }
#toast .tier { display: inline-block; font-size: 12px; letter-spacing: 1.5px; padding: 3px 10px; border-radius: 99px; margin-bottom: 6px; background: #fff; text-shadow: none; }
.t-common { color: #6a8f7e; } .t-rare { color: #3c78c4; } .t-ultra { color: #b04fb8; } .t-diamond { color: #1f8fd6; text-shadow: 0 0 8px #bfeaff; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
#shelfBtn { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); font-weight: 800; padding: 10px 22px; }
#shelfBtn.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: translateX(-50%) scale(1.15); } }
#shelfCount { opacity: .65; margin-left: 4px; }
#jarBadge { position: fixed; right: 14px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 10px); font-size: 12px; font-weight: 700; opacity: .6; pointer-events: none; }

section[hidden] { display: none !important; }
#shelf, #result { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; background: rgba(251,238,240,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow-y: auto; padding: max(12px, env(safe-area-inset-top)) 12px 16px; }
.panel { width: min(100%, 460px); background: var(--paper); border-radius: 26px; padding: 16px 16px 14px; box-shadow: 0 12px 40px rgba(90,74,94,.18); margin: auto 0; }
.panel h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800; }
.panel h3 { margin: 14px 0 6px; font-size: 16px; }
.dim, .sub { opacity: .65; font-weight: 600; }
.sub { margin: 0 0 10px; font-size: 14px; }
.row { display: flex; gap: 8px; justify-content: center; margin: 12px 0 4px; flex-wrap: wrap; }
#charmGrid .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#charmGrid .sethead { margin: 10px 0 6px; font-size: 15px; }
#charmGrid .sethead:first-child { margin-top: 0; }
.setnote { margin: -2px 0 6px; font-size: 13px; font-weight: 700; color: #b04fb8; }
.grid.setlocked { opacity: .55; }
/* placed by placePullShare() in main.js: just above Shelf on phones, beside it when the bottom row has room; never on the toy */
#pullShare { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px); font-weight: 800; font-size: 15px; padding: 10px 20px; min-height: 44px; white-space: nowrap; background: var(--ink); color: #fff; animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
#pullShare[hidden] { display: none; }
#swapBtn { position: fixed; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 90px); font-size: 13px; font-weight: 700; padding: 6px 14px; min-height: 36px; background: rgba(255,255,255,.85); white-space: nowrap; box-shadow: 0 2px 8px rgba(80,40,70,.12); }
#swapBtn::before { content: "\21C4"; margin-right: 6px; }
#swapBtn[hidden] { display: none; }
.charm { background: #fff; border-radius: 14px; padding: 4px 2px 6px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.1; position: relative; }
.charm img { width: 100%; aspect-ratio: 1; display: block; }
.charm.locked img { filter: brightness(0) opacity(.12); }
.charm .n { position: absolute; top: 4px; right: 6px; font-size: 11px; opacity: .7; }
.charm .tierdot { display: block; font-size: 9px; letter-spacing: 1px; margin-top: 2px; }
#jar { width: 160px; height: 120px; margin: 4px auto 0; border: 3px solid rgba(90,74,94,.25); border-top: 0; border-radius: 10px 10px 34px 34px; position: relative; overflow: hidden; background: rgba(255,255,255,.6); }
#jarBlobs { position: absolute; inset: auto 6px 6px 6px; display: flex; flex-wrap: wrap-reverse; gap: 2px; }
#jarBlobs i { width: 18px; height: 12px; border-radius: 50% 50% 45% 55%; display: block; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.credit { font-size: 12px; opacity: .6; text-align: center; margin: 10px 0 0; }
.credit a, #doorThanks a { color: inherit; }
#resTitle { color: #c4517a; font-size: 34px; text-align: center; }
#resLine { text-align: center; margin: 2px 0 6px; font-weight: 600; }
#resCharms { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
#resCharms img { width: 54px; height: 54px; background: #fff; border-radius: 12px; }
#vote { margin-top: 8px; }
#vote .q { margin: 0 0 6px; font-weight: 700; font-size: 14px; text-align: center; }
#vote .opts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
#vote .opts button { white-space: nowrap; font-size: 13px; flex: none; }
#voteThanks, #doorThanks { text-align: center; font-weight: 700; margin: 8px 0; font-size: 14px; }
.door { display: block; margin: 8px auto 6px; font-size: 13px; background: #f3e9f6; }
[data-wefav-row] { margin-top: 8px; text-align: center; font-size: 13px; }
@media (min-width: 900px) and (pointer: fine) {
  #title h1 { font-size: 34px; }
  #hud { padding: 22px 28px 0; }
  #toyname { top: 30px; font-size: 18px; }
  #swapBtn { top: 62px; }
}
#result.locked .panel { pointer-events: none; }
#result { align-items: flex-end; background: rgba(251,238,240,.25); backdrop-filter: none; -webkit-backdrop-filter: none; }
#result .panel { margin: 0; }
@media (min-width: 900px) { #result { align-items: center; justify-content: flex-end; padding-right: 6vw; } }

.hudbtns { display: flex; align-items: center; gap: 6px; position: relative; }
#dailyBtn { font-size: 13px; font-weight: 800; padding: 8px 14px; min-height: 40px; position: relative; }
#dailyBtn.fresh { background: var(--ink); color: #fff; }
#dailyBtn.fresh::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: #b04fb8; border: 2px solid #fff; }
#streak { position: absolute; right: 4px; top: 46px; white-space: nowrap; font-size: 12px; font-weight: 800; color: #b04fb8; pointer-events: none; }
#streak:empty { display: none; }
#resDaily { text-align: center; background: #fff; border-radius: 18px; padding: 10px 12px; margin: 6px 0 8px; }
#resDaily b { display: block; font-size: 30px; color: #b04fb8; }
#resDaily span { display: block; font-weight: 800; }
#resDaily small { display: block; margin-top: 4px; font-size: 13px; opacity: .7; font-weight: 600; }
#hud button, #title h1 { white-space: nowrap; }
#toast small + small { margin-top: 2px; }
@media (max-width: 400px) { #hud #mute, #dailyBtn { padding: 8px 11px; } #title h1 { font-size: 23px; } }

/* round 6: pick the next squishy on the result card */
#picker { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; flex-wrap: wrap; }
#picker[hidden] { display: none; }
#picker .q { font-weight: 700; font-size: 13px; }
#pickOpts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; background: rgba(255,255,255,.6); border-radius: 999px; padding: 3px; }
#pickOpts button { min-height: 38px; padding: 6px 10px; font-size: 13px; background: transparent; }
@media (max-width: 420px) { #pickOpts button { padding: 6px 7px; font-size: 12px; } }
#pickOpts button.on { background: var(--ink); color: #fff; font-weight: 700; }
@media (max-width: 480px) { #pickOpts:has(button:nth-child(6)) { display: grid; grid-template-columns: repeat(3, auto); border-radius: 22px; } } /* studio#164: six squishies sit three and three on a phone */

/* studio#152: the charm viewer (the charm itself is drawn into the canvas behind it) */
#viewer { position: fixed; inset: 0; touch-action: none; }
#shelf.under { visibility: hidden; }
body.viewing #hud, body.viewing #toyname, body.viewing #hint, body.viewing #shelfBtn, body.viewing #jarBadge, body.viewing #pullShare, body.viewing #swapBtn, body.viewing #toast { visibility: hidden; }
.vbtn { position: absolute; width: 48px; height: 48px; padding: 0; font-size: 22px; font-weight: 800; line-height: 1; background: rgba(255,255,255,.9); }
#vClose { top: max(12px, env(safe-area-inset-top)); right: 14px; }
.varrow { font-size: 34px; padding-bottom: 4px; }
#vPrev { left: 10px; } #vNext { right: 10px; }
.varrow[hidden] { display: none; }
#vInfo { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 420px); text-align: center;
  background: var(--paper); border-radius: 24px; padding: 12px 14px 8px; box-shadow: 0 10px 30px rgba(90,74,94,.14); }
#vName { font-size: 24px; font-weight: 800; line-height: 1.15; }
#vMeta { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; align-items: center; margin-top: 6px; font-size: 14px; font-weight: 700; }
#vSet { opacity: .75; }
#vCount { background: #fff; border-radius: 99px; padding: 2px 10px; }
.vtier { display: inline-block; font-size: 12px; letter-spacing: 1.5px; padding: 4px 11px; border-radius: 99px; background: #fff; font-weight: 800; position: relative; overflow: hidden; }
.vtier.t-ultra { background: linear-gradient(100deg, #fff 30%, #f6e6ff 45%, #fff6d6 55%, #fff 70%) 0 0 / 300% 100%; animation: vsheen 2.6s linear infinite; }
.vtier.t-diamond { background: linear-gradient(100deg, #fff 25%, #dff4ff 40%, #fff 50%, #e8fbff 60%, #fff 75%) 0 0 / 300% 100%; animation: vsheen 1.4s linear infinite; }
.sethead.diamondhead { color: #1f8fd6; }
.charm.dia { background: linear-gradient(160deg, #f3fbff, #ffffff 60%, #e6f6ff); box-shadow: 0 0 0 2px #bfeaff inset; }
#toast .tier.toast-dia { font-size: 26px; letter-spacing: 3px; }
@keyframes vsheen { from { background-position: 100% 0; } to { background-position: -50% 0; } }
#vInfo .row { margin: 10px 0 4px; }
#vShare { min-width: 140px; }
#vHelp { margin: 4px 0 0; font-size: 12px; }
@media (max-height: 680px) { #vName { font-size: 21px; } #vInfo { padding: 8px 12px 6px; } #vInfo .row { margin: 6px 0 2px; } }
@media (min-width: 900px) and (pointer: fine) { #vClose { top: 22px; right: 28px; } #vPrev { left: max(24px, calc(50% - 420px)); } #vNext { right: max(24px, calc(50% - 420px)); } }
.charm[data-id] { cursor: pointer; }
.charm[data-id]:hover { box-shadow: 0 0 0 2px var(--lilac); }
body.pad .charm.sel { box-shadow: 0 0 0 3px var(--ink); }
/* studio#153: the collector score, personal bests and today's board (the shared game services' panel and picker) */
:root { --gs-card: #fff; --gs-ink: var(--ink); --gs-muted: #8f7f92; --gs-line: #f1dde5; --gs-accent: var(--ink); --gs-hi: #b04fb8; --gs-scrim: rgba(251,238,240,.72); --gs-radius: 18px; }
#shelfPts { margin-left: 8px; font-size: 13px; font-weight: 700; opacity: .7; }
#shelfPts:empty { display: none; }
#pbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 4px; }
#pbs div { background: #fff; border-radius: 14px; padding: 6px 4px; text-align: center; }
#pbs b { display: block; font-size: 20px; color: #b04fb8; }
#pbs span { display: block; font-size: 11px; font-weight: 700; opacity: .7; line-height: 1.15; }
#board { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; background: rgba(251,238,240,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow-y: auto; padding: max(12px, env(safe-area-inset-top)) 12px 16px; z-index: 5; }
#board[hidden] { display: none; }
#board .panel { margin: auto 0; }
#board .gs-panel, #resBoard .gs-panel { max-width: none; border-width: 0; padding: 8px 10px; }
#board .sub { margin: 0 0 8px; font-size: 13px; opacity: .75; }
.tabs { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 0 0 8px; }
.tabs button { min-height: 40px; padding: 6px 12px; font-size: 14px; font-weight: 700; background: transparent; }
.tabs button.on { background: var(--ink); color: #fff; }
#boardYou { margin: 8px 0 0; text-align: center; font-weight: 700; font-size: 14px; }
#boardYou:empty { display: none; }
.inilink { display: block; margin: 6px auto 0; background: transparent; font-size: 14px; min-height: 40px; padding: 6px 12px; }
.inilink[hidden] { display: none; }
.inilink u { text-decoration-thickness: 2px; text-underline-offset: 3px; color: #b04fb8; font-weight: 700; }
#resDaily .rank { color: #b04fb8; font-size: 17px; }
#resDaily .rank:empty { display: none; }
#resDaily .week { font-size: 14px; color: #8a5a8e; }
#resDaily .week:empty { display: none; }
#toast small.yday { opacity: 1; font-weight: 800; color: #b04fb8; }
#resBoard { margin: 0 0 4px; }
#resBoard .gs-foot { display: none; }
#resBoard .gs-panel h3 { font-size: 15px; margin-bottom: 2px; }
#resBoard .gs-list li { min-height: 22px; padding: 1px 8px; font-size: 14px; }
#result.daily #vote, #result.daily #voteThanks, #result.daily #door, #result.daily #doorThanks { display: none; }
#result.daily { align-items: flex-start; }
#result.daily .panel { margin: auto 0 0; }
@media (min-width: 900px) { #result.daily .panel { margin: auto 0; } }
@media (max-height: 700px) { #resDaily { padding: 6px 10px; margin: 4px 0 6px; } #resDaily b { font-size: 24px; } #resDaily small { display: none; } #result.daily #resCharms img { width: 34px; height: 34px; } }
