@import url("https://fonts.googleapis.com/css?family=Montserrat:400,600,700");
@font-face { font-family: "Wurld Bubble"; src: url("../assets/fonts/WurldBubble.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Boring Time"; src: url("../assets/fonts/BoringTime.otf") format("opentype"); font-display: swap; }

:root { --ink: #1a1b1f; --paper: #efe9dc; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); font-family: "Boring Time", Impact, sans-serif;
             -webkit-user-select: none; user-select: none; touch-action: none; }
canvas { display: block; }
button { font-family: inherit; cursor: pointer; }

#prompt, #toast, #help-keys { position: fixed; pointer-events: none; text-align: center; z-index: 5; }
/* place names: size / position come from ui.json (wurld3d.js) */
#tags { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.tag { position: absolute; left: 0; top: 0; font-family: "Wurld Bubble", "Boring Time", sans-serif; font-size: 44px; color: #fff; cursor: pointer;
       -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; opacity: 0; transition: opacity .25s; white-space: nowrap; will-change: transform; }
/* "enter", "sign up"...: a little speech bubble from Lotus, its tail pointing down at him (bubble look: popups.css) */
#prompt { font: 22px "Wurld Bubble", "Boring Time", sans-serif; color: var(--ink); white-space: nowrap; display: none;
          padding: .2em .65em .3em; --pop-tail: 14px; --pop-tail-left: calc(50% - 7px); --pop-shadow: 4px 4px 0 #1a1b1f;
          transform: translate(-50%, calc(-100% - 18px)); }
/* the zoom control (phones only), lettered like the inspector */
@font-face { font-family: "Hand Caps"; src: url("../assets/fonts/ArchitectsDaughter.woff2") format("woff2"); font-display: swap; }
#zoom { display: none; position: fixed; z-index: 6; left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top));
        flex-direction: column; align-items: center; padding: 2px 4px; --pop-tail: 0px; --pop-shadow: 4px 4px 0 #1a1b1f;
        font-family: "Hand Caps", "Comic Sans MS", cursive; color: var(--ink); user-select: none; -webkit-user-select: none; }
html.zoomable #zoom { display: flex; }
.zoom span { font-size: 13px; letter-spacing: .08em; line-height: 1; }
.zoom button { width: 40px; height: 34px; border: 0; background: none; font: 26px/1 "Hand Caps", "Comic Sans MS", cursive; color: inherit;
               touch-action: manipulation; }
.zoom button:disabled { opacity: .3; }
#toast { left: 50%; bottom: 90px; transform: translateX(-50%); background: #1a1b1fdd; color: #fff; padding: 10px 18px; border-radius: 10px;
         font-size: 18px; opacity: 0; transition: opacity .3s; }
#help-keys { left: 12px; bottom: 10px; font: 13px system-ui, sans-serif; color: var(--ink); background: #fff9; padding: 5px 9px; border-radius: 8px; text-align: left; }
#loading { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
           background: var(--paper); transition: opacity .5s; }
/* the loading picture fills the whole screen; the bar sits on top near the bottom */
#loading { justify-content: flex-end; padding-bottom: max(7vh, env(safe-area-inset-bottom)); }
#loading img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#loading img:not([src]) { visibility: hidden; }
#loading .bar { position: relative; z-index: 1; background: #ffffffb3; box-shadow: 0 0 0 2px #fff; }
#loading .bar { width: 240px; height: 6px; background: #0002; border-radius: 3px; overflow: hidden; }
#loading .fill { height: 100%; width: 0; background: var(--ink); transition: width .2s; }
#fade { position: fixed; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 40; }
#fade.on { opacity: 1; }

/* pages over the world: always a big, clear EXIT */
.layer { position: fixed; inset: 0; z-index: 30; background: #1a1b1fe6; display: flex; flex-direction: column; }
.layer[hidden] { display: none; }
.bar-top { display: flex; align-items: center; gap: 14px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; color: #fff; font-size: 20px; }
.exit { font-family: "Wurld Bubble", "Boring Time", sans-serif; font-size: 22px; background: #fff; color: var(--ink); border: 3px solid var(--ink);
        border-radius: 999px; padding: 10px 22px; min-height: 48px; box-shadow: 0 3px 0 #0006; }
.exit:active { transform: translateY(2px); box-shadow: none; }
#frame { flex: 1; border: 0; background: #fff; margin: 0 10px 10px; border-radius: 12px; }

[hidden] { display: none !important; }

/* Help (Q&A + Contact): a pop-up box, not a full page */
.layer.popup { background: rgba(10, 12, 18, 0.6); align-items: center; justify-content: center; padding: 16px; }
.popup-box { position: relative; width: min(760px, 100%); height: min(86vh, 900px); border: 3px solid #fff; border-radius: 12px; overflow: hidden;
             background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
.popup-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.popup-close { position: absolute; top: 8px; right: 10px; z-index: 1; width: 44px; height: 44px; border: 3px solid var(--ink); border-radius: 50%;
               background: #fff; color: var(--ink); font: 700 26px/1 system-ui, sans-serif; box-shadow: 0 3px 0 #0004; }

.mail-box { margin: auto; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 24px; width: min(420px, 86vw); text-align: center; }
.mail-icon { width: 120px; }
.mail-box h2 { font-family: "Wurld Bubble", sans-serif; font-weight: normal; font-size: 28px; margin: 8px 0 16px; }
.mail-box form { display: flex; gap: 8px; }
.mail-box input[type=email] { flex: 1; min-width: 0; font-size: 17px; padding: 12px; border-radius: 10px; border: 2px solid var(--ink); }
.mail-box button[type=submit] { font-size: 17px; padding: 12px 16px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; }


/* fast travel: one dot per place, spaced like the street; the ring is Lotus */
#dots { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(560px, 70vw); height: 28px; z-index: 6; }
#dots[hidden] { display: none; }
#dots .track { position: absolute; left: 0; right: 0; top: 13px; height: 2px; background: #fffd; box-shadow: 0 0 0 1px #1a1b1f44; }
#dots button { position: absolute; top: 6px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 2px solid #1a1b1f;
               background: #fff; padding: 0; cursor: pointer; }
#dots button:hover { transform: scale(1.3); }
#dots-you { position: absolute; top: 2px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; border: 3px solid #fff;
            box-shadow: 0 0 0 2px #1a1b1f; pointer-events: none; transition: left .08s linear; }
.touch #dots { bottom: max(18px, env(safe-area-inset-bottom)); top: auto; width: 76vw; }

/* phones and tablets: no keyboard hints (Lotus explains the taps and swipes - tutorial.js) */
.touch #help-keys { display: none; }
