/* Pastel Pad — bold "sticker book" look.
   Layout: dotted page, chunky hero with floating Doodles, ink ticker strip, then
   pastel cards with thick ink outlines and hard offset shadows (like Doodle art).
   Cards keep their pastel fills in every theme; only the page around them changes. */

:root {
  --outline: #2b2540;             /* thick ink line, same as the art */
  --shadow: #2b2540;              /* hard sticker shadow */
  --p-pink: #ffc8e1;
  --p-sky: #c9e4ff;
  --p-mint: #c6f2dc;
  --p-butter: #fff1b8;
  --p-lilac: #e2d6ff;
  --p-peach: #ffd9c2;
  --pop: #7b5cff;                 /* buttons inside cards */
  --page: #fdf6ff;
  --page-dot: #2b254018;
  --page-ink: #2b2540;
  --glow-a: #ffc8e1;
  --glow-b: #c9e4ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow: #a48cff; --page: #1b1433; --page-dot: #ffffff14; --page-ink: #fbf7ff; --glow-a: #5b2a6e; --glow-b: #23407a; }
}
:root[data-theme="dark"] { --shadow: #a48cff; --page: #1b1433; --page-dot: #ffffff14; --page-ink: #fbf7ff; --glow-a: #5b2a6e; --glow-b: #23407a; }

/* Moods recolor the pastels and the page */
html:root[data-mood="cotton"] { --shadow: #2b2540; --page: #fff0f7; --page-ink: #3a2240; --page-dot: #3a224018; --glow-a: #ffb3d6; --glow-b: #e2d6ff; --pop: #e0569b;
  --p-sky: #f3dcff; --p-mint: #ffe0ef; --p-butter: #ffeaf3; }
html:root[data-mood="mint"] { --shadow: #2b2540; --page: #ecfaf3; --page-ink: #1f3a33; --page-dot: #1f3a3318; --glow-a: #b5f0d3; --glow-b: #d9f3ff; --pop: #1f9f74;
  --p-pink: #d8f5e6; --p-lilac: #d9f3ff; --p-peach: #e9fbd9; }
html:root[data-mood="sunset"] { --shadow: #2b2540; --page: #fff3e8; --page-ink: #43261c; --page-dot: #43261c18; --glow-a: #ffc69b; --glow-b: #ffb3c8; --pop: #f0703c;
  --p-sky: #ffe3c9; --p-mint: #fff1b8; --p-lilac: #ffd3dc; }
html:root[data-mood="midnight"] { --shadow: #8fb2ff; --page: #0c0f2b; --page-ink: #eef0ff; --page-dot: #ffffff12; --glow-a: #2a2f7a; --glow-b: #4a2a7a; --pop: #4f6bff;
  --p-pink: #d9dcff; --p-sky: #c8d6ff; --p-mint: #d7f0ff; --p-butter: #e6e0ff; --p-lilac: #dcd0ff; --p-peach: #f0dcff; }

/* ---------- page ---------- */
body {
  background-color: var(--page);
  background-image:
    radial-gradient(60vmax 60vmax at 105% -10%, color-mix(in srgb, var(--glow-a) 70%, transparent), transparent 60%),
    radial-gradient(50vmax 50vmax at -10% 40%, color-mix(in srgb, var(--glow-b) 60%, transparent), transparent 60%),
    radial-gradient(var(--page-dot) 1.6px, transparent 1.8px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed, fixed, scroll;
  color: var(--page-ink);
}
.wrap { gap: 34px; max-width: 1180px; }

/* ---------- header ---------- */
header { padding-top: 4px; }
.wordmark { font-size: clamp(2rem, 4.2vw, 2.8rem); color: var(--page-ink); }
.wordmark span { background: var(--outline) !important; color: var(--p-butter) !important; border: 3px solid var(--outline); box-shadow: 3px 3px 0 var(--pop); }
.tag { display: none; }
.logo { width: 72px; height: 72px; filter: drop-shadow(3px 4px 0 color-mix(in srgb, var(--outline) 35%, transparent)); }

/* Everything that is a "sticker": pastel fill, ink outline, hard shadow, ink text inside */
.card, .canvas-box, .day, .field, .moods, .icon-btn, .marquee {
  --ink: #2b2540; --muted: #5d5577; --line: #2b254033; --surface: #fffdfe; --bg: #ffffff99;
  --accent: var(--pop); --accent-ink: #ffffff;
  color: #2b2540; color-scheme: light;
  border: 3px solid var(--outline) !important;
  box-shadow: 6px 6px 0 var(--shadow);
}
.card, .canvas-box { border-radius: 26px; }

/* each section gets its own pastel */
.canvas-box { background: var(--p-sky); }
.card.info { background: var(--p-pink); }
.persona { background: var(--p-lilac) !important; }
.card.wardrobe { background: var(--p-mint); }
.explore { background: var(--p-butter); }
.game { background: var(--p-pink); }
.shelf { background: var(--p-sky); }
.badges { background: var(--p-lilac); }

/* headings */
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -0.02em; }
h3 { color: #2b2540; opacity: .75; }
.card h3:first-child, .wardrobe > h3 { display: inline-block; justify-self: start; background: #2b2540; color: #fff; opacity: 1;
  padding: 5px 12px 4px; border-radius: 10px; transform: rotate(-2deg); letter-spacing: .12em; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; align-items: center; padding-block: 8px 4px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.eyebrow { margin: 0; justify-self: start; font: 800 .8rem var(--body); letter-spacing: .14em; text-transform: uppercase;
  background: var(--p-butter); color: #2b2540; border: 2.5px solid var(--outline); border-radius: 999px; padding: 6px 14px; box-shadow: 3px 3px 0 var(--shadow); transform: rotate(-1.5deg); }
.hero-title { margin: 0; font: 800 clamp(2.7rem, 7vw, 5.4rem)/.95 var(--display); letter-spacing: -0.04em; color: var(--page-ink); text-wrap: balance; }
.hero-title .hl { display: inline-block; margin-top: .12em; padding: 0 .18em .06em; color: #2b2540; border: 4px solid var(--outline); border-radius: .28em;
  background: linear-gradient(90deg, #ffc8e1, #fff1b8, #c6f2dc, #c9e4ff, #e2d6ff); background-size: 200% 100%;
  box-shadow: 6px 6px 0 var(--shadow); transform: rotate(-2deg); animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: 200% 0; } }
.hero-sub { margin: 0; max-width: 52ch; font-size: 1.08rem; color: var(--page-ink); opacity: .8; }
.search { gap: 12px; }
.field { background: #ffffff; border-radius: 999px; padding: 8px 8px 8px 22px; }
.field:focus-within { box-shadow: 6px 6px 0 var(--pop); }
.field span { color: #2b2540; }
.field input { color: #2b2540; font-size: 1.35rem; }
.field input::placeholder { color: #8a83a3; }
#status { color: var(--page-ink); opacity: .75; }
#status.err { color: #ff5c8a; opacity: 1; }

/* floating Doodles */
.hero-art { position: relative; aspect-ratio: 1 / 0.92; min-height: 280px; }
.float { position: absolute; width: 46%; border: 3px solid var(--outline); border-radius: 22px; background: #fff; padding: 6px;
  box-shadow: 6px 6px 0 var(--shadow); animation: bob 5s ease-in-out infinite; cursor: pointer; transition: transform .2s; }
.float img { display: block; width: 100%; aspect-ratio: 1; border-radius: 15px; background: var(--p-lilac); }
.float .tagline { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%) rotate(-3deg); white-space: nowrap;
  font: 800 .8rem var(--display); background: var(--p-butter); color: #2b2540; border: 2.5px solid var(--outline); border-radius: 999px; padding: 3px 10px; }
.float:nth-child(1) { left: 2%; top: 4%; rotate: -8deg; }
.float:nth-child(2) { right: 0; top: 0; width: 42%; rotate: 7deg; animation-delay: -1.5s; }
.float:nth-child(3) { left: 26%; bottom: 0; width: 50%; rotate: -2deg; animation-delay: -3s; z-index: 2; }
.float:hover { z-index: 3; }
@keyframes bob { 50% { transform: translateY(-12px); } }
.hero-art .spark { position: absolute; width: 34px; height: 34px; animation: twinkle 2.6s ease-in-out infinite; }

/* ---------- ticker strip ---------- */
.marquee { overflow: hidden; background: var(--outline) !important; border-radius: 16px; transform: rotate(-1deg); box-shadow: 6px 6px 0 var(--pop) !important; }
.marquee-track { display: flex; width: max-content; animation: ticker 32s linear infinite; }
.marquee-track span { flex: none; padding: 12px 22px; font: 800 1.05rem var(--display); color: #fff; letter-spacing: .02em; white-space: nowrap; }
.marquee-track span:nth-child(5n+1) b { color: #ffc8e1; } .marquee-track span:nth-child(5n+2) b { color: #fff1b8; }
.marquee-track span:nth-child(5n+3) b { color: #c6f2dc; } .marquee-track span:nth-child(5n+4) b { color: #c9e4ff; }
.marquee-track span:nth-child(5n) b { color: #e2d6ff; }
.marquee-track i { font-style: normal; color: #ffd36b; margin-right: 22px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Doodle of the day ---------- */
.day { background: linear-gradient(110deg, var(--p-butter), var(--p-pink) 55%, var(--p-lilac)); border-radius: 26px; padding: 16px 20px; }
.day img { width: 76px; height: 76px; border: 3px solid var(--outline); border-radius: 16px; transform: rotate(-4deg); }
.day strong { font-size: 1.35rem; }

/* ---------- buttons, chips ---------- */
.btn { border: 3px solid var(--outline) !important; background: var(--pop); color: #fff; box-shadow: 4px 4px 0 var(--shadow); transition: transform .12s, box-shadow .12s; padding: 11px 22px; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.ghost { background: #ffffff; color: #2b2540; padding: 11px 22px; }
.day .btn { background: #2b2540; color: #fff; }
.chip, .val, .stk { border: 2.5px solid var(--outline) !important; background: #ffffffcc; color: #2b2540; }
.chip:hover, .val:hover { background: #fff; transform: translateY(-1px); }
.chip[aria-pressed="true"], .val[aria-pressed="true"] { background: #2b2540 !important; color: #fff !important; box-shadow: 3px 3px 0 var(--pop); }
.sw { border: 3px solid var(--outline); box-shadow: none; width: 36px; height: 36px; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--outline); transform: scale(1.08); }
.icon-btn { background: #fff; box-shadow: 3px 3px 0 var(--shadow); }
.moods { background: #fff; box-shadow: 3px 3px 0 var(--shadow); }
.mood { border: 2px solid var(--outline); }
.mood[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--outline); }

/* ---------- inner pieces ---------- */
.trait { border: 2.5px solid var(--outline); box-shadow: 3px 3px 0 var(--shadow); }
.trait:nth-child(odd) { rotate: -1.5deg; } .trait:nth-child(even) { rotate: 1.2deg; }
.trait.star { box-shadow: 3px 3px 0 var(--shadow), 0 0 0 3px #fff inset; }
.tier { border: 2.5px solid var(--outline); box-shadow: 2px 2px 0 var(--shadow); }
.meter { height: 14px; border: 2.5px solid var(--outline); background: #fff; }
.rank b { font-size: 1.6rem; }
.persona .quote, .stampcard, .badge, .tile, .pick, .mini { border: 2.5px solid var(--outline) !important; background: #ffffffd9; }
.tile, .mini { box-shadow: 4px 4px 0 var(--shadow); }
.tile:hover, .mini:hover { box-shadow: 6px 6px 0 var(--shadow); }
.pick { box-shadow: 5px 5px 0 var(--shadow); }
.pick.right { border-color: #1f9f74 !important; box-shadow: 5px 5px 0 #1f9f74; }
.pick.wrong { border-color: #e0446f !important; box-shadow: 5px 5px 0 #e0446f; }
.badge.got { background: #fff !important; box-shadow: 3px 3px 0 var(--shadow); }
.score span { border: 2.5px solid var(--outline); background: #fff; }
.text-in { border: 2.5px solid var(--outline); background: #fff; color: #2b2540; }
canvas#cv { border: 3px solid var(--outline); }
.empty { border-color: var(--outline); color: #5d5577; }

/* ---------- footer, toast ---------- */
footer { color: var(--page-ink); opacity: .7; border-top: 3px dashed color-mix(in srgb, var(--page-ink) 30%, transparent); }
.toast { background: var(--p-butter); color: #2b2540; border: 3px solid var(--outline); box-shadow: 4px 4px 0 var(--shadow); }

@media (max-width: 600px) {
  .card, .canvas-box, .day { box-shadow: 4px 4px 0 var(--shadow); }
  .hero-art { min-height: 0; max-width: 420px; width: 100%; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { .marquee-track, .float, .hero-title .hl { animation: none !important; } }

/* pictures: hide alt text / broken icon while loading or retrying */
img.dimg, .tile img, .mini img, .pick img, .float img, .day img { color: transparent; font-size: 0; }
img.failed { background: repeating-linear-gradient(45deg, #ffffff66 0 8px, transparent 8px 16px), var(--p-lilac); }

/* search box must shrink on narrow phones */
.field { min-width: 0; max-width: 100%; }
.field input { width: 100%; min-width: 0; }
@media (max-width: 420px) { .field input { font-size: 1.1rem; } .field input::placeholder { font-size: .9rem; } }

/* ---------- personality card, expanded ---------- */
.persona .ptitle { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.pmeta { display: flex; flex-wrap: wrap; gap: 8px; }
.pmeta span { border: 2.5px solid var(--outline); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .85rem; background: #fff; }
.pmeta .psign { background: #2b2540; color: #fff; transform: rotate(-2deg); }
.pstats { display: grid; gap: 7px; }
.pstat { display: grid; grid-template-columns: minmax(0, 9.5em) 1fr 2.4em; align-items: center; gap: 10px; font-weight: 800; font-size: .85rem; }
.pstat i { height: 14px; border: 2.5px solid var(--outline); border-radius: 999px; background: #fff; overflow: hidden; }
.pstat b { display: block; height: 100%; background: linear-gradient(90deg, #ffc8e1, #fff1b8, #c6f2dc, #c9e4ff, #a48cff); border-right: 2.5px solid var(--outline); }
.pstat em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.persona dl.pfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pfacts div { background: #ffffffd9; border: 2.5px solid var(--outline); border-radius: 14px; padding: 8px 12px; min-width: 0; }
.pfacts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #5d5577; font-weight: 800; }
.pfacts dd { margin: 2px 0 0; font-weight: 700; line-height: 1.3; }
.pcount { margin: 0; font-size: .8rem; font-weight: 700; color: #5d5577; text-align: center; }

/* ---------- music button ---------- */
.music { display: flex; align-items: center; gap: 8px; }
.music-btn { position: relative; }
.music-btn.on { background: var(--p-butter); }
.music-btn.on svg { animation: groove 1.46s ease-in-out infinite; }
@keyframes groove { 25% { transform: rotate(-10deg) translateY(-1px); } 75% { transform: rotate(10deg) translateY(-1px); } }
.music-btn .eq { position: absolute; right: -4px; top: -6px; display: none; gap: 2px; align-items: flex-end; height: 14px; padding: 2px 3px;
  background: #2b2540; border-radius: 6px; }
.music-btn.on .eq { display: flex; }
.music-btn .eq i { width: 3px; background: #c6f2dc; border-radius: 2px; animation: eq .73s ease-in-out infinite; }
.music-btn .eq i:nth-child(2) { animation-delay: -.25s; background: #ffc8e1; }
.music-btn .eq i:nth-child(3) { animation-delay: -.5s; background: #c9e4ff; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }
.vol { display: flex; align-items: center; background: #fff; border: 2.5px solid var(--outline); border-radius: 999px; padding: 6px 12px; box-shadow: 3px 3px 0 var(--shadow); }
.vol input { width: 90px; accent-color: var(--pop); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Pastel Pad Radio (floating player, bottom-left) ---------- */
body.has-player .wrap { padding-bottom: 120px; }
body.has-player .toast { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
.player {
  --c1: #ffc8e1; --c2: #fff1b8; --c3: #c9e4ff;
  position: fixed; z-index: 25;
  left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(120deg, color-mix(in srgb, var(--c1) 70%, #fff), color-mix(in srgb, var(--c3) 70%, #fff));
  color: #2b2540; border: 3px solid var(--outline); border-radius: 22px; box-shadow: 6px 6px 0 var(--shadow);
  transition: border-radius .2s;
}
.disc { position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--outline);
  background: conic-gradient(var(--c1), var(--c2), var(--c3), var(--c1)); }
.disc::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1.5px dashed #2b254055; }
.disc i { position: absolute; inset: 50% auto auto 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid var(--outline); }
.player.playing .disc { animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pinfo { display: grid; min-width: 0; line-height: 1.2; }
.plabel { font: 800 .66rem var(--body); letter-spacing: .14em; text-transform: uppercase; opacity: .65; }
.ptitle-track { font: 800 1.05rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { font-size: .78rem; font-weight: 700; opacity: .75; white-space: nowrap; }
.viz { width: 120px; height: 42px; flex: none; }
.pctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.pbtn { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--outline); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0;
  box-shadow: 2px 2px 0 var(--outline); transition: transform .1s, box-shadow .1s; }
.pbtn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--outline); }
.pbtn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--outline); }
.pbtn svg { width: 18px; height: 18px; fill: #2b2540; stroke: #2b2540; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.pbtn.big { width: 50px; height: 50px; background: #2b2540; }
.pbtn.big svg { width: 22px; height: 22px; fill: #fff; stroke: #fff; }
.pbtn .i-pause, .player.playing .pbtn .i-play { display: none; }
.player.playing .pbtn .i-pause { display: block; }
.pvol { display: flex; align-items: center; gap: 6px; flex: none; }
.pvol svg { width: 20px; height: 20px; fill: #2b2540; stroke: #2b2540; stroke-width: 2; stroke-linecap: round; }
.pvol input { width: 80px; accent-color: #2b2540; }
.pmin { position: absolute; top: -12px; right: -12px; width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--outline);
  background: var(--p-butter); color: #2b2540; font: 800 1rem/1 var(--display); cursor: pointer; padding: 0; }
/* shrunk: just the spinning disc and play button */
.player.mini { gap: 8px; padding: 8px; border-radius: 999px; }
.player.mini .pinfo, .player.mini .viz, .player.mini .pvol, .player.mini #prevBtn, .player.mini #nextBtn { display: none; }
.player.mini .disc { width: 44px; height: 44px; }
.player.mini .pbtn.big { width: 44px; height: 44px; }
/* phones: full-width bar, fewer controls */
@media (max-width: 640px) {
  .player:not(.mini) { right: max(16px, env(safe-area-inset-right, 0px)); gap: 10px; }
  .player .viz, .player .pvol, .player #prevBtn { display: none; }
  .player .disc { width: 48px; height: 48px; }
  .pinfo { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .player.playing .disc { animation: none; } }

/* ---------- Doodle Rooms: cards ---------- */
.rooms { background: var(--p-peach); }
.rooms .title-row h2 { margin-top: 2px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.room-card { display: grid; grid-template-rows: auto 1fr; background: #fff; border: 3px solid var(--outline); border-radius: 22px; overflow: hidden; box-shadow: 5px 5px 0 var(--shadow); transition: transform .15s, box-shadow .15s; }
.room-card:hover { transform: translate(-2px, -3px) rotate(-.4deg); box-shadow: 8px 8px 0 var(--shadow); }
.room-thumb { position: relative; display: block; padding: 0; border: 0; border-bottom: 3px solid var(--outline); background: #2b2540; cursor: pointer; }
.room-thumb canvas { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; }
.room-enter { position: absolute; right: 12px; bottom: 12px; font: 800 .9rem var(--display); background: #2b2540; color: #fff; border-radius: 999px; padding: 6px 14px;
  border: 2.5px solid #fff; transform: rotate(-2deg); transition: transform .15s; }
.room-card:hover .room-enter { transform: rotate(-2deg) scale(1.06); }
.room-body { display: grid; gap: 8px; padding: 14px 16px 16px; align-content: start; }
.room-name { margin: 0; font: 800 1.35rem var(--display); color: #2b2540; opacity: 1 !important; background: none !important; padding: 0 !important; transform: none !important; letter-spacing: -0.01em !important; }
.room-desc { margin: 0; font-size: .92rem; color: #4a4363; line-height: 1.45; }
.room-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.room-tags span { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: .78rem; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--outline); background: var(--p-butter); color: #2b2540; }
.room-tags span:nth-child(2) { background: var(--p-sky); } .room-tags span:nth-child(3) { background: var(--p-mint); }
.room-tags svg { width: 14px; height: 14px; fill: none; stroke: #2b2540; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Doodle Rooms: full-screen room ---------- */
body.room-open { overflow: hidden; }
body.room-open .player { display: none; }
.room-view { position: fixed; inset: 0; z-index: 40; background: #2b2540; color: #2b2540; }
.room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: fill; border-radius: 0; display: block; touch-action: none; }
.room-canvas.dragging { cursor: grabbing !important; }
.room-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.room-top > * { pointer-events: auto; }
.room-pill, .room-round { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 3px solid var(--outline); background: #fff; color: #2b2540;
  font: 800 .95rem var(--display); cursor: pointer; box-shadow: 3px 3px 0 #2b2540; }
.room-pill { border-radius: 999px; padding: 8px 16px 8px 10px; }
.room-round { width: 46px; height: 46px; border-radius: 50%; }
.room-nav { display: flex; gap: 10px; }
.room-pill svg, .room-round svg { width: 20px; height: 20px; fill: none; stroke: #2b2540; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.room-pill:active, .room-round:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #2b2540; }
.room-panel { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(430px, calc(100vw - 32px)); max-height: calc(100vh - 110px); overflow-y: auto;
  display: grid; gap: 12px; padding: 18px 20px 18px; background: #ffffffeb; backdrop-filter: blur(8px);
  border: 3px solid var(--outline); border-radius: 24px; box-shadow: 6px 6px 0 #2b2540; }
.room-title { margin: 0; font: 800 clamp(1.6rem, 3.4vw, 2.2rem)/1.05 var(--display); padding-right: 30px; }
.room-text { margin: 0; color: #4a4363; line-height: 1.45; }
.room-hide { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--outline); background: var(--p-butter);
  font: 800 1.05rem/1 var(--display); cursor: pointer; padding: 0; color: #2b2540; }
.room-panel.tucked > :not(.room-title):not(.room-hide) { display: none; }
.room-controls { display: flex; align-items: center; gap: 14px; }
.room-play { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--outline); background: #2b2540; display: grid; place-items: center; cursor: pointer;
  box-shadow: 4px 4px 0 var(--pop); transition: transform .1s; }
.room-play:active { transform: translate(2px, 2px); }
.room-play svg { width: 26px; height: 26px; fill: #fff; }
.room-play .i-pause, .room-play.on .i-play { display: none; }
.room-play.on .i-pause { display: block; }
.room-play.on { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.mixer { display: grid; gap: 6px; flex: 1; min-width: 0; }
.mixer label { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 8px; font-weight: 800; font-size: .82rem; }
.mixer input { width: 100%; accent-color: #2b2540; }
.room-guests { display: grid; gap: 8px; border-top: 2.5px dashed #2b254044; padding-top: 12px; }
.room-guests h3 { margin: 0; font-size: .74rem; }
.guest-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.guest-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 2.5px solid var(--outline); background: var(--p-lilac); font-weight: 800; }
.guest-chip button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--outline); background: #fff; cursor: pointer; padding: 0; font-weight: 800; line-height: 1; color: #2b2540; }
.guest-chip.loading { padding-right: 12px; opacity: .7; animation: breathe 1s ease-in-out infinite; }
.guest-add { display: flex; align-items: center; gap: 8px; background: #fff; border: 2.5px solid var(--outline); border-radius: 999px; padding: 4px 4px 4px 14px; }
.guest-add span { font: 800 1.1rem var(--display); }
.guest-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 700 1rem var(--body); color: #2b2540; }
.guest-add .btn { padding: 7px 16px; box-shadow: 2px 2px 0 var(--outline); }
@media (max-width: 640px) {
  .room-panel { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-height: 52vh; padding: 14px 16px; gap: 10px; }
  .room-text { font-size: .9rem; }
  .room-play { width: 54px; height: 54px; }
  .mixer label { grid-template-columns: 6.5em 1fr; }
}
/* folded room panel: title + a play button row stays handy */
.room-panel.tucked { gap: 0; }
.room-panel.tucked .room-title { font-size: 1.3rem; }

/* =========================================================
   TABS LAYOUT — one section at a time
   ========================================================= */
.wrap { gap: 26px; padding-block: 0 48px; }
main#views { display: block; min-width: 0; }
.view { display: grid; gap: 26px; min-width: 0; animation: viewIn .25s ease; }
.view[hidden] { display: none !important; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* sticky top bar: brand · tabs · tools */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--page); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 16px; flex-wrap: nowrap;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 12px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 3px solid color-mix(in srgb, var(--page-ink) 14%, transparent); }
.topbar .brand { flex: none; gap: 10px; }
.topbar .logo { width: 48px; height: 48px; }
.topbar .wordmark { font-size: 1.7rem; white-space: nowrap; }
.topbar .wordmark span { border-width: 2.5px; box-shadow: 2px 2px 0 var(--pop); }
.topbar .header-tools { flex: none; margin-left: auto; }
.topbar .moods { padding: 4px; }
.topbar .mood { width: 24px; height: 24px; }
.topbar .icon-btn { width: 38px; height: 38px; font-size: 1rem; }

.tabs-nav { display: flex; gap: 6px; margin-inline: auto; padding: 5px; border-radius: 999px; background: #fff; border: 3px solid var(--outline); box-shadow: 3px 3px 0 var(--shadow); }
.tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #2b2540; border-radius: 999px; padding: 8px 14px;
  font: 800 .92rem var(--display); cursor: pointer; white-space: nowrap; transition: background .15s; }
.tab svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tab:hover { background: var(--p-lilac); }
.tab[aria-current="page"] { background: #2b2540; color: #fff; }

/* 1100px and down: tabs show icons + short labels, tools shrink */
@media (max-width: 1100px) { .tab { padding: 8px 11px; } .topbar .wordmark { font-size: 1.45rem; } }

/* phones: tabs move to a bottom app bar */
@media (max-width: 760px) {
  .tabs-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 22px 22px 0 0; border-width: 3px 0 0;
    justify-content: space-around; gap: 0; padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 0 var(--shadow); }
  .tab { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: .7rem; flex: 1; border-radius: 14px; }
  .tab svg { width: 22px; height: 22px; }
  .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important; }
  .topbar .logo { width: 40px; height: 40px; }
  .topbar .wordmark { font-size: 1.3rem; }
  .topbar .moods { display: none; }
}

/* My Doodle tab */
.view[data-view="home"] .hero { padding-top: 6px; }
.doodle-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .doodle-grid { grid-template-columns: 1fr; } }
.doodle-card { background: var(--p-sky); justify-items: stretch; }
.doodle-frame { border: 3px solid var(--outline); border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 4px 4px 0 var(--shadow); }
.doodle-frame img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; color: transparent; background: var(--p-lilac); }
.doodle-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.doodle-actions .btn { flex: 1 1 160px; }

/* section headers inside tabs */
.view-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.view-head .pkicker { margin: 0; font: 800 .75rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--page-ink); opacity: .7; }
.view-head h2 { margin: 2px 0 0; color: var(--page-ink); }
.now { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 3px solid var(--outline); background: #fff; color: #2b2540;
  box-shadow: 3px 3px 0 var(--shadow); cursor: pointer; font: inherit; }
.now img { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--outline); object-fit: cover; background: var(--p-lilac); }
.now span { display: grid; text-align: left; line-height: 1.15; }
.now b { font: 800 1rem var(--display); }
.now small { font-size: .75rem; font-weight: 700; color: #5d5577; }
.now em { font-style: normal; font-weight: 800; font-size: .8rem; color: var(--pop); margin-left: 4px; }

/* Play tab: game and badges side by side on wide screens */
.view[data-view="play"] { grid-template-columns: minmax(0, 1fr); }
.game .duel { max-width: 720px; width: 100%; margin-inline: auto; }
.game .game-msg, .game > .hint { text-align: center; }
/* phones: the blur would trap the fixed bottom bar inside the header */
@media (max-width: 760px) { .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--page); } }
/* folded room panel still shows play + volume */
.room-panel.tucked > .room-controls { display: flex !important; margin-top: 10px; }

/* =========================================================
   ROOM VIEW — clean, minimal, cinematic (overrides the sticker style)
   ========================================================= */
.room-view { background: #120d18; color: #fff; }
.room-pill, .room-round { border: 1px solid rgba(255,255,255,.22) !important; background: rgba(20,14,28,.45); color: #fff; box-shadow: none;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font: 500 .95rem var(--body); transition: background .2s; }
.room-pill:hover, .room-round:hover { background: rgba(20,14,28,.7); }
.room-pill svg, .room-round svg { stroke: #fff; stroke-width: 2; }
.room-pill:active, .room-round:active { transform: none; box-shadow: none; }
.room-panel { background: rgba(18,12,24,.55); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1); padding: 22px 24px; gap: 14px; }
.room-title { font: 400 clamp(1.8rem, 3.6vw, 2.6rem)/1.05 "Fraunces", Georgia, serif; letter-spacing: -0.01em; color: #fff; }
.room-text { color: rgba(255,255,255,.78); font-size: .95rem; }
.room-hide { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font-weight: 500; }
.room-view .room-tags span { border: 0; background: transparent !important; color: rgba(255,255,255,.85); padding: 0 12px 0 0; font-weight: 600; font-size: .85rem; }
.room-view .room-tags svg { stroke: rgba(255,255,255,.85); }
.room-play { border: 0; background: #fff; box-shadow: none; width: 58px; height: 58px; }
.room-play svg { fill: #120d18; }
.room-play.on { animation: none; }
.mixer label { color: rgba(255,255,255,.8); font-weight: 600; }
.mixer input { accent-color: #fff; }
.room-guests { border-top: 1px solid rgba(255,255,255,.14); }
.room-guests h3 { color: rgba(255,255,255,.6) !important; background: none !important; padding: 0 !important; transform: none !important; letter-spacing: .14em; }
.room-view .hint { color: rgba(255,255,255,.55); }
.guest-chip { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.guest-chip button { border: 0; background: rgba(255,255,255,.2); color: #fff; }
.guest-add { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); }
.guest-add span, .guest-add input { color: #fff; }
.guest-add input::placeholder { color: rgba(255,255,255,.5); }
.guest-add .btn { border: 0 !important; background: #fff; color: #120d18; box-shadow: none; }
.guest-add .btn:hover { transform: none; box-shadow: none; background: #f1ecf7; }

/* room cards: let the painted previews breathe */
.room-thumb { border-bottom: 0; }
.room-enter { border: 0; background: rgba(18,12,24,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transform: none; font: 500 .85rem var(--body); }
.room-card:hover .room-enter { transform: scale(1.04); }
.room-name { font: 400 1.5rem "Fraunces", Georgia, serif !important; }
.room-card .room-name { color: #2b2540 !important; }
