/* Bonbon Voyage — pastel pop UI. Mobile first; everything sits on top of the 3D canvas. */
:root {
  --pink: #ff5fa8;
  --pink-2: #ff8fc7;
  --pink-soft: #ffe6f2;
  --lav: #b79cff;
  --mint: #7de3c8;
  --sky: #8fd3ff;
  --gold: #f5c66b;
  --gold-2: #e39a2b;
  --ink: #4a2a4f;
  --ink-soft: #94708f;
  --paper: #fffafc;
  --line: #f8d7e8;
  --shadow: 0 10px 28px rgba(255, 95, 168, 0.24);
  --shadow-s: 0 4px 12px rgba(255, 95, 168, 0.2);
  --font: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "M PLUS Rounded 1c", "Arial Rounded MT Bold", ui-rounded, system-ui, -apple-system, sans-serif;
  --top: max(10px, env(safe-area-inset-top));
  --bottom: max(10px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffd9ec; color: var(--ink); font-family: var(--font); font-size: 15px; overscroll-behavior: none; }
body { position: fixed; inset: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stage { position: fixed; inset: 0; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: auto; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
h2, h3, p { margin: 0; }
img { -webkit-user-drag: none; }
.hidden { display: none !important; }

/* ---- shared bits ---- */
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.grid8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.kicker { font-size: 11px; font-weight: 900; letter-spacing: 0.18em; color: var(--pink); }
.section-label { margin-top: 8px; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; color: var(--ink-soft); }
.fine { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.text-link { align-self: center; margin-top: 8px; font-size: 12px; color: var(--ink-soft); text-decoration: underline; }
.note { padding: 12px 14px; border-radius: 16px; background: var(--pink-soft); font-size: 13px; line-height: 1.6; }
.note p { color: var(--ink-soft); font-size: 12px; }
.note.warn { background: #fff3d6; }
.empty { padding: 28px 12px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.empty-icon { font-size: 34px; margin-bottom: 6px; }
.field { width: 100%; padding: 13px 16px; border: 2px solid var(--line); border-radius: 16px; background: #fff; font-size: 16px; outline: none; user-select: text; -webkit-user-select: text; resize: none; }
.field:focus { border-color: var(--pink-2); box-shadow: 0 0 0 4px rgba(255, 143, 199, 0.22); }
.fatal { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; padding: 30px; text-align: center; background: var(--paper); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.chip.open, .chip.here { background: #e2fbf2; border-color: #a9ecd6; color: #1f8f6b; }
.chip.locked { background: #fff0f6; color: var(--pink); }
.chip.soon { background: #f3effa; border-color: #e2daf5; color: #8f85a8; }
.chip.gold { background: linear-gradient(135deg, #fff3cf, #ffe1a1); border-color: #f3cf7e; color: #9b6a12; }
.chip.coin { background: #fff6da; border-color: #f6dc97; color: #9b6a12; }
.chip.gem { background: #eaf4ff; border-color: #bcdcff; color: #2a6fc0; }
.chip.link { border-color: var(--pink-2); color: var(--pink); background: #fff; }
.chip.role-owner { background: linear-gradient(135deg, #fff3cf, #ffe1a1); border-color: #f3cf7e; color: #9b6a12; }
.chip.role-admin { background: #efe9ff; border-color: #d6c9ff; color: #6b4fd0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 99px; font-weight: 900; font-size: 16px; text-decoration: none; white-space: nowrap; transition: transform 0.12s, filter 0.12s; }
.btn:active { transform: scale(0.95); }
.btn:disabled { filter: grayscale(0.7) opacity(0.55); pointer-events: none; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #ff8fc7, #ff4f9f); box-shadow: 0 5px 0 #d93484, var(--shadow); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
.btn-gold { color: #6d4706; background: linear-gradient(180deg, #ffe7a8, #f5c04f); box-shadow: 0 5px 0 #d19a2a, 0 10px 24px rgba(245, 198, 107, 0.4); }
.btn-soft { color: var(--pink); background: #fff; border: 2px solid var(--pink-2); box-shadow: 0 4px 0 #ffd0e6; }
.btn-ghost { color: var(--ink-soft); background: rgba(255, 255, 255, 0.85); border: 2px solid var(--line); }
.btn-s { min-height: 38px; padding: 0 14px; font-size: 13px; box-shadow: none; }
.btn-primary.btn-s { box-shadow: 0 3px 0 #d93484; }
.btn-gold.btn-s { box-shadow: 0 3px 0 #d19a2a; }
.btn-wide { width: 100%; }
.btn-icon { font-size: 1.15em; }
.icon-btn { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid var(--line); font-size: 17px; font-weight: 900; color: var(--ink-soft); box-shadow: var(--shadow-s); }
.icon-btn.pink { background: linear-gradient(180deg, #ff8fc7, #ff4f9f); border-color: #fff; color: #fff; }
.icon-btn:active { transform: scale(0.92); }

/* ---- toasts, veil, confetti ---- */
.toasts { position: absolute; top: calc(var(--top) + 172px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none !important; z-index: 90; }
.toast { display: flex; align-items: center; gap: 8px; max-width: 88vw; padding: 9px 16px 9px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.96); border: 2px solid var(--pink-2); box-shadow: var(--shadow); font-weight: 800; font-size: 13px; animation: pop-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); transition: opacity 0.3s, transform 0.3s; }
.toast.warn { border-color: #ffc96b; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast-icon { font-size: 18px; }
.veil { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: linear-gradient(160deg, #ffc1e0, #ffe7c9 60%, #c9e6ff); z-index: 100; transition: opacity 0.35s; }
.veil.out { opacity: 0; pointer-events: none !important; }
.veil-logo { font-size: 56px; animation: bob 1.1s ease-in-out infinite; }
.veil-text { font-weight: 900; color: #fff; font-size: 18px; text-shadow: 0 2px 0 var(--pink); letter-spacing: 0.04em; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none !important; z-index: 95; }
.confetti span { position: absolute; top: 46%; animation: burst 1.7s ease-out forwards; }
@keyframes burst { 0% { transform: translateY(0) scale(0.2) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-46vh) scale(1.3) rotate(260deg); opacity: 0; } }
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-12px) rotate(6deg); } }
@keyframes rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- sheets & dialogs ---- */
.sheet-wrap, .dialog-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; z-index: 60; transition: opacity 0.2s; }
.dialog-wrap { align-items: center; z-index: 80; }
.sheet-wrap.out, .dialog-wrap.out { opacity: 0; pointer-events: none !important; }
.backdrop { position: absolute; inset: 0; background: rgba(74, 42, 79, 0.36); animation: fade-in 0.2s; }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 82%; display: flex; flex-direction: column; background: var(--paper); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 40px rgba(74, 42, 79, 0.25); animation: rise 0.28s cubic-bezier(0.2, 1, 0.3, 1); }
.sheet.tall { height: 86%; }
.sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 9px; background: var(--line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 18px 10px; }
.sheet-title { font-size: 21px; font-weight: 900; line-height: 1.25; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px calc(var(--bottom) + 18px); display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.chat-sheet .sheet-body { overflow: hidden; }
.dialog { position: relative; width: min(340px, 88vw); padding: 24px 20px 20px; border-radius: 28px; background: var(--paper); text-align: center; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(74, 42, 79, 0.35); animation: pop-in 0.25s cubic-bezier(0.2, 1.4, 0.4, 1); }
.dialog-icon { font-size: 40px; }
.dialog h3 { font-size: 18px; }
.dialog p { font-size: 13px; color: var(--ink-soft); line-height: 1.6; white-space: pre-line; }
.dialog-thumb { width: 150px; height: 150px; margin: 0 auto; border-radius: 24px; background: linear-gradient(160deg, #ffe6f2, #efe9ff); }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 99px; background: var(--pink-soft); flex: none; }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; background: transparent; padding: 0; }
.tabs.scroll::-webkit-scrollbar { display: none; }
.tab { flex: 1; padding: 9px 12px; border-radius: 99px; font-weight: 900; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.tabs.scroll .tab { flex: none; background: #fff; border: 2px solid var(--line); }
.tab.on { background: #fff; color: var(--pink); box-shadow: var(--shadow-s); }
.tabs.scroll .tab.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; padding: 2px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--pink), 0 4px 10px rgba(255, 95, 168, 0.4); transform: scale(1.1); }
.face { border-radius: 50%; background: linear-gradient(160deg, #ffd3e8, #e3d9ff); border: 2.5px solid #fff; box-shadow: var(--shadow-s); object-fit: cover; flex: none; }

.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 20px; background: #fff; border: 2px solid var(--line); text-align: left; }
button.list-row:active { transform: scale(0.98); background: var(--pink-soft); }
.row-emoji { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--pink-soft); font-size: 24px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main p { font-size: 12px; color: var(--ink-soft); white-space: normal; }
.row-go { color: var(--pink-2); font-size: 22px; font-weight: 900; }
.row-time { color: var(--ink-soft); font-size: 11px; }
.row-face { position: relative; flex: none; display: flex; }
.row-face.online::after, .dot-online { content: ""; position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: #3ddc97; border: 2.5px solid #fff; }
.dot-online { position: static; display: inline-block; margin-left: 6px; }
.emoji-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 18px; background: #fff; border: 2px solid var(--line); font-size: 28px; }
.emoji-btn small { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.emoji-btn.plain { padding: 6px 0; font-size: 24px; border-color: transparent; background: transparent; }
.emoji-btn.on { border-color: var(--pink); background: var(--pink-soft); }
.emoji-btn:active { transform: scale(0.9); }

/* ---- HUD ---- */
.hud { position: absolute; inset: 0; pointer-events: none !important; }
.hud > * { pointer-events: auto; }
.hud.mode-hidden { display: none; }
.hud.mode-build .nav, .hud.mode-build .rail, .hud.mode-build .chat-log, .hud.mode-build .action, .hud.mode-build .place, .hud.mode-build .house-panel, .hud.mode-build .chat-bar, .hud.mode-build .me-chip { display: none; }
.hud-top { position: absolute; top: var(--top); left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud.mode-build .hud-top { justify-content: flex-end; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.92); border: 2px solid #fff; box-shadow: var(--shadow); min-width: 0; }
.me-face { display: flex; }
.me-info { min-width: 0; text-align: left; }
.me-name { font-weight: 900; font-size: 13.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-row { display: flex; align-items: center; gap: 6px; }
.me-level { font-size: 11px; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--lav), var(--pink)); padding: 1px 7px; border-radius: 99px; }
.xp-bar { width: 58px; height: 7px; border-radius: 9px; background: var(--pink-soft); overflow: hidden; }
.xp-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--gold), #ffb347); transition: width 0.5s; }
.wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pill { display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.94); border: 2px solid #fff; box-shadow: var(--shadow-s); font-weight: 900; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pill-icon { font-size: 17px; }
.pill.gem { padding-right: 4px; }
.pill-plus { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 15px; line-height: 1; }
.place { position: absolute; top: calc(var(--top) + 62px); left: 10px; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 18px; background: rgba(255, 255, 255, 0.9); border: 2px solid #fff; box-shadow: var(--shadow-s); text-align: left; max-width: 64vw; }
.place-flag { font-size: 24px; }
.place-text { display: flex; flex-direction: column; min-width: 0; }
.place-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-text small { font-size: 10.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-online { font-size: 11px; font-weight: 900; color: #1faf78; }
.house-panel { position: absolute; top: calc(var(--top) + 118px); left: 10px; right: 64px; display: flex; flex-wrap: wrap; gap: 6px; }
.house-btn { display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 13px; border-radius: 99px; background: rgba(255, 255, 255, 0.94); border: 2px solid #fff; box-shadow: var(--shadow-s); font-size: 13px; max-width: 150px; }
.house-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-btn.on { background: var(--pink-soft); border-color: var(--pink-2); color: var(--pink); }
.house-btn.build { background: linear-gradient(180deg, #ffe7a8, #f5c04f); color: #6d4706; }
.house-btn:disabled { opacity: 0.7; }
.rail { position: absolute; right: 10px; top: calc(var(--top) + 84px); display: flex; flex-direction: column; gap: 9px; }
.rail-btn { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.94); border: 2px solid #fff; box-shadow: var(--shadow-s); font-size: 21px; }
.rail-btn:active { transform: scale(0.9); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 900; border: 2px solid #fff; }
.nav { position: absolute; left: 50%; bottom: var(--bottom); transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: 28px; background: rgba(255, 255, 255, 0.92); border: 2px solid #fff; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 66px; padding: 6px 0 4px; border-radius: 20px; }
.nav-btn:active { background: var(--pink-soft); transform: scale(0.94); }
.nav-icon { font-size: 24px; line-height: 1.1; }
.nav-label { font-size: 10px; font-weight: 900; color: var(--ink-soft); }
.action { position: absolute; left: 50%; bottom: calc(var(--bottom) + 88px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 28px 0 20px; border-radius: 99px; color: #fff; font-weight: 900; font-size: 18px; background: linear-gradient(180deg, #ff8fc7, #ff4f9f); border: 3px solid #fff; box-shadow: 0 5px 0 #d93484, 0 0 0 0 rgba(255, 95, 168, 0.6); animation: pulse 1.4s infinite; }
.action-icon { font-size: 24px; }
/* Doors are walked through: the pill is a hint, not a call to tap. */
.action.hint { width: max-content; max-width: calc(100vw - 24px); white-space: nowrap; height: 44px; padding: 0 20px 0 14px; font-size: 14.5px; color: var(--pink); background: rgba(255, 255, 255, 0.92); border: 2px solid var(--pink-2); box-shadow: var(--shadow-s); animation: hint-bob 1.6s ease-in-out infinite; }
.action.hint .action-icon { font-size: 19px; }
.action.hint span:last-child { overflow: hidden; text-overflow: ellipsis; }
@keyframes hint-bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
/* One bite / sip of what you are holding. */
.eat-btn { position: absolute; right: 12px; bottom: calc(var(--bottom) + 150px); width: 84px; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 50%; color: #fff; font-weight: 900; background: radial-gradient(circle at 35% 30%, #ffb3d6, #ff5fa8 70%); border: 3px solid #fff; box-shadow: 0 5px 0 #d93484, var(--shadow); animation: pop-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.eat-btn:active { transform: scale(0.92); }
.eat-btn.chomp .eat-icon { animation: chomp 0.45s ease-out; }
.eat-icon { font-size: 30px; line-height: 1; }
.eat-label { font-size: 11.5px; line-height: 1.2; }
.eat-dots { display: flex; gap: 3px; margin-top: 2px; }
.eat-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.eat-dots i.on { background: #fff; }
@keyframes chomp { 0% { transform: scale(1); } 30% { transform: scale(1.35) rotate(-10deg); } 60% { transform: scale(0.9) rotate(6deg); } 100% { transform: scale(1); } }
.hud.mode-talk .eat-btn, .hud.mode-build .eat-btn { display: none; }
/* Turning the view: ◀ 🧭 🎥 ▶ (tap an arrow for 15°, hold to keep turning; 🧭 squares it to the roads). */
.cam { position: absolute; right: 12px; bottom: calc(var(--bottom) + 246px); display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.92); border: 2px solid #fff; box-shadow: var(--shadow-s); }
.cam-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-size: 17px; font-weight: 900; color: var(--pink); touch-action: none; user-select: none; -webkit-user-select: none; }
.cam-btn.view, .cam-btn.straight { font-size: 19px; }
.cam-btn.on, .cam-btn:active { background: var(--pink-soft); transform: scale(0.92); }
.hud.mode-talk .cam, .hud.mode-build .cam { display: none; }
/* Walk / run switch: under the view buttons, beside the bite button while you hold food. */
.run-btn { position: absolute; right: 12px; bottom: calc(var(--bottom) + 156px); width: 64px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 50%; color: var(--pink); font-weight: 900; background: rgba(255, 255, 255, 0.94); border: 2px solid #fff; box-shadow: var(--shadow-s); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.run-icon { font-size: 27px; line-height: 1; }
.run-label { font-size: 10.5px; line-height: 1.1; }
.run-btn.on { color: #fff; background: radial-gradient(circle at 35% 30%, #ffb3d6, #ff5fa8 70%); box-shadow: 0 4px 0 #d93484, var(--shadow-s); }
.run-btn:active { transform: scale(0.92); }
.eat-btn:not(.hidden) ~ .run-btn { right: 104px; }
.hud.mode-talk .run-btn, .hud.mode-build .run-btn { display: none; }
@keyframes pulse { 0% { box-shadow: 0 5px 0 #d93484, 0 0 0 0 rgba(255, 95, 168, 0.55); } 100% { box-shadow: 0 5px 0 #d93484, 0 0 0 18px rgba(255, 95, 168, 0); } }
.chat-log { position: absolute; left: 10px; bottom: calc(var(--bottom) + 158px); width: min(64vw, 320px); display: flex; flex-direction: column; gap: 4px; pointer-events: none !important; }
.chat-line { align-self: flex-start; max-width: 100%; padding: 5px 11px; border-radius: 14px; background: rgba(255, 255, 255, 0.86); font-size: 12.5px; line-height: 1.4; transition: opacity 0.5s; animation: pop-in 0.25s; overflow-wrap: anywhere; }
.chat-line b { color: var(--pink); margin-right: 6px; }
.chat-line.out { opacity: 0; }
.chat-bar { position: absolute; left: 10px; right: 10px; bottom: calc(var(--bottom) + 84px); display: flex; gap: 8px; max-width: 500px; margin: 0 auto; z-index: 2; }
.chat-input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 99px; border: 2px solid var(--pink-2); background: #fff; font-size: 16px; outline: none; user-select: text; -webkit-user-select: text; box-shadow: var(--shadow); }
.xp-pop { position: absolute; top: calc(var(--top) + 58px); left: 70px; font-weight: 900; font-size: 14px; color: #fff; text-shadow: 0 2px 0 var(--gold-2); pointer-events: none !important; animation: float-up 1.3s ease-out forwards; z-index: 92; }
@keyframes float-up { 0% { transform: translateY(8px) scale(0.6); opacity: 0; } 20% { transform: translateY(0) scale(1.15); opacity: 1; } 100% { transform: translateY(-34px); opacity: 0; } }
.levelup { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none !important; z-index: 93; transition: opacity 0.3s; }
.levelup.out { opacity: 0; }
.levelup-card { padding: 22px 40px; border-radius: 30px; text-align: center; background: linear-gradient(160deg, #fff, #fff3cf); border: 3px solid var(--gold); box-shadow: 0 20px 60px rgba(245, 198, 107, 0.6); animation: pop-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
.levelup-num { font-weight: 900; color: var(--gold-2); line-height: 1; margin: 6px 0 12px; }
.levelup-num small { font-size: 24px; }
.levelup-num b { font-size: 68px; }
.reward-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ---- language picker ---- */
.lang-switch { display: inline-flex; gap: 3px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.92); border: 2px solid #fff; box-shadow: var(--shadow-s); align-self: flex-start; }
.lang-btn { padding: 6px 13px; border-radius: 99px; font-weight: 800; font-size: 12.5px; color: var(--ink-soft); }
.lang-btn.on { background: var(--pink); color: #fff; }
.title-screen .lang-switch { position: absolute; top: var(--top); right: 12px; z-index: 1; }

/* ---- sound ---- */
.title-screen .sound-toggle { position: absolute; top: var(--top); left: 12px; z-index: 1; }
.volume-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--line); }
.volume-row span { flex: none; width: 108px; font-weight: 800; font-size: 13px; }
.volume-row input { flex: 1; min-width: 0; accent-color: var(--pink); height: 28px; }

/* ---- title & onboarding ---- */
.title-screen { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 18px 16px calc(var(--bottom) + 22px); background: linear-gradient(180deg, rgba(255, 190, 224, 0) 30%, rgba(255, 150, 205, 0.5)); overflow-y: auto; }
.title-card { width: 100%; max-width: 440px; padding: 24px 20px; border-radius: 32px; background: rgba(255, 250, 252, 0.94); border: 3px solid #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; text-align: center; animation: rise 0.45s cubic-bezier(0.2, 1, 0.3, 1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.title-card h2 { font-size: 21px; }
.logo { display: flex; flex-direction: column; line-height: 0.92; font-weight: 900; letter-spacing: -0.01em; }
.logo-a { font-size: 58px; color: var(--pink); text-shadow: 0 3px 0 #fff, 0 6px 0 #ffc1df, 0 12px 20px rgba(255, 95, 168, 0.35); }
.logo-b { font-size: 46px; font-style: italic; color: var(--gold-2); text-shadow: 0 3px 0 #fff, 0 6px 0 #ffe3a6; margin-left: 76px; }
.tagline { font-weight: 800; font-size: 14.5px; }
.title-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.title-points span { padding: 5px 11px; border-radius: 99px; background: var(--pink-soft); font-size: 12px; font-weight: 800; }
.home-cards { display: flex; flex-direction: column; gap: 8px; }
.home-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 14px; border-radius: 20px; background: #fff; border: 2.5px solid var(--line); text-align: left; }
.home-card.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, #fff); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.home-flag { grid-row: span 2; font-size: 36px; }
.home-main { display: flex; align-items: baseline; gap: 8px; }
.home-main b { font-size: 16px; }
.home-main small { font-size: 12px; color: var(--ink-soft); }
.home-tag { font-size: 11.5px; color: var(--ink-soft); }

/* ---- avatar studio / tiles ---- */
.studio, .photo-ui, .build-ui, .flight { position: absolute; inset: 0; pointer-events: none !important; display: flex; flex-direction: column; justify-content: space-between; z-index: 30; }
.studio > *, .photo-ui > *, .build-ui > *, .flight > * { pointer-events: auto; }
.studio-top, .photo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: var(--top) 12px 0; }
.studio-heading { flex: 1; text-align: center; }
.studio-hint, .photo-hint { font-size: 11.5px; color: var(--ink); font-weight: 800; background: rgba(255, 255, 255, 0.7); border-radius: 99px; padding: 3px 10px; display: inline-block; }
.studio-panel { width: 100%; max-width: 520px; height: 52%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px calc(var(--bottom) + 10px); background: var(--paper); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 40px rgba(74, 42, 79, 0.22); animation: rise 0.3s cubic-bezier(0.2, 1, 0.3, 1); }
.studio-bar { display: flex; align-items: center; gap: 8px; flex: none; }
.studio-bar .tabs { flex: 1; min-width: 0; }
.studio-content { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.studio-offer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 16px; background: #fff3d6; flex: none; }
.offer-text { display: flex; flex-direction: column; font-size: 12.5px; }
.offer-text small { color: var(--ink-soft); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 7px; border-radius: 18px; background: #fff; border: 2.5px solid var(--line); min-width: 0; }
.tile:active { transform: scale(0.95); }
.tile.on { border-color: var(--pink); background: var(--pink-soft); box-shadow: var(--shadow-s); }
.tile.locked .tile-img { filter: saturate(0.75) opacity(0.82); }
.tile.owned { opacity: 0.6; }
.tile-img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: linear-gradient(160deg, #fff3f8, #f3efff); }
.tile-none { width: 100%; aspect-ratio: 1; display: grid; place-items: center; font-size: 28px; color: var(--ink-soft); }
.tile-name { font-size: 10.5px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-lock, .tile-price { font-size: 10px; font-weight: 900; color: var(--pink); white-space: nowrap; }
.tile-tag { position: absolute; top: 4px; right: 5px; font-size: 12px; color: var(--gold-2); }
.tile-tag.flag { left: 5px; right: auto; font-size: 14px; }
.tile-count { font-size: 10.5px; font-weight: 900; color: #1f8f6b; white-space: nowrap; }
.tile-lock.ready { color: #1f8f6b; }
.choice-row, .photo-poses { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { padding: 8px 13px; border-radius: 99px; background: #fff; border: 2px solid var(--line); font-size: 12.5px; font-weight: 800; }
.choice.on { background: var(--pink); border-color: var(--pink); color: #fff; }

/* ---- world map ---- */
.map-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: linear-gradient(170deg, #fff6fb 0%, #f3ecff 55%, #e6f4ff 100%); z-index: 40; animation: fade-in 0.25s; transition: opacity 0.2s; }
.map-screen.out { opacity: 0; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; padding: calc(var(--top) + 4px) 16px 6px; }
.map-head h2 { font-size: 24px; font-weight: 900; }
.map-meta { display: flex; gap: 8px; padding: 0 16px 8px; }
.map-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-inner { position: relative; flex: none; margin: auto 0; background-size: 100% 100%; }
.map-arcs { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.arc { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 2 10; animation: dash 1.2s linear infinite; }
.arc.open { stroke: var(--gold-2); }
.arc.locked { stroke: #d9bfe0; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 1; }
.pin-dot { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 3px solid var(--pink-2); font-size: 20px; box-shadow: var(--shadow-s); }
.pin-name { margin-top: 2px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.9); font-size: 10px; font-weight: 900; white-space: nowrap; }
.pin.here { z-index: 3; }
.pin.here .pin-dot { border-color: var(--gold-2); box-shadow: 0 0 0 0 rgba(227, 154, 43, 0.6); animation: ring 1.5s infinite; }
@keyframes ring { to { box-shadow: 0 0 0 16px rgba(227, 154, 43, 0); } }
.pin.open .pin-dot { border-color: #3ddc97; }
.pin.locked { z-index: 2; }
.pin.soon { opacity: 0.75; }
.pin.soon .pin-dot { width: 26px; height: 26px; font-size: 13px; border-color: #d9d0ea; filter: grayscale(0.5); }
.pin.soon .pin-name { display: none; }
.pin-lock { position: absolute; top: -6px; right: -8px; font-size: 13px; }
.pin-you { position: absolute; top: -15px; padding: 0 6px; border-radius: 99px; background: var(--gold-2); color: #fff; font-size: 9px; font-weight: 900; }
.pin.stamped .pin-dot { background: #fff8e0; }
.map-cards { display: flex; gap: 10px; overflow-x: auto; padding: 10px 16px calc(var(--bottom) + 14px); scrollbar-width: none; flex: none; }
.map-cards::-webkit-scrollbar { display: none; }
.map-card { position: relative; flex: none; width: 132px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; border-radius: 22px; background: #fff; border: 2.5px solid var(--line); text-align: left; box-shadow: var(--shadow-s); }
.map-card.here { border-color: var(--gold); }
.map-card.soon { opacity: 0.7; }
.map-card b { font-size: 15px; }
.map-card small { font-size: 11px; color: var(--ink-soft); margin-bottom: 4px; }
.map-card-flag { font-size: 30px; line-height: 1; }
.map-card-stamp { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #fff; font-size: 12px; font-weight: 900; }

.country-hero { position: relative; padding: 16px; border-radius: 24px; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 26%, #fff), #fff); border: 2px solid color-mix(in srgb, var(--accent) 40%, #fff); min-height: 118px; }
.country-city { font-size: 22px; font-weight: 900; }
.country-hero p { font-size: 13px; color: var(--ink-soft); max-width: 62%; line-height: 1.6; margin-top: 4px; }
.country-hero .stamp, .country-hero .stamp-empty { position: absolute; right: 12px; top: 12px; }
.stamp-empty { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; border: 2.5px dashed #d8c2dc; color: #c5aecb; font-size: 9.5px; font-weight: 900; text-align: center; }
.thumb-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.thumb { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.thumb img { width: 78px; height: 78px; border-radius: 16px; background: linear-gradient(160deg, #fff3f8, #f3efff); border: 2px solid var(--line); }
.thumb small { font-size: 10px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passport-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; background: #fff; border: 2px solid var(--line); }
.passport-mini { flex: none; width: 36px; height: 48px; display: grid; place-items: center; border-radius: 7px 10px 10px 7px; color: rgba(255, 255, 255, 0.92); font-size: 16px; box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.14), var(--shadow-s); }
.passport-row .row-main small { white-space: normal; }

/* ---- gate, flight, arrival ---- */
.gate, .arrival { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(74, 42, 79, 0.5); z-index: 70; animation: fade-in 0.25s; transition: opacity 0.3s; }
.gate.out, .arrival.out { opacity: 0; pointer-events: none !important; }
.gate-board { width: min(340px, 90vw); padding: 24px; border-radius: 28px; background: #3a2f52; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4); animation: pop-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.gate-board .kicker { color: var(--gold); }
.gate-route { display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 38px; font-weight: 900; letter-spacing: 0.06em; }
.gate-route span { color: var(--pink-2); font-size: 28px; }
.gate-cities { font-size: 12px; opacity: 0.8; }
.gate-passport { font-size: 52px; animation: bob 1s ease-in-out infinite; }
.gate-check { padding: 9px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); font-weight: 900; letter-spacing: 0.12em; font-size: 13px; }
.gate-check.ok { background: #3ddc97; color: #0f5a40; animation: pop-in 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); }
.flight-top { padding: calc(var(--top) + 8px) 14px 0; }
.flight-route { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 24px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); max-width: 520px; margin: 0 auto; }
.flight-route > div:not(.flight-track) { display: flex; flex-direction: column; align-items: center; }
.flight-route b { font-size: 22px; font-weight: 900; letter-spacing: 0.05em; }
.flight-route small { font-size: 10px; color: var(--ink-soft); white-space: nowrap; }
.flight-track { position: relative; flex: 1; height: 6px; border-radius: 9px; background: var(--pink-soft); }
.flight-fill { height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--pink-2), var(--gold)); }
.flight-plane { position: absolute; top: -13px; left: 0; transform: translateX(-50%); font-size: 22px; color: var(--pink); }
.flight-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 16px calc(var(--bottom) + 18px); }
.flight-fact { width: 100%; max-width: 480px; padding: 14px 18px; border-radius: 22px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); }
.flight-fact p { margin-top: 4px; font-size: 14px; font-weight: 700; line-height: 1.6; }
.arrival-card { width: min(360px, 92vw); padding: 24px 20px 20px; border-radius: 30px; background: var(--paper); text-align: center; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(74, 42, 79, 0.4); animation: pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.arrival-card h2 { font-size: 22px; }
.arrival-text { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.passport-page { position: relative; height: 176px; display: grid; place-items: center; border-radius: 18px; background: #fff8ec; border: 2px solid #f1e0c4; overflow: hidden; }
.page-lines { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 21px, rgba(227, 154, 43, 0.14) 21px 22px), radial-gradient(circle at 20% 30%, rgba(255, 143, 199, 0.16) 0 32px, transparent 33px), radial-gradient(circle at 82% 70%, rgba(183, 156, 255, 0.16) 0 40px, transparent 41px); }

.stamp { position: relative; width: 132px; height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; color: var(--c); border: 4px double var(--c); outline: 2px solid var(--c); outline-offset: 4px; transform: rotate(var(--tilt, -8deg)); font-weight: 900; line-height: 1.15; background: color-mix(in srgb, var(--c) 7%, transparent); mix-blend-mode: multiply; }
.stamp-top { font-size: 8.5px; letter-spacing: 0.24em; }
.stamp-flag { font-size: 24px; }
.stamp-name { font-size: 15px; letter-spacing: 0.08em; }
.stamp-city { font-size: 8.5px; }
.stamp-date { font-size: 8.5px; letter-spacing: 0.08em; margin-top: 1px; }
.stamp.small { width: 92px; height: 92px; outline-offset: 3px; border-width: 3px; }
.stamp.small .stamp-flag { font-size: 16px; }
.stamp.small .stamp-name { font-size: 10.5px; }
.stamp.small .stamp-top, .stamp.small .stamp-city, .stamp.small .stamp-date { font-size: 6.5px; }
.stamp.slam { animation: slam 0.5s 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.stamp.faded { opacity: 0.55; }
@keyframes slam { 0% { transform: scale(3) rotate(18deg); opacity: 0; } 60% { transform: scale(0.92) rotate(var(--tilt)); opacity: 1; } 100% { transform: scale(1) rotate(var(--tilt)); opacity: 1; } }

/* ---- passport book ---- */
.passport-cover { position: relative; flex: none; height: 168px; padding: 18px; border-radius: 12px 26px 26px 12px; background: linear-gradient(140deg, color-mix(in srgb, var(--cover) 82%, #fff), var(--cover)); color: rgba(255, 255, 255, 0.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: inset 10px 0 0 rgba(0, 0, 0, 0.1), inset 0 0 0 2px rgba(255, 255, 255, 0.35), var(--shadow); }
.cover-emblem { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.9); font-size: 26px; margin-bottom: 6px; }
.cover-title { font-size: 24px; font-weight: 900; letter-spacing: 0.3em; margin-right: -0.3em; }
.cover-sub { font-size: 12px; font-weight: 800; opacity: 0.95; }
.cover-brand { position: absolute; bottom: 10px; font-size: 9px; letter-spacing: 0.3em; opacity: 0.8; }
.id-page { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: #fff8ec; border: 2px solid #f1e0c4; }
.id-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.id-lines div { display: flex; flex-direction: column; }
.id-lines small { font-size: 8.5px; letter-spacing: 0.16em; color: #b8935a; font-weight: 900; }
.id-lines b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 12px 6px; justify-items: center; padding: 12px 6px; border-radius: 20px; background: #fff8ec; border: 2px solid #f1e0c4; }
.stamp-slot { width: 92px; height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 50%; border: 2.5px dashed #e3cfae; color: #c2a67a; }
.stamp-slot .slot-flag { font-size: 22px; filter: grayscale(1) opacity(0.45); }
.stamp-slot small { font-size: 8.5px; font-weight: 900; letter-spacing: 0.06em; }
.stamp-slot.soon { border-style: dotted; opacity: 0.65; }

/* ---- land & build ---- */
.land-hero { display: flex; gap: 16px; align-items: center; }
.land-grid { flex: none; width: 124px; height: 124px; border-radius: 16px; border: 3px solid #fff; box-shadow: var(--shadow-s); background-color: #c9f0d2; background-image: linear-gradient(rgba(255, 255, 255, 0.75) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(255, 255, 255, 0.75) 1.5px, transparent 1.5px); background-size: calc(100% / var(--n)) calc(100% / var(--n)); }
.stat { display: flex; flex-direction: column; }
.stat small { font-size: 10.5px; color: var(--ink-soft); font-weight: 800; }
.stat b { font-size: 16px; }
.stat b.price { color: var(--pink); font-size: 20px; }
.build-top { display: flex; align-items: center; gap: 6px; padding: calc(var(--top) + 78px) 10px 0; flex-wrap: wrap; }
.build-count { padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.94); font-weight: 900; font-size: 12.5px; box-shadow: var(--shadow-s); }
.build-top .btn { margin-left: auto; padding: 0 12px; }
.seg { display: flex; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-s); }
.seg-btn { padding: 5px 11px; border-radius: 99px; font-weight: 900; font-size: 13px; color: var(--ink-soft); }
.seg-btn.on { background: var(--pink); color: #fff; }
.build-panel { width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 12px calc(var(--bottom) + 8px); display: flex; flex-direction: column; gap: 9px; background: var(--paper); border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(74, 42, 79, 0.22); animation: rise 0.3s cubic-bezier(0.2, 1, 0.3, 1); }
.tool-row { display: flex; align-items: center; gap: 6px; }
.tool { display: flex; flex-direction: column; align-items: center; width: 52px; padding: 5px 0 4px; border-radius: 16px; background: #fff; border: 2px solid var(--line); font-size: 18px; line-height: 1.15; }
.tool small { font-size: 9.5px; font-weight: 900; color: var(--ink-soft); }
.tool.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.tool.on small { color: #fff; }
.tool-hint { flex: 1; min-width: 0; text-align: right; font-size: 11.5px; font-weight: 800; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-items { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.build-items::-webkit-scrollbar { display: none; }
.build-items .tile { flex: none; width: 84px; }
.build-panel .swatches { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px; }
.build-panel .swatch { flex: none; width: 30px; height: 30px; }

/* ---- chat threads ---- */
.thread { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.thread-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; -webkit-overflow-scrolling: touch; }
.thread-form { display: flex; gap: 8px; flex: none; }
.sticker-tray { display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px; border-radius: 18px; background: var(--pink-soft); flex: none; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.msg.mine { align-self: flex-end; }
.msg-face { flex: none; display: flex; }
.msg-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg.mine .msg-main { align-items: flex-end; }
.msg-name { font-size: 10.5px; font-weight: 800; color: var(--ink-soft); }
.msg-text { padding: 9px 13px; border-radius: 18px 18px 18px 6px; background: #fff; border: 2px solid var(--line); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.msg.mine .msg-text { border-radius: 18px 18px 6px 18px; background: linear-gradient(180deg, #ff9fcf, #ff6fb0); border-color: transparent; color: #fff; }
.msg-sticker { font-size: 52px; line-height: 1.1; }
.msg-time { font-size: 9.5px; color: #c2a8c0; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment-main { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 6px 18px 18px 18px; background: #fff; border: 2px solid var(--line); }
.comment-main b { font-size: 12.5px; margin-right: 6px; }
.comment-main small { font-size: 10px; color: var(--ink-soft); }
.comment-main p { font-size: 13.5px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }

/* ---- profile ---- */
.profile-hero { display: flex; align-items: flex-end; gap: 6px; padding: 12px 14px 0 4px; border-radius: 26px; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 34%, #fff), #fff5fb 70%); border: 2px solid #fff; box-shadow: var(--shadow-s); flex: none; overflow: hidden; }
.profile-portrait { width: 128px; height: 168px; object-fit: cover; object-position: center 20%; flex: none; margin-bottom: -4px; }
.profile-id { flex: 1; min-width: 0; padding-bottom: 14px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.profile-name { font-size: 22px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-badge { display: inline-flex; align-items: baseline; gap: 2px; padding: 2px 16px 3px; border-radius: 99px; color: #fff; background: linear-gradient(135deg, var(--gold), #ff9f4a); box-shadow: 0 4px 0 #d98a2a, 0 8px 18px rgba(245, 198, 107, 0.5); }
.level-badge small { font-size: 13px; font-weight: 900; }
.level-badge b { font-size: 30px; line-height: 1.1; }
.profile-title { font-size: 13px; font-weight: 900; color: var(--pink); letter-spacing: 0.04em; }
.flag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.flag-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.9); font-size: 15px; }
.flag-chip small { font-size: 10px; font-weight: 800; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: none; }
.stat-row .stat { align-items: center; padding: 8px 2px; border-radius: 16px; background: #fff; border: 2px solid var(--line); }
.bio { font-size: 13.5px; line-height: 1.7; padding: 10px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--line); overflow-wrap: anywhere; }

/* ---- community ---- */
.comm-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 16px; font-size: 24px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), var(--shadow-s); }
.comm-icon.big { width: 54px; height: 54px; font-size: 30px; border-radius: 20px; }
.comm-head { display: flex; align-items: center; gap: 12px; flex: none; }
.comm-head .row-main b { font-size: 18px; }
.comm-content { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.comm-content.chat { overflow: hidden; }
.event-card { display: flex; gap: 12px; padding: 12px; border-radius: 20px; background: #fff; border: 2px solid var(--line); }
.event-date { flex: none; width: 50px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 14px; background: linear-gradient(180deg, #ff8fc7, #ff5fa8); color: #fff; line-height: 1.1; }
.event-date b { font-size: 22px; }
.event-date small { font-size: 10px; font-weight: 800; }

/* ---- shop, missions, photo ---- */
.gem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gem-pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 4px 10px; border-radius: 22px; background: linear-gradient(170deg, #fff, #eaf4ff); border: 2.5px solid #cfe4ff; }
.gem-pack:active { transform: scale(0.95); }
.gem-pack b { font-size: 19px; }
.gem-pack small { font-size: 10px; color: var(--ink-soft); }
.pack-icon { font-size: 32px; }
.pack-price { margin-top: 6px; padding: 4px 10px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 900; white-space: nowrap; }
.pack-badge { position: absolute; top: -8px; right: -4px; padding: 2px 9px; border-radius: 99px; background: var(--gold); color: #6d4706; font-size: 10px; font-weight: 900; }
.mission { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; background: #fff; border: 2px solid var(--line); }
.mission.claimed { opacity: 0.55; }
.mission .row-main b, .mission .row-main small { white-space: normal; }
.mission.bonus { background: linear-gradient(135deg, #fff9e6, #fff); border-color: #f3dfa6; }
.mission-icon { font-size: 28px; }
.bar { height: 8px; border-radius: 9px; background: var(--pink-soft); overflow: hidden; margin: 3px 0 1px; }
.bar-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--pink-2), var(--pink)); transition: width 0.4s; }
.photo-top .choice { box-shadow: var(--shadow-s); }
.photo-bottom { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 14px calc(var(--bottom) + 18px); }
.photo-poses { justify-content: center; }
.photo-poses .choice { box-shadow: var(--shadow-s); }
.shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 6px solid var(--pink); box-shadow: 0 0 0 4px #fff, var(--shadow); }
.shutter:active { transform: scale(0.9); background: var(--pink-soft); }
.photo-result { width: auto; max-width: 100%; max-height: 52vh; align-self: center; border-radius: 20px; box-shadow: var(--shadow); }

@media (min-width: 760px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 30px; max-height: 84%; }
  .sheet.tall { height: 84%; }
  .sheet::before { display: none; }
  .sheet-head { padding-top: 18px; }
  .title-screen { align-items: center; }
  .me-name { max-width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---- talking to shop staff ---- */
.talk { position: absolute; left: 10px; right: 10px; bottom: var(--bottom); max-width: 520px; margin: 0 auto; max-height: 70vh; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 28px; background: var(--paper); border: 3px solid #fff; box-shadow: var(--shadow); z-index: 20; animation: talk-in 0.22s ease-out; transition: opacity 0.2s, transform 0.2s; }
.talk.out { opacity: 0; transform: translateY(12px); }
@keyframes talk-in { from { opacity: 0; transform: translateY(16px); } }
.talk-head { display: flex; align-items: center; gap: 10px; }
.talk-face { flex: none; width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(160deg, #ffe6f2, #efe9ff); border: 3px solid var(--pink-2); object-fit: cover; }
.talk-who { flex: 1; display: flex; flex-direction: column; }
.talk-who b { font-size: 16px; }
.talk-who small { font-size: 11px; font-weight: 900; letter-spacing: 0.1em; color: var(--pink); }
.talk-close { flex: none; }
.talk-bubble { position: relative; padding: 12px 14px; border-radius: 20px; background: #fff; border: 2px solid var(--line); cursor: pointer; }
.talk-bubble::before { content: ''; position: absolute; top: -9px; left: 22px; border: 8px solid transparent; border-bottom-color: var(--line); border-top: 0; }
.talk-text { min-height: 3.2em; font-size: 15px; line-height: 1.65; white-space: pre-line; }
.talk-extra { display: flex; justify-content: center; margin-top: 8px; }
.talk-image { border-radius: 22px; background: linear-gradient(160deg, #ffe6f2, #efe9ff); }
.talk-choices { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.talk-choices.busy { opacity: 0.5; pointer-events: none; }
.talk-choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--line); text-align: left; font-weight: 800; font-size: 14.5px; animation: talk-in 0.18s ease-out backwards; }
.talk-choice:nth-child(2) { animation-delay: 0.04s; }
.talk-choice:nth-child(3) { animation-delay: 0.08s; }
.talk-choice:nth-child(4) { animation-delay: 0.12s; }
.talk-choice:active { transform: scale(0.98); background: var(--pink-soft); }
.talk-choice.primary { background: linear-gradient(180deg, #ff8fc7, #ff4f9f); border-color: #fff; color: #fff; box-shadow: 0 3px 0 #d93484; }
.talk-choice-icon { flex: none; width: 26px; text-align: center; font-size: 19px; }
.talk-choice-label { flex: 1; }
.talk-choice small { flex: none; font-size: 12.5px; font-weight: 900; color: var(--pink); }
.talk-choices.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.talk-choices.grid .talk-choice { flex-wrap: wrap; gap: 4px 8px; padding: 9px 11px; font-size: 13.5px; }
.talk-choices.grid .talk-choice-label { flex: 1 1 60%; }
.talk-choices.grid .talk-choice small { flex-basis: 100%; padding-left: 34px; }
.talk-image { width: 104px; height: 104px; }
.hud.mode-talk .nav, .hud.mode-talk .rail, .hud.mode-talk .chat-log, .hud.mode-talk .action, .hud.mode-talk .place, .hud.mode-talk .house-panel, .hud.mode-talk .chat-bar, .hud.mode-talk .me-chip { display: none; }
.hud.mode-talk .hud-top { justify-content: flex-end; }
.talk-choice.primary small { color: #fff; }

/* Members cards (ui/card.js): a stamp per order, members-only dishes at 5 and 10. */
.mcard-pop { position: absolute; left: 50%; top: calc(var(--top) + 64px); transform: translateX(-50%); width: min(92vw, 360px); z-index: 30; display: flex; flex-direction: column; gap: 6px; animation: card-in 0.35s cubic-bezier(0.2, 1.3, 0.4, 1); transition: opacity 0.25s, transform 0.25s; }
.mcard-pop.out { opacity: 0; transform: translateX(-50%) translateY(-12px); }
@keyframes card-in { from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); } }
.mcard-banner { align-self: center; padding: 6px 16px; border-radius: 99px; background: linear-gradient(180deg, #ffe07a, #f5b73b); color: #6a3a00; font-weight: 900; font-size: 14px; border: 2px solid #fff; box-shadow: var(--shadow-s); animation: pop-in 0.4s 0.5s backwards cubic-bezier(0.2, 1.5, 0.4, 1); }
.mcard { --card: #a8714a; padding: 12px 14px; border-radius: 20px; border: 3px solid #fff; box-shadow: var(--shadow); background: linear-gradient(135deg, color-mix(in srgb, var(--card) 16%, #fff) 0%, #fffdf8 62%); }
.mcard-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 2px dashed color-mix(in srgb, var(--card) 35%, #fff); }
.mcard-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--card); font-size: 21px; }
.mcard-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.mcard-title small { font-size: 10px; font-weight: 900; letter-spacing: 0.12em; color: var(--card); }
.mcard-title b { font-size: 14.5px; }
.mcard-owner { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.mcard-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px 6px 8px; }
.mcard-slot { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--card) 45%, #fff); background: #fff; }
.mcard-slot.goal { border-style: solid; border-color: var(--gold); background: #fff8e6; }
.mcard-n { font-size: 12px; font-weight: 900; color: color-mix(in srgb, var(--card) 50%, #fff); }
.mcard-slot.on { border: 3px solid #e8475f; background: #fff0f2; }
.mcard-slot.on em { font-style: normal; font-size: 22px; line-height: 1; transform: rotate(var(--tilt)); }
.mcard-slot.fresh em { animation: slam 0.45s 0.25s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.mcard-goal { position: absolute; top: -8px; right: -8px; font-size: 14px; }
.mcard-count { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.mcard-extra { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); }
.mcard-next { margin-top: 2px; font-size: 12.5px; font-weight: 800; color: var(--pink); }
.mcard-perks { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.mcard-perk { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: #f6f2f7; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.mcard-perk.open { background: #fff4d6; color: var(--ink); }
.mcard-perk-icon { font-size: 17px; }
.mcard-perk-name { flex: 1; }
.mcard-perk small { font-size: 11px; }
/* Popping up after an order (over the conversation): just the stamps. */
.mcard-pop.compact .mcard-perks { display: none; }
.mcard-pop.compact .mcard-slots { gap: 6px; padding: 8px 26px 6px; }
.mcard-pop.compact .mcard-slot.on em { font-size: 19px; }
.mcard-tap { align-self: center; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(150, 40, 100, 0.7); }

/* ---- farm: the bag, the workbench, the market ---- */
.house-btn.harvest { background: linear-gradient(180deg, #e2fbd8, #a8e68f); border-color: #fff; color: #2f6b1f; animation: farm-bob 1.6s ease-in-out infinite; }
@keyframes farm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.farm-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 14px; background: #eefbe6; color: #3f7a2a; font-size: 11.5px; font-weight: 800; line-height: 1.4; }
.farm-strip .chip { flex: none; }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.bag-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 18px; background: #fff; border: 2.5px solid var(--line); min-width: 0; }
.bag-cell:active { transform: scale(0.95); }
.bag-pic { width: 52px; height: 52px; display: grid; place-items: center; font-size: 34px; line-height: 1; }
.bag-pic.thumb, .recipe-pic.thumb, .thing-pic.thumb { object-fit: contain; border-radius: 12px; background: linear-gradient(160deg, #fff3f8, #f3efff); }
.bag-name { font-size: 10.5px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-qty { font-size: 12px; font-weight: 900; color: var(--pink); }
.thing-hero { display: flex; align-items: center; gap: 14px; }
.thing-hero small { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.thing-pic { flex: none; width: 92px; height: 92px; display: grid; place-items: center; font-size: 60px; border-radius: 24px; background: linear-gradient(160deg, #fff3f8, #f3efff); }
.recipe { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 20px; background: #fff; border: 2px solid var(--line); }
.recipe.ready { border-color: #a9ecd6; background: #f6fffb; }
.recipe-pic { flex: none; width: 50px; height: 50px; display: grid; place-items: center; font-size: 30px; border-radius: 14px; background: var(--pink-soft); }
.recipe-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recipe-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-main small { font-size: 11px; color: var(--ink-soft); line-height: 1.4; }
.need-row { display: flex; flex-wrap: wrap; gap: 4px; }
.need { padding: 2px 7px; border-radius: 99px; background: #fff0f0; color: #d2545f; font-size: 11px; font-weight: 900; white-space: nowrap; }
.need.ok { background: #e2fbf2; color: #1f8f6b; }
.buy-btns { flex: none; display: flex; flex-direction: column; gap: 5px; }
.buy-btns .btn-s { min-height: 32px; padding: 0 10px; font-size: 12px; }
.market-note b { font-size: 18px; color: #9b6a12; }
