/* Warm, quiet controls: the village gets most of the screen. */
.glass{background:#fff3dfe8;color:#43553d;border-color:#fff9eccc;box-shadow:0 3px 12px #243e2926,inset 0 0 0 1px #b5a27926;backdrop-filter:blur(10px)}
.brand,.harvest{border-radius:24px}.brand strong{color:#40513a}.rank-line,.harvest small{color:#7d8065}.meter{background:#d6d9bd}.meter i{background:#84956a}
.view-reset,.controls-toggle{background:#fff3dfe8;color:#536247}.view-reset:hover,.controls-toggle:hover{background:#fff8e9}
.restoration-hint{border-radius:20px}.restoration-hint small,.restoration-hint #recoveryMinutes{color:#7b8065}.restoration-hint .recovery-meter{background:#d9dbc4}.restoration-hint .recovery-meter i{background:#8a9a67}.restoration-hint.ready{border-color:#94a56b;background:#f3f4dc}
.welcome{border-radius:22px}.welcome p{color:#667052}.welcome .eyebrow,.welcome>.icon-button{color:#7c8069}
.focus-dock{border-radius:24px}.dock-copy .eyebrow{color:#7d826b}.dock-copy strong{color:#46583e}.dock-buttons .primary{border-radius:20px;background:#718959;color:#fffbed;box-shadow:0 2px 0 #566c41}.dock-buttons .primary:hover{background:#627c4c}
.journal-button{color:#5b704c;background:#f8efd8;border-color:#d8d8bc;border-radius:18px}.journal-button:hover{background:#f2e6c9}.count{background:#b97d50;border-color:#fff3df}.dock-progress i{background:#b9c793}.demo-mode .dock-copy .eyebrow{color:#84723f}.demo-mode .focus-dock{border-color:#ceb882}
.compact-recovery,#focusShort{display:none}.toast{background:#fff0d9;color:#4d5c40;border-color:#eadcc0;border-radius:20px;box-shadow:0 4px 18px #24412f24}.toast button{color:#6b7e4d}

/* Conversations belong to the person speaking, not to a modal layer. */
.speech-bubble{position:fixed;z-index:7;width:268px;max-width:calc(100vw - 24px);padding:23px 15px 10px;background:#fff5df;color:#455239;border:1px solid #daceb4;border-radius:23px 25px 22px 19px;box-shadow:0 5px 0 #233b2d12,0 9px 24px #16382c24;touch-action:manipulation;animation:speech-in .18s ease-out;transform-origin:50% 100%;isolation:isolate}
.speech-bubble:after{content:"";position:absolute;left:calc(var(--tail-x,50%) - 7px);bottom:-8px;width:14px;height:14px;transform:rotate(45deg);background:#fff5df;border-right:1px solid #daceb4;border-bottom:1px solid #daceb4;border-radius:0 0 4px 0;z-index:-1}
.speech-bubble.tail-hidden:after{display:none}.speech-name{position:absolute;top:-12px;left:17px;border:1px solid #ecdfba;background:#73845a;color:#fff6df;font:600 14px/1.2 var(--ui-font);padding:5px 12px;border-radius:14px;box-shadow:0 2px 0 #263b2420}
.speech-close{position:absolute;right:-9px;top:-16px;width:44px;height:44px;padding:13px;display:grid;place-items:center;background:radial-gradient(circle,#f5ecd7 48%,transparent 51%);border:0;border-radius:50%;color:#7c8067}.speech-close .icon{width:17px;height:17px}
.speech-bubble p{margin:0 0 9px;font:400 16px/1.45 var(--ui-font);overflow-wrap:anywhere}.speech-choices{display:flex;gap:5px;border-top:1px solid #e6dec5;padding-top:4px}.speech-choices button,.speech-next{min-height:44px;border:0;background:none;color:#697c4d;font:600 14px/1.2 var(--ui-font);border-radius:12px;padding:8px;touch-action:manipulation}.speech-choices button{flex:1;display:flex;align-items:center;justify-content:center;gap:4px}.speech-choices button .icon{width:16px;height:16px}.speech-choices button:hover,.speech-next:hover{background:#e9ecd6}.speech-next{display:flex;justify-content:flex-end;align-items:center;gap:12px;width:100%;border-top:1px solid #e6dec5}.speech-next span{font-size:22px}
.talking .welcome,.talking .restoration-hint,.talking .controls-hint{visibility:hidden;pointer-events:none}
@keyframes speech-in{from{opacity:0;transform:scale(.96) translateY(5px)}to{opacity:1;transform:none}}

@media(max-width:760px){
  .topbar{left:max(12px,env(safe-area-inset-left));right:66px;top:max(12px,env(safe-area-inset-top));gap:8px;align-items:center}
  .brand{min-width:0;max-width:calc(100% - 64px);min-height:44px;padding:6px 10px;gap:7px;border-radius:22px}.brand strong{font-size:14px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crest{font-size:24px;line-height:1}.brand .rank-line,.brand .meter{display:none}
  .harvest{height:44px;padding:6px 10px;gap:5px;border-radius:22px}.harvest strong{font-size:16px}.harvest>span:first-child{font-size:18px}
  .controls-toggle,.demo-mode .controls-toggle{top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:44px;height:44px;border-radius:50%;font-size:14px}
  .view-reset{display:none}.location{left:max(16px,env(safe-area-inset-left));top:calc(max(12px,env(safe-area-inset-top)) + 55px);max-width:calc(100% - 125px);transform:none;text-align:left}.location .eyebrow{display:none}.location h2{margin:0;font-size:18px;line-height:1.4;color:#fff8e4;text-shadow:0 2px 5px #25442699}
  .restoration-hint{left:auto;right:max(12px,env(safe-area-inset-right));top:calc(max(12px,env(safe-area-inset-top)) + 51px);width:auto;min-width:76px;height:44px;min-height:44px;padding:8px 12px;gap:7px;border-radius:22px}.restoration-hint .recovery-detail,.recovery-chevron{display:none}.restoration-hint>.icon{width:18px;height:18px}.compact-recovery{display:inline;font-size:14px;white-space:nowrap}
  .demo-badge{top:calc(max(12px,env(safe-area-inset-top)) + 91px);left:12px;right:auto;transform:none;min-height:36px;padding:6px 10px;font-size:12px;border-radius:18px;background:#f0dfb9dd;border-color:#ecddb8;color:#75613f;box-shadow:0 2px 9px #263b2a14}
  .focus-dock{left:auto;right:max(12px,env(safe-area-inset-right));bottom:calc(18px + var(--safe-b));width:222px;max-width:calc(100% - 105px);padding:0;transform:none;border:0;background:none;box-shadow:none;backdrop-filter:none;overflow:visible;border-radius:0}
  .dock-copy{display:none}.dock-buttons{gap:8px;align-items:center}.dock-buttons .primary{min-height:48px;min-width:0;padding:11px 14px;border:1px solid #fff7e6b3;border-radius:24px;background:#fff1d9;color:#4e6342;box-shadow:0 3px 0 #bdad8a44,0 5px 15px #193e2c26;font-size:14px;white-space:nowrap;line-height:1.2}.dock-buttons .primary:hover{background:#fff8e9}
  #focusLabel{display:none}#focusShort{display:inline}.journal-button{width:48px;height:48px;min-height:48px;padding:12px;border-radius:50%;background:#f7ebd3;color:#64794e;box-shadow:0 3px 0 #bdad8a44,0 5px 15px #193e2c26;border:1px solid #fff7e6b3;flex-shrink:0}.journal-button>span:not(.count){display:none}.journal-button .icon{width:21px;height:21px}.count{right:-1px;top:-4px;font-size:12px;min-width:19px;height:19px;border-width:2px}
  .dock-progress{left:20px;right:76px;bottom:5px;height:2px;border-radius:4px;overflow:hidden;pointer-events:none}.dock-progress i{background:#a3b584}
  .joystick{left:max(21px,env(safe-area-inset-left));bottom:calc(18px + var(--safe-b));width:64px;height:64px;background:#fff0cb21;border-color:#fff3d380;box-shadow:0 0 0 6px #ffedce0a}.stick{left:16px;top:16px;width:30px;height:30px;background:#fff0cdaf;border-color:#fff4dcb8;box-shadow:0 2px 5px #2c47251a}.joystick-label{display:none}
  .welcome{left:auto;right:12px;top:auto;bottom:calc(82px + var(--safe-b));width:268px;max-width:calc(100% - 40px);padding:14px 40px 14px 16px;border-radius:20px}.welcome h2,.welcome .eyebrow{display:none}.welcome p{font-size:14px;line-height:1.45;margin:0}.welcome>.icon-button{right:0;top:0}
  .npc-label{font-size:15px}.npc-label span{display:none}.marker{font-size:12px}.pin{font-size:15px;margin-bottom:2px}.toast{bottom:calc(83px + var(--safe-b));padding:10px 14px;font-size:14px;max-width:calc(100% - 32px)}
  .journal-modal{height:78dvh;max-height:calc(100dvh - 44px);border-radius:24px 24px 0 0;padding:18px 20px calc(22px + var(--safe-b))}.journal-modal .dialog-head{margin-bottom:15px}.journal-modal .dialog-head h2{font-size:25px}.journal-tabs{margin-bottom:10px}.journal-footer small{margin-top:10px}.examine-modal{width:min(330px,calc(100% - 40px));padding:21px}.examine-modal .dialog-head h2{font-size:25px}
  .world-menu{width:250px;border-radius:18px;box-shadow:0 5px 0 #253c2c12,0 10px 30px #1c3b292e}.world-menu.touch-menu .menu-heading strong{font-size:20px}
  .portrait-controls{bottom:calc(20px + var(--safe-b));font-size:14px}
}
@media(max-width:350px){.brand strong{font-size:14px}.brand{padding:6px 8px}.brand .crest{font-size:21px}.harvest{padding:6px 8px}.focus-dock{width:202px}.speech-bubble{width:252px}}
@media(max-height:480px) and (pointer:coarse){.location{display:none}.restoration-hint{top:65px}.journal-modal{height:90dvh}.speech-bubble{padding-top:19px}.speech-bubble p{font-size:15px;line-height:1.4}}
@media(prefers-reduced-motion:reduce){.speech-bubble{animation:none}}
