/* The town's chrome: full-screen canvas, chips, speech bubbles, loader. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #9fd4f2; font: 15px/1.35 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif; color: #2d3a2a; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
.chip { position: fixed; top: max(14px, env(safe-area-inset-top)); z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 0; background: rgba(255, 253, 246, .92); color: #2d3a2a; font: 600 14px/1 inherit; font-family: inherit; text-decoration: none; box-shadow: 0 3px 0 rgba(45, 58, 42, .18); cursor: pointer; }
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(45, 58, 42, .18); }
.toggle { right: 16px; }
.toggle .moon, .toggle .star, .toggle[data-mood="dusk"] .sun, .toggle[data-mood="night"] .sun { display: none; }
.toggle[data-mood="dusk"] .moon, .toggle[data-mood="night"] .star { display: inline; }
.hint { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; margin: 0; padding: 8px 16px; border-radius: 999px; background: rgba(45, 58, 42, .72); color: #fffdf6; font-weight: 600; font-size: 13px; white-space: nowrap; transition: opacity .6s ease; pointer-events: none; }
.hint.gone { opacity: 0; }
#bubbles { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.bubble { position: absolute; left: 0; top: 0; max-width: min(240px, 70vw); padding: 9px 13px; border-radius: 18px; background: #fffdf6; color: #2d3a2a; font-weight: 600; font-size: 14px; box-shadow: 0 3px 0 rgba(45, 58, 42, .2); transform: translate(-50%, -100%); opacity: 0; transition: opacity .25s ease; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fffdf6; }
.bubble.show { opacity: 1; }
.bubble b { display: block; color: #e0703a; font-size: 12px; letter-spacing: .02em; }
.bubble.place { background: #2d3a2a; color: #fffdf6; padding: 6px 12px; font-size: 13px; }
.bubble.place::after { border-top-color: #2d3a2a; }
.loader { position: fixed; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 14px; background: #bfe3a4; font-weight: 600; transition: opacity .5s ease; }
.loader.done { opacity: 0; pointer-events: none; }
.ring { width: 44px; height: 44px; border-radius: 50%; border: 5px solid rgba(45, 58, 42, .15); border-top-color: #e0703a; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* The gate: the walking hint waits until the visitor is inside; the conversation card sits at the bottom. */
body.gate .hint { display: none; }
.talk { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; width: min(440px, 100vw - 32px); display: grid; gap: 8px; padding: 12px; border-radius: 22px; background: rgba(255, 253, 246, .94); box-shadow: 0 4px 0 rgba(45, 58, 42, .2); }
.talk[hidden] { display: none; }
.talk .row { display: flex; gap: 8px; }
.talk button, .talk input { flex: 1 1 0; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid rgba(45, 58, 42, .18); background: #fffdf6; color: #2d3a2a; font: 600 15px/1.2 inherit; font-family: inherit; text-align: center; }
.talk button { cursor: pointer; }
.talk button:active { transform: translateY(2px); }
.talk .primary { background: #e0703a; border-color: #e0703a; color: #fffdf6; }
.talk .google { background: #fff; }
.talk input { text-align: left; }
.talk input:focus { outline: none; border-color: #e0703a; }
.talk > button { flex: none; }
@media (max-width: 480px) { .talk .row:has(> :nth-child(3)) { flex-wrap: wrap; } .talk .row:has(> :nth-child(3)) > * { flex-basis: 100%; } }
