:root { --plum: #7a3b52; --pink: #ff8fab; --cream: #fff4ec; --bw: clamp(14px, 5.2vh, 22px); --ease: cubic-bezier(.34, 1.56, .64, 1); }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #fde8e0; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; font-family: var(--font, "Trebuchet MS", sans-serif); }
#app { position: fixed; inset: 0; }
canvas#stage { display: block; width: 100%; height: 100%; }
.layer { position: absolute; inset: 0; }
#hud, #fx { pointer-events: none; }
#ui { pointer-events: none; }
img { -webkit-user-drag: none; user-drag: none; }

/* ---- type ---- */
.otext { font-family: var(--font); font-weight: 900; color: #fff; -webkit-text-stroke: .2em var(--plum); paint-order: stroke fill; text-shadow: 0 .09em 0 rgba(122, 59, 82, .6); }
.ptext { font-family: var(--font); font-weight: 800; color: var(--plum); }

/* ---- panel ---- */
.panel { position: relative; box-sizing: border-box; pointer-events: auto; font-family: var(--font); color: var(--plum);
  background: var(--cream); border: 6px solid #ffb3c7; border-radius: 26px; padding: 10px 12px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .9), 0 8px 0 rgba(122, 59, 82, .25), 0 14px 24px rgba(122, 59, 82, .25); }
html.art-ui-panel .panel { background: none; border-style: solid; border-width: var(--bw); border-color: transparent; border-radius: 0; box-shadow: none;
  border-image: var(--ui-panel) var(--panel-slice) fill / var(--bw) stretch; padding: 8px 10px; filter: drop-shadow(0 6px 10px rgba(122, 59, 82, .3)); }

/* ---- button ---- */
.btn { position: relative; box-sizing: border-box; pointer-events: auto; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; min-width: 48px; padding: 6px 18px; margin: 0; font-family: var(--font); font-weight: 900; font-size: clamp(16px, 3.4vh, 28px); line-height: 1.1;
  color: #fff; -webkit-text-stroke: 5px var(--plum); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(122, 59, 82, .6); text-align: center;
  background: linear-gradient(#ffc9a8, #ff9f9a); border: 4px solid #d96a86; border-radius: 16px; box-shadow: inset 0 4px 0 rgba(255, 255, 255, .6), 0 5px 0 #b04a68;
  transition: transform .18s var(--ease), filter .15s; outline: none; }
html.art-ui-button .btn { background: none; border-style: solid; border-width: 16px; border-color: transparent; border-radius: 0; box-shadow: none; border-image: var(--ui-button) var(--button-slice) fill / 16px stretch; padding: 0 8px; }
.btn > * { -webkit-text-stroke: 0; }
.btn > span { -webkit-text-stroke: 5px var(--plum); paint-order: stroke fill; }
.btn img { width: 1.7em; height: 1.7em; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(122, 59, 82, .5)); flex: none; }
.btn.small { min-height: 44px; font-size: clamp(14px, 2.8vh, 22px); padding: 4px 14px; }
html.art-ui-button .btn.small { padding: 0 6px; }
.btn:hover, .btn.focus { filter: brightness(1.08) drop-shadow(0 0 8px rgba(255, 255, 255, .9)); transform: scale(1.05); }
.btn:active { transform: scale(.94); filter: brightness(.96); }
.btn.off { filter: grayscale(.85) brightness(.95); opacity: .75; }
.btn.sel { filter: brightness(1.12) drop-shadow(0 0 10px #fff3a8); }

.plate { position: relative; pointer-events: auto; cursor: pointer; width: 48px; height: 48px; padding: 0; border: 0; display: flex; align-items: center; justify-content: center; flex: none;
  background: linear-gradient(#ffc2d2, #ff8fab); border-radius: 14px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 4px 0 #b04a68; transition: transform .18s var(--ease), filter .15s; outline: none; }
html.art-ui-plate .plate { background: var(--ui-plate) center / 100% 100% no-repeat; box-shadow: none; border-radius: 0; }
.plate img { width: 60%; height: 60%; object-fit: contain; pointer-events: none; }
.plate.art { background: none !important; box-shadow: none; }
.plate.art img { width: 100%; height: 100%; filter: drop-shadow(0 3px 0 rgba(122, 59, 82, .4)); }
.plate:hover, .plate.focus { filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, .9)); transform: scale(1.08); }
.plate:active { transform: scale(.92); }
.focus { filter: brightness(1.1) drop-shadow(0 0 3px #fff) drop-shadow(0 0 9px rgba(255, 255, 255, .95)); transform: scale(1.06); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 8px; box-sizing: border-box; border-radius: 22px; pointer-events: none;
  background: linear-gradient(#fffaf5, #ffe6d8); border: 3px solid #ffb3c7; box-shadow: inset 0 3px 0 #fff, 0 3px 0 rgba(122, 59, 82, .35); font-family: var(--font); font-weight: 900; font-size: 20px; color: #fff; -webkit-text-stroke: 5px var(--plum); paint-order: stroke fill; }
.chip img { width: 28px; height: 28px; object-fit: contain; -webkit-text-stroke: 0; }

/* ---- screens ---- */
.screen { position: absolute; inset: 0; pointer-events: none; font-family: var(--font); color: var(--plum); }
.screen.enter .pop { animation: popIn .26s var(--ease) backwards; }
.screen.enter .slideL { animation: slideL .26s var(--ease) backwards; }
.screen.leave { animation: fadeOut .18s forwards; pointer-events: none !important; }
.screen.leave * { pointer-events: none !important; }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideL { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
.safe-tl { position: absolute; left: max(76px, calc(env(safe-area-inset-left) + 76px)); top: max(12px, env(safe-area-inset-top)); display: flex; gap: 10px; align-items: center; }
.safe-tr { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); display: flex; gap: 10px; align-items: center; }
.hdr { font-size: clamp(18px, 4vh, 32px); text-align: center; margin-bottom: 4px; }

/* title */
.s-title { pointer-events: auto; background: url(assets/title-bg.webp) center / cover no-repeat; cursor: pointer; }
.s-title .logo { position: absolute; left: 50%; top: 3vh; width: min(72vw, 125vh); max-height: 34vh; object-fit: contain; transform: translateX(-50%); animation: logoDrop .6s var(--ease) backwards, logoFloat 3.2s ease-in-out .6s infinite; filter: drop-shadow(0 6px 0 rgba(122, 59, 82, .25)); pointer-events: none; }
@keyframes logoDrop { from { transform: translate(-50%, -80vh); } }
@keyframes logoFloat { 50% { transform: translate(-50%, -6px); } }
.s-title .prompt { position: absolute; left: 50%; top: 86%; width: max-content; max-width: 86vw; text-align: center; font-size: clamp(16px, 3.2vh, 26px); transform: translateX(-50%); animation: pulse 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes pulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.08); opacity: .75; } }

/* hub */
.hub-panel { position: absolute; left: 3vw; top: 50%; transform: translateY(-50%); width: clamp(240px, 34vw, 460px); display: flex; flex-direction: column; gap: 10px; }
.s-hub .hub-panel.pop, .s-hub .hub-panel { }
.row-btn { justify-content: flex-start; width: 100%; min-height: clamp(52px, 12vh, 92px); font-size: clamp(18px, 3.8vh, 32px); text-align: left; }
.row-btn img { width: clamp(40px, 8vh, 56px); height: clamp(40px, 8vh, 56px); }
.row-btn .col { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.row-btn .sub { font-size: max(12px, 2.1vh); color: #fff3a8; }
.badge { position: absolute; right: 6px; top: 0; width: 18px; height: 18px; border-radius: 50%; background: #ff4f6d; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(122, 59, 82, .5); }

/* songs */
.songs-panel { position: absolute; left: 3vw; top: max(60px, 14vh); bottom: 12px; width: 64vw; display: flex; flex-direction: column; }
.songs-body { flex: 1; min-height: 0; display: flex; gap: 10px; }
.song-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; }
.card { position: relative; box-sizing: border-box; pointer-events: auto; cursor: pointer; min-height: 44px; border-radius: 16px; border: 4px solid rgba(255, 255, 255, .9); padding: 6px 8px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 4px 0 rgba(122, 59, 82, .35); transition: transform .18s var(--ease), filter .15s; outline: none; color: var(--plum); }
.card:hover, .card.focus { filter: brightness(1.06) drop-shadow(0 0 8px #fff); transform: scale(1.03); }
.card:active { transform: scale(.95); }
.card.sel { border-color: #ff8fab; box-shadow: 0 0 0 3px #fff, 0 0 14px 4px #ff8fab, 0 4px 0 rgba(122, 59, 82, .35); }
.card .nm { font-weight: 900; font-size: clamp(14px, 2.7vh, 22px); line-height: 1.1; }
.card .md { font-weight: 800; font-size: max(12px, 2vh); opacity: .8; line-height: 1.1; }
.card .stars { font-size: max(14px, 2.4vh); color: #f0a020; letter-spacing: 1px; text-shadow: 0 1px 0 #fff; }
.card .bs { font-weight: 900; font-size: max(12px, 2.1vh); }
.card .lock { position: absolute; inset: 0; background: rgba(60, 30, 70, .62); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; font-weight: 900; font-size: max(14px, 2.4vh); }
.card .lock img { height: clamp(28px, 7vh, 52px); }
.card .price { display: flex; align-items: center; gap: 4px; }
.card .price img { height: 1.3em; }
.side-col { width: clamp(132px, 22vw, 230px); display: flex; flex-direction: column; gap: 8px; justify-content: space-between; }
.pills { display: flex; flex-direction: column; gap: 6px; }
.pills .btn { min-height: 44px; font-size: clamp(14px, 2.7vh, 22px); }
.speed { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 900; font-size: max(14px, 2.4vh); }
.speed .v { min-width: 2.6em; text-align: center; font-size: clamp(16px, 3vh, 26px); }
.side-row { display: flex; gap: 8px; align-items: center; }
.play-btn { flex: 1; min-width: 0; min-height: clamp(48px, 11vh, 80px); font-size: clamp(16px, 3.6vh, 32px); white-space: nowrap; padding-left: 6px; padding-right: 6px; }
.play-btn span { overflow: hidden; text-overflow: clip; }

/* cats + closet */
.cat-panel { position: absolute; left: 3vw; top: max(60px, 14vh); bottom: 12px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.s-cats .cat-panel { width: 42vw; }
.s-closet .cat-panel { width: 50vw; }
.sw-row { display: flex; gap: 8px; justify-content: center; }
.cat-b { pointer-events: auto; cursor: pointer; width: clamp(44px, 10vh, 60px); height: clamp(44px, 10vh, 60px); border-radius: 50%; border: 4px solid #fff; padding: 0; overflow: hidden; background: #ffe3ec; box-shadow: 0 3px 0 rgba(122, 59, 82, .4); transition: transform .18s var(--ease), filter .15s; outline: none; flex: none; }
.cat-b img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; pointer-events: none; }
.cat-b.sel { border-color: #ff8fab; box-shadow: 0 0 0 3px #fff, 0 0 12px 3px #ff8fab; }
.cat-b:hover { transform: scale(1.08); }
.cat-b:active { transform: scale(.92); }
.cname { font-size: clamp(20px, 4.2vh, 34px); text-align: center; line-height: 1.05; }
.info { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: max(14px, 2.5vh); align-items: center; text-align: center; }
.stars-big { color: #f0a020; font-size: clamp(18px, 3.6vh, 28px); letter-spacing: 3px; text-shadow: 0 1px 0 #fff; line-height: 1; }
.xpbar { width: 80%; height: 14px; border-radius: 9px; border: 3px solid var(--plum); background: #fff; overflow: hidden; box-shadow: inset 0 3px 0 rgba(122, 59, 82, .2); box-sizing: border-box; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb3c7, #fff3a8, #bfe8d8); border-radius: 6px; transition: width .4s; }
.req { display: flex; align-items: center; gap: 6px; justify-content: center; flex-wrap: wrap; }
.req img { height: 1.4em; }
.sec { font-weight: 900; font-size: max(14px, 2.5vh); margin: 0 0 2px 4px; color: var(--plum); }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tile-w { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.tile { position: relative; pointer-events: auto; cursor: pointer; box-sizing: border-box; width: 100%; max-width: 64px; min-width: 44px; height: clamp(44px, 9vh, 60px); border-radius: 14px; border: 4px solid #fff; background: linear-gradient(#fff, #ffe3ec); padding: 2px; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(122, 59, 82, .4); transition: transform .18s var(--ease), filter .15s; outline: none; font-size: 24px; font-weight: 900; color: var(--plum); }
.tile img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tile:hover { transform: scale(1.06); filter: brightness(1.05); }
.tile:active { transform: scale(.92); }
.tile.sel { border-color: #ff8fab; box-shadow: 0 0 0 3px #fff, 0 0 12px 3px #ff8fab; }
.tile.sel::after { content: "✓"; position: absolute; right: -6px; top: -8px; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: #7bd88f; color: #fff; font-size: 14px; border: 2px solid #fff; text-align: center; }
.tile.locked img { filter: grayscale(.6) brightness(.8); }
.tile .pr { position: absolute; left: 0; right: 0; bottom: -2px; display: flex; justify-content: center; align-items: center; gap: 2px; font-size: 12px; color: #fff; -webkit-text-stroke: 3px var(--plum); paint-order: stroke fill; }
.tile .pr img { width: 14px; height: 14px; filter: none !important; }
.tile-l { font-size: 12px; font-weight: 800; line-height: 1.05; text-align: center; max-height: 2.1em; overflow: hidden; width: 100%; overflow-wrap: anywhere; }
.paws { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { pointer-events: auto; cursor: pointer; position: relative; width: clamp(44px, 8vh, 52px); height: clamp(36px, 7vh, 44px); border-radius: 22px; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(122, 59, 82, .4); transition: transform .18s var(--ease), filter .15s; outline: none; padding: 0; }
.swatch.sel { box-shadow: 0 0 0 3px #ff8fab, 0 0 12px 3px #ff8fab; }
.swatch.sel::after { content: "✓"; position: absolute; inset: 0; line-height: 28px; text-align: center; color: #fff; font-weight: 900; font-size: 18px; -webkit-text-stroke: 3px var(--plum); paint-order: stroke fill; }
.swatch:hover, .swatch.focus { transform: scale(1.08); }
.swatch:active { transform: scale(.92); }

.toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); padding: 8px 20px; border-radius: 20px; background: var(--cream); border: 4px solid #ffb3c7; color: var(--plum); font-weight: 900; font-size: clamp(16px, 3vh, 24px); animation: popIn .26s var(--ease), fadeOut .3s 1.6s forwards; pointer-events: none; z-index: 5; box-shadow: 0 5px 0 rgba(122, 59, 82, .3); white-space: nowrap; }

/* overlays in #fx */
#intro { position: absolute; inset: 0; background: #000 url(assets/title-bg.webp) center / cover no-repeat; display: none; pointer-events: none; z-index: 20; }
#intro.on { display: block; pointer-events: auto; }
#intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
#intro .skip { position: absolute; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); }
#help { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(90, 40, 70, .45); pointer-events: auto; z-index: 15; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
#help .panel { width: min(86vw, 760px); max-height: 94vh; display: flex; flex-direction: column; gap: 6px; animation: popIn .26s var(--ease); box-sizing: border-box; }
.help-row { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: clamp(14px, 2.9vh, 22px); line-height: 1.2; }
.help-ic { flex: none; width: clamp(40px, 9vh, 64px); height: clamp(40px, 9vh, 64px); border-radius: 16px; background: linear-gradient(#fff, #ffe3ec); border: 3px solid #ffb3c7; display: flex; align-items: center; justify-content: center; font-size: clamp(22px, 5vh, 36px); }
.help-ic img { width: 80%; height: 80%; object-fit: contain; }
.help-keys b { display: inline-block; min-width: 1.6em; padding: 0 5px; margin: 0 2px; border-radius: 7px; background: #fff; border: 2px solid var(--plum); text-align: center; box-shadow: 0 2px 0 var(--plum); }
.help-close { align-self: center; margin-top: 4px; min-width: 160px; }
