/* Cozy Paws design system – see docs/DESIGN_SYSTEM.md. No external fonts or assets. */
:root {
    --lav-50: #F6F1FC;
    --lav-100: #ECE3F8;
    --lav-200: #D9C8EC;
    --lav-300: #C9B3E6;
    --lav-500: #9F86C9;
    --lav-700: #6E5A93;
    --rose-200: #F9D9E1;
    --rose-300: #F2B8C6;
    --rose-500: #D98AA0;
    --cream: #FFF8EE;
    --beige: #E8D5BA;
    --honey: #D9A35F;
    --wood: #B9804A;
    --sky: #A9CFEA;
    --leaf: #86BD7E;
    --ink: #4A3428;          /* dark brown outline + text */
    --ink-soft: #7A6152;
    --shadow: 0 4px 0 var(--ink);
    --shadow-sm: 0 2px 0 var(--ink);
    --radius: 14px;
    --radius-sm: 10px;
    --border: 3px solid var(--ink);
    --font: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", "Segoe UI Rounded", "Segoe UI", system-ui, sans-serif;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: radial-gradient(ellipse at 50% 30%, #F3EAFB 0%, var(--lav-200) 70%, #CDB9E3 100%);
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;
    font-size: 17px;
}
input, textarea { -webkit-user-select: text; user-select: text; }
h1, h2 { margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
a { color: inherit; }
button, a.btn, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--rose-500); outline-offset: 2px; }

/* ---------- boot screen */
.boot-screen {
    position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: .5rem;
    background: var(--lav-200); z-index: 100; transition: opacity .35s;
}
.boot-screen.gone { opacity: 0; pointer-events: none; }
.boot-paw { font-size: 3.2rem; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }

/* ---------- building blocks */
.panel {
    background: var(--cream);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 52px; padding: 0 1.2rem;
    background: var(--cream); border: var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm); text-decoration: none; font-weight: 700;
    transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--rose-300); }
.btn-primary:hover:not(:disabled) { background: #F5C5D1; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; }
.btn-big { min-height: 60px; font-size: 1.15rem; width: 100%; }
.btn-small { min-height: 44px; padding: 0 .9rem; font-size: .95rem; }
.badge {
    display: inline-block; padding: .1rem .55rem; border-radius: 99px; background: var(--lav-300);
    border: 2px solid var(--ink); font-size: .8rem; font-weight: 800;
}
.badge-soft { background: var(--lav-100); }
.hint { color: var(--ink-soft); margin: .2rem 0; }
.fineprint { font-size: .8rem; color: var(--ink-soft); text-align: center; }
.message { padding: .6rem .8rem; border-radius: var(--radius-sm); border: 2px solid var(--ink); }
.message-soft { background: var(--rose-200); }
.field { display: flex; flex-direction: column; gap: .3rem; margin: .7rem 0; font-weight: 700; }
.field input:not([type=range]) {
    min-height: 52px; padding: 0 .8rem; border: var(--border); border-radius: var(--radius-sm); background: #fff; font-size: 1.05rem;
}
.field input[type=range] { width: 100%; accent-color: var(--rose-500); height: 36px; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.screen { min-height: 100dvh; padding: calc(1rem + var(--safe-t)) 1rem calc(1rem + var(--safe-b)); }
.screen-center { display: grid; place-items: center; }

/* ---------- login & profiles */
.login-panel, .profiles-panel { width: min(440px, 100%); text-align: center; }
.logo-paw { font-size: 3rem; display: block; }
.subtitle { margin: 0 0 1rem; color: var(--ink-soft); font-weight: 700; }
.login-panel form { text-align: left; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; margin: 1rem 0; }
.profile-card {
    display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1rem .5rem;
    background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 900;
    background: var(--rose-300); border: var(--border);
}
.profile-name { font-weight: 800; }
.add-profile input { flex: 1; min-height: 52px; padding: 0 .8rem; border: var(--border); border-radius: var(--radius-sm); }

/* ---------- game layout */
.game {
    height: 100dvh; display: grid;
    grid-template-rows: auto auto 1fr auto;
    padding-top: var(--safe-t);
    position: relative; overflow: hidden;
}
.hud {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .55rem .8rem;
}
.hud-player { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.hud-avatar {
    flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
    background: var(--rose-300); border: var(--border); font-weight: 900; font-size: 1.3rem; box-shadow: var(--shadow-sm);
}
.hud-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp-bar {
    position: relative; width: min(46vw, 260px); height: 20px; margin-top: 3px;
    background: var(--lav-100); border: var(--border); border-radius: 99px; overflow: hidden;
}
.xp-fill { height: 100%; background: repeating-linear-gradient(90deg, var(--rose-300) 0 8px, #F5C5D1 8px 16px); transition: width .6s ease; }
.xp-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.hud-door {
    display: flex; flex-direction: column; align-items: center; min-width: 76px; min-height: 56px; padding: .2rem .5rem;
    background: var(--honey); border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
    font-size: .78rem; font-weight: 800;
}
.hud-door .icon { font-size: 1.3rem; }
.hud-door.open { background: #FFE7B0; }

.room-tabs {
    display: flex; gap: .45rem; overflow-x: auto; padding: 0 .8rem .4rem; scrollbar-width: none;
}
.room-tabs::-webkit-scrollbar { display: none; }
.room-tab {
    flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 46px; padding: .2rem .9rem; background: var(--cream); border: var(--border);
    border-radius: var(--radius-sm); font-weight: 800; font-size: .92rem; box-shadow: var(--shadow-sm);
}
.room-tab small { font-size: .68rem; font-weight: 700; color: var(--ink-soft); }
.room-tab.active { background: var(--rose-300); }
.room-tab.locked { opacity: .6; background: var(--lav-100); }
.room-tab .cat-count { color: var(--ink); }

.world-wrap { position: relative; min-height: 0; overflow: hidden; }
.world { width: 100%; display: block; touch-action: none; image-rendering: pixelated; }
.world-overlay {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .6rem; font-weight: 700;
}
.floaters { position: absolute; left: 50%; top: 35%; pointer-events: none; }
.floater {
    position: absolute; transform: translateX(-50%); white-space: nowrap; font-weight: 900; font-size: 1.4rem;
    color: var(--ink); text-shadow: 0 2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 -2px 0 #fff;
    animation: floatUp 1.4s ease-out forwards;
}
@keyframes floatUp { from { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.toast {
    position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); width: min(92%, 480px);
    background: var(--cream); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: .7rem 1rem; text-align: center; font-weight: 700; animation: pop .25s ease-out; z-index: 5;
}
@keyframes pop { from { transform: translate(-50%, 12px); opacity: 0; } }

.welcome {
    position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: min(92%, 420px);
    text-align: center; z-index: 4; animation: pop2 .4s ease-out;
}
@keyframes pop2 { from { opacity: 0; transform: translate(-50%, -40%); } }

.bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem;
    padding: .45rem .5rem calc(.45rem + var(--safe-b));
    background: var(--cream); border-top: var(--border); z-index: 6;
}
.bottom-nav > * {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
    min-height: 58px; border: 0; background: transparent; border-radius: var(--radius-sm);
    font-size: .74rem; font-weight: 800; text-decoration: none;
}
.bottom-nav .icon { font-size: 1.55rem; line-height: 1; }
.bottom-nav .active { background: var(--lav-200); }
.bottom-nav .disabled, .bottom-nav :disabled { opacity: .4; pointer-events: none; }

/* ---------- sheets */
.sheet {
    position: absolute; left: 50%; bottom: calc(76px + var(--safe-b)); transform: translateX(-50%);
    width: min(96%, 560px); max-height: 62%; overflow-y: auto; z-index: 7;
    background: var(--cream); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1rem 1rem 1.1rem; animation: sheetUp .22s ease-out;
}
@keyframes sheetUp { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet-close {
    position: absolute; right: .6rem; top: .6rem; width: 44px; height: 44px; border-radius: 50%;
    border: var(--border); background: #fff; font-weight: 900;
}
.cat-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .6rem; padding-right: 44px; }
.portrait {
    image-rendering: pixelated; background: radial-gradient(circle at 50% 70%, var(--lav-100), var(--lav-200));
    border: var(--border); border-radius: var(--radius-sm); flex: none;
}
.portrait.small { width: 64px; height: 56px; }
.portrait.big { width: 160px; height: 136px; display: block; margin: 0 auto .6rem; }
.hearts { color: var(--rose-500); font-size: 1.2rem; letter-spacing: .1em; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .45rem; }
.action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    min-height: 78px; padding: .3rem; background: #fff; border: var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm); font-weight: 800; font-size: .8rem;
}
.action-btn .icon { font-size: 1.7rem; }
.action-btn small { font-size: .62rem; color: var(--ink-soft); }
.action-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.action-btn:disabled { opacity: .5; }
.cat-list { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0 1rem; }
.cat-row { display: flex; align-items: center; gap: .6rem; padding: .4rem; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.cat-row small { display: block; }

/* ---------- edit mode */
/* in edit mode the room shrinks into the space between toolbar and catalog (ResizeObserver rescales it) */
.world-wrap { display: flex; flex-direction: column; }
.world { flex: 1; min-height: 0; }
.is-editing .world-wrap { padding: 78px 0 196px; }
.edit-bar {
    position: absolute; left: .5rem; right: .5rem; top: .3rem; z-index: 6;
    display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
    padding: .4rem; background: rgba(255, 248, 238, .92); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.tool {
    display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; min-height: 56px;
    padding: .2rem .4rem; background: #fff; border: var(--border); border-radius: var(--radius-sm); font-size: .74rem; font-weight: 800;
}
.tool .icon { font-size: 1.3rem; line-height: 1.1; }
.tool:disabled { opacity: .4; }
.tool-primary { background: var(--leaf); }
.selection-name { font-weight: 700; font-size: .9rem; text-align: center; padding: 0 .3rem; }
.catalog {
    position: absolute; left: 0; right: 0; bottom: calc(76px + var(--safe-b)); z-index: 6;
    background: var(--cream); border-top: var(--border); padding: .5rem .5rem .6rem;
    animation: sheetUp2 .2s ease-out;
}
@keyframes sheetUp2 { from { transform: translateY(20px); opacity: 0; } }
.catalog-tabs { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .45rem; scrollbar-width: none; }
.catalog-tabs::-webkit-scrollbar { display: none; }
.chip {
    flex: none; min-height: 44px; padding: 0 .8rem; border: 2px solid var(--ink); border-radius: 99px;
    background: #fff; font-weight: 800; font-size: .85rem;
}
.chip.active { background: var(--lav-300); }
.catalog-items { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .2rem; }
.item-card {
    flex: none; width: 104px; display: flex; flex-direction: column; align-items: center; gap: .2rem;
    padding: .35rem; background: #fff; border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.item-card canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.item-card .swatch { width: 72px; height: 72px; border: 2px solid var(--ink); border-radius: 8px; }
.item-card.active { background: var(--rose-200); }
.item-name { font-size: .72rem; font-weight: 800; text-align: center; line-height: 1.15; }
.item-card small { font-size: .62rem; color: var(--ink-soft); }
.item-card.locked { opacity: .55; filter: grayscale(.6); }

/* ---------- modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem;
    background: rgba(74, 52, 40, .35);
}
.modal { width: min(460px, 100%); max-height: 92dvh; overflow-y: auto; text-align: center; animation: pop3 .3s ease-out; }
@keyframes pop3 { from { transform: scale(.9); opacity: 0; } }
.levelup-star { font-size: 3.4rem; animation: spin 2.4s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotate(14deg) scale(1.1); } }
.unlock-list { list-style: none; padding: 0; margin: .6rem 0 1rem; text-align: left; display: grid; gap: .3rem; }
.unlock-list li { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: .45rem .6rem; font-weight: 700; }

/* ---------- shelter */
.shelter { max-width: 1100px; margin: 0 auto; }
.shelter-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; }
.shelter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.shelter-card {
    display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem .5rem;
    background: var(--cream); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.shelter-card .portrait { width: 112px; height: 96px; }
.shelter-card.locked { background: var(--lav-100); }
.shelter-card.adopted { background: var(--rose-200); }
.note { margin-bottom: 1rem; }
.note ul { margin: .4rem 0; }
.cat-profile p { text-align: left; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; text-align: left; margin: .6rem 0 1rem; }
.facts dt { font-weight: 800; }
.facts dd { margin: 0; }
.welcome-home h2 { margin-top: .4rem; }
.hearts-rain { font-size: 2rem; animation: bob 1.2s ease-in-out infinite; }

/* ---------- error ui */
#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: .8rem 1rem;
    background: var(--rose-200); border-top: var(--border); font-weight: 700;
}
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ---------- responsive */
@media (max-width: 560px) {
    .action-grid { grid-template-columns: repeat(3, 1fr); }
    .is-editing .world-wrap { padding: 120px 0 196px; }
    .selection-name { order: 10; flex-basis: 100%; }
    .tool { min-width: 56px; }
    h1 { font-size: 1.4rem; }
}
@media (min-width: 900px) {
    .sheet { bottom: calc(86px + var(--safe-b)); }
    .bottom-nav { padding-inline: calc(50% - 320px); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- player character & wardrobe */
.hud-avatar { overflow: hidden; padding: 0; background: var(--lav-100); text-decoration: none; }
.hud-avatar canvas { width: 44px; height: 44px; image-rendering: pixelated; display: block; }
.bottom-nav { grid-template-columns: repeat(6, 1fr); }
.wardrobe { max-width: 1100px; margin: 0 auto; }
.wardrobe .tabs { margin-left: auto; }
.wardrobe-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1rem; align-items: start; }
.preview-panel { display: flex; flex-direction: column; align-items: center; gap: .8rem; position: sticky; top: 1rem; }
.char-preview {
    width: 168px; height: 252px; image-rendering: pixelated;
    background: radial-gradient(ellipse at 50% 85%, #E8D5BA 0 18%, transparent 19%), radial-gradient(circle at 50% 40%, var(--lav-50), var(--lav-200));
    border: var(--border); border-radius: var(--radius);
}
.row.center { justify-content: center; }
.row.wrap, .catalog-tabs.wrap { flex-wrap: wrap; overflow: visible; }
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; margin-top: .4rem; }
.wardrobe-grid .item-card { width: auto; }
.swatch.round { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); margin: 8px 0; }
.cat-accessories { display: grid; gap: .8rem; }
.cat-acc-row { display: flex; gap: 1rem; align-items: center; }
.acc-chip { display: inline-flex; align-items: center; gap: .35rem; }
.acc-chip small { font-size: .68rem; color: var(--ink-soft); }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }
@media (max-width: 700px) {
    .wardrobe-layout { grid-template-columns: 1fr; }
    .preview-panel { position: static; }
    .cat-acc-row { flex-direction: column; align-items: flex-start; }
    .bottom-nav > * { font-size: .62rem; }
    .bottom-nav .icon { font-size: 1.35rem; }
}

/* ---------- tasks, minigames & collections */
.hud-right { gap: .4rem; flex-wrap: nowrap; }
.hud-gear {
    width: 52px; min-height: 56px; border: var(--border); border-radius: var(--radius-sm); background: var(--cream);
    box-shadow: var(--shadow-sm); font-size: 1.4rem;
}
.hud-gear.active { background: var(--lav-200); }
.tasks-page { max-width: 1100px; margin: 0 auto; }
.center-text { text-align: center; }
.corkboard {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; padding: 1.4rem;
    background: repeating-radial-gradient(circle at 30% 30%, #D9A35F 0 2px, #CF9852 2px 5px);
    border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.note-card {
    position: relative; background: #FFFBEF; border: 2px solid var(--ink); border-radius: 6px; padding: 1.2rem 1rem .8rem;
    box-shadow: 0 4px 0 rgba(74,52,40,.5); text-align: center; display: flex; flex-direction: column; gap: .4rem; align-items: center;
}
.note-card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.note-card:nth-child(3n+2) { transform: rotate(1deg); background: #FDF0F4; }
.note-card:nth-child(3n) { transform: rotate(-.4deg); background: #F1ECFA; }
.note-card h2 { margin: 0; font-size: 1.15rem; }
.note-card p { margin: 0; }
.pin { position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--rose-500); border: 2px solid var(--ink); }
.note-icon { font-size: 2rem; }
.note-progress { width: 100%; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.game-card { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; cursor: pointer; }
.game-icon { font-size: 2.6rem; }
.game-modal { width: min(640px, 100%); position: relative; }
.difficulty { display: grid; gap: .6rem; margin: 1rem 0; }
.sort-items { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; min-height: 80px; margin: .8rem 0; }
.sort-item { padding: .3rem; background: #fff; border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.sort-item canvas, .sort-box canvas, .memory-card canvas, .find-spot canvas, .collection-item canvas { image-rendering: pixelated; display: block; }
.sort-item.active { background: var(--rose-200); transform: translateY(-4px); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.sort-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.sort-box { display: flex; flex-direction: column; align-items: center; padding: .5rem; background: var(--lav-100); border: var(--border); border-radius: var(--radius-sm); font-weight: 800; }
.sort-box small { color: var(--ink-soft); }
.memory-grid, .find-grid { display: grid; gap: .5rem; margin-top: .6rem; }
.memory-card, .find-spot {
    position: relative; aspect-ratio: 1; display: grid; place-items: center; border: var(--border); border-radius: var(--radius-sm);
    background: var(--lav-300); box-shadow: var(--shadow-sm); transition: transform .2s;
}
.memory-card .paw { font-size: 1.6rem; opacity: .7; }
.memory-card.open { background: #fff; transform: rotateY(0); }
.memory-card.matched { background: #E4F4EA; }
.find-spot { background: var(--cream); }
.find-spot.checked { background: var(--lav-100); }
.spot-hint { position: absolute; right: 4px; top: 2px; font-size: 1.3rem; }
.dust-stack { position: relative; width: min(320px, 80vw); aspect-ratio: 1; margin: .6rem auto; border: var(--border); border-radius: var(--radius); overflow: hidden; background: var(--cream); }
.dust-stack canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.dust-layer { touch-action: none; cursor: grab; }
.game-result { text-align: center; }
.collections h2 { margin-top: 1.2rem; }
.collection { margin-bottom: .8rem; }
.collection h3 { margin: 0 0 .5rem; display: flex; gap: .5rem; align-items: center; }
.collection-items { display: flex; flex-wrap: wrap; gap: .5rem; }
.collection-item { width: 84px; display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; font-size: .7rem; font-weight: 700; }
.collection-item.wide { width: 120px; padding: .5rem; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.collection-item .swatch { width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 8px; }
.collection-item.locked canvas, .collection-item.locked .swatch { filter: grayscale(1) brightness(1.15); opacity: .55; }
@media (max-width: 560px) {
    .hud-door { min-width: 64px; }
    .xp-bar { width: 38vw; }
}
.memory-card canvas, .find-spot canvas { width: 82%; height: 82%; }
.game-modal { max-height: 94dvh; }
@media (max-width: 560px) { .sort-boxes span { font-size: .72rem; } .game-modal { padding: 1rem .7rem; } }

/* ---------- catalog search & colour variants */
.catalog-search { display: flex; gap: .4rem; margin-bottom: .4rem; }
.catalog-search input { flex: 1; min-width: 0; min-height: 44px; padding: 0 .8rem; border: 2px solid var(--ink); border-radius: 99px; background: #fff; }
.catalog-search select { min-height: 44px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; padding: 0 .6rem; font-weight: 700; }
.variant-dots { display: inline-flex; gap: .35rem; margin-left: .5rem; vertical-align: middle; }
.variant-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); }
.variant-dot.active { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.catalog .hint { padding: 1rem; }


/* ---------- Phase 15: needs & everyday life (soft symbols, never red, never numbers) */
.hud-needs { display: flex; gap: .25rem; margin-top: .25rem; }
.need-chip {
    width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #fff;
    font-size: .95rem; line-height: 1; display: grid; place-items: center; padding: 0; transition: opacity .3s, transform .2s;
}
.need-chip.mood-happy { background: #FFF6D8; }
.need-chip.mood-good { background: var(--cream); }
.need-chip.mood-abit { background: var(--lav-100); animation: needBob 2.4s ease-in-out infinite; }
.need-chip.dish { background: var(--rose-200); }
@keyframes needBob { 50% { transform: translateY(-2px); } }
.cat-needs { display: flex; flex-wrap: wrap; gap: .3rem; margin: -.2rem 0 .7rem; }
.need-pill { font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; border: 2px solid var(--ink); background: #fff; }
.need-pill.mood-happy { background: #FFF6D8; }
.need-pill.mood-abit { background: var(--lav-100); }
.content-line { width: 100%; margin: 0 0 .2rem; font-weight: 800; color: var(--lav-700); }
.use-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; padding-right: 44px; }
.use-head canvas { image-rendering: pixelated; width: 56px; height: 56px; background: var(--lav-100); border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.use-head h2 { margin: 0; }
.action-btn.soft { opacity: .75; }
.field-check { flex-direction: row; align-items: center; gap: .6rem; }
.field-check input { width: 26px; height: 26px; accent-color: var(--rose-500); }

/* cooking */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; margin: .6rem 0; }
.recipe-card {
    display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .6rem .4rem; font-weight: 800;
    background: #fff; border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.recipe-card .recipe-icon { font-size: 2.2rem; }
.recipe-card.locked { opacity: .5; }
.recipe-card small { font-size: .7rem; color: var(--ink-soft); }
.recipe-steps { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: .5rem 0; counter-reset: step; }
.recipe-steps li {
    counter-increment: step; display: flex; align-items: center; gap: .25rem; padding: .25rem .55rem; font-weight: 700;
    background: #fff; border: 2px solid var(--ink); border-radius: 999px;
}
.recipe-steps li::before { content: counter(step) "."; color: var(--ink-soft); font-size: .8rem; }
.recipe-steps li.next { background: #FFF6D8; transform: scale(1.06); }
.recipe-steps li.done { background: var(--lav-100); opacity: .7; }
.step-icon { font-size: 1.5rem; line-height: 1; }
.pot {
    min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem; font-size: 1.8rem;
    margin: .5rem 0; padding: .4rem; background: #E9E1EF; border: var(--border); border-radius: 40px;
}
.pot.ready { background: #FFF1CF; animation: needBob 1.2s ease-in-out infinite; }
.pantry { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .45rem; margin: .5rem 0; }
.pantry-item {
    display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .4rem .2rem; min-height: 64px;
    background: #fff; border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); font-weight: 700;
}
.pantry-item:active { transform: translateY(2px); box-shadow: none; }
.pantry-item small { font-size: .7rem; }
.cook-hint { min-height: 2.6em; display: flex; align-items: center; justify-content: center; text-align: center; }
.cook-hint.empty { background: transparent; border-color: transparent; box-shadow: none; }
.cooking { min-height: min(560px, 90dvh); }

/* ---- Phase 16: special events – soft, inviting, never alarming ---- */
.event-banner {
    display: flex; align-items: center; gap: .6rem; margin: .4rem auto 0; max-width: 760px; width: calc(100% - 1rem);
    padding: .55rem .7rem; background: linear-gradient(135deg, var(--cream), var(--rose-200)); border: var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); animation: event-in .45s ease-out;
}
.event-icon { font-size: 1.9rem; line-height: 1; animation: event-bob 2.4s ease-in-out infinite; }
.event-text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: .85rem; color: var(--ink-soft); }
.event-text strong { color: var(--ink); font-size: .95rem; }
.event-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.event-actions .btn { white-space: nowrap; }
.event-progress { align-self: center; font-size: .9rem; font-weight: 600; color: var(--ink-soft, #7A6A7E); white-space: nowrap; }
.item-card.surprise { box-shadow: 0 0 0 2px #F2B8C6 inset; }

/* vet visit (Phase 16) */
.vet-sheet h3 { margin: 0 0 .25rem; }
.vet-steps { margin: .5rem 0 .75rem; padding-left: 1.4rem; display: grid; gap: .3rem; }
.vet-steps li { opacity: .65; }
.vet-steps li.now { opacity: 1; font-weight: 700; }
.vet-steps li.done { opacity: .5; text-decoration: line-through; }
.vet-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; }
.vet-tool { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .6rem .3rem; border-radius: 14px;
    border: 2px solid #E2D5F3; background: #FFFDF8; cursor: pointer; font: inherit; }
.vet-tool span { font-size: 1.8rem; line-height: 1; }
.vet-tool small { font-size: .78rem; }
.vet-tool:active { transform: scale(.96); }
@keyframes event-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes event-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }
@media (max-width: 560px) {
    .event-banner { flex-wrap: wrap; }
    .event-actions { width: 100%; }
    .event-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .event-banner, .event-icon { animation: none; } }
.collection-item.souvenir { width: 92px; padding: .4rem .2rem; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.souvenir-icon { font-size: 1.8rem; line-height: 1.2; }
.collection-item.souvenir.locked { opacity: .6; background: var(--lav-50); }

/* ---- Kid login (name + PIN pad) and admin panel ---- */
.kid-login .field input { font-size: 1.2rem; text-align: center; }
.pin-label { margin: .4rem 0 .2rem; font-weight: 700; }
.pin-dots { display: flex; justify-content: center; gap: .7rem; margin-bottom: .6rem; }
.pin-dot { width: 20px; height: 20px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; }
.pin-dot.filled { background: var(--lav-500); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: .55rem; justify-content: center; }
.pin-key { height: 60px; font: 800 1.5rem var(--font); color: var(--ink); background: var(--cream); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; touch-action: manipulation; }
.pin-key:active { transform: translateY(2px); box-shadow: none; }
.pin-key.pin-soft { background: var(--lav-100); font-size: 1.2rem; }
.pin-message { min-height: 2.6em; display: flex; align-items: center; justify-content: center; margin-top: .6rem; }
.pin-message.empty { background: transparent; border-color: transparent; box-shadow: none; }
.parent-link { display: inline-block; margin-top: .8rem; font-size: .85rem; color: var(--ink-soft); }
.admin-screen { max-width: 820px; margin: 0 auto; padding: 1rem; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.admin-card { margin: .8rem 0; padding: 1rem; }
.admin-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.admin-form .field { margin: 0; flex: 1 1 160px; }
.admin-child-head { display: flex; align-items: center; gap: .7rem; }
.admin-child-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-child-title input { font-weight: 700; }
.admin-child-title small { color: var(--ink-soft); }
.admin-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.badge-note { background: var(--rose-200); }
.admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.admin-actions .pin-input { width: 7.5rem; }
.admin-confirm { font-size: .85rem; font-weight: 700; }
.btn-danger-soft { background: var(--rose-300); }

/* ---- Phase 10: offline note (calm, never alarming) ---- */
.offline-chip {
    margin: .4rem auto 0; max-width: 760px; width: calc(100% - 1rem); padding: .45rem .7rem; font-size: .85rem; font-weight: 700;
    color: var(--ink-soft); background: var(--lav-100); border: 2px solid var(--ink); border-radius: var(--radius-sm);
}

/* ---- Apartment overview and zoom reset ---- */
.overview-tab { min-width: 48px; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.overview-room { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem; background: #fff;
    border: 2px solid var(--ink); border-radius: var(--radius-sm); font: inherit; color: var(--ink); cursor: pointer; }
.overview-room canvas { width: 100%; height: auto; image-rendering: pixelated; }
.overview-room small { color: var(--ink-soft); font-size: .72rem; }
.overview-room.here { background: var(--lav-100); box-shadow: var(--shadow-sm); }
.overview-room.locked { opacity: .6; cursor: default; justify-content: center; min-height: 120px; background: var(--lav-50); }
.overview-lock { font-size: 1.6rem; }
.world-wrap { position: relative; }
.view-reset { position: absolute; right: .6rem; bottom: .6rem; padding: .35rem .7rem; font: 700 .85rem var(--font); color: var(--ink);
    background: var(--cream); border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-sm); cursor: pointer; }

/* ---- favourite toy & sleeping place ---- */
.cat-extras { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.bed-choice { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.color-swatch { display: inline-block; width: .9em; height: .9em; border-radius: 50%; border: 2px solid var(--ink); margin-right: .4em; vertical-align: -0.1em; }

/* ---- furnishing sets ---- */
.set-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.set-card { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .6rem; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius-sm); }
.set-card small { display: block; color: var(--ink-soft); font-size: .75rem; }
.set-card .set-progress { font-weight: 700; color: var(--ink); }
.set-card.complete { background: var(--lav-100); }
.set-icon { font-size: 1.6rem; line-height: 1; }

/* ---- minigame "Farben sortieren" ---- */
.color-basket { width: 56px; height: 40px; border: 2px solid var(--ink); border-radius: 6px 6px 14px 14px; box-shadow: inset 0 -6px 0 rgba(74,52,40,.15); }
