/* Layout: app a schermo singolo, colonna centrale max 480px (mobile-first).
   Look volutamente unico (pastello chiaro "kawaii"), quindi niente tema scuro. */
:root {
  --cream: #fff8f3;
  --paper: #ffffff;
  --ink: #5b3f55;
  --ink-soft: #8d7189;
  --ink-faint: #d9c6d2;
  --rose: #ff8fab;
  --rose-deep: #e8607f;
  --blush: #ffd3df;
  --mist: #fff0f4;
  --lilac: #e6dcff;
  --mint: #cdeee0;
  --butter: #fff0bf;
  --sky: #d7ecff;
  --pa: #ff8fab;
  --pb: #8fa8ff;
  /* colori del tema (vedi [data-theme] qui sotto) */
  --btn-1: #ffa7be;
  --btn-2: #ff7f9f;
  --btn-edge: #d9577a;
  --head-1: #ffdbe6;
  --head-2: #ffeef3;
  --bg-1: #fbe1ea;
  --bg-2: #ece3fb;
  --font-display: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}

/* Temi scelti dalle impostazioni (o in automatico dal sesso del proprio personaggio). */
:root[data-theme="azzurro"] { --rose: #7aa7f5; --rose-deep: #4f7fd9; --blush: #d7e6ff; --mist: #eef4ff; --btn-1: #9cbcfa; --btn-2: #6f9af0; --btn-edge: #4a74c9; --head-1: #d9e7ff; --head-2: #eef4ff; --bg-1: #dde9ff; --bg-2: #e6e3fb; }
:root[data-theme="lilla"] { --rose: #a98ce6; --rose-deep: #8565d1; --blush: #e6dcff; --mist: #f4f0ff; --btn-1: #bea6f0; --btn-2: #9a7de0; --btn-edge: #7656bf; --head-1: #e9e0ff; --head-2: #f5f1ff; --bg-1: #ebe2fc; --bg-2: #fbe3f0; }
:root[data-theme="menta"] { --rose: #4fc39a; --rose-deep: #2f9e78; --blush: #cdeee0; --mist: #effaf5; --btn-1: #7fd9b6; --btn-2: #4fc39a; --btn-edge: #2f9473; --head-1: #d4f2e5; --head-2: #effaf5; --bg-1: #ddf3ea; --bg-2: #e3eefb; }
:root[data-theme="pesca"] { --rose: #ff9a6b; --rose-deep: #e8743f; --blush: #ffe0cf; --mist: #fff4ee; --btn-1: #ffb38f; --btn-2: #ff8f5c; --btn-edge: #d96a35; --head-1: #ffe2d2; --head-2: #fff3ec; --bg-1: #ffe6d8; --bg-2: #fbe3ee; }

html { height: 100%; box-sizing: border-box; background: var(--bg-1); }
*, *::before, *::after { box-sizing: inherit; }
body {
  height: 100%;
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12px 12px, rgba(255, 255, 255, .7) 2px, transparent 2.5px) 0 0 / 26px 26px,
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#root { height: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pb); outline-offset: 2px; border-radius: 12px; }
.hidden { display: none; }

/* ------------------------------------------------------------ boot */
.boot-screen {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-display); color: var(--ink); padding: 24px 16px; text-align: center;
}
.boot-screen svg { animation: heartbeat 1.2s ease-in-out infinite; }
.boot-error { max-width: 100%; white-space: pre-wrap; font-size: 12px; background: #fff; padding: 12px; border-radius: 12px; color: #a33; }

/* ------------------------------------------------------------ shell */
.app-shell {
  height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--cream); position: relative; overflow: hidden;
}
@media (min-width: 520px) {
  .app-shell { box-shadow: 0 0 0 1px rgba(91, 63, 85, .06), 0 30px 80px -30px rgba(140, 80, 120, .45); }
}
.app-header {
  flex: none; position: relative; z-index: 20;
  background: linear-gradient(180deg, var(--head-1) 0%, var(--head-2) 100%);
  border-bottom-left-radius: 26px; border-bottom-right-radius: 26px;
  box-shadow: 0 8px 20px -14px color-mix(in srgb, var(--rose-deep) 55%, transparent);
}
.app-main { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.screen-enter { animation: screen-in .35s cubic-bezier(.2, .9, .3, 1.2); }

.couple-heads { display: flex; flex: none; }
.head-bubble { width: 44px; height: 44px; border-radius: 999px; background: #fff; border: 2.5px solid #fff; box-shadow: 0 3px 8px -3px rgba(140, 80, 120, .45); }
.head-bubble.is-a { background: #ffe1ea; }
.head-bubble.is-b { background: #e3e9ff; }
.head-bubble.is-second { margin-left: -12px; }
.head-unknown { display: inline-grid; place-items: center; border-radius: 999px; background: #fff; color: var(--rose-deep); font-family: var(--font-display); font-weight: 600; font-size: 22px; border: 2.5px dashed var(--rose); }
.head-bubble.head-unknown { width: 44px; height: 44px; }
.head-unknown.is-big { width: 110px; height: 110px; font-size: 54px; }
.heartbeat { color: var(--rose); display: inline-block; animation: heartbeat 1.4s ease-in-out infinite; font-size: 18px; }

.partner-switch { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.partner-switch-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--ink-soft); }
.partner-pill {
  max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 999px;
  border: 2px solid transparent; background: rgba(255, 255, 255, .7); color: var(--ink-soft); cursor: pointer; transition: all .15s;
}
.partner-pill.is-a.is-active { background: var(--pa); color: #fff; box-shadow: 0 3px 0 var(--btn-edge); }
.partner-pill.is-b.is-active { background: var(--pb); color: #fff; box-shadow: 0 3px 0 #6278d6; }

/* ------------------------------------------------------------ nav */
.bottom-nav {
  flex: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top-left-radius: 26px; border-top-right-radius: 26px;
  box-shadow: 0 -8px 24px -14px rgba(140, 80, 120, .45); position: relative; z-index: 20;
}
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer; padding: 2px 0; color: var(--ink-soft); }
.nav-icon { display: grid; place-items: center; width: 42px; height: 30px; border-radius: 999px; transition: background .2s, transform .2s; }
.nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.nav-btn.is-active { color: var(--rose-deep); }
.nav-btn.is-active .nav-icon { background: var(--blush); animation: nav-pop .35s cubic-bezier(.2, .9, .3, 1.5); }

/* ------------------------------------------------------------ elementi base */
.card { background: var(--paper); border-radius: 24px; box-shadow: 0 4px 18px -8px rgba(140, 80, 120, .3); }
.field-label { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); margin: 0; }
.input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--mist); border: 2px solid transparent;
  border-radius: 16px; padding: 10px 14px; outline: none; transition: border-color .15s, background .15s;
}
.input::placeholder { color: #b9a3b4; }
.input:focus { border-color: var(--rose); background: #fff; }

.btn-game {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: .01em;
  border: 0; border-radius: 999px; padding: .7rem 1.2rem; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, var(--btn-1), var(--btn-2));
  box-shadow: 0 4px 0 var(--btn-edge), 0 10px 18px -8px var(--btn-edge);
  text-shadow: 0 1px 0 rgba(160, 40, 80, .25);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn-game:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-edge), 0 4px 10px -6px var(--btn-edge); }
.btn-game:disabled { filter: grayscale(.5); opacity: .55; cursor: not-allowed; }
.btn-game.is-white { background: #fff; color: var(--ink); text-shadow: none; box-shadow: 0 4px 0 var(--blush), 0 10px 18px -10px rgba(140, 80, 120, .5); }
.btn-game.is-white:active { box-shadow: 0 1px 0 var(--blush); }
.btn-game.is-mint { background: linear-gradient(180deg, #8fe3c2, #5ccaa0); box-shadow: 0 4px 0 #3ea883, 0 10px 18px -8px rgba(62, 168, 131, .6); text-shadow: 0 1px 0 rgba(30, 110, 80, .3); }
.btn-game.is-mint:active { box-shadow: 0 1px 0 #3ea883; }
.btn-game.is-peach { background: linear-gradient(180deg, #ffc89e, #ffa36f); box-shadow: 0 4px 0 #e0814b, 0 10px 18px -8px rgba(224, 129, 75, .6); text-shadow: 0 1px 0 rgba(150, 70, 30, .3); }
.btn-game.is-peach:active { box-shadow: 0 1px 0 #e0814b; }
.btn-game.is-danger { background: linear-gradient(180deg, #ff9a9a, #f26d7d); box-shadow: 0 4px 0 #cc4a5c; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 0;
  background: var(--mist); color: var(--ink); cursor: pointer; flex: none; transition: transform .1s;
}
.icon-btn:active { transform: scale(.92); }
.mini-btn { border: 0; border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 12px; background: var(--mist); cursor: pointer; }
.mini-btn.is-danger { background: #f26d7d; color: #fff; }

.tabs-scroller { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.hscroll { position: relative; min-width: 0; }
.hscroll-track { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 5px; cursor: grab; }
.hscroll.has-right .hscroll-track { mask-image: linear-gradient(90deg, #000 82%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); }
.hscroll.has-left .hscroll-track { mask-image: linear-gradient(90deg, transparent, #000 18%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%); }
.hscroll.has-left.has-right .hscroll-track { mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
.hscroll-arrow {
  position: absolute; top: calc(50% - 2px); transform: translateY(-50%); z-index: 3; width: 30px; height: 30px; border-radius: 999px; border: 0;
  display: grid; place-items: center; background: #fff; color: var(--rose-deep); cursor: pointer; box-shadow: 0 3px 10px -3px rgba(140, 80, 120, .55);
}
.hscroll-arrow.is-left { left: -4px; }
.hscroll-arrow.is-right { right: -4px; }
.hscroll-arrow:active { transform: translateY(-50%) scale(.9); }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.tab-chip, .room-chip {
  flex: none; border: 0; cursor: pointer; white-space: nowrap; font-family: var(--font-display); font-weight: 500; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--ink-soft); box-shadow: 0 2px 0 #f0dce6;
  transition: background .15s, color .15s, transform .1s;
}
.tab-chip.is-small { font-size: 13px; padding: 6px 12px; }
.tab-chip.is-on, .room-chip.is-on { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #3d2a39; }
.room-chip.is-on { background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); box-shadow: 0 3px 0 var(--btn-edge); }
.chip {
  border: 2px solid #f3e1ea; background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink-soft);
}
.chip.is-on { border-color: var(--rose); background: var(--mist); color: var(--rose-deep); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: color-mix(in srgb, var(--blush) 50%, #fff); padding: 4px; border-radius: 999px; }
.segmented button { border: 0; background: none; border-radius: 999px; padding: 9px 8px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-soft); cursor: pointer; transition: all .15s; }
.segmented button.is-on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px -2px rgba(140, 80, 120, .4); }

.swatch {
  width: 36px; height: 36px; border-radius: 999px; border: 3px solid #fff; cursor: pointer; display: inline-grid; place-items: center;
  box-shadow: 0 0 0 1.5px var(--blush), 0 3px 6px -3px rgba(140, 80, 120, .5); transition: transform .12s;
}
.swatch.is-on { box-shadow: 0 0 0 3px var(--rose), 0 3px 8px -2px color-mix(in srgb, var(--rose-deep) 60%, transparent); transform: scale(1.08); }
.swatch.is-none { background: repeating-linear-gradient(45deg, #fff 0 4px, #f6e7ee 4px 8px); color: var(--ink-soft); }
.swatch.is-pet { width: 42px; height: 42px; }

.toggle { width: 52px; height: 30px; border-radius: 999px; border: 0; background: #ecd9e3; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 2px 4px rgba(91, 63, 85, .3); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.toggle.is-on { background: var(--rose); }
.toggle.is-on .toggle-knob { transform: translateX(22px); }

.thumb-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 6px;
  border-radius: 18px; border: 2.5px solid transparent; background: var(--mist); cursor: pointer; transition: transform .12s, border-color .12s; min-width: 0;
}
.thumb-card:active { transform: scale(.95); }
.thumb-card.is-on { border-color: var(--rose); background: #fff; box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--rose-deep) 55%, transparent); }
.thumb-svg { display: block; width: 100%; height: auto; }
/* scelte bloccate da un'altra opzione (es. occhi chiusi): visibili ma non selezionabili */
.is-locked-field .thumb-card { cursor: not-allowed; opacity: .5; filter: grayscale(.45); }
.is-locked-field .thumb-card:active { transform: none; }
.field-locked-note { margin: 0; padding: 8px 12px; border-radius: 14px; background: var(--mist); color: var(--ink-soft); font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.thumb-label { font-size: 11px; font-weight: 800; color: var(--ink-soft); text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-check { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 999px; background: var(--rose); color: #fff; display: grid; place-items: center; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f4e8ee; color: var(--ink-soft); }
.badge.is-gold { background: #fff0bf; color: #a57a17; }
.badge.is-match { background: var(--rose); color: #fff; }
.notice { background: #fff4d6; border: 2px dashed #f5cf6e; color: #8a6514; font-weight: 700; font-size: 14px; border-radius: 18px; padding: 10px 14px; }
.empty-state { text-align: center; padding: 36px 16px; border: 2.5px dashed #f0d4e0; border-radius: 24px; background: #fff; }
.form-error { color: #c43c58; font-weight: 700; font-size: 14px; margin: 0; }
.skeleton { border-radius: 22px; background: linear-gradient(90deg, var(--mist) 25%, var(--mist) 50%, var(--mist) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.hint-list { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.hint-list li::before { content: '♥'; color: var(--rose); margin-right: 6px; }

/* ------------------------------------------------------------ sheet + toast */
.sheet-root { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(91, 63, 85, .35); backdrop-filter: blur(2px); animation: fade-in .2s ease; }
.sheet-panel {
  position: relative; width: 100%; max-width: 480px; max-height: 86%; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 30px 30px 0 0; box-shadow: 0 -20px 50px -20px rgba(91, 63, 85, .5);
  padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheet-up .32s cubic-bezier(.2, .9, .3, 1.1);
}
.sheet-head { position: sticky; top: 0; z-index: 6; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); padding: 10px 20px 12px; }
.sheet-grip { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--blush); margin: 0 auto 10px; }
.sheet-body { padding: 4px 20px 24px; }
.toast-host { position: absolute; left: 0; right: 0; bottom: 96px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 80; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(58, 40, 51, .7); animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.4); max-width: 100%; text-align: center; }
.toast.is-error { background: #c43c58; }

/* ------------------------------------------------------------ personaggi */
.stage {
  position: relative; overflow: hidden; border-radius: 28px; padding: 18px 12px 14px;
  background: radial-gradient(ellipse at 50% 100%, #fff 0 30%, transparent 31%) bottom / 100% 40% no-repeat, linear-gradient(180deg, color-mix(in srgb, var(--blush) 60%, #fff), #efe6ff);
  box-shadow: inset 0 -10px 0 rgba(255, 255, 255, .5), 0 6px 20px -10px rgba(140, 80, 120, .45);
}
.stage-spot { position: absolute; inset: -40% 10% auto; height: 120%; background: radial-gradient(closest-side, rgba(255, 255, 255, .8), transparent); pointer-events: none; }
.name-tag { margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 600; font-size: 14px; padding: 3px 12px; border-radius: 999px; color: #fff; }
.name-tag.is-f { background: #ff8fab; box-shadow: 0 3px 0 #d9577a; }
.name-tag.is-m { background: #7aa7f5; box-shadow: 0 3px 0 #4a74c9; }
.name-tag.is-n { background: #4fc39a; box-shadow: 0 3px 0 #2f9473; }

/* ------------------------------------------------------------ stanza */
.room-canvas {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; margin: 0 auto; overflow: hidden;
  border-radius: 28px; touch-action: none; user-select: none; -webkit-user-select: none;
  isolation: isolate; /* i livelli interni (personaggi, mobili) restano dentro la stanza e sotto i cassetti */
  box-shadow: 0 0 0 4px #fff, 0 16px 30px -14px rgba(140, 80, 120, .55);
  background: #f7e8ef;
}
/* Muro e pavimento sono solo sfondo: livello 0, nessuna interazione, nessuna trasformazione 3D. */
.room-wall, .room-floor, .room-floor-pattern, .room-baseboard, .room-light { pointer-events: none; user-select: none; z-index: 0; }
.room-wall { position: absolute; left: 0; right: 0; top: 0; height: 58%; }
.room-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; overflow: hidden; }
.room-floor-pattern { position: absolute; inset: 0; }
.room-floor::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(91, 63, 85, .2), rgba(91, 63, 85, .04) 40%, transparent 70%); }
.room-baseboard { position: absolute; left: 0; right: 0; top: 57%; height: 2.4%; background: #fff; box-shadow: 0 3px 6px -2px rgba(91, 63, 85, .25); }
.room-light { position: absolute; inset: 0; background: radial-gradient(ellipse at 18% 8%, rgba(255, 255, 255, .55), transparent 55%); }

.placed-item { position: absolute; transform: translate(-50%, -100%); touch-action: none; cursor: grab; filter: drop-shadow(0 4px 3px rgba(91, 63, 85, .2)); }
.placed-item:active { cursor: grabbing; }
.placed-svg { display: block; width: 100%; height: auto; transition: transform .2s; }
.placed-item.is-selected { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 6px 10px color-mix(in srgb, var(--rose-deep) 45%, transparent)); }
.placed-item.is-selected::after {
  content: ''; position: absolute; inset: -6px; border: 2.5px dashed var(--rose-deep); border-radius: 12px; pointer-events: none;
  animation: marching 1s linear infinite;
}

.room-couple { position: absolute; transform: translate(-50%, -100%); width: 46%; display: flex; touch-action: none; cursor: grab; filter: drop-shadow(0 6px 4px rgba(91, 63, 85, .18)); }
.room-avatar { width: 50%; height: auto; margin: 0 -2%; }
.room-pet { position: absolute; transform: translate(-50%, -100%); width: 17%; border: 0; padding: 0; background: none; cursor: pointer; transition: left 2.8s ease-in-out, top 2.8s ease-in-out; }
.room-pet-inner { display: block; animation: pet-hop .9s ease-in-out infinite; }
.room-pet .mood-triste { filter: saturate(.6); }
.room-pet:has(.mood-triste) .room-pet-inner { animation: pet-sad 3s ease-in-out infinite; }

.burst { position: absolute; z-index: 9000; pointer-events: none; transform: translate(-50%, -50%); }
.burst span { position: absolute; color: var(--rose-deep); font-size: 20px; animation: burst-up 1.1s ease-out forwards; }
.burst span:nth-child(2) { left: -18px; animation-delay: .08s; font-size: 15px; }
.burst span:nth-child(3) { left: 16px; animation-delay: .16s; font-size: 17px; }

.item-toolbar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 9999; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border-radius: 22px; padding: 8px 6px 8px; box-shadow: 0 10px 26px -10px rgba(91, 63, 85, .6); animation: toast-in .25s cubic-bezier(.2, .9, .3, 1.3);
}
.tool-btn {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: var(--mist); border-radius: 14px;
  padding: 6px 2px 5px; cursor: pointer; color: var(--ink);
}
.tool-btn:active:not(:disabled) { transform: scale(.94); }
.tool-btn:disabled { opacity: .35; cursor: not-allowed; }
.tool-btn.is-danger { background: #ffe1e5; color: #c43c58; }
.tool-label { font-size: 10px; font-weight: 800; }
.tool-scale { align-self: center; font-size: 11px; font-weight: 800; color: var(--ink-soft); min-width: 34px; text-align: center; }
.tool-sep { width: 1px; background: #f0dce6; margin: 4px 2px; }

/* cornici: posizione = centro, larghezza in % della stanza */
.photo-frame { position: absolute; transform: translate(-50%, -50%); touch-action: none; cursor: grab; filter: drop-shadow(0 6px 6px rgba(91, 63, 85, .28)); }
.photo-frame.is-selected::after { content: ''; position: absolute; inset: -6px; border: 2.5px dashed var(--rose-deep); border-radius: 12px; pointer-events: none; animation: marching 1s linear infinite; }
.frame-look { display: block; width: 100%; }
.frame-hanger { display: block; width: 46%; margin: 0 auto -1px; }
.frame-tape { display: block; width: 38%; height: 9px; margin: 0 auto -5px; position: relative; z-index: 1; background: rgba(255, 179, 199, .85); transform: rotate(-4deg); border-radius: 1px; }
.frame-outer { display: block; padding: 9%; border-radius: 6px; }
.frame-mat { display: block; padding: 8%; background: #fffaf2; aspect-ratio: 4 / 5; box-shadow: inset 0 1px 4px rgba(0, 0, 0, .18); border-radius: 2px; overflow: hidden; }
.frame-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.frame-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; color: #c08aa2; font-size: 9px; font-weight: 800; border: 1.5px dashed var(--blush); border-radius: inherit; background: var(--mist); }
/* materiali */
.fs-oro .frame-outer { background: linear-gradient(135deg, #fbedc4 0%, #d9b25e 28%, #f9e7b0 50%, #c99a3e 74%, #f3dc9c 100%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7), inset 0 0 0 3px rgba(160, 110, 40, .35); }
.fs-legno .frame-outer { background: repeating-linear-gradient(100deg, #c9915f 0 6px, #b97f4f 6px 9px, #d39f6d 9px 15px); box-shadow: inset 0 0 0 2px rgba(90, 50, 20, .35); }
.fs-bianco .frame-outer { background: #ffffff; box-shadow: inset 0 0 0 1.5px #eadde4; }
.fs-rosa .frame-outer { background: linear-gradient(135deg, #ffd1dc, #ffb3c7); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.fs-argento .frame-outer { background: linear-gradient(135deg, #f4f4f8 0%, #b9bccb 30%, #eef0f6 52%, #a3a7b8 76%, #e3e5ee 100%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8); }
.fs-nero .frame-outer { padding: 4%; background: #3d3a4a; }
.fs-fiori .frame-outer { background: radial-gradient(circle at 6px 6px, #ffffff 2.2px, transparent 2.8px) 0 0 / 12px 12px, #b9e6c9; box-shadow: inset 0 0 0 2px #8fd19e; }
/* materiali in più: legni, colori pastello, bambù, vimini, conchiglie, velluto */
.fs-noce .frame-outer { background: repeating-linear-gradient(100deg, #8a5a3c 0 6px, #74492f 6px 9px, #96654a 9px 15px); box-shadow: inset 0 0 0 2px rgba(50, 25, 10, .4); }
.fs-sbiancato .frame-outer { background: repeating-linear-gradient(100deg, #f3ebe2 0 7px, #e3d7c9 7px 9px, #efe5da 9px 16px); box-shadow: inset 0 0 0 1.5px rgba(150, 120, 90, .3); }
.fs-menta .frame-outer { background: linear-gradient(135deg, #d7f3e6, #a8e0c6); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.fs-azzurro .frame-outer { background: linear-gradient(135deg, #dcecff, #a9cbf2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.fs-lilla .frame-outer { background: linear-gradient(135deg, #ece4ff, #c7b6f5); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.fs-pesca .frame-outer { background: linear-gradient(135deg, #ffe6d6, #ffbf9c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.fs-burro .frame-outer { background: linear-gradient(135deg, #fff6cf, #ffe08a); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.fs-bambu .frame-outer { background: repeating-linear-gradient(0deg, #d8c27a 0 12px, #b59c52 12px 14px), #d8c27a; box-shadow: inset 0 0 0 2px rgba(120, 95, 30, .35); }
.fs-vimini .frame-outer { background: repeating-linear-gradient(45deg, #e6c48f 0 3px, #cfa66b 3px 6px), repeating-linear-gradient(-45deg, transparent 0 3px, rgba(150, 105, 50, .35) 3px 6px); box-shadow: inset 0 0 0 2px rgba(130, 90, 40, .35); }
.fs-conchiglie .frame-outer { background: radial-gradient(circle at 5px 5px, #fff 1.8px, transparent 2.4px) 0 0 / 10px 10px, linear-gradient(135deg, #fdf3ea, #f4d9c8); box-shadow: inset 0 0 0 2px #e9c3ad; }
.fs-velluto .frame-outer { background: radial-gradient(circle at 30% 20%, #e89ab2, #b5577a); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), inset 0 0 6px rgba(80, 20, 40, .4); }
.fs-cuori .frame-outer { background: radial-gradient(circle at 6px 6px, #ff8fab 2px, transparent 2.6px) 0 0 / 12px 12px, #fff0f4; box-shadow: inset 0 0 0 2px #ffc2d1; }
.fs-stelle .frame-outer { background: radial-gradient(circle at 5px 5px, #fff6c9 1.6px, transparent 2.2px) 0 0 / 11px 11px, linear-gradient(135deg, #4d5a80, #3a4566); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.fs-polaroid .frame-outer { padding: 6% 6% 22%; background: #ffffff; border-radius: 2px; box-shadow: inset 0 0 0 1px #ece3e8; }
.fs-polaroid .frame-mat { padding: 0; }
/* forme */
.shape-orizzontale .frame-mat { aspect-ratio: 5 / 4; }
.shape-quadrato .frame-mat, .shape-tondo .frame-mat, .shape-cuore .frame-mat { aspect-ratio: 1 / 1; }
.shape-ovale .frame-outer, .shape-ovale .frame-mat, .shape-tondo .frame-outer, .shape-tondo .frame-mat { border-radius: 50%; }
.shape-cuore .frame-outer, .shape-cuore .frame-mat { clip-path: url(#pocketus-heart-clip); border-radius: 0; }
.shape-cuore .frame-outer { padding: 12%; }
.frame-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; padding: 4px 14%; }
.frame-thumb .frame-look { width: 100%; filter: drop-shadow(0 3px 3px rgba(91, 63, 85, .25)); }
.photo-view { border-radius: 22px; overflow: hidden; padding: 14px; background: linear-gradient(135deg, #fbedc4, #d9b25e 30%, #f9e7b0 55%, #c99a3e); }
.photo-view img { display: block; width: 100%; max-height: 52vh; object-fit: contain; background: #fffaf2; border-radius: 6px; }

/* catalogo decorazioni */
.catalog-card { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; padding: 10px 6px 8px; background: var(--mist); border-radius: 20px; cursor: pointer; transition: transform .12s; min-width: 0; }
.catalog-card:active { transform: scale(.95); }
.catalog-preview { display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; padding: 6px; }
.catalog-preview svg { width: 100%; height: 100%; }
.catalog-name { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.15; color: var(--ink); }
.catalog-price { font-size: 10px; font-weight: 800; color: #3ea883; background: #ddf6ea; padding: 1px 8px; border-radius: 999px; }
.surface-card { position: relative; display: flex; flex-direction: column; gap: 6px; border: 2.5px solid transparent; background: #fff; border-radius: 20px; padding: 6px; cursor: pointer; box-shadow: 0 2px 0 #f0dce6; }
.surface-card.is-on { border-color: var(--rose); }
.surface-preview { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(91, 63, 85, .08); }
.surface-name { font-size: 12px; font-weight: 800; text-align: center; color: var(--ink); }

/* ------------------------------------------------------------ animaletto */
.pet-preview { display: flex; flex-direction: column; align-items: center; padding: 14px; border-radius: 28px; background: radial-gradient(circle at 50% 60%, #fff 0 38%, transparent 39%), linear-gradient(180deg, #e6f6ee, #fff3d6); }
.pet-scene {
  position: relative; overflow: hidden; border-radius: 28px; padding: 16px 16px 12px;
  background: linear-gradient(180deg, #dff2ff 0 58%, #c6ebd2 58% 100%);
  box-shadow: 0 0 0 4px #fff, 0 14px 28px -14px rgba(140, 80, 120, .5);
}
.pet-scene::before { content: ''; position: absolute; left: 50%; bottom: 74px; width: 70%; height: 22%; transform: translateX(-50%); border-radius: 50%; background: var(--blush); box-shadow: inset 0 0 0 8px var(--mist); }
.pet-scene.mood-triste { background: linear-gradient(180deg, #dfe3ee 0 58%, #c9d8cf 58% 100%); }
.pet-scene.mood-felice::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .7) 2px, transparent 3px) 0 0 / 40px 40px; animation: twinkle 3s linear infinite; }
/* cure del cucciolo dentro la scena, con la barretta del suo stato */
.pet-care-row { position: relative; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
/* card bianche con bolla colorata per l'azione e barretta del livello (colore del livello, non dell'azione) */
.pet-care-btn {
  --c1: #ffd6bd; --c2: #ffa36f; --edge: #f0c3a6;
  display: grid; justify-items: center; gap: 6px; padding: 10px 8px 9px; border: 0; border-radius: 20px; cursor: pointer;
  background: #fff; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 0 var(--edge), 0 8px 16px -10px rgba(91, 63, 85, .5); transition: transform .08s, box-shadow .08s;
}
.pet-care-btn.is-peach { --c1: #ffe0cc; --c2: #ff9a6b; --edge: #f3c6aa; }
.pet-care-btn.is-mint { --c1: #fff1b8; --c2: #f4c64a; --edge: #f1dc9a; }
.pet-care-btn.is-sky { --c1: #d7ecff; --c2: #6fa9ec; --edge: #bcd7f3; }
.pet-care-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.pet-care-icon {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-size: 20px; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--c1) 60%, var(--c2));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08), 0 2px 0 var(--edge);
}
.pet-care-btn:active .pet-care-icon { animation: nav-pop .35s cubic-bezier(.2, .9, .3, 1.5); }
.pet-care-top { display: block; white-space: nowrap; }
.pet-care-meter.stat-track { display: block; width: 100%; height: 7px; background: #f4e8ee; }
.pet-care-meter .stat-fill { display: block; height: 100%; }
.pet-stage { position: relative; z-index: 1; display: block; width: min(56%, 34vh); margin: 0 auto; border: 0; padding: 0; background: none; cursor: pointer; }
.pet-stage-inner { display: block; transform-origin: 50% 95%; }
.pet-particle { position: absolute; bottom: 60%; font-size: 26px; color: var(--rose-deep); pointer-events: none; animation: float-up 1.4s ease-out forwards; }
.mood-chip { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.mood-chip.is-felice { background: color-mix(in srgb, var(--blush) 60%, #fff); color: var(--rose-deep); }
.mood-chip.is-normale { background: #e3f4ec; color: #2f8a69; }
.mood-chip.is-triste { background: #e7e4f0; color: #6b5f86; }

.stat-track { height: 16px; border-radius: 999px; background: #f4e8ee; overflow: hidden; box-shadow: inset 0 2px 3px rgba(91, 63, 85, .12); }
.stat-fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2, .9, .3, 1.2); background-image: linear-gradient(180deg, rgba(255, 255, 255, .45), transparent 60%); }
.stat-track.is-high .stat-fill { background-color: #6fd3a8; }
.stat-track.is-mid .stat-fill { background-color: #ffcf6b; }
.stat-track.is-low .stat-fill { background-color: #ff8f9c; animation: low-pulse 1.4s ease-in-out infinite; }

.pet-sprite .pet-tail { transform-box: fill-box; }
.mood-felice .pet-tail { animation: wag .5s ease-in-out infinite alternate; }
.mood-normale .pet-tail { animation: wag 1.4s ease-in-out infinite alternate; }
.mood-felice .pet-wing-l { animation: flap-l .4s ease-in-out infinite alternate; }
.mood-felice .pet-wing-r { animation: flap-r .4s ease-in-out infinite alternate; }
.pet-tear { animation: tear 2.4s ease-in infinite; }
.pet-heart { animation: heart-float 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pet-sprite.mood-triste { filter: saturate(.7); }

.pet-anim-idle { animation: pet-stroll 6s ease-in-out infinite; }
.pet-anim-happy { animation: pet-hop .8s ease-in-out infinite; }
.pet-anim-sad { animation: pet-sad 3.2s ease-in-out infinite; }
.pet-anim-feed { animation: pet-munch .3s ease-in-out 3; }
.pet-anim-play { animation: pet-spin .8s cubic-bezier(.3, 1.4, .5, 1); }
.pet-anim-cuddle { animation: pet-squish .5s ease-in-out; }

/* ------------------------------------------------------------ ricordi */
.memories-hero, .quiz-hero { border-radius: 26px; padding: 16px; background: linear-gradient(135deg, #fff0bf, color-mix(in srgb, var(--blush) 60%, #fff) 60%, #e6dcff); box-shadow: 0 6px 18px -10px rgba(140, 80, 120, .45); }
.memories-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; display: grid; gap: 14px; }
.timeline::before { content: ''; position: absolute; left: 31px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--blush) 0 10px, transparent 10px 16px); }
.timeline-item { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; }
.timeline-date {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 62px;
  background: #fff; border-radius: 18px; color: var(--rose-deep); box-shadow: 0 3px 0 var(--blush), 0 6px 14px -8px color-mix(in srgb, var(--rose-deep) 60%, transparent);
}
.memory-card { min-width: 0; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 4px 16px -8px rgba(140, 80, 120, .35); }
.memory-card.is-start { box-shadow: 0 0 0 2.5px #f5cf6e, 0 6px 18px -8px rgba(200, 150, 40, .6); }
.memory-photo { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.timeline-end { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; margin-left: 12px; border-radius: 999px; background: #fff; color: var(--rose); font-size: 20px; box-shadow: 0 3px 0 var(--blush), 0 6px 14px -8px rgba(140, 80, 120, .5); }
.timeline-year { position: relative; z-index: 1; padding-left: 4px; }
.timeline-jumper-slot { position: sticky; top: 0; z-index: 6; margin: 0 -4px; }
.timeline-jumper { display: grid; gap: 6px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); box-shadow: 0 6px 16px -10px rgba(140, 80, 120, .6); }
.jumper-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.jumper-months .month-pill:disabled { opacity: .35; cursor: default; }
.timeline-item, .timeline-year { scroll-margin-top: 130px; }
.timeline-year span { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #fff; background: var(--ink); padding: 3px 14px; border-radius: 999px; box-shadow: 0 3px 0 #3d2a39; }
.memory-card.is-new { animation: flash-new 2.2s ease; }
@keyframes flash-new { 0%, 60% { box-shadow: 0 0 0 4px var(--rose), 0 8px 20px -8px color-mix(in srgb, var(--rose-deep) 70%, transparent); } }
.sex-icon { display: inline-grid; place-items: center; border-radius: 999px; vertical-align: -4px; color: #fff; box-shadow: 0 2px 0 rgba(91, 63, 85, .2); flex: none; }
.sex-icon.is-F { background: var(--pa); }
.sex-icon.is-M { background: var(--pb); }
.sex-icon.is-N { background: #4fc39a; }

/* calendario ricordi */
.cal-select { font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); background: var(--mist); border: 0; border-radius: 999px; padding: 7px 12px; min-width: 0; cursor: pointer; }
.month-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.month-pill { position: relative; border: 0; border-radius: 12px; padding: 6px 0 8px; font-size: 12px; font-weight: 800; text-transform: capitalize; color: var(--ink-soft); background: #faf3f6; cursor: pointer; }
.month-pill.has-mem { color: var(--rose-deep); background: color-mix(in srgb, var(--blush) 60%, #fff); }
.month-pill.is-on { background: var(--ink); color: #fff; }
.month-dot { position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 999px; background: var(--rose); }
.month-pill.is-on .month-dot { background: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-faint); padding: 2px 0; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 12px; background: #fdf8fa; font-weight: 700; font-size: 14px; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.cal-day.has-mem { background: color-mix(in srgb, var(--blush) 60%, #fff); color: var(--rose-deep); box-shadow: inset 0 0 0 2px var(--blush); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--pb); }
.cal-day.is-on { background: var(--rose); color: #fff; box-shadow: 0 3px 0 var(--btn-edge); }
.cal-heart { font-size: 10px; line-height: 1; font-weight: 800; color: var(--rose-deep); }
.cal-day.is-on .cal-heart { color: #fff; }
.upload-box { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border-radius: 18px; border: 2.5px dashed var(--blush); background: var(--mist); color: var(--rose-deep); font-weight: 800; cursor: pointer; }
.start-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: #fff7dc; cursor: pointer; font-size: 14px; }
.start-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rose-deep); flex: none; }

/* ------------------------------------------------------------ quiz */
.quiz-progress { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .7); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pa), var(--pb)); transition: width .5s; }
.quiz-card { background: #fff; border-radius: 24px; padding: 16px; box-shadow: 0 4px 16px -8px rgba(140, 80, 120, .35); animation: screen-in .4s ease both; }
.quiz-card.is-revealed { background: linear-gradient(180deg, #fff, var(--mist)); }
.quiz-status { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: 999px; }
.quiz-status.is-open { background: var(--sky); color: #4b67b8; }
.quiz-status.is-waiting { background: #fff0bf; color: #a57a17; }
.quiz-status.is-revealed { background: color-mix(in srgb, var(--blush) 60%, #fff); color: var(--rose-deep); }
.wyr-option {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 2.5px solid #f3e1ea; background: #fff; border-radius: 18px;
  padding: 11px 12px; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; min-height: 52px; transition: transform .1s, border-color .15s;
}
.wyr-option:active:not(:disabled) { transform: scale(.98); }
.wyr-option:disabled { cursor: default; }
.wyr-option.is-locked:not(.is-mine):not(.is-theirs) { opacity: .6; }
.wyr-option.is-mine { border-color: var(--pa); background: var(--mist); }
.wyr-option.is-theirs { border-color: var(--pb); background: #f0f3ff; }
.wyr-option.is-mine.is-theirs { border-color: var(--rose-deep); background: linear-gradient(90deg, var(--mist), #f0f3ff); }
.wyr-letter { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: var(--mist); font-family: var(--font-display); font-weight: 600; color: var(--rose-deep); }
.wyr-head { width: 30px; height: 30px; border-radius: 999px; background: #fff; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(91, 63, 85, .25); }
.waiting { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; color: #a57a17; background: #fff7dc; border-radius: 14px; padding: 9px; }
.waiting-dots { display: inline-flex; gap: 3px; }
.waiting-dots i { width: 6px; height: 6px; border-radius: 999px; background: #e8b84a; animation: dot 1.2s ease-in-out infinite; }
.waiting-dots i:nth-child(2) { animation-delay: .15s; }
.waiting-dots i:nth-child(3) { animation-delay: .3s; }
.partner-ready { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #4b67b8; background: #eef2ff; border-radius: 14px; padding: 9px 12px; }
.bubble { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 18px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.bubble.is-mine { background: var(--mist); }
.bubble.is-theirs { background: #f0f3ff; }
.bubble-head { width: 34px; height: 34px; flex: none; border-radius: 999px; background: #fff; }
.bubble-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.reveal-pop { animation: reveal .5s cubic-bezier(.2, .9, .3, 1.4); }

/* ------------------------------------------------------------ animazioni */
.chibi-idle { animation: chibi-bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.chibi-delay .chibi-idle { animation-delay: -1.3s; }

@keyframes chibi-bob { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-2px) scaleY(1.012); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nav-pop { 0% { transform: scale(.8); } 100% { transform: scale(1); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.95); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes marching { 50% { opacity: .55; } }
@keyframes burst-up { 0% { opacity: 0; transform: translateY(0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) scale(1.2); } }
@keyframes float-up { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-90px) scale(1.15) rotate(12deg); } }
@keyframes wag { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes flap-l { from { transform: rotate(0); } to { transform: rotate(18deg); } }
@keyframes flap-r { from { transform: rotate(0); } to { transform: rotate(-18deg); } }
@keyframes tear { 0% { opacity: 0; transform: translateY(-3px); } 20% { opacity: 1; } 80% { opacity: 1; transform: translateY(6px); } 100% { opacity: 0; transform: translateY(9px); } }
@keyframes heart-float { 0%, 100% { transform: translateY(0) scale(1); opacity: .9; } 50% { transform: translateY(-6px) scale(1.1); opacity: 1; } }
@keyframes pet-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-7%) scale(.97, 1.04); } 80% { transform: translateY(0) scale(1.05, .95); } }
@keyframes pet-stroll {
  0%, 100% { transform: translateX(0) scaleX(1); }
  24% { transform: translateX(16%) scaleX(1); }
  26% { transform: translateX(16%) scaleX(-1); }
  74% { transform: translateX(-16%) scaleX(-1); }
  76% { transform: translateX(-16%) scaleX(1); }
}
@keyframes pet-sad { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(2%) rotate(-2deg) scaleY(.97); } }
@keyframes pet-munch { 50% { transform: scale(1.06, .94); } }
/* piroetta: un piccolo salto e un giro su se stesso (attorno all'asse verticale), sempre dentro la scena */
@keyframes pet-spin {
  0% { transform: translateY(0) rotateY(0) scale(1, 1); }
  15% { transform: translateY(0) rotateY(0) scale(1.08, .92); }
  45% { transform: translateY(-16%) rotateY(180deg) scale(1, 1); }
  75% { transform: translateY(-10%) rotateY(330deg) scale(1, 1); }
  90% { transform: translateY(0) rotateY(360deg) scale(1.08, .92); }
  100% { transform: translateY(0) rotateY(360deg) scale(1, 1); }
}
@keyframes pet-squish { 30% { transform: scale(1.1, .9); } 60% { transform: scale(.95, 1.06); } }
@keyframes twinkle { 50% { opacity: .4; } }
@keyframes low-pulse { 50% { filter: brightness(1.12); } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes reveal { from { opacity: 0; transform: scale(.9) translateY(6px); } }

/* ------------------------------------------------------------ personaggi nella stanza */
.room-char { position: absolute; transform: translate(-50%, -100%); width: 21%; touch-action: none; transition: left .55s ease, top .55s ease; filter: drop-shadow(0 6px 4px rgba(91, 63, 85, .18)); }
/* camminata verso il punto toccato: passetti saltellanti */
.room-char.is-walking { transition-timing-function: ease-in-out; }
.room-char.is-walking .room-char-body { animation: walk-bob .32s ease-in-out infinite; }
@keyframes walk-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4%) rotate(3deg); } }
.walk-target {
  position: absolute; width: 9%; aspect-ratio: 2 / 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; z-index: 1;
  border: 2.5px solid #fff; background: color-mix(in srgb, var(--rose) 35%, transparent); animation: walk-target .9s ease-out forwards;
}
@keyframes walk-target { from { opacity: 1; scale: .4; } to { opacity: 0; scale: 1.3; } }
.room-char.is-dragging { transition: none; }
.room-char.is-me { cursor: grab; }
.room-char .room-avatar { display: block; width: 100%; height: auto; margin: 0; }
.room-char.is-sleep { width: 12%; transform: translate(-50%, -50%); }
.room-char.is-bath { width: 18.3%; }
.room-char.anim-rock .room-avatar { animation: rock 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.room-char.anim-swing .room-avatar { animation: swing 2s ease-in-out infinite; transform-origin: 50% -60%; }
.room-char.anim-bounce .room-avatar { animation: hop 0.6s ease-in-out infinite; }
.room-char.anim-jump .room-avatar { animation: big-jump 1s ease-in-out infinite; }
.room-char-body { display: block; transform-origin: 50% 100%; transition: transform .4s ease; }
.room-char.anim-dance .room-avatar { animation: couple-dance 1s ease-in-out infinite; transform-origin: 50% 100%; }
.room-char.anim-shake .room-avatar { animation: giggle .35s ease-in-out infinite; transform-origin: 50% 100%; }
.room-avatar .steam, .room-avatar .drops { animation: rise 1.4s ease-in-out infinite; }
.room-avatar .notes { animation: hop 1s ease-in-out infinite; }
.gesture-card { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; padding: 14px 6px 10px; border-radius: 20px; background: var(--mist); cursor: pointer; transition: transform .12s; }
.gesture-card:active { transform: scale(.94); }
.gesture-emoji { font-size: 32px; line-height: 1; }
@keyframes couple-dance { 0%, 100% { transform: translateY(0) rotate(-6deg); } 25% { transform: translateY(-6%) rotate(0); } 50% { transform: translateY(0) rotate(6deg); } 75% { transform: translateY(-6%) rotate(0); } }
@keyframes giggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2%); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.me-marker { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); font-size: 9px; font-weight: 800; color: #fff; background: var(--ink); border-radius: 999px; padding: 0 6px; line-height: 14px; pointer-events: none; }
.room-char.is-sleep .me-marker { bottom: -10px; }
.placed-item:not(.is-editing) { cursor: default; }
.placed-item.is-usable { cursor: pointer; }
.placed-item.is-usable:hover { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rose) 90%, transparent)) drop-shadow(0 4px 3px rgba(91, 63, 85, .2)); }
.pendulum { transform-box: fill-box; transform-origin: 50% 0; animation: rock 2s ease-in-out infinite; }

@keyframes rock { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes swing { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6%); } }
@keyframes big-jump { 0%, 100% { transform: translateY(0) scale(1.03, .97); } 50% { transform: translateY(-30%) scale(.98, 1.03); } }
@keyframes float-emote { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 4px; } }
@keyframes bubble-in { from { opacity: 0; scale: .6; } }

/* ------------------------------------------------------------ gioco col cucciolo: animazioni varie */
.pet-anim-play-spin { animation: pet-spin 1.1s ease-in-out; }
.pet-anim-play-flip { animation: play-flip 1.1s ease-in-out; transform-origin: 50% 60%; }
.pet-anim-play-zoomies { animation: play-zoomies 1.3s ease-in-out; }
.pet-anim-play-wiggle { animation: play-wiggle .9s ease-in-out; }
.pet-anim-play-jump { animation: play-jump 1.1s cubic-bezier(.3, .7, .4, 1); }
.pet-anim-play-roll { animation: play-roll 1.8s ease-in-out; transform-origin: 50% 70%; }
.pet-anim-play-tail { animation: play-tail 1.3s linear; }
.pet-anim-play-dance { animation: play-dance 1.2s ease-in-out; }
/* capriola: si accuccia, salta, gira in aria e atterra schiacciandosi un po' */
@keyframes play-flip { 0% { transform: translateY(0) rotate(0) scale(1, 1); } 16% { transform: translateY(0) rotate(0) scale(1.14, .82); } 32% { transform: translateY(-38%) rotate(-80deg) scale(.94, 1.06); } 50% { transform: translateY(-56%) rotate(-190deg) scale(1, 1); } 68% { transform: translateY(-34%) rotate(-310deg) scale(1, 1); } 82% { transform: translateY(0) rotate(-360deg) scale(1.16, .8); } 92% { transform: translateY(-4%) rotate(-360deg) scale(.95, 1.06); } 100% { transform: translateY(0) rotate(-360deg) scale(1, 1); } }
@keyframes play-zoomies {
  0% { transform: translateX(0) scaleX(1); } 20% { transform: translateX(32%) scaleX(1); } 22% { transform: translateX(32%) scaleX(-1); }
  50% { transform: translateX(-32%) scaleX(-1); } 52% { transform: translateX(-32%) scaleX(1); } 80% { transform: translateX(14%) scaleX(1); } 100% { transform: none; }
}
@keyframes play-wiggle { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-10deg) scale(1.04); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-8deg) scale(1.04); } 60% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
@keyframes play-jump { 0% { transform: scale(1.1, .85); } 30% { transform: translateY(-45%) scale(.92, 1.08); } 55% { transform: translateY(-45%) scale(1); } 85% { transform: translateY(0) scale(1.12, .86); } 100% { transform: none; } }
/* rotola sul tappeto: si ribalta di lato, resta a pancia all'aria scalciando felice, poi torna su */
@keyframes play-roll { 0% { transform: translate(0, 0) rotate(0); } 18% { transform: translate(-6%, 4%) rotate(-95deg); } 32% { transform: translate(-10%, 10%) rotate(-180deg); } 40% { transform: translate(-10%, 10%) rotate(-168deg); } 48% { transform: translate(-10%, 10%) rotate(-192deg); } 56% { transform: translate(-10%, 10%) rotate(-170deg); } 64% { transform: translate(-10%, 10%) rotate(-190deg); } 72% { transform: translate(-10%, 10%) rotate(-180deg); } 88% { transform: translate(-3%, 2%) rotate(-40deg); } 94% { transform: translate(0, 0) rotate(6deg) scale(1.06, .94); } 100% { transform: translate(0, 0) rotate(0) scale(1, 1); } }
@keyframes play-tail { 0% { transform: rotateY(0); } 25% { transform: rotateY(180deg) translateX(8%); } 50% { transform: rotateY(360deg); } 75% { transform: rotateY(540deg) translateX(-8%); } 100% { transform: rotateY(720deg); } }
@keyframes play-dance { 0%, 100% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(-10%, -8%) rotate(-12deg); } 40% { transform: translate(0, 0) rotate(0) scale(1.05, .95); } 60% { transform: translate(10%, -8%) rotate(12deg); } 80% { transform: translate(0, 0) scale(1.05, .95); } }

/* ------------------------------------------------------------ messaggini */
.header-chat { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: #fff; color: var(--rose-deep); cursor: pointer; box-shadow: 0 3px 0 #f3d2df; }
.header-chat:active { transform: translateY(2px); box-shadow: 0 1px 0 #f3d2df; }
.header-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--rose-deep); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; animation: heartbeat 1.4s ease-in-out infinite; }
.message-banner {
  flex: none; display: flex; align-items: center; gap: 10px; margin: 8px 16px 0; padding: 8px 12px; border: 0; border-radius: 18px; cursor: pointer;
  background: linear-gradient(90deg, color-mix(in srgb, var(--blush) 60%, #fff), var(--mist)); color: var(--ink); box-shadow: 0 0 0 2px var(--rose), 0 8px 18px -10px color-mix(in srgb, var(--rose-deep) 80%, transparent); animation: toast-in .4s cubic-bezier(.2, .9, .3, 1.4);
}
.banner-envelope { font-size: 22px; animation: heartbeat 1.6s ease-in-out infinite; }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 4px 2px 8px; }
.chat-day { align-self: center; font-size: 11px; font-weight: 800; color: var(--ink-soft); background: #f6e7ee; border-radius: 999px; padding: 2px 10px; margin: 6px 0 2px; text-transform: capitalize; }
.chat-row { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; }
.chat-row.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-head { width: 30px; height: 30px; border-radius: 999px; background: #fff; flex: none; }
.chat-bubble { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 18px 18px 18px 6px; background: #f0f3ff; min-width: 0; }
.chat-bubble.is-mine { background: color-mix(in srgb, var(--blush) 60%, #fff); border-radius: 18px 18px 6px 18px; }
.chat-emoji { font-size: 20px; line-height: 1.1; }
.chat-emoji.is-big { font-size: 34px; }
.chat-text { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-meta { font-size: 10px; font-weight: 700; color: var(--ink-soft); }
.chat-compose { position: sticky; bottom: 0; background: #fff; padding-top: 10px; border-top: 1.5px solid #f6e7ee; display: grid; gap: 8px; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-btn { width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--mist); font-size: 19px; cursor: pointer; transition: transform .1s; }
.emoji-btn.is-on { background: var(--rose); transform: scale(1.1); box-shadow: 0 3px 0 var(--btn-edge); }

/* ------------------------------------------------------------ idee */
.idea-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 22px; background: #fff; cursor: pointer; box-shadow: 0 4px 16px -8px rgba(140, 80, 120, .35); text-align: left; }
.idea-card:active { transform: scale(.99); }
.idea-card.is-done { background: linear-gradient(90deg, #f1fbf6, #fff); }
.idea-emoji { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--mist); font-size: 24px; }
.idea-emoji.is-big { width: 56px; height: 56px; font-size: 28px; }
.idea-thumb { flex: none; width: 48px; height: 48px; border-radius: 16px; object-fit: cover; }
.badge.is-done { background: #ddf6ea; color: #2f8a69; }
.done-box { border-radius: 18px; padding: 12px; background: #f6f2ff; display: grid; gap: 8px; }
.done-box.is-done { background: #ddf6ea; }
.review-card { border-radius: 18px; padding: 12px; background: var(--mist); }
.review-card.is-partner { background: #f0f3ff; }
.star-btn { border: 0; padding: 0; background: none; cursor: pointer; transition: transform .1s; }
.star-btn:active { transform: scale(.85); }
.idea-photo { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--mist); }
.idea-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idea-photo-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .92); display: grid; place-items: center; cursor: pointer; }

/* ------------------------------------------------------------ catalogo arredo */
.catalog-tools { display: grid; gap: 10px; margin-bottom: 10px; }
.chip-count { font-size: 10px; opacity: .65; margin-left: 2px; }
.catalog-group { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); margin: 6px 0 8px; }
.catalog-group span { font-size: 11px; font-weight: 800; color: var(--ink-soft); background: #f6e7ee; border-radius: 999px; padding: 1px 8px; }
.catalog-card { position: relative; }
.catalog-use { position: absolute; top: 6px; right: 6px; font-size: 13px; background: #fff; border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; box-shadow: 0 2px 6px -2px rgba(91, 63, 85, .4); }

/* ------------------------------------------------------------ accesso di coppia */
.couple-heads { position: relative; border: 0; padding: 0; background: none; cursor: pointer; }
.head-bubble.is-waiting { filter: grayscale(.8); opacity: .55; }
.invite-dot { position: absolute; right: -4px; bottom: -2px; width: 18px; height: 18px; border-radius: 999px; background: var(--rose-deep); color: #fff; font-size: 13px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid #fff; }
.invite-strip { display: block; width: calc(100% - 32px); margin: 0 16px 10px; border: 0; border-radius: 14px; padding: 7px 12px; background: #fff; color: var(--ink-soft); font-size: 12px; cursor: pointer; box-shadow: 0 0 0 1.5px var(--blush); }
.invite-strip strong { color: var(--rose-deep); }
.onboarding { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.onboarding-card { width: 100%; max-width: 420px; background: #fff; border-radius: 32px; padding: 28px 22px; box-shadow: 0 30px 60px -30px rgba(140, 80, 120, .55); animation: screen-in .45s cubic-bezier(.2, .9, .3, 1.2); }
.onboarding-hero { display: flex; align-items: flex-end; justify-content: center; gap: 0; padding: 12px; border-radius: 26px; background: radial-gradient(ellipse at 50% 100%, #fff 0 32%, transparent 33%), linear-gradient(180deg, color-mix(in srgb, var(--blush) 60%, #fff), #efe6ff); }
.pocketus-logo { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pocketus-mark { width: 170px; max-width: 100%; height: auto; overflow: visible; }
.pocketus-heart { transform-box: fill-box; transform-origin: 50% 100%; animation: pocket-peek 2.6s ease-in-out infinite; }
.pocketus-sparkle { transform-box: fill-box; transform-origin: center; animation: twinkle-star 1.8s ease-in-out infinite; }
.pocketus-sparkle.is-late { animation-delay: -.9s; }
.pocketus-name { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 38px; line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.pocketus-name span { color: var(--rose-deep); }
@keyframes pocket-peek { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.04); } }
@keyframes twinkle-star { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.6) rotate(20deg); opacity: .6; } }
.onboarding-heart { font-size: 26px; color: var(--rose); margin: 0 -6px 60px; animation: heartbeat 1.4s ease-in-out infinite; }
.back-link { border: 0; background: none; color: var(--ink-soft); font-weight: 800; font-size: 14px; cursor: pointer; padding: 0; }
.code-input { font-family: var(--font-display); font-size: 24px; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.code-tiles { display: flex; justify-content: center; align-items: center; gap: 6px; }
.code-tile { display: grid; place-items: center; width: 42px; height: 54px; border-radius: 14px; background: var(--mist); font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--rose-deep); box-shadow: inset 0 -3px 0 var(--blush); }
.code-dash { font-size: 24px; color: var(--ink-faint); font-weight: 800; }
.pairing-status { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 16px; background: #fff7dc; color: #8a6514; font-weight: 800; font-size: 14px; }
.pairing-status.is-joined { background: #ddf6ea; color: #2f8a69; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; background: var(--mist); flex-wrap: wrap; }
.role-chip { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.role-chip.is-a { background: var(--pa); }
.role-chip.is-b { background: var(--pb); }
.pairing-box { display: grid; gap: 8px; padding: 14px; border-radius: 20px; background: var(--mist); box-shadow: inset 0 0 0 2px var(--blush); }
.pairing-box.is-joined { background: #f4fbf7; box-shadow: inset 0 0 0 2px #cdeee0; }
.pairing-code { flex: 1; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: .12em; color: var(--rose-deep); }

/* ------------------------------------------------------------ messaggini sopra le teste */
.message-banner { position: relative; z-index: 15; margin-bottom: 10px; }

/* ------------------------------------------------------------ chi è in quale stanza */
.room-chip { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.room-chip-people { display: inline-flex; margin-left: 2px; }
.room-chip-head { width: 22px; height: 22px; border-radius: 999px; background: #fff; border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(91, 63, 85, .35); }
.room-chip-head + .room-chip-head { margin-left: -7px; }

/* ------------------------------------------------------------ ricorrenze, quiz */
.celebration-strip { margin: 0 16px 10px; padding: 6px 12px; border-radius: 14px; background: #fff7dc; color: #8a6514; font-size: 12px; font-weight: 800; text-align: center; }
.answer-times { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 0; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.answer-times span::before { content: '🕒 '; }

/* ------------------------------------------------------------ impostazioni */
.theme-card { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; padding: 0; }
.theme-swatch { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; color: #fff; box-shadow: 0 0 0 2px #fff, 0 3px 8px -3px rgba(91, 63, 85, .5); }
.theme-card.is-on .theme-swatch { box-shadow: 0 0 0 3px var(--ink), 0 3px 8px -3px rgba(91, 63, 85, .5); }
.link-btn { border: 0; background: none; padding: 0; color: var(--rose-deep); font-weight: 800; cursor: pointer; text-decoration: underline; }
/* scelta della musica: cartoncini con icona, nome e "umore" */
.music-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.music-card {
  position: relative; display: grid; justify-items: center; gap: 1px; padding: 12px 6px 9px; border: 0; cursor: pointer;
  border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--blush), 0 3px 0 color-mix(in srgb, var(--blush) 80%, #d9c6d2);
  transition: transform .12s, box-shadow .15s;
}
.music-card:active { transform: translateY(2px); }
.music-card.is-on { background: var(--mist); box-shadow: inset 0 0 0 2.5px var(--rose), 0 3px 0 var(--btn-edge); }
.music-card.is-locked .music-icon, .music-card.is-locked .music-name { opacity: .6; }
.music-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; background: var(--mist); margin-bottom: 3px; }
.music-card.is-on .music-icon { background: #fff; box-shadow: 0 0 0 2px var(--blush); }
.music-icon.is-playing { animation: music-bob 1.6s ease-in-out infinite; }
@keyframes music-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }
.music-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.1; }
.music-mood { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.1; }
.music-card .plus-lock { top: 4px; left: auto; right: 4px; }

/* volume: scaletta di tacche col colore del tema e bottoncini − / + */
.volume-card {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 22px;
  background: #fff; box-shadow: inset 0 0 0 2px var(--blush), 0 3px 0 color-mix(in srgb, var(--blush) 80%, #d9c6d2);
}
.volume-badge { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; color: var(--rose-deep); background: var(--mist); }
.volume-step {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); box-shadow: 0 3px 0 var(--btn-edge); transition: transform .1s, box-shadow .1s;
}
.volume-step:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-edge); }
.volume-step:disabled { opacity: .4; cursor: default; }
.volume-step svg { stroke-width: 3; }
.volume-meter { flex: 1; height: 34px; display: flex; align-items: flex-end; gap: 4px; padding: 0 2px; cursor: pointer; touch-action: none; border-radius: 10px; }
.volume-meter:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
.volume-tick { flex: 1; height: var(--h); border-radius: 6px; background: var(--mist); box-shadow: inset 0 0 0 1.5px var(--blush); transition: background .15s, transform .15s; }
.volume-tick.is-on { background: linear-gradient(180deg, var(--btn-1), var(--btn-2)); box-shadow: inset 0 -2px 0 var(--btn-edge); }
.volume-card.is-off .volume-tick.is-on { filter: grayscale(.7); opacity: .55; }

/* quiz: nota della versione gratuita */
.quiz-free-note {
  margin-top: 10px; display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 14px; cursor: pointer;
  background: #fff7dc; color: #8a6514; font-size: 12px; font-weight: 800; text-align: left;
}
.quiz-free-note .plus-lock { position: static; flex: none; }

/* schermata iniziale: rientro nel nido "in pausa" */
.resume-box { display: grid; gap: 8px; padding: 14px; border-radius: 20px; background: var(--mist); box-shadow: inset 0 0 0 2px var(--blush); }

/* ------------------------------------------------------------ cucciolo: crescita e bagnetto */
.btn-game.is-sky { background: linear-gradient(180deg, #a9d3fb, #78b6f2); box-shadow: 0 4px 0 #4f90d6, 0 10px 18px -8px rgba(79, 144, 214, .6); text-shadow: 0 1px 0 rgba(30, 80, 140, .3); }
.btn-game.is-sky:active { box-shadow: 0 1px 0 #4f90d6; }
.growth-badge { font-size: 28px; }
.stat-track .growth-fill { background-color: var(--rose); }
.pet-anim-wash { animation: pet-wash .9s ease-in-out; }
@keyframes pet-wash { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg) scale(1.03); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg) scale(1.03); } 80% { transform: rotate(3deg); } }
.pet-stink path { animation: rise 1.6s ease-in-out infinite; }
.pet-fly { animation: fly 1.4s ease-in-out infinite; }
@keyframes fly { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-6px, -4px); } 50% { transform: translate(-2px, 3px); } 75% { transform: translate(4px, -3px); } }
.float-soft { animation: hop 2.4s ease-in-out infinite; }
.rock-soft { transform-box: fill-box; transform-origin: 50% 0; animation: rock-soft 3.2s ease-in-out infinite; }
@keyframes rock-soft { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .rock-soft { animation: none; } }
/* acquario e laghetto: pesciolini che nuotano avanti e indietro (si girano a metà giro), bollicine, alghe */
.fx-swim { animation: fx-swim var(--t, 8s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.fx-swim > g { transform-box: fill-box; transform-origin: center; animation: fx-turn var(--t, 8s) steps(1) infinite; animation-delay: var(--d, 0s); }
@keyframes fx-swim { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(calc(var(--dx) / 2), -2px); } 50% { transform: translate(var(--dx), 0); } 75% { transform: translate(calc(var(--dx) / 2), 2px); } }
@keyframes fx-turn { 0% { transform: scaleX(1); } 50%, 100% { transform: scaleX(-1); } }
.fx-bubble { animation: fx-bubble 3.2s ease-in infinite; animation-delay: var(--d, 0s); }
@keyframes fx-bubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(var(--rise, -26px)); opacity: 0; } }
.fx-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: fx-sway 2.8s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes fx-sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.fx-steam { animation: fx-steam 2.4s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes fx-steam { 0% { transform: translateY(2px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-6px); opacity: 0; } }
.fx-spin { transform-box: fill-box; transform-origin: center; animation: fx-spin var(--t, 1.4s) linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.pendulum-clock { transform-box: fill-box; transform-origin: 50% 0; animation: pendulum-clock 2s ease-in-out infinite; }
@keyframes pendulum-clock { 0%, 100% { transform: rotate(-11deg); } 50% { transform: rotate(11deg); } }
.fx-twinkle { animation: fx-twinkle 1.6s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes fx-twinkle { from { opacity: .35; } to { opacity: 1; } }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .5s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(.85, 1.15); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ nuvolette dei messaggini */
.speech-wrap {
  --bub: #ff8fab; --bub-soft: #fff0f4;
  position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 3; width: max-content; max-width: 160px;
  translate: -50% 0; transform-origin: 50% 100%; animation: bubble-in .45s cubic-bezier(.2, .9, .3, 1.5), bubble-float 3s ease-in-out .45s infinite;
}
.speech-wrap.is-b { --bub: #8fb8ee; --bub-soft: #eef5ff; }
.speech-bubble {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%;
  border: 2.5px solid var(--bub); background: linear-gradient(180deg, #fff 55%, var(--bub-soft)); color: var(--ink); cursor: pointer;
  border-radius: 20px 20px 20px 20px; padding: 6px 12px 7px; font-size: 12px; font-weight: 700; line-height: 1.25; text-align: left;
  box-shadow: 0 7px 16px -8px rgba(91, 63, 85, .55), inset 0 -3px 0 rgba(255, 255, 255, .6);
}
/* coda della nuvoletta: due puntini tondi, come nei fumetti cute */
.speech-bubble::before, .speech-bubble::after { content: ''; position: absolute; left: 50%; border-radius: 50%; background: #fff; border: 2.5px solid var(--bub); }
.speech-bubble::before { width: 11px; height: 11px; top: calc(100% + 1px); transform: translateX(-30%); }
.speech-bubble::after { width: 6px; height: 6px; top: calc(100% + 13px); transform: translateX(-10%); border-width: 2px; }
.speech-body { display: flex; align-items: center; gap: 5px; min-width: 0; }
.speech-emoji { flex: none; font-size: 17px; line-height: 1; }
.speech-text { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.speech-new { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--bub); border-radius: 999px; padding: 1px 7px; }
.speech-wrap.is-new .speech-bubble { box-shadow: 0 0 0 4px var(--bub-soft), 0 8px 18px -6px var(--bub); animation: new-pulse 1.2s ease-in-out .45s infinite; }
.speech-hide {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2px solid #fff; border-radius: 50%; background: var(--bub); color: #fff; box-shadow: 0 2px 6px -2px rgba(91, 63, 85, .5);
  transition: transform .12s;
}
.speech-hide:active { transform: scale(.85); }
@keyframes bubble-float { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 4px; } }
@keyframes new-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ------------------------------------------------------------ cosa sta facendo il personaggio */
.action-badge {
  --act: #ff8fab;
  position: absolute; left: 50%; bottom: calc(100% + 2px); translate: -50% 0; z-index: 4; pointer-events: none;
  display: flex; align-items: center; gap: 4px; white-space: nowrap; padding: 2px 8px 2px 2px; border-radius: 999px;
  background: #fff; border: 2px solid var(--act); color: var(--ink); font-size: 10px; font-weight: 800;
  box-shadow: 0 4px 10px -4px rgba(91, 63, 85, .5); animation: badge-in .4s cubic-bezier(.2, .9, .3, 1.5);
}
.action-badge.is-b { --act: #8fb8ee; }
/* se c'è anche la nuvoletta, la nuvoletta sale e il badge resta subito sopra la testa */
.speech-wrap.has-badge { bottom: calc(100% + 56px); }
.room-char.is-sleep .speech-wrap.has-badge { bottom: calc(92% + 56px); }
.room-char.is-sleep .action-badge { bottom: 92%; }
.room-char.edge-r .speech-wrap, .room-char.edge-r .action-badge { left: auto; right: 0; translate: none; transform-origin: 85% 100%; }
.room-char.edge-r .speech-hide { right: -2px; }
.room-char.edge-l .speech-wrap, .room-char.edge-l .action-badge { left: 0; translate: none; transform-origin: 15% 100%; }
.action-icon {
  width: 22px; height: 22px; display: grid; place-items: center; flex: none; border-radius: 50%; font-size: 13px; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--act) 35%, #fff)); animation: icon-bob 1.4s ease-in-out infinite;
}
.action-dots { display: inline-flex; gap: 2px; }
.action-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--act); animation: dot-wave 1.2s ease-in-out infinite; }
.action-dots i:nth-child(2) { animation-delay: .15s; }
.action-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes badge-in { from { opacity: 0; scale: .5; } }
@keyframes icon-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-2px) rotate(6deg); } }
@keyframes dot-wave { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ------------------------------------------------------------ animazioni delle attività */
.room-avatar .arm { transform-box: view-box; }
.room-avatar .arm-R { transform-origin: 123px 166px; }
.room-avatar .arm-L { transform-origin: 77px 166px; }
.room-char-body { transform-origin: 50% 100%; }

/* braccia */
.act-cook .arm-R { animation: arm-stir 1.1s ease-in-out infinite; }
.act-dish .arm-R, .act-dish .arm-L { animation: arm-scrub .7s ease-in-out infinite; }
.act-dish .arm-L { animation-delay: -.35s; }
.act-brush .arm-R { animation: arm-brush .28s ease-in-out infinite; }
.act-makeup .arm-R { animation: arm-dab 1.4s ease-in-out infinite; }
.act-mirror .arm-R { animation: arm-comb 1.2s ease-in-out infinite; }
.act-mirror .arm-L { animation: arm-hip 2.4s ease-in-out infinite; }
.act-shower .arm-R, .act-shower .arm-L { animation: arm-scrub .6s ease-in-out infinite; }
.act-shower .arm-L { animation-delay: -.3s; }
.act-paint .arm-R { animation: arm-stroke 1.6s ease-in-out infinite; }
.act-mic .arm-R { animation: arm-sing 2s ease-in-out infinite; }
.act-water .arm-R { animation: arm-pour 2.2s ease-in-out infinite; }
.act-drink .arm-R { animation: arm-sip 3s ease-in-out infinite; }
.act-type .arm-R, .act-type .arm-L, .act-game .arm-R, .act-game .arm-L { animation: arm-tap .3s ease-in-out infinite; }
.act-type .arm-L, .act-game .arm-L { animation-delay: -.15s; }
.act-drum .arm-R { animation: arm-drum .42s ease-in-out infinite; }
.act-drum .arm-L { animation: arm-drum-l .42s ease-in-out -.21s infinite; }
.act-cheer .arm-R { animation: arm-wave-r 1s ease-in-out infinite; }
.act-cheer .arm-L { animation: arm-wave-l 1s ease-in-out infinite; }
.act-clay .arm-R, .act-clay .arm-L { animation: arm-scrub 1.4s ease-in-out infinite; }
.act-clay .arm-L { animation-direction: reverse; }
.act-pet .arm-R, .act-patR .arm-R { animation: arm-pat .6s ease-in-out infinite; }
.act-patL .arm-L { animation: arm-pat-l .6s ease-in-out infinite; }
.act-play .arm-R { animation: arm-wave-r .8s ease-in-out infinite; }
.room-avatar .foam-bubbles circle { animation: foam-pop 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.room-avatar .foam-bubbles circle:nth-child(2n) { animation-delay: -.4s; }
.room-avatar .foam-bubbles circle:nth-child(3n) { animation-delay: -.8s; }

@keyframes arm-stir { 0%, 100% { transform: rotate(-7deg) translateX(0); } 50% { transform: rotate(6deg) translateX(-2px); } }
@keyframes arm-scrub { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(7deg); } }
@keyframes arm-brush { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes arm-dab { 0%, 40%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 60% { transform: rotate(3deg); } }
@keyframes arm-comb { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(8deg) translateY(3px); } }
@keyframes arm-hip { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(5deg); } }
@keyframes arm-stroke { 0%, 100% { transform: rotate(-10deg); } 30% { transform: rotate(6deg); } 60% { transform: rotate(-2deg); } }
@keyframes arm-sing { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@keyframes arm-pour { 0%, 100% { transform: rotate(0); } 40%, 70% { transform: rotate(16deg); } }
@keyframes arm-sip { 0%, 55%, 100% { transform: rotate(0); } 70%, 85% { transform: rotate(-22deg); } }
@keyframes arm-tap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes arm-drum { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-16deg); } }
@keyframes arm-drum-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(16deg); } }
@keyframes arm-wave-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
@keyframes arm-wave-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
@keyframes arm-pat { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(10deg) translateY(2px); } }
@keyframes arm-pat-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-10deg) translateY(2px); } }
@keyframes foam-pop { 0%, 100% { transform: scale(.7); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }

/* corpo */
.room-char.doing-read .room-char-body { animation: body-nod 3.2s ease-in-out infinite; }
.room-char.doing-cook .room-char-body, .room-char.doing-dish .room-char-body { animation: body-sway 2.2s ease-in-out infinite; }
.room-char.doing-mirror .room-char-body { animation: body-pose 3.6s ease-in-out infinite; }
.room-char.doing-makeup .room-char-body { animation: body-nod 2.6s ease-in-out infinite; }
.room-char.doing-shower .room-char-body, .room-char.doing-bath .room-char-body { animation: body-wiggle 1.6s ease-in-out infinite; }
.room-char.doing-guitar .room-char-body { animation: body-sway 1.4s ease-in-out infinite; }
.room-char.doing-mic .room-char-body, .room-char.doing-cheer .room-char-body { animation: body-groove .9s ease-in-out infinite; }
.room-char.doing-drum .room-char-body { animation: body-bop .42s ease-in-out infinite; }
.room-char.doing-pedal .room-char-body { animation: body-pedal .5s ease-in-out infinite; }
.room-char.doing-yoga .room-char-body { animation: body-stretch 4s ease-in-out infinite; }
.room-char.doing-game .room-char-body { animation: body-lean 2.4s ease-in-out infinite; }
.room-char.doing-eat .room-char-body, .room-char.doing-drink .room-char-body { animation: body-nod 3s ease-in-out infinite; }
.room-char.doing-paint .room-char-body, .room-char.doing-water .room-char-body, .room-char.doing-flowers .room-char-body { animation: body-sway 3s ease-in-out infinite; }
.room-char.doing-pet .room-char-body, .room-char.doing-play .room-char-body { animation: body-bop .8s ease-in-out infinite; }
.room-char.doing-type .room-char-body { animation: body-nod 4s ease-in-out infinite; }
.room-char.doing-clay .room-char-body { animation: body-nod 2.4s ease-in-out infinite; }
/* effetti degli oggetti: acqua che scorre, fiammella, tornio */
.placed-item .fx-rain { animation: rain-fall .5s linear infinite; }
.placed-item .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1s ease-in-out infinite; }
.placed-item .spin-dash { animation: dash-spin .6s linear infinite; }
@keyframes rain-fall { from { transform: translateY(-3px); opacity: .6; } to { transform: translateY(4px); opacity: 1; } }
@keyframes flicker { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(.85, 1.15); } }
@keyframes dash-spin { to { stroke-dashoffset: -10; } }

@keyframes body-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2deg) translateY(1%); } }
@keyframes body-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes body-pose { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-3deg); } 50% { transform: rotate(0) scale(1.03, .98); } 75% { transform: rotate(3deg); } }
@keyframes body-wiggle { 0%, 100% { transform: rotate(-2deg) translateX(0); } 50% { transform: rotate(2deg) translateX(1%); } }
@keyframes body-groove { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-3%); } }
@keyframes body-bop { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-2%) scale(1.02, .98); } }
@keyframes body-pedal { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-2.5%) rotate(1deg); } }
@keyframes body-stretch { 0%, 100% { transform: scale(1, 1); } 45%, 60% { transform: scale(.98, 1.05) translateY(-2%); } }
@keyframes body-lean { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-5deg); } 70% { transform: rotate(5deg); } }

@media (prefers-reduced-motion: reduce) {
  .room-avatar .arm, .room-char-body, .speech-wrap, .speech-bubble, .action-icon, .action-dots i, .room-avatar .foam-bubbles circle { animation: none !important; }
}
/* ------------------------------------------------------------ il cucciolo con i suoi oggetti */
.room-pet-flip { display: block; }
.room-pet.pet-doing-sleep .room-pet-inner { animation: pet-breathe 3s ease-in-out infinite; transform-origin: 50% 100%; }
.room-pet.pet-doing-scratch .room-pet-inner { animation: play-wiggle .9s ease-in-out infinite; transform-origin: 50% 100%; }
.room-pet.pet-doing-eat .room-pet-inner, .room-pet.pet-doing-drink .room-pet-inner { animation: pet-munch .45s ease-in-out infinite; transform-origin: 50% 100%; }
.room-pet.pet-doing-fetch .room-pet-inner, .room-pet.pet-doing-zoomies .room-pet-inner { animation: play-zoomies 1.3s ease-in-out infinite; }
.room-pet.pet-doing-jump .room-pet-inner { animation: play-jump 1.1s cubic-bezier(.3, .7, .4, 1) infinite; transform-origin: 50% 100%; }
.room-pet.pet-doing-wash .room-pet-inner { animation: pet-wash .9s ease-in-out infinite; transform-origin: 50% 100%; }
.room-pet.pet-doing-climb .room-pet-inner { animation: pet-hop .6s ease-in-out infinite; }
.room-pet.pet-doing-sleep .room-pet-emote { animation: zzz 2.4s ease-in-out infinite; }
.room-pet-emote {
  position: absolute; left: 78%; bottom: 80%; font-size: 14px; line-height: 1; pointer-events: none;
  background: #fff; border-radius: 999px; padding: 3px 5px; box-shadow: 0 3px 8px -3px rgba(91, 63, 85, .45); animation: icon-bob 1.4s ease-in-out infinite;
}
@keyframes pet-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .95); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px) scale(.8); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -8px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .room-pet-inner, .room-pet-emote, .placed-item .fx-rain, .placed-item .flame { animation: none !important; } }
/* ------------------------------------------------------------ cassetto: parte fissa in alto */
.sheet-head-extra { margin-top: 10px; }
.decor-sticky { display: grid; gap: 8px; }
.decor-sticky .input { padding-top: 8px; padding-bottom: 8px; }
/* ------------------------------------------------------------ mini anteprima avatar mentre scorri */
.avatar-float-anchor { position: sticky; top: 8px; height: 0; z-index: 20; margin: 0 !important; }
.avatar-float {
  position: absolute; right: -6px; top: 0; width: 120px; padding: 8px; border-radius: 28px; pointer-events: none; cursor: zoom-in;
  background: radial-gradient(circle at 50% 30%, #fff, var(--mist)); border: 2.5px solid var(--blush);
  box-shadow: 0 12px 24px -10px rgba(91, 63, 85, .55); opacity: 0; transform: translateY(-10px) scale(.85); transform-origin: top right;
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .9, .3, 1.3), width .25s cubic-bezier(.2, .9, .3, 1.2);
}
.avatar-float.is-on { opacity: 1; transform: none; pointer-events: auto; }
.avatar-float.is-big { width: 210px; cursor: zoom-out; }
.avatar-float-zoom {
  position: absolute; left: 6px; bottom: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--rose); color: #fff; box-shadow: 0 2px 0 var(--btn-edge);
}
/* ------------------------------------------------------------ icone delle stanze */
.room-icon-badge {
  width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--mist)); box-shadow: inset 0 0 0 1.5px var(--blush), 0 2px 4px -2px rgba(91, 63, 85, .35);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.5);
}
.room-icon { width: 20px; height: 20px; display: block; }
.room-chip.is-on .room-icon-badge { background: #fff; transform: rotate(-8deg) scale(1.1); box-shadow: inset 0 0 0 1.5px #fff, 0 3px 6px -2px rgba(91, 63, 85, .45); }

/* ------------------------------------------------------------ casa a schermo intero (niente scroll) */
.app-main.is-fixed { overflow: hidden; }
.app-main.is-fixed > .screen-enter { height: 100%; }
.house-tab { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 10px; }
.house-tab > * { flex: none; }
.house-tab > .room-stage { flex: 1 1 auto; min-height: 0; container-type: size; display: flex; justify-content: center; align-items: flex-start; padding: 4px 4px 12px; }
.room-stage .room-canvas { width: min(100cqw, 75cqh); max-height: none; margin: 0; }
.account-box { padding: 14px; border-radius: 18px; background: var(--mist); box-shadow: inset 0 0 0 2px var(--blush); }
.account-box.is-saved { background: #f2fbf6; box-shadow: inset 0 0 0 2px #cdeee0; }
.account-box .btn-game svg { flex: none; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1.5px; background: var(--blush); }

/* ------------------------------------------------------------ PocketUs Plus */
.plus-lock {
  position: absolute; top: 5px; left: 5px; z-index: 1; padding: 1px 6px; border-radius: 999px; pointer-events: none;
  font-size: 9.5px; font-weight: 800; color: #8a6514; background: linear-gradient(135deg, #fff6c9, #ffe08a);
  box-shadow: 0 0 0 1.5px #fff, 0 2px 4px -1px rgba(138, 101, 20, .4);
}
.catalog-card.is-locked .catalog-preview, .surface-card.is-locked .surface-preview, .thumb-card.is-locked > :is(svg, .frame-thumb) { opacity: .55; filter: saturate(.6); }
.theme-card.is-locked .theme-swatch { opacity: .6; }
.mini-lock { position: absolute; right: -4px; bottom: -4px; font-size: 11px; }
.theme-swatch { position: relative; }
.plus-reason { margin: 0; padding: 10px 12px; border-radius: 14px; background: #fff7dc; color: #8a6514; font-size: 13px; font-weight: 700; }
.plus-hero {
  position: relative; display: grid; gap: 6px; padding: 18px 16px 16px; border-radius: 24px; text-align: center;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .9) 2px, transparent 3px) 0 0 / 26px 26px, linear-gradient(135deg, #fff6c9, #ffe1ea 55%, #e6dcff);
  box-shadow: inset 0 0 0 2px #fff, 0 10px 22px -14px rgba(140, 80, 120, .6);
}
.plus-hero-badge { justify-self: center; padding: 2px 12px; border-radius: 999px; font-weight: 800; font-size: 12px; color: #8a6514; background: #fff; box-shadow: 0 2px 0 #f3d97a; }
.plus-price { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink); }
.plus-price span { font-family: var(--font-body); font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.plus-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plus-perks li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.plus-perks li span { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--mist); font-size: 16px; }
.plus-teaser {
  position: relative; width: 100%; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 26px 16px 18px; border: 0; cursor: pointer;
  border-radius: 24px; background: linear-gradient(135deg, #fff6c9, #ffe1ea); box-shadow: inset 0 0 0 2px #fff, 0 8px 18px -12px rgba(140, 80, 120, .6);
}
.plus-teaser .plus-lock { position: static; }
.permission-hero { font-size: 46px; text-align: center; line-height: 1.2; padding: 10px 0 2px; }
