/* Frooky's world - styles. Mobile portrait first, Hebrew RTL. Palette: orange / blue / yellow / green. */
:root {
  --orange: #F37021; --blue: #005CA9; --yellow: #FFD100; --green: #008D36;
  --paper: #FFF8E7; --ink: #000; --pink: #F6879B;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { --vh: 100dvh; }
html, body { margin: 0; background: #fff; color: var(--ink); }
body { font-family: "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif; font-size: 18px; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button { font-family: inherit; cursor: pointer; }
input { -webkit-user-select: text; user-select: text; font-family: inherit; }
h1 { font-size: 30px; margin: 0; text-align: center; color: var(--blue); }
h2 { font-size: 24px; margin: 0 0 8px; text-align: center; color: var(--blue); }
p { margin: 6px 0; }
.big { font-size: 22px; font-weight: bold; }
.hint { text-align: center; color: #555; }
small { font-size: 14px; color: inherit; opacity: .8; }

#app { max-width: 480px; margin: 0 auto; min-height: var(--vh); position: relative; overflow-x: clip; }
.screen { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px calc(40px + env(safe-area-inset-bottom)); min-height: var(--vh); position: relative; }

/* ---------- buttons ---------- */
.btn { min-height: 56px; padding: 10px 18px; border: 3px solid #000; border-radius: 18px; font-size: 20px; font-weight: bold; background: #fff; color: #000; box-shadow: 0 4px 0 #000; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn:disabled { opacity: .85; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.orange { background: var(--orange); color: #fff; }
.btn.white { background: #fff; }
.btn small { display: block; width: 100%; text-align: center; font-weight: normal; }
.btn-row { display: flex; gap: 10px; justify-content: center; }
.btn-row .btn { flex: 1; }
.btn-row.two .btn { flex-direction: column; gap: 0; }
.icon-btn { width: 48px; height: 48px; border: 3px solid #000; border-radius: 50%; background: #fff; font-size: 22px; font-weight: bold; padding: 0; line-height: 1; }
.icon-btn.small { width: 44px; height: 44px; font-size: 20px; }
.icon-btn.danger { background: #fff; }
.icon-btn:active { background: var(--yellow); }

/* ---------- top bars ---------- */
.topbar { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.92); border: 3px solid #000; border-radius: 16px; padding: 6px 8px; }
.topbar-title { flex: 1; text-align: center; font-weight: bold; font-size: 19px; }
.starcount { font-weight: bold; font-size: 20px; background: var(--yellow); border: 3px solid #000; border-radius: 14px; padding: 4px 12px; white-space: nowrap; }
.toggles { display: flex; gap: 6px; }
.home-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chip { display: flex; align-items: center; gap: 6px; border: 3px solid #000; border-radius: 24px; background: #fff; padding: 4px 12px 4px 8px; font-size: 18px; font-weight: bold; min-height: 48px; }

/* ---------- players ---------- */
.avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 3px solid #000; color: #fff; font-weight: bold; font-size: 26px; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.avatar.tiny { width: 32px; height: 32px; font-size: 18px; border-width: 2px; }
.player-list { display: flex; flex-direction: column; gap: 10px; }
.player-card { display: flex; align-items: center; gap: 8px; border: 3px solid #000; border-radius: 18px; background: #fff; padding: 8px; box-shadow: 0 4px 0 #000; }
.player-main { flex: 1; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: right; font-size: 18px; min-height: 56px; }
.pinfo { display: flex; flex-direction: column; }
.pname { font-weight: bold; font-size: 22px; }
.pstats { font-size: 14px; color: #444; }
.hero-small { width: 120px; margin: 0 auto; }
.hero-small svg { width: 100%; height: auto; display: block; }
.name-input { width: 100%; font-size: 24px; padding: 12px; border: 3px solid #000; border-radius: 14px; text-align: center; margin: 8px 0 4px; }
.form-msg { color: var(--orange); font-weight: bold; min-height: 24px; text-align: center; }

/* ---------- home ---------- */
.hero { height: min(calc(.32 * var(--vh)), 280px); display: flex; justify-content: center; }
.hero svg { height: 100%; width: auto; }
.hero.hop svg { animation: hop .6s ease 2; }
.bubble { position: relative; background: #fff; border: 3px solid #000; border-radius: 18px; padding: 8px 14px; font-weight: bold; text-align: center; font-size: 19px; }
.bubble.small { font-size: 17px; flex: 1; }
.games { display: flex; flex-direction: column; gap: 12px; }
.btn.game { justify-content: flex-start; text-align: right; min-height: 76px; }
.btn.game .gicon { font-size: 36px; }
.btn.game .gtext { display: flex; flex-direction: column; }
.btn.game .gtitle { font-size: 22px; }
.btn.game .gsub { font-size: 14px; font-weight: normal; opacity: .95; }
.ver-row { display: flex; direction: ltr; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; padding: 8px 4px; }
.ver-btn { min-height: 44px; padding: 4px 12px; font-size: 14px; font-weight: bold; border: 2px solid #000; border-radius: 14px; background: #fff; color: #000; box-shadow: 0 2px 0 #000; }
.ver { margin-top: auto; text-align: center; color: #888; font-size: 12px; padding: 12px; min-height: 44px; }

/* ---------- case file / clue card ---------- */
.case-card { position: relative; background: var(--paper); border: 3px solid #000; border-radius: 14px; padding: 22px 14px 14px; box-shadow: 0 4px 0 #000; text-align: center; }
.case-card.soft { padding-top: 14px; }
.case-tab { position: absolute; top: -16px; right: 14px; background: var(--yellow); border: 3px solid #000; border-radius: 10px 10px 0 0; padding: 1px 12px; font-size: 14px; font-weight: bold; }
.clip { position: absolute; top: -10px; left: 16px; width: 18px; height: 40px; border: 3px solid #666; border-radius: 9px; background: transparent; }
.pic { width: 120px; height: 120px; margin: 4px auto 8px; background: #fff; border: 3px solid #000; border-radius: 12px; transform: rotate(-2deg); padding: 4px; }
.pic svg { width: 100%; height: 100%; display: block; }
.clue { font-size: 22px; font-weight: bold; line-height: 1.35; margin: 4px 0 6px; }
.result { display: none; background: #FFF3C4; border: 2px dashed #000; border-radius: 10px; padding: 8px 10px; font-size: 17px; line-height: 1.4; text-align: right; margin-top: 8px; }
.result.show { display: block; animation: fadeUp .4s ease; }
.stamp { position: absolute; top: 40px; right: 6px; max-width: 150px; white-space: normal; transform: rotate(-12deg); border: 5px solid; border-radius: 12px; padding: 4px 14px; font-size: 28px; font-weight: bold; line-height: 1.1; background: rgba(255,255,255,.85); opacity: 0; pointer-events: none; text-align: center; }
.stamp.yes { color: var(--green); border-color: var(--green); }
.stamp.no { color: var(--orange); border-color: var(--orange); }
.stamp.slam { animation: slam .45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.big-stamp { position: static; display: inline-block; margin: 6px auto 10px; transform: rotate(-6deg); font-size: 34px; }
.star-pop { position: absolute; top: 6px; left: 40px; font-size: 28px; font-weight: bold; color: var(--orange); animation: starPop 1.2s ease forwards; }
.open-case { padding-top: 24px; }

.speech-row { display: flex; align-items: center; gap: 10px; }
.speech-row.tight .face, .speech-row.tight .kitchen-frooky { width: auto; height: clamp(150px, calc(.26 * var(--vh)), 220px); flex: none; }
.speech-row.tight .face svg, .speech-row.tight .kitchen-frooky svg { height: 100%; width: auto; display: block; }
.face svg, .kitchen-frooky svg { width: 100%; height: auto; display: block; }
.answers { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.answers.single { grid-template-columns: 1fr; }
.ans { min-height: 76px; font-size: 20px; line-height: 1.15; }
.ans.two-line { font-size: 17px; flex-wrap: nowrap; }
.ans.picked { outline: 4px solid var(--yellow); }
.mini-tomato { width: 34px; height: 34px; flex: none; }

/* ---------- backgrounds ---------- */
.screen.play { padding: 0; }
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg svg { width: 100%; height: 100%; display: block; }
.play-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); min-height: var(--vh); }
.play-inner .answers, .play-inner .btn { margin-top: auto; }
.play-inner .speech-row { margin-top: auto; }
.play-inner .speech-row + .answers { margin-top: 0; }
.speech-row.tight .bubble { background: rgba(255,255,255,.95); }

/* ---------- topics ---------- */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topic-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 3px solid #000; border-radius: 18px; padding: 14px 8px; box-shadow: 0 4px 0 #000; min-height: 130px; justify-content: center; font-size: 18px; }
.topic-card:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.topic-card .ticon { font-size: 40px; }
.topic-card .tname { font-weight: bold; font-size: 20px; }
.topic-card.mix { grid-column: 1 / -1; background: var(--yellow); min-height: 90px; }
.tbar { display: block; width: 80%; height: 10px; border: 2px solid #000; border-radius: 6px; background: #fff; overflow: hidden; }
.tbar > span { display: block; height: 100%; background: var(--green); }

/* ---------- briefcase & notebook ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool { min-width: 0; overflow: hidden; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; background: #eee; border: 3px solid #999; border-radius: 16px; color: #888; padding: 4px; }
.tool.owned { background: #FFF3C4; border-color: #000; color: #000; box-shadow: 0 3px 0 #000; }
.tool .ticon { font-size: 36px; }
.tool .tname { font-size: 14px; font-weight: bold; }
.tool-big { font-size: 80px; animation: hop .7s ease 2; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { border: 3px solid #000; border-radius: 22px; background: #fff; padding: 8px 14px; font-size: 16px; font-weight: bold; min-height: 44px; }
.tab.on { background: var(--yellow); }
.nb-list { display: flex; flex-direction: column; gap: 10px; }
.nb-item { display: flex; gap: 10px; background: var(--paper); border: 3px solid #000; border-radius: 14px; padding: 8px; align-items: center; }
.nb-pic { width: 64px; height: 64px; flex: none; background: #fff; border: 2px solid #000; border-radius: 10px; padding: 2px; }
.nb-pic svg { width: 100%; height: 100%; }
.nb-text { font-size: 16px; line-height: 1.35; }
.nb-text .myth { color: var(--orange); font-weight: bold; }
.trophy { color: var(--green); }


/* ---------- modal, toast, update ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border: 4px solid #000; border-radius: 22px; padding: 20px; width: min(92vw, 380px); text-align: center; animation: pop .25s ease; }
.modal .btn { width: 100%; margin-top: 8px; }
.modal .btn-row .btn { width: auto; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: #000; color: #fff; padding: 10px 18px; border-radius: 22px; z-index: 60; font-size: 16px; text-align: center; max-width: 90vw; animation: fadeUp .3s ease; }
.update-banner { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--yellow); border: 3px solid #000; border-radius: 22px; padding: 14px 22px; font-size: 18px; font-weight: bold; box-shadow: 0 4px 0 #000; }

/* ---------- animations ---------- */
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-16px); } }
@keyframes slam { 0% { opacity: 0; transform: rotate(-12deg) scale(2.2); } 60% { opacity: 1; transform: rotate(-12deg) scale(.92); } 100% { opacity: .95; transform: rotate(-12deg) scale(1); } }
.big-stamp.slam { animation: slamStatic .5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes slamStatic { 0% { opacity: 0; transform: rotate(-6deg) scale(3); } 100% { opacity: .95; transform: rotate(-6deg) scale(1); } }
@keyframes starPop { 0% { opacity: 0; transform: translateY(10px) scale(.5); } 25% { opacity: 1; transform: translateY(-10px) scale(1.3); } 100% { opacity: 0; transform: translateY(-50px) scale(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { animation: fadeUpToast .3s ease; }
@keyframes fadeUpToast { from { opacity: 0; } to { opacity: 1; } }

@media (max-height: 700px) { .pic { width: 96px; height: 96px; } .hero { height: calc(.24 * var(--vh)); } .clue { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; } }
/* short phones (e.g. 360x640): keep the whole clue screen, including both answer buttons, on screen */
@media (max-height: 680px) {
  .pic { width: 84px; height: 84px; margin-bottom: 4px; }
  .speech-row.tight .face, .speech-row.tight .kitchen-frooky { height: clamp(120px, calc(.22 * var(--vh)), 200px); }
  .play-inner { gap: 10px; }
  .ans { min-height: 64px; }
}
/* gender picker, rank line, medals */
.gender-row { display: flex; gap: 10px; margin: 8px 0 4px; }
.gender-btn { flex: 1; min-height: 56px; border: 3px solid #000; border-radius: 16px; background: #fff; font-size: 20px; font-weight: bold; }
.gender-btn.on { background: var(--yellow); box-shadow: 0 3px 0 #000; }
.rank { text-align: center; font-weight: bold; color: var(--blue); font-size: 16px; }
.medal-list, .award-list { display: flex; flex-direction: column; gap: 8px; }
.medal, .award { display: flex; align-items: center; gap: 12px; border: 3px solid #999; border-radius: 14px; background: #eee; padding: 8px 12px; color: #777; }
.medal.got, .award { background: #FFF3C4; border-color: #000; color: #000; }
.micon { font-size: 32px; width: 44px; text-align: center; flex: none; }
.mtext { display: flex; flex-direction: column; min-width: 0; }
.mtext b { font-size: 17px; }
.mtext small { font-size: 13px; opacity: .85; }
.award-list { margin: 6px 0 10px; text-align: right; }
.award-list .big { text-align: center; margin: 4px 0; }
.modal .award-list { max-height: 40vh; overflow-y: auto; }
.player-card .icon-btn { flex: none; }
/* narrow phones (320px) with 3-digit star counts: the top row may shrink instead of overflowing */
.home-top > * { min-width: 0; }
.chip { max-width: 46%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.toggles { flex: none; }
@media (max-width: 360px) { .home-top { gap: 4px; } .starcount { font-size: 17px; padding: 4px 8px; } }

/* ---------- Frooky's house: rooms ---------- */
.screen.house { gap: 8px; padding-top: 10px; }
.room-strip { display: flex; gap: 6px; }
.room-chip { flex: 1; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid #000; border-radius: 14px; background: #fff; padding: 2px; font-size: 22px; line-height: 1.1; }
.room-chip small { font-size: 13px; font-weight: bold; opacity: 1; white-space: nowrap; }
.room-chip.on { background: var(--yellow); box-shadow: 0 3px 0 #000; }
.scene { position: relative; width: min(100%, calc((var(--vh) - 196px) * 360 / var(--sh, 440))); aspect-ratio: 360 / var(--sh, 440); margin: 0 auto; direction: ltr; border: 3px solid #000; border-radius: 16px; overflow: hidden; background: #fff; animation: fadeUp .35s ease; }
.room-art, .room-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.room-art .obj { cursor: pointer; }
.scene.night::after { content: ""; position: absolute; inset: 0; background: rgba(0, 20, 90, .38); pointer-events: none; z-index: 2; }
.pf { position: absolute; z-index: 3; width: 32%; left: 50%; top: 86%; transform: translate(-50%, -100%) scale(var(--s, 1)); transform-origin: 50% 100%; transition: left var(--dur, 0s) linear, top var(--dur, 0s) linear; pointer-events: none; }
.pf-in svg { width: 100%; height: auto; display: block; }
.pf-in { transform-origin: 50% 100%; }
.pf.left .pf-in { transform: scaleX(-1); }
.pf.walking .pf-hop { animation: walkHop .34s ease-in-out infinite; }
@keyframes walkHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7%); } }
.say { position: absolute; z-index: 5; top: 8px; left: 10px; right: 10px; direction: rtl; background: #fff; border: 3px solid #000; border-radius: 16px; padding: 6px 12px; font-size: 17px; font-weight: bold; text-align: center; opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; pointer-events: none; }
.say.show { opacity: 1; transform: none; }
.door { position: absolute; z-index: 4; bottom: 3%; width: 15%; height: 28%; min-width: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 3px solid #000; border-radius: 12px 12px 0 0; background: var(--yellow); padding: 0; font-size: 26px; line-height: 1; box-shadow: 0 3px 0 rgba(0,0,0,.35); direction: rtl; }
.door small { font-size: 11px; font-weight: bold; opacity: 1; }
.door.left { left: -3px; border-radius: 0 12px 0 0; border-left: 0; }
.door.right { right: -3px; border-radius: 12px 0 0 0; border-right: 0; }
.door:active { background: #ffe56a; }

/* ---------- cooking ---------- */
.screen.cook .play-inner { gap: 8px; }
.cook-hint { margin: 0; text-align: center; font-weight: bold; background: rgba(255,255,255,.9); border-radius: 12px; padding: 2px 8px; }
.pot-wrap { position: relative; width: 190px; height: 112px; margin: 0 auto; }
.pot-svg svg { width: 100%; height: auto; display: block; }
.pot-items { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 56px; display: flex; flex-wrap: wrap-reverse; justify-content: center; align-items: flex-end; gap: 0; min-height: 40px; pointer-events: none; }
.chip-ing { pointer-events: auto; width: 40px; height: 40px; padding: 0; border: 0; background: none; margin: 0 -3px; animation: pop .25s ease; }
.chip-ing svg { width: 100%; height: 100%; display: block; }
.pot-wrap.cooking { animation: shake .3s ease-in-out infinite; }
.pot-wrap.cooking::before { content: "♨ ♨ ♨"; position: absolute; top: -26px; left: 0; right: 0; text-align: center; font-size: 22px; color: #fff; text-shadow: 0 0 4px #000; animation: fadeUp 1s ease infinite; }
@keyframes shake { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.cook-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 0 !important; }
.cook-actions > .btn, .cook-actions > .btn-row { margin-top: 0; }
.cook-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.cook-actions > .btn { flex: 1 1 40%; min-height: 52px; }
.cook-actions > .result-stars, .cook-actions > .result-note { flex: 1 1 100%; }
.cook-actions > .btn-row { flex: 1 1 100%; }
.cook-actions .btn-row .btn { min-height: 52px; font-size: 17px; padding: 6px 8px; }
.result-stars { text-align: center; font-size: 26px; font-weight: bold; }
.result-note { text-align: center; font-weight: bold; background: rgba(255,255,255,.92); border: 2px dashed #000; border-radius: 12px; padding: 4px 8px; }
.result-note.disc { background: #FFF3C4; }
.pantry { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: auto; }
.ing { background: #fff; border: 3px solid #000; border-radius: 14px; padding: 2px 2px 0; min-height: 70px; box-shadow: 0 3px 0 #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ing:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.ing.in-pot { background: var(--yellow); }
.ing-pic { width: 100%; max-width: 48px; aspect-ratio: 1; display: block; }
.ing-pic svg { width: 100%; height: 100%; display: block; }
.ing small { font-size: 12px; font-weight: bold; line-height: 1.1; padding-bottom: 3px; opacity: 1; }
.sub-h { margin: 14px 0 8px; font-size: 20px; }
@media (max-height: 700px) { .pot-wrap { width: 150px; height: 88px; } .pot-items { bottom: 44px; } .chip-ing { width: 32px; height: 32px; } .ing { min-height: 62px; } }
.screen.cook .speech-row.tight .kitchen-frooky { height: clamp(84px, calc(.15 * var(--vh)), 130px); }

/* ---------- wardrobe ---------- */
.screen.wardrobe { gap: 8px; height: var(--vh); min-height: 0; overflow: hidden; padding-bottom: 8px; }
.wardrobe-stage { flex: 0 0 auto; height: clamp(150px, calc(.3 * var(--vh)), 250px); display: flex; justify-content: center; align-items: flex-end; background: #FFF1B8; border: 3px solid #000; border-radius: 16px; overflow: hidden; }
.wardrobe-frooky { height: 100%; padding-top: 6px; }
.wardrobe-frooky svg { height: 100%; width: auto; display: block; }
.wardrobe-frooky.hop svg { animation: hop .6s ease 2; }
.wardrobe-tabs { gap: 6px; }
.wardrobe-tabs .tab { padding: 6px 9px; font-size: 14px; min-height: 44px; }
.cloth-grid { flex: 1 1 0; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-content: start; padding: 2px 2px 8px; }
.cloth { position: relative; min-width: 0; min-height: 96px; background: #fff; border: 3px solid #000; border-radius: 14px; padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; box-shadow: 0 3px 0 #000; }
.cloth:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.cloth-pic { display: flex; align-items: center; justify-content: center; width: 100%; height: 64px; font-size: 26px; }
.cloth-pic svg { width: 100%; height: 100%; display: block; }
.cloth small { font-size: 11px; font-weight: bold; line-height: 1.1; text-align: center; opacity: 1; padding: 0 1px 2px; }
.cloth.worn { background: var(--yellow); }
.cloth.locked { background: #eee; border-color: #999; box-shadow: none; color: #777; }
.cloth.locked .cloth-pic { filter: grayscale(1) brightness(.75) contrast(.8); opacity: .55; }
.cloth .lock, .cloth .new-tag, .cloth .worn-tag { position: absolute; top: -2px; right: -2px; font-size: 14px; font-weight: bold; background: #fff; border: 2px solid #000; border-radius: 10px; padding: 0 6px; line-height: 1.3; }
.cloth .new-tag { background: var(--orange); color: #fff; }
.cloth .worn-tag { background: var(--green); color: #fff; }
.wardrobe-count { margin: 0; font-size: 14px; }

/* ---------- house: bed, bathtub, tidying ---------- */
.scene-front { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.scene-front svg { width: 100%; height: 100%; display: block; }
.scene-front .blanket, .scene-front .zzz, .scene-front .tubfront, .scene-front .tubduck, .scene-front .sofafront, .scene-front .toiletfront { display: none; }
.scene.in-sleep .scene-front .blanket, .scene.in-sleep .scene-front .zzz { display: block; }
.scene.in-bath .scene-front .tubfront, .scene.in-bath .scene-front .tubduck { display: block; }
.scene-front .tubduck { animation: duckBob 2.2s ease-in-out infinite; }
@keyframes duckBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.zzz text { animation: zz 2.2s ease-in-out infinite; }
.zzz text:nth-child(2) { animation-delay: .4s; } .zzz text:nth-child(3) { animation-delay: .8s; }
@keyframes zz { 0%, 100% { opacity: .25; transform: translateY(6px); } 50% { opacity: 1; transform: translateY(-4px); } }
.pf.lying .pf-in { transform-origin: 50% 50%; transform: rotate(-90deg); }
.pf.lying { transition: none; }
.mess-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.mess { transition: left .25s, top .25s; position: absolute; width: 14%; min-width: 44px; aspect-ratio: 1; transform: translate(-50%, -100%); padding: 0; border: 0; background: none; pointer-events: auto; animation: pop .3s ease; }
.mess svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 0 rgba(0,0,0,.18)); }
.scene.sparkle { animation: sparkle 1.6s ease; }
@keyframes sparkle { 0%, 100% { filter: none; } 30% { filter: brightness(1.18) saturate(1.3); } }
.scene.in-sit .scene-front .sofafront { display: block; }
.scene.in-toilet .scene-front .toiletfront { display: block; }
.table-layer { z-index: 2; }
.table-item { position: absolute; width: 11%; aspect-ratio: 1; transform: translate(-50%, -100%); pointer-events: none; animation: pop .3s ease; }
.table-item svg { width: 100%; height: 100%; display: block; }
.puff { position: absolute; z-index: 5; font-size: 22px; pointer-events: none; opacity: 0; animation: puffUp 1.5s ease-out forwards; }
@keyframes puffUp { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) scale(1.2); } }

/* things on a table / sofa / bed are smaller; the one in his hand is drawn by .pf-carry instead */
.mess:not([data-on="floor"]) { width: 10.5%; min-width: 34px; }
.mess[data-on="hand"] { display: none; }
.pf-hop { position: relative; }
.pf-carry { position: absolute; left: -16%; bottom: 20%; width: 38%; aspect-ratio: 1; display: none; pointer-events: none; animation: carryBob .9s ease-in-out infinite; }
.pf-carry.show { display: block; }
.pf-carry svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 0 rgba(0,0,0,.18)); }
.pf-carry .hand { position: absolute; right: 10%; bottom: 4%; width: 26%; aspect-ratio: 1; border: 3px solid #000; border-radius: 50%; background: #fff; }
.pf.left .pf-carry { left: auto; right: -16%; }
@keyframes carryBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
/* sitting: only his upper body shows (his own legs are cut off); the legs drawn in .scene-front hang over the seat */
.pf.sitting .pf-in { clip-path: inset(0 0 10% 0); }
.topic-grid .topic-card:not(.mix):nth-last-child(2):nth-child(odd) { grid-column: 1 / -1; min-height: 100px; }
/* two counters on the home screen: stars (Fact Detective) and keys (Frooky's house) */
.counts { display: flex; gap: 10px; justify-content: center; }
.counts .starcount { font-size: 20px; padding: 4px 14px; }
.starcount.keycount { background: #BDE3F5; }
.ver .credit { color: #555; font-size: 14px; font-weight: bold; margin-bottom: 2px; }
.credit-line { text-align: center; color: #555; font-size: 14px; font-weight: bold; padding: 4px 0; }
