/* Cozy menus: one soft, rounded look for every panel the player opens.
   Loaded last so it restyles the journal, place panels, mission conversations, rooms, menu and settings. */
:root{--cozy-ink:#5b4636;--cozy-muted:#9a8574;--cozy-paper:#fffdf8;--cozy-cream:#fff6ea;--cozy-edge:#f1dfcc;--cozy-blush:#fbe1dc;--cozy-rose:#e38f8b;--cozy-rose-deep:#c46e6a;--cozy-mint:#dff0e2;--cozy-sage:#78b287;--cozy-sage-deep:#4f8d62;--cozy-butter:#fff0c4;--cozy-lilac:#efe7f8;--cozy-lilac-edge:#d6c7ea;--cozy-round:'Fredoka','Quicksand',sans-serif}

/* Panels */
.life-dialog,#adventure-journal,#game-menu{background:var(--cozy-cream);color:var(--cozy-ink);border:3px solid var(--cozy-edge);border-radius:30px;box-shadow:0 10px 0 #ead6c1,0 30px 80px #3b2a2044}
.life-dialog::backdrop,#adventure-journal::backdrop,#game-menu::backdrop{background:#4a3a3055;backdrop-filter:blur(4px)}
.life-dialog header,#adventure-journal .journal-header{background:radial-gradient(circle,#f6d9d0 1.5px,transparent 2px) 0 0/18px 18px,linear-gradient(#fff4ec,#fff8f0);border-bottom:2px dashed var(--cozy-edge)}
.life-dialog header small,#adventure-journal .journal-header small{display:inline-block;padding:3px 11px;border-radius:999px;background:var(--cozy-blush);color:var(--cozy-rose-deep);font:600 10px Quicksand,sans-serif;letter-spacing:.14em}
.life-dialog h2,#adventure-journal h2,#game-menu h2{font:600 30px var(--cozy-round);color:var(--cozy-ink);letter-spacing:.2px}
.life-balance{display:inline-block;margin-top:2px;font-weight:700;color:#b98a2e}.life-balance::before{content:'';display:inline-block;width:11px;height:11px;margin-right:5px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#ffe9a0,#e9b441);vertical-align:-1px}

/* Buttons: soft candy pills that press down */
.life-dialog button,#adventure-journal button,#game-menu button,.bakery-conversation button{font-family:var(--cozy-round);font-weight:500;letter-spacing:.2px;border-radius:999px;transition:transform .1s,box-shadow .1s,background .15s}
.life-dialog .life-card button,.life-dialog .life-body>button,#adventure-journal .adventure-entry button,#game-menu .btn-small{background:var(--cozy-sage);color:#fff;border:0;box-shadow:0 4px 0 var(--cozy-sage-deep);padding:9px 18px;font-size:14px}
.life-dialog .life-card button:hover:not(:disabled),#adventure-journal .adventure-entry button:hover,#game-menu .btn-small:hover{background:#86bd94;transform:translateY(-1px);box-shadow:0 5px 0 var(--cozy-sage-deep)}
.life-dialog .life-card button:active:not(:disabled),#adventure-journal .adventure-entry button:active,#game-menu .btn-small:active{transform:translateY(3px);box-shadow:0 1px 0 var(--cozy-sage-deep)}
.life-dialog .life-card button~button{background:var(--cozy-paper);color:var(--cozy-sage-deep);box-shadow:0 3px 0 var(--cozy-edge);border:2px solid var(--cozy-edge)}
.life-dialog .life-card button:disabled{background:#e8e0d6;color:#a8998a;box-shadow:0 3px 0 #d8ccbf;opacity:1}
.life-dialog header button,#journal-close,#menu-close{background:var(--cozy-paper);color:var(--cozy-rose-deep);border:2px solid var(--cozy-blush);box-shadow:0 3px 0 var(--cozy-blush);padding:8px 16px;font-size:13px}
.life-dialog header button:hover,#journal-close:hover,#menu-close:hover{background:var(--cozy-blush)}

/* Journal pages */
.life-dialog nav{background:linear-gradient(#fbeee4,#f7e9dc);border-right:2px dashed var(--cozy-edge)}
.life-dialog nav button{font-size:15px;color:var(--cozy-muted);border-radius:16px}
.life-dialog nav button[aria-pressed=true]{background:var(--cozy-rose);color:#fff;box-shadow:0 4px 0 var(--cozy-rose-deep)}
.life-dialog nav button:hover:not([aria-pressed=true]){background:#fff3ea;color:var(--cozy-ink)}
.life-dialog .life-filters{border-bottom:2px dashed var(--cozy-edge)}
.life-dialog .life-filters button{font-size:13px;color:var(--cozy-muted);box-shadow:none;background:transparent}
.life-dialog .life-filters button[aria-pressed=true]{background:var(--cozy-mint);color:var(--cozy-sage-deep)}
.life-message{background:var(--cozy-butter);color:#8a6a2a;font-weight:600;border-bottom:2px dashed #f2dc9c}
#adventure-journal nav button{font-family:var(--cozy-round)}
#adventure-journal nav button[aria-selected=true]{background:var(--cozy-rose);border-color:var(--cozy-rose)}

/* Cards: little stickers */
.life-card,#adventure-journal .adventure-entry{background:var(--cozy-paper);border:2px solid var(--cozy-edge);border-radius:22px;box-shadow:0 4px 0 var(--cozy-edge)}
.life-card h3,.life-section h3,#adventure-journal .adventure-entry h3{font:500 21px var(--cozy-round);color:var(--cozy-ink)}
.life-card p,.life-section p,#adventure-journal .adventure-entry p{color:#7d6858}
.life-card small{color:var(--cozy-muted)}
.life-card>small:first-child{display:inline-block;width:auto;padding:3px 10px;border-radius:999px;background:var(--cozy-mint);color:var(--cozy-sage-deep);font-weight:700;letter-spacing:.06em}
.life-feature{background:var(--cozy-butter);border-color:#f2d98f;box-shadow:0 4px 0 #f2d98f;border-left-width:2px}
.life-card.life-locked{background:var(--cozy-lilac);border:2px dashed var(--cozy-lilac-edge);box-shadow:none}
.life-card.life-locked>small:first-child{background:#fff;color:#8a73ad}
.life-card.life-locked>small:first-child::before{content:'';display:inline-block;width:11px;height:12px;margin-right:5px;vertical-align:-1px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 13'%3E%3Cpath d='M3.5 6V4a2.5 2.5 0 0 1 5 0v2' fill='none' stroke='%238a73ad' stroke-width='1.6' stroke-linecap='round'/%3E%3Crect x='1.5' y='6' width='9' height='6.5' rx='2' fill='%238a73ad'/%3E%3C/svg%3E") no-repeat center/contain}
.life-inventory .life-slot{border:2px solid var(--cozy-edge);border-radius:20px;background:var(--cozy-paper);box-shadow:0 3px 0 var(--cozy-edge)}
.life-inventory .life-slot[aria-pressed=true]{background:var(--cozy-blush);border-color:var(--cozy-rose);color:var(--cozy-ink)}
.life-item-detail{background:var(--cozy-mint);border-color:#bfe0c7;box-shadow:0 4px 0 #bfe0c7}

/* Recipes: ingredient chips instead of a sentence */
.life-recipe-needs{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 4px}
.life-need{display:inline-flex;align-items:center;gap:5px;padding:3px 10px 3px 4px;border-radius:999px;background:#fff4e6;border:2px solid #f3e0c6;font:600 12px Quicksand,sans-serif;color:var(--cozy-ink)}
.life-need .life-item-icon{width:26px;height:26px;margin:0}.life-need .life-item-icon svg{width:20px;height:20px}
.life-need b{font-weight:700}.life-need em{font-style:normal;color:var(--cozy-sage-deep)}.life-need.short em{color:var(--cozy-rose-deep)}
.life-recipe-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:8px 0 12px}
.life-chip{display:inline-block;padding:3px 10px;border-radius:999px;background:var(--cozy-lilac);color:#7b64a0;font:700 11px Quicksand,sans-serif}
.life-chip.gentle{background:transparent;color:var(--cozy-muted);font-weight:500;padding:0}

/* Mission conversations */
#adventure-journal .adventure-entry.conversation{background:var(--cozy-paper)}

/* Room conversation cards (Hana, Warda, Noor) */
.bakery-conversation{border:3px solid var(--cozy-edge);border-radius:26px;background:#fffaf2f7;box-shadow:0 6px 0 #ead6c1,0 18px 40px #3b2a2030}
.bakery-conversation strong{font:600 17px var(--cozy-round);color:var(--cozy-ink)}
.bakery-conversation .venue-row button{box-shadow:0 4px 0 #8f4f4d}
.bakery-conversation .venue-row button:active{transform:translateY(3px);box-shadow:0 1px 0 #8f4f4d}
.bakery-conversation .venue-row .venue-secondary{box-shadow:0 3px 0 #ecd2cf}
#florist-dialog .bakery-conversation .venue-row button:not(.venue-secondary){box-shadow:0 4px 0 #3f6b55}

/* Menu and settings */
#game-menu .menu-head{background:radial-gradient(circle,#f6d9d0 1.5px,transparent 2px) 0 0/18px 18px,linear-gradient(#fff4ec,#fff8f0);border-bottom:2px dashed var(--cozy-edge)}
#game-menu .menu-tabs{background:var(--cozy-paper);border:2px solid var(--cozy-edge);box-shadow:inset 0 2px 0 #f6eadc}
#game-menu .menu-tab{color:var(--cozy-muted)}#game-menu .menu-tab:hover{color:var(--cozy-ink);background:var(--cozy-blush)}
#game-menu .menu-tab.active{background:var(--cozy-sage);color:#fff;box-shadow:0 3px 0 var(--cozy-sage-deep)}
#game-menu .menu-tab:focus-visible,#game-menu .menu-tile:focus-visible{outline:3px solid var(--cozy-rose);outline-offset:2px}
#game-menu .menu-tile{border:2px solid var(--cozy-edge);background:var(--cozy-paper);border-radius:22px;box-shadow:0 4px 0 var(--cozy-edge);color:var(--cozy-ink)}
#game-menu .menu-tile:hover{background:var(--cozy-blush);border-color:#f2c8c2;transform:translateY(-1px)}
#game-menu .menu-card{background:var(--cozy-paper);border:2px solid var(--cozy-edge);box-shadow:0 4px 0 var(--cozy-edge)}
#game-menu #menu-home{background:linear-gradient(#fffaf0,#fff4dc);border-color:#f3dc9c;box-shadow:0 4px 0 #efd58a}
#game-menu kbd{background:var(--cozy-mint);border-color:#bfe0c7;color:var(--cozy-sage-deep);border-radius:8px}
#game-menu h3{color:var(--cozy-rose-deep)}
#game-menu .menu-settings label{color:var(--cozy-ink)}#game-menu input[type=range]{accent-color:var(--cozy-rose)}#game-menu input[type=checkbox]{accent-color:var(--cozy-sage)}
/* The G prompt joins the bottom prompt stack, so it sits above the E prompt instead of on top of it. */
#guide-controls #life-nearby{position:static;transform:none;pointer-events:auto;white-space:nowrap}
/* Notices join the bottom stack above the prompts, so nothing ever lands on top of a button. */
#guide-controls #adventure-notice,#guide-controls .activity-result{position:static;transform:none;width:clamp(220px,calc(100vw - 700px),520px);box-sizing:border-box;border:3px solid #f3dc9c;border-radius:22px;background:#fff6dcf2;color:var(--cozy-ink);font-weight:600;text-align:center;box-shadow:0 4px 0 #efd58a,0 12px 28px #3b2a2022}
#game-menu #menu-close{background:var(--cozy-paper);color:var(--cozy-rose-deep);border:2px solid var(--cozy-blush);box-shadow:0 3px 0 var(--cozy-blush)}
#menu-keys dt{justify-self:start;padding:2px 9px;border-radius:8px;background:var(--cozy-mint);color:var(--cozy-sage-deep);font:700 11px Quicksand,sans-serif}#menu-keys dd{color:var(--cozy-ink)}

/* Quest complete: bold extruded letters over the world, no background. */
#quest-complete{position:fixed;inset:0;z-index:200;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;pointer-events:none;text-align:center;animation:quest-out .8s ease-in 2.8s forwards}
.quest-complete-word{display:block;font:700 clamp(46px,8.5vw,112px)/1 'Fredoka',sans-serif;letter-spacing:1px;color:#ffd449;-webkit-text-stroke:7px #fff;paint-order:stroke fill;text-shadow:0 2px 0 #f2b733,0 4px 0 #e5a22a,0 6px 0 #d78f22,0 8px 0 #c97d1c,0 10px 0 #b86c17,0 12px 0 #a55d13,0 18px 22px #3b2a2066}
.quest-complete-word span{display:inline-block;transform-origin:50% 80%;animation:quest-pop .55s cubic-bezier(.3,1.6,.5,1) both}
.quest-complete-word .gap{width:.3em}
.quest-complete-title{display:block;font:600 clamp(22px,3.2vw,38px)/1.1 'Fredoka',sans-serif;font-style:normal;color:#ffb3ad;-webkit-text-stroke:5px #fff;paint-order:stroke fill;text-shadow:0 2px 0 #e3867f,0 4px 0 #cc6c66,0 6px 0 #b35852,0 10px 16px #3b2a2055;animation:quest-rise .5s ease-out .6s both}
.quest-complete-coins{display:block;font:700 clamp(18px,2.4vw,28px)/1 'Fredoka',sans-serif;color:#fff2b8;-webkit-text-stroke:4px #b8791a;paint-order:stroke fill;text-shadow:0 3px 0 #9a6214,0 8px 12px #3b2a2044;animation:quest-rise .5s ease-out .85s both}
@keyframes quest-pop{0%{opacity:0;transform:translateY(40px) scale(.2) rotate(-14deg)}70%{opacity:1;transform:translateY(-8px) scale(1.18) rotate(4deg)}100%{transform:none}}
@keyframes quest-rise{0%{opacity:0;transform:translateY(18px) scale(.8)}100%{opacity:1;transform:none}}
@keyframes quest-out{to{opacity:0;transform:translateY(-40px) scale(1.05)}}
@keyframes quest-fade{to{opacity:0}}
@media(prefers-reduced-motion:reduce){.quest-complete-word span,.quest-complete-title,.quest-complete-coins{animation:none}#quest-complete{animation:quest-fade .8s ease-in 2.8s forwards}}

/* Rides, lift, train, range and district helpers: just their E button, styled like every other prompt. */
#guide-controls>section{position:static;inset:auto;transform:none;width:auto;max-width:none;margin:0;padding:0;border:0;background:none;box-shadow:none;backdrop-filter:none;pointer-events:auto}
#guide-controls>section>:is(strong,p,small,h2,h3){display:none}
#guide-controls>section>div{display:flex;gap:8px;justify-content:center}#guide-controls>section>div>button{margin:0;white-space:nowrap}
#guide-controls>section>button{margin:0;white-space:nowrap;box-shadow:0 4px 14px #172d4230}
#guide-controls>section>button:disabled{opacity:.7}

/* Mission tracker: text straight over the world, no card and no glow. Yellow title, orange details, crisp dark outline. */
#journey-card{background:none;box-shadow:none;border:0;backdrop-filter:none}
#journey-title{font:600 19px/1.2 'Fredoka',sans-serif;color:#ffd449;-webkit-text-stroke:4px #4a2f17;paint-order:stroke fill;text-shadow:none}
#journey-text,#journal-open{font-weight:700;color:#ff9a3c;-webkit-text-stroke:3px #4a2f17;paint-order:stroke fill;text-shadow:none}
#journal-open:hover{color:#ffb466;text-decoration:none}#journal-open::before{background:#ff9a3c;filter:drop-shadow(0 0 1px #4a2f17) drop-shadow(0 0 1px #4a2f17)}

/* Speech caption keeps its look; it only gains a comic-book tail pointing up at whoever is talking (--tail-x is set each frame).
   Its width leaves room for the chat log so the two never overlap. */
#npc-dialogue-caption{overflow:visible;width:clamp(280px,calc(100vw - 700px),620px);box-sizing:border-box}
#npc-dialogue-caption::after{content:'';position:absolute;left:var(--tail-x,50%);top:-10px;width:18px;height:18px;margin-left:-9px;background:#faf6ea;border-left:1px solid #aebca6;border-top:1px solid #aebca6;border-radius:3px 0 0 0;transform:rotate(45deg) skew(14deg,14deg)}
#npc-dialogue-caption.no-tail::after{display:none}
#npc-dialogue-text{max-height:calc(100vh - 200px);overflow:auto}
.life-dialog .life-card .henna-tools button[aria-pressed]{background:var(--cozy-paper);color:var(--cozy-sage-deep);box-shadow:0 3px 0 var(--cozy-edge);border:2px solid var(--cozy-edge)}.life-dialog .life-card .henna-tools button[aria-pressed]:hover{background:#fff3ea}.life-dialog .life-card .henna-tools button[aria-pressed=true]{background:var(--cozy-sage);color:#fff;border-color:var(--cozy-sage);box-shadow:0 4px 0 var(--cozy-sage-deep)}

/* Opening title over the moving train, using the quest-complete lettering. */
#arrival-title{position:absolute;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:24px;pointer-events:none;text-align:center;opacity:0;animation:arrival-title-fade 8s ease-in-out both}
.arrival-welcome{font:400 clamp(22px,3vw,36px)/1.2 'Quicksand',sans-serif;color:#fff;text-shadow:0 2px 8px #0008}
.arrival-valley{font-size:clamp(38px,8vw,104px);white-space:nowrap}
.arrival-title-active #look-prompt{visibility:hidden}
@keyframes arrival-title-fade{0%,10%{opacity:0}30%,70%{opacity:1}100%{opacity:0}}
@media(max-width:650px){.arrival-valley{-webkit-text-stroke-width:4px}}

/* Controls tutorial (controls-tutorial.js): takes the mission tracker's place while it runs, so the two never overlap. */
#controls-tutorial{position:absolute;top:var(--life-journey-top,130px);left:20px;width:300px;box-sizing:border-box;padding:14px 16px 12px;border:1px solid #aebca6;border-radius:16px;background:#faf6eaf5;color:#354e40;box-shadow:0 8px 32px #172d4230;z-index:6;transition:transform .2s,border-color .2s}
#controls-tutorial[hidden]{display:none}.controls-tutorial-active #journey-card{display:none!important}
#controls-tutorial header{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#756e59}
.tutorial-device{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tutorial-count{white-space:nowrap}
.tutorial-title{font:600 20px/1.2 'Fredoka',sans-serif;margin:6px 0 8px;color:#354e40}
.tutorial-keys{display:flex;flex-wrap:wrap;gap:6px}.tutorial-keys:empty{display:none}
.tutorial-keys kbd{font:600 13px/1 'Fredoka',sans-serif;padding:6px 10px;min-width:16px;text-align:center;border-radius:8px;background:#fff;border:1.5px solid #58785d66;border-bottom-width:3px;color:#354e40}
.tutorial-text{font-size:13px;line-height:1.5;margin:9px 0 10px}
#controls-tutorial footer{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tutorial-dots{display:flex;gap:5px}.tutorial-dots i{width:8px;height:8px;border-radius:50%;background:#d8d0bb}.tutorial-dots i.now{background:#e0a32a}.tutorial-dots i.done{background:#58785d}
#controls-tutorial-skip{padding:5px 12px;font-size:11px;background:transparent;color:#58785d;border:1.5px solid #58785d66;box-shadow:none}
#controls-tutorial.cleared{border-color:#58785d;transform:scale(1.02)}#controls-tutorial.cleared .tutorial-title::after{content:' ✓';color:#58785d}
#controls-tutorial.finished footer{display:none}
.tutorial-highlight{outline:3px solid #ffd449;outline-offset:3px;animation:tutorial-pulse 1.2s ease-in-out infinite}
@keyframes tutorial-pulse{50%{outline-color:#ffd44933}}
.archery-active #controls-tutorial,.pickleball-active #controls-tutorial,.playing-activity #controls-tutorial{display:none!important}
@media(max-width:650px){#controls-tutorial{top:max(var(--life-journey-top,130px),172px);left:12px;width:min(260px,calc(100vw - 24px));padding:10px 12px}.tutorial-title{font-size:17px}.tutorial-text{font-size:12px}}
@media(max-height:500px) and (orientation:landscape){#controls-tutorial{left:8px;width:240px;padding:8px 12px;max-height:calc(100vh - var(--life-journey-top,80px) - 136px);overflow:auto}.tutorial-title{font-size:15px;margin:3px 0 5px}.tutorial-text{font-size:11px;line-height:1.35;margin:5px 0 6px}.tutorial-keys kbd{font-size:11px;padding:4px 7px}}
