:root {
  --bg: #0b1024;
  --glass: rgba(16, 20, 40, 0.66);
  --glass-strong: rgba(16, 20, 40, 0.86);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f6ff;
  --muted: rgba(230, 236, 255, 0.66);
  --accent: #7c5cff;
  --accent2: #22c1ff;
  --good: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5d73;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; touch-action: none; }
input { user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
#fade { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; z-index: 50; }
#fade.on { opacity: 1; }

.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28); }

/* ---------- brand ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 26px; letter-spacing: -0.5px; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.big-logo { font-size: 44px; }
.cube { width: 1em; height: 1em; display: inline-block; position: relative; transform: rotate(45deg) skew(-8deg, -8deg); border-radius: 5px; background: linear-gradient(135deg, #8b6bff, #22c1ff); box-shadow: inset -5px -5px 0 rgba(0,0,0,0.15), 0 4px 16px rgba(124,92,255,0.6); }
.planet-logo { width: 1.05em; height: 1.05em; flex: none; border-radius: 50%; position: relative; background: radial-gradient(circle at 34% 30%, #c8ffe4 0%, #3ddc97 30%, #22a6ff 68%, #2350c8 100%); box-shadow: inset -0.12em -0.12em 0 rgba(0,0,0,0.18), 0 4px 16px rgba(34,193,255,0.55); }
.planet-logo::before { content: ''; position: absolute; left: -28%; top: 40%; width: 156%; height: 26%; border: 0.07em solid #ffd36a; border-radius: 50%; transform: rotate(-16deg); box-sizing: border-box; }
.planet-logo::after { content: ''; position: absolute; left: 38%; top: -22%; width: 0.34em; height: 0.34em; border-radius: 0.06em; background: linear-gradient(135deg, #ffcf6b, #ff8a3d); transform: rotate(10deg); box-shadow: inset -0.05em -0.05em 0 rgba(0,0,0,0.2); }
.wm { letter-spacing: -0.5px; }
.wm b { font-weight: 900; background: linear-gradient(135deg, #ffe08a, #ffb547); -webkit-background-clip: text; background-clip: text; color: transparent; }
#splash { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 24px; background: radial-gradient(ellipse at 50% 40%, #1b2358, #070a1a 70%); z-index: 60; transition: opacity 0.6s; }
#splash.hide { opacity: 0; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.15); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px; background: rgba(255,255,255,0.1); border: 1px solid var(--line); font-weight: 800; font-size: 15px; transition: transform 0.12s, background 0.2s, box-shadow 0.2s; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,0.16); }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; box-shadow: 0 6px 22px rgba(80, 110, 255, 0.45); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(255, 93, 115, 0.18); border-color: rgba(255, 93, 115, 0.4); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.huge { width: 100%; font-size: 24px; padding: 18px; border-radius: 18px; letter-spacing: 0.3px; }
.btn.huge span { font-size: 20px; }
.btn.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.08); font-size: 18px; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,0.16); }

/* ---------- home ---------- */
#home { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#home > * { pointer-events: auto; }
.home-top { position: absolute; top: calc(14px + var(--safe-t)); left: calc(18px + var(--safe-l)); right: calc(18px + var(--safe-r)); display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.home-top > * { pointer-events: auto; }
.net-pill { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; font-weight: 700; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.net-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px currentColor; }
.net-pill.on .dot { background: var(--good); }
.net-pill.off .dot { background: #9aa; }
.home-card { position: absolute; left: calc(24px + var(--safe-l)); top: 50%; transform: translateY(-50%); width: 360px; max-height: calc(100% - 120px); overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.profile { display: flex; gap: 8px; align-items: center; }
.profile input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,0.25); color: var(--text); font: 800 18px Nunito, system-ui, sans-serif; padding: 0 12px; outline: none; }
.profile input:focus { border-color: var(--accent2); }
.avatar-chip { width: 44px; height: 44px; border-radius: 12px; flex: none; position: relative; box-shadow: inset 0 -6px 0 rgba(0,0,0,0.2); }
.avatar-chip::after { content: '🙂'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); transition: transform 0.1s; }
.swatch.on { border-color: #fff; transform: scale(1.12); }
.sub { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; margin-top: -4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,0.25); color: var(--text); font: 900 22px Nunito, monospace; letter-spacing: 4px; text-transform: uppercase; text-align: center; outline: none; }
.code-row input::placeholder { font-size: 14px; letter-spacing: 1px; text-transform: none; font-weight: 700; }
.home-lists { display: flex; flex-direction: column; gap: 10px; }
.list-title { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 4px 2px 6px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); margin-bottom: 6px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.online { color: var(--good); }
.theme { font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(124,92,255,0.18), rgba(34,193,255,0.12)); border: 1px solid rgba(124,92,255,0.3); }
.theme b { color: var(--text); }
.planet-hint { position: absolute; bottom: calc(22px + var(--safe-b)); left: 50%; transform: translateX(-50%); margin-left: 190px; padding: 9px 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translate(-50%, -4px); } }

.pick-card { position: fixed; z-index: 30; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%); width: min(340px, calc(100% - 32px)); padding: 16px; display: flex; flex-direction: column; gap: 10px; animation: pop 0.25s cubic-bezier(.2,1.4,.4,1); }
.pick-title { font-size: 22px; font-weight: 900; }
.pick-sub { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: -8px; }
@keyframes pop { from { transform: translateX(-50%) scale(0.85); opacity: 0; } }

.space-btn { width: 100%; background: linear-gradient(135deg, rgba(40,30,90,0.9), rgba(20,60,110,0.9)); border-color: rgba(140,120,255,0.45); }
.map-actions { display: flex; gap: 8px; align-items: center; }
.map-actions .space-btn { width: auto; }
#spaceBar { position: fixed; z-index: 25; top: calc(14px + var(--safe-t)); left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#spaceBar > * { pointer-events: auto; }
.space-card { gap: 8px; }
.space-card .perm { font-size: 13px; font-weight: 800; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.07); }
.space-card .perm.ok { color: var(--good); }
.space-card .col { display: flex; flex-direction: column; gap: 8px; }
.space-friends { position: fixed; z-index: 24; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); }
.space-friends .chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid rgba(255,211,106,0.45); font-weight: 800; font-size: 13px; }
.space-friends .chip .pdot { width: 10px; height: 10px; border-radius: 50%; }
#hud.visitor .hotbar, #hud.visitor .tools { opacity: 0.45; }
.visit-pill { padding: 8px 12px; border-radius: 12px; background: rgba(34,193,255,0.18); border: 1px solid rgba(34,193,255,0.45); font-size: 12px; font-weight: 800; }
#mapBar { position: fixed; z-index: 25; top: calc(14px + var(--safe-t)); left: calc(14px + var(--safe-l)); right: calc(14px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#mapBar > * { pointer-events: auto; }
.map-title { padding: 10px 16px; font-weight: 900; font-size: 18px; display: flex; flex-direction: column; }
.map-title small { font-weight: 700; font-size: 12px; color: var(--muted); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud button, #hud .hotbar, #hud .tools, #hud #touch, #hud .quests { pointer-events: auto; }
.hud-tl { position: absolute; top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l)); display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; max-width: 60vw; }
.world-pill { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 14px; text-align: left; border-radius: 14px; }
.wp-name { font-weight: 900; font-size: 15px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.invite { padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(124,92,255,0.8), rgba(34,193,255,0.8)); border: 0; }
.quests { flex-basis: 100%; width: max-content; max-width: 280px; padding: 10px 12px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.quests:empty { display: none; }
.quest { display: flex; gap: 8px; align-items: center; }
.quest .qbar { height: 5px; flex: 1; min-width: 40px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
.quest .qbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.3s; }
.quest.done { opacity: 0.55; text-decoration: line-through; }
.quests .qhead { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 900; display: flex; justify-content: space-between; }
.quests .qhead button { color: var(--muted); font-size: 12px; }
.hud-tr { position: absolute; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); display: flex; gap: 8px; }
.hud-btn { width: 46px; height: 46px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 20px; display: grid; place-items: center; position: relative; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.1s; }
.hud-btn:active { transform: scale(0.92); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.coords { position: absolute; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; color: rgba(255,255,255,0.8); text-shadow: 0 1px 4px rgba(0,0,0,0.6); white-space: nowrap; }
.credit { position: absolute; right: calc(8px + var(--safe-r)); bottom: calc(4px + var(--safe-b)); font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.55); text-shadow: 0 1px 2px rgba(0,0,0,0.6); pointer-events: none; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: rgba(255,255,255,0.9); box-shadow: 0 0 3px rgba(0,0,0,0.6); border-radius: 1px; }
.crosshair::before { left: 10px; top: 3px; width: 2px; height: 16px; }
.crosshair::after { top: 10px; left: 3px; height: 2px; width: 16px; }

.bottom { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.hotbar { display: flex; gap: 5px; padding: 6px; border-radius: 18px; }
.slot { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; position: relative; background: rgba(0,0,0,0.2); border: 2px solid transparent; transition: transform 0.1s, border-color 0.15s; }
.slot.on { border-color: #fff; background: rgba(255,255,255,0.14); transform: translateY(-3px); }
.slot .num { position: absolute; top: 2px; left: 5px; font-size: 10px; font-weight: 900; color: rgba(255,255,255,0.6); }
.slot.more { font-size: 24px; font-weight: 900; background: linear-gradient(135deg, rgba(124,92,255,0.5), rgba(34,193,255,0.5)); }
.star-chip { display: flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 14px; font-weight: 900; font-size: 15px; color: #ffe08a; transition: transform 0.2s; }
.star-chip.bump { transform: scale(1.18); }
.plot-chip { pointer-events: auto; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); }
.plot-chip.sale { border-color: rgba(61,220,151,0.55); }
.plot-chip.other { border-color: rgba(255,181,71,0.55); }
.plot-chip.mine { border-color: rgba(61,220,151,0.8); color: #bff5dc; }
.plot-chip .buy { padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent2)); font-weight: 900; }
.wallet-big { text-align: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(246,207,58,0.18), rgba(255,160,70,0.12)); border: 1px solid rgba(246,207,58,0.35); }
.wallet-big b { display: block; font-size: 36px; font-weight: 900; color: #ffe08a; }
.fame-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 14px; border-radius: 14px; background: rgba(140,170,255,0.12); border: 1px solid rgba(140,170,255,0.3); }
.fame-row b { font-weight: 900; color: #ffe08a; }
.fame-row span { font-weight: 800; }
.earn-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.earn-list span:nth-child(odd) { color: #ffe08a; font-weight: 900; text-align: right; }
.tool-guide { pointer-events: auto; max-width: min(560px, calc(100vw - 24px)); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; font-size: 14px; font-weight: 700; border-color: rgba(34,193,255,0.45); animation: pop2 0.2s ease; }
.tool-guide .gstep b { color: var(--accent2); }
.tool-guide .gsize { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tool-guide .grow2 { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.tool-guide .gh { min-width: 70px; font-size: 13px; }
.tool-guide .ghint { font-size: 11px; color: var(--muted); }
.tool-guide img { vertical-align: middle; }
.tools { display: flex; gap: 4px; padding: 5px; border-radius: 16px; }
.tool { height: 38px; padding: 0 12px; border-radius: 11px; font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.tool.on { background: rgba(255,255,255,0.16); color: var(--text); }
.tool .k { font-size: 10px; opacity: 0.6; }

/* isometric block icon */
.bicon { width: 30px; height: 30px; position: relative; }
.bicon i { position: absolute; display: block; }
.bicon .t { width: 21px; height: 21px; left: 4.5px; top: -1px; transform: rotate(45deg) scale(1, 1); transform-origin: center; }
.bicon { transform: scale(0.95); }
.bicon .face { position: absolute; width: 15px; height: 17px; top: 11px; }
.bicon .l { left: 0; transform: skewY(30deg); transform-origin: top right; filter: brightness(0.8); }
.bicon .r { left: 15px; transform: skewY(-30deg); transform-origin: top left; filter: brightness(0.62); }
.bicon .top { position: absolute; width: 21.2px; height: 21.2px; left: 4.4px; top: -2px; transform: scaleY(0.577) rotate(45deg); transform-origin: center; }
.bicon.glass-b .face, .bicon.glass-b .top { opacity: 0.55; }
.bicon.glow { filter: drop-shadow(0 0 5px rgba(255, 230, 150, 0.9)); }

.chat-log { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(140px + var(--safe-b)); width: min(380px, 70vw); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.chat-line { align-self: flex-start; max-width: 100%; padding: 6px 10px; border-radius: 12px; background: rgba(10, 14, 30, 0.55); font-size: 14px; font-weight: 700; line-height: 1.3; text-shadow: 0 1px 2px rgba(0,0,0,0.4); animation: chatin 0.2s ease; transition: opacity 1s; overflow-wrap: anywhere; }
.chat-line b { margin-right: 6px; }
.chat-line.sys { color: #cfe4ff; font-style: italic; }
.chat-line.old { opacity: 0; }
.chat-log.open .chat-line.old { opacity: 1; }
@keyframes chatin { from { transform: translateY(6px); opacity: 0; } }

.toasts { position: fixed; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; z-index: 40; }
.toast { padding: 10px 16px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--line); font-weight: 800; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); animation: toastin 0.3s cubic-bezier(.2,1.4,.4,1); transition: opacity 0.4s, transform 0.4s; text-align: center; max-width: 90vw; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast.good { border-color: rgba(61, 220, 151, 0.5); }
.toast.bad { border-color: rgba(255, 93, 115, 0.5); }
@keyframes toastin { from { transform: translateY(-10px) scale(0.9); opacity: 0; } }

.click-hint { position: absolute; left: 50%; bottom: calc(132px + var(--safe-b)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 5px 12px; border-radius: 999px; background: rgba(10,14,30,0.55); font-weight: 700; font-size: 12px; line-height: 1.4; color: rgba(220,228,255,0.8); text-align: center; pointer-events: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.click-hint b { color: var(--text); }

/* ---------- touch ---------- */
#touch { position: absolute; inset: 0; pointer-events: none !important; }
.stick { position: absolute; left: calc(26px + var(--safe-l)); bottom: calc(110px + var(--safe-b)); width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.18); pointer-events: none; transition: opacity 0.2s; }
.knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,255,255,0.35); box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.touch-right { position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(110px + var(--safe-b)); display: grid; grid-template-columns: auto auto; gap: 10px; align-items: end; justify-items: center; pointer-events: auto; }
.tbtn { width: 66px; height: 66px; border-radius: 50%; background: rgba(16,20,40,0.55); border: 2px solid rgba(255,255,255,0.22); font-size: 26px; display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: auto; }
.tbtn.small { width: 50px; height: 50px; font-size: 20px; }
.tbtn.mode { background: linear-gradient(135deg, rgba(124,92,255,0.75), rgba(34,193,255,0.75)); border-color: transparent; }
.tbtn.mode.breaking { background: linear-gradient(135deg, rgba(255,93,115,0.8), rgba(255,160,70,0.8)); }
.tbtn.on { background: rgba(255,255,255,0.3); }
.tbtn:active { transform: scale(0.92); }

/* ---------- emote wheel ---------- */
.emote-wheel { position: fixed; z-index: 30; right: calc(16px + var(--safe-r)); bottom: calc(190px + var(--safe-b)); padding: 10px; display: grid; grid-template-columns: repeat(4, 52px); gap: 6px; animation: pop2 0.2s ease; }
.emote-wheel button { height: 52px; border-radius: 14px; background: rgba(255,255,255,0.08); font-size: 24px; }
.emote-wheel button:hover { background: rgba(255,255,255,0.18); }
.emote-wheel .qc { grid-column: span 2; font-size: 13px; font-weight: 800; }
@keyframes pop2 { from { transform: scale(0.9); opacity: 0; } }

/* ---------- chat form ---------- */
.chat-form { position: fixed; z-index: 30; left: 50%; bottom: calc(118px + var(--safe-b)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.1); font-weight: 800; font-size: 13px; }
.quick button:hover { background: rgba(255,255,255,0.2); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--text); font: 700 16px Nunito, system-ui, sans-serif; padding: 0 12px; outline: none; }
.chat-note { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 4px; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(5, 8, 20, 0.35); animation: fadein 0.2s; padding: 16px; }
@keyframes fadein { from { opacity: 0; } }
.sheet-card { width: min(560px, 100%); max-height: min(720px, 100%); display: flex; flex-direction: column; overflow: hidden; background: var(--glass-strong); animation: sheetin 0.25s cubic-bezier(.2,1.2,.4,1); }
@keyframes sheetin { from { transform: translateY(20px) scale(0.97); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 900; }
.sheet-body { padding: 4px 20px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); font-weight: 700; }
.field .hint { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.field input[type=range] { width: 150px; accent-color: var(--accent2); }
.field select, .text-in { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--text); font: 700 15px Nunito, system-ui, sans-serif; padding: 0 10px; outline: none; }
.text-in { width: 100%; }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,0.15); position: relative; flex: none; transition: background 0.2s; }
.toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.toggle.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.toggle.on::after { transform: translateX(20px); }
.code-big { font: 900 30px Nunito, monospace; letter-spacing: 6px; text-align: center; padding: 12px; border-radius: 14px; background: rgba(0,0,0,0.3); user-select: all; -webkit-user-select: all; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; padding: 10px; border-radius: 10px; background: rgba(0,0,0,0.3); user-select: all; -webkit-user-select: all; }
.palette-tabs { display: flex; gap: 6px; }
.palette-tabs button { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,0.08); font-weight: 800; }
.palette-tabs button.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pblock { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 6px; border-radius: 12px; background: rgba(255,255,255,0.05); font-size: 11px; font-weight: 800; color: var(--muted); border: 2px solid transparent; }
.pblock:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.pblock.on { border-color: #fff; color: var(--text); }
.hats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hat { padding: 10px 4px; border-radius: 12px; background: rgba(255,255,255,0.06); font-weight: 800; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid transparent; }
.hat .e { font-size: 24px; }
.hat.on { border-color: #fff; }
.hat.locked { opacity: 0.45; }
.hats.faces .hat { padding: 6px 2px; }
.face-cv { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 8px; }
.dress-wrap { position: relative; display: grid; place-items: center; margin: 6px 0 10px; border-radius: 18px; background: radial-gradient(ellipse at 50% 85%, rgba(34,193,255,0.22), rgba(124,92,255,0.10) 55%, rgba(255,255,255,0.03)); }
.dress-stage { width: 180px; height: 210px; touch-action: none; cursor: grab; }
.dress-hint { position: absolute; bottom: 6px; font-size: 11px; font-weight: 700; opacity: 0.5; }
.dress-opts { display: grid; gap: 6px; margin-bottom: 8px; }
.stat-row { display: flex; gap: 8px; }
.stat { flex: 1; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.06); text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 900; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; font-weight: 700; }
.kbd { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; font-weight: 700; }
.kbd kbd { font: 800 12px Nunito, sans-serif; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,0.12); border-bottom: 2px solid rgba(0,0,0,0.3); justify-self: start; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.cf { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); opacity: 0.8; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .home-card { left: 12px; right: 12px; width: auto; top: auto; bottom: calc(12px + var(--safe-b)); transform: none; max-height: 58%; padding: 14px; gap: 10px; }
  .planet-hint { bottom: auto; top: calc(64px + var(--safe-t)); margin-left: 0; font-size: 12px; }
  .home-lists, .theme { display: none; }
  .home-card.expanded .home-lists, .home-card.expanded .theme { display: flex; }
  .btn.huge { font-size: 22px; padding: 15px; }
  .slot { width: min(40px, calc((100vw - 52px) / 10)); height: min(40px, calc((100vw - 52px) / 10)); border-radius: 10px; }
  .slot { padding: 0; grid-template: 100% / 100%; }
  .slot img { width: 78% !important; height: 78% !important; object-fit: contain; aspect-ratio: 1; }
  .slot .num { display: none; }
  .hotbar { gap: 2px; padding: 4px; }
  .hud-btn { width: 42px; height: 42px; font-size: 18px; border-radius: 12px; }
  .hud-tr { gap: 6px; flex-direction: column; }
  .hud-tl { max-width: calc(100vw - 80px); }
  .tool { height: 34px; padding: 0 9px; font-size: 12px; }
  .tool .k { display: none; }
  .wp-name { max-width: 130px; }
  .chat-log { bottom: calc(260px + var(--safe-b)); width: 60vw; }
  .chat-line { font-size: 12px; }
  .pick-card { bottom: calc(16px + var(--safe-b)); }
  .quests { max-width: 200px; font-size: 12px; }
  .coords { top: auto; bottom: calc(112px + var(--safe-b)); left: 12px; transform: none; font-size: 11px; }
}
@media (max-height: 500px) {
  .stick { bottom: calc(20px + var(--safe-b)); width: 110px; height: 110px; }
  .touch-right { bottom: calc(20px + var(--safe-b)); }
  .bottom { bottom: calc(6px + var(--safe-b)); }
  .home-card { max-height: calc(100% - 70px); top: calc(56px + var(--safe-t)); transform: none; }
  .quests { display: none; }
}
body.touch .crosshair { opacity: 0.35; }
body.touch .tools .k { display: none; }
.backpack { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.backpack .bp { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); }
.backpack .bp .e { font-size: 22px; }
.backpack .bp b { font-weight: 900; font-size: 16px; }
.backpack .bp span:last-child { font-size: 11px; opacity: 0.75; }

/* brand tagline ("Your world grows with friends", see docs/SLOGAN.md) */
.tagline { margin-top: 10px; font-weight: 800; font-size: 18px; letter-spacing: 0.2px; color: #cfe0ff; text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,0.45); }
.tagline.small { margin: 0; font-size: 14px; text-align: left; opacity: 0.9; padding-left: 12px; border-left: 1px solid rgba(207,224,255,0.35); }
.brand-block { display: flex; flex-direction: row; align-items: center; gap: 12px; }
@media (max-width: 640px) { .tagline.small { display: none; } }
/* planet growth */
.grow-stage { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.grow-stage .e { font-size: 36px; }
.grow-stage b { font-size: 18px; font-weight: 900; }
.grow-bar { height: 12px; border-radius: 8px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 8px; }
.grow-bar .fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #6fe28a, #b8ff7a); }
.grow-part { display: flex; gap: 8px; font-weight: 700; font-size: 14px; padding: 2px 0; opacity: 0.9; }
.grow-part.done { opacity: 0.6; }

/* planet traits, wanted resource, community projects */
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.traits > div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 2px; }
.traits span { font-size: 12px; opacity: 0.75; }
.traits-line { font-size: 13px; font-weight: 700; opacity: 0.85; margin: 4px 0 6px; }
.want-banner { padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; font-weight: 800; font-size: 14px; background: rgba(255,140,60,0.16); border: 1px solid rgba(255,160,80,0.4); }
.list-item.wanted { border-color: rgba(255,160,80,0.55); background: rgba(255,140,60,0.1); }
.project { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); margin-top: 8px; }
.project.done { border-color: rgba(120,230,140,0.5); }
.project .ph { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.project .ph .e { font-size: 28px; }
.project .s { font-size: 12px; opacity: 0.8; }
.give-row { display: flex; gap: 6px; }

/* brand logo (brand/BuildMyPlanet-Logo-original.png) */
.brand-logo { display: block; height: auto; width: 360px; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.45)); user-select: none; -webkit-user-drag: none; }
/* Powell Play rule: the game logo is at least 3x the studio mark's width on any screen showing both
   (2x on phones under 600 px). The marks are 104 px (home) and 120 px (Settings); the loading mark
   is clamp(140px, 34vmin, 280px). */
.brand-logo.big { width: min(calc(3 * clamp(140px, 34vmin, 280px)), 96vw); }
@media (max-width: 599px), (max-height: 599px) { .brand-logo { width: 240px; } .brand-logo.big { width: min(560px, 82vw, 80vh); } }

/* ---- welcome card (home) ---- */
.field-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 5px 2px; }
.home-card .profile { align-items: flex-end; gap: 12px; }
.name-field { flex: 1; min-width: 0; display: block; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,0.25); color: var(--text); font: 800 19px Nunito, system-ui, sans-serif; padding: 0 14px; outline: none; }
.name-row input:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(34,193,255,0.2); }
.name-row .icon-btn { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; flex: none; }
/* mini character: head (skin) over shirt */
.avatar-chip { width: 66px; height: 70px; border-radius: 18px; flex: none; position: relative; background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)); border: 1px solid var(--line); box-shadow: none; overflow: visible; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; cursor: pointer; transition: transform 0.12s; }
.avatar-chip:hover, .avatar-chip:focus-visible { transform: translateY(-2px); }
.avatar-chip::after { content: none; }
.av-head { width: 30px; height: 28px; border-radius: 7px; background: var(--skin, #f2c9a0); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.15); position: relative; }
.av-eyes::before, .av-eyes::after { content: ''; position: absolute; top: 11px; width: 5px; height: 6px; border-radius: 2px; background: #2a2440; }
.av-eyes::before { left: 7px; } .av-eyes::after { right: 7px; }
.av-body { width: 40px; height: 22px; margin-top: 2px; border-radius: 8px 8px 6px 6px; background: var(--shirt, #7c5cff); box-shadow: inset 0 -5px 0 rgba(0,0,0,0.18); }
.av-edit { position: absolute; right: -6px; top: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #1b2140; border: 1px solid var(--line); }
/* shirt colours: two even rows of big, round, easy-to-tap buttons */
.home-card .swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.home-card .swatch { width: 100%; height: auto; aspect-ratio: 1; max-height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.08); box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2); position: relative; justify-self: center; max-width: 44px; }
.home-card .swatch.on { border-color: #fff; transform: scale(1.08); box-shadow: 0 0 0 3px rgba(34,193,255,0.45), inset 0 -4px 0 rgba(0,0,0,0.2); }
.home-card .swatch.on::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 16px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
/* play + three matching action tiles */
.home-card .sub { text-align: center; font-size: 13px; margin-top: -4px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 8px 4px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); font: 800 13px Nunito, system-ui, sans-serif; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.action .ai { font-size: 24px; line-height: 1; }
.action:hover, .action:focus-visible { background: rgba(255,255,255,0.11); transform: translateY(-2px); }
.action:active { transform: scale(0.97); }
.action.space { background: linear-gradient(135deg, rgba(60,40,140,0.85), rgba(20,70,130,0.85)); border-color: rgba(140,120,255,0.45); }
@media (max-width: 760px) {
  .planet-hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); line-height: 1.35; }
  .avatar-chip { width: 58px; height: 62px; }
  .action { min-height: 60px; }
}
.hint-short { display: none; }
@media (max-width: 760px) { .hint-long { display: none; } .hint-short { display: inline; } }
.home-card .swatch.on.light::after { color: #1b2140; text-shadow: none; }
/* ---- welcome card, condensed: one row of small colours, shorter tiles, more planet showing ---- */
.home-card { gap: 10px; padding: 16px; }
.home-card .profile { gap: 10px; }
.avatar-chip { width: 48px; height: 50px; border-radius: 14px; padding-bottom: 4px; }
.av-head { width: 22px; height: 20px; border-radius: 5px; }
.av-eyes::before, .av-eyes::after { top: 8px; width: 4px; height: 4px; }
.av-eyes::before { left: 5px; } .av-eyes::after { right: 5px; }
.av-body { width: 30px; height: 15px; border-radius: 6px 6px 5px 5px; }
.av-edit { width: 20px; height: 20px; font-size: 10px; right: -5px; top: -5px; }
.name-row input { height: 42px; font-size: 17px; border-radius: 12px; }
.name-row .icon-btn { width: 42px; height: 42px; font-size: 19px; border-radius: 12px; }
.field-label { font-size: 11px; margin-bottom: 4px; }
.home-card .swatches { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 3px; }
.home-card .swatch { width: 22px; height: 22px; max-width: none; max-height: none; flex: none; border-width: 2px; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2); }
.home-card .swatch.on { transform: scale(1.18); box-shadow: 0 0 0 2px rgba(34,193,255,0.6); }
.home-card .swatch.on::after { font-size: 11px; }
.btn.huge { padding: 13px; font-size: 21px; border-radius: 16px; }
.actions { gap: 6px; }
.action { flex-direction: row; min-height: 42px; gap: 6px; padding: 6px 4px; border-radius: 12px; font-size: 12.5px; }
.action .ai { font-size: 17px; }
@media (max-width: 760px) {
  .home-card { padding: 12px; gap: 8px; }
  .avatar-chip { width: 46px; height: 48px; }
  .action { min-height: 40px; }
  .btn.huge { padding: 12px; font-size: 20px; }
}
@media (max-width: 360px) { .home-card .swatch { width: 20px; height: 20px; } }
.action span:last-child { white-space: nowrap; }
@media (max-width: 400px) { .action { font-size: 12px; gap: 4px; } .action .ai { font-size: 15px; } }

/* ---- Explore Space: the premium headline button over the planet ---- */
.actions.two { grid-template-columns: 1fr 1fr; }
.space-hero { position: absolute; top: calc(22px + var(--safe-t)); left: 50%; margin-left: 190px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 999px; cursor: pointer; color: #fff;
  font: 900 17px Nunito, system-ui, sans-serif; text-align: left; isolation: isolate;
  background: linear-gradient(135deg, #2a1a6e 0%, #3b2bb5 45%, #1a6fd6 100%); border: 0;
  box-shadow: 0 10px 30px rgba(60, 60, 255, 0.45), 0 0 0 1px rgba(255,255,255,0.08) inset;
  animation: heroFloat 3.2s ease-in-out infinite; }
/* glowing animated rim */
.space-hero::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; z-index: -2;
  background: conic-gradient(from var(--a, 0deg), #7cf7ff, #b388ff, #ffd36a, #ff7ad9, #7cf7ff); animation: heroSpin 4s linear infinite; }
.space-hero::after { content: ''; position: absolute; inset: 1px; border-radius: inherit; z-index: -1;
  background: linear-gradient(135deg, #22145c 0%, #3424a8 45%, #1560c4 100%); }
/* shimmer sweep */
.sh-glow { position: absolute; inset: 1px; border-radius: inherit; overflow: hidden; z-index: 0; pointer-events: none; }
.sh-glow::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent); animation: heroShine 3.6s ease-in-out infinite; }
.sh-ico { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.08)); box-shadow: 0 0 18px rgba(124,247,255,0.55); }
.sh-text { position: relative; z-index: 1; display: flex; flex-direction: column; line-height: 1.15; }
.sh-text b { font-size: 17px; letter-spacing: 0.2px; background: linear-gradient(90deg, #fff, #cfe8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sh-text small { font-size: 12px; font-weight: 700; color: rgba(220,232,255,0.85); }
.sh-go { position: relative; z-index: 1; font-size: 26px; font-weight: 900; margin-left: 4px; opacity: 0.9; transition: transform 0.15s; }
.space-hero:hover .sh-go, .space-hero:focus-visible .sh-go { transform: translateX(3px); }
.space-hero:hover { box-shadow: 0 12px 36px rgba(90, 90, 255, 0.6); }
.space-hero:active { transform: translateX(-50%) scale(0.97); }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes heroSpin { to { --a: 360deg; } }
@keyframes heroFloat { 50% { transform: translate(-50%, -3px); } }
@keyframes heroShine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .space-hero, .space-hero::before, .sh-glow::before { animation: none; } }
@media (max-width: 760px) {
  .space-hero { top: calc(70px + var(--safe-t)); margin-left: 0; padding: 8px 14px 8px 8px; gap: 10px; }
  .sh-ico { width: 34px; height: 34px; font-size: 19px; }
  .sh-text b { font-size: 16px; }
  .planet-hint { top: calc(134px + var(--safe-t)); }
}
.space-hero { width: max-content; white-space: nowrap; }
@media (max-width: 760px) {
  .space-hero { top: calc(66px + var(--safe-t)); }
  .sh-text small { font-size: 11px; }
  .planet-hint { top: calc(126px + var(--safe-t)); font-size: 11px; padding: 6px 12px; }
}

/* ---- cleaner front screen: no emojis, compact Explore Space, line icons ---- */
.space-hero { gap: 8px; padding: 6px 14px 6px 6px; font-size: 14px; box-shadow: 0 6px 20px rgba(60, 60, 255, 0.4); }
.sh-ico { width: 28px; height: 28px; font-size: 0; color: #fff; box-shadow: 0 0 12px rgba(124,247,255,0.5); }
.sh-text b { font-size: 14px; }
.sh-go { font-size: 18px; margin-left: 0; }
.av-edit { color: #fff; }
.av-edit svg { display: block; }
.name-row .icon-btn { color: var(--text); display: grid; place-items: center; }
.name-row .icon-btn svg { transition: transform 0.35s ease; }
.name-row .icon-btn:hover svg, .name-row .icon-btn:active svg { transform: rotate(180deg); }
.action { font-size: 14px; min-height: 40px; }
@media (max-width: 760px) {
  .space-hero { top: calc(64px + var(--safe-t)); padding: 5px 12px 5px 5px; }
  .sh-ico { width: 26px; height: 26px; }
  .sh-text b { font-size: 13px; }
  .planet-hint { top: calc(106px + var(--safe-t)); }
}

/* ---- AI builder agent ---- */
.agent-hero { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, rgba(34,193,255,0.14), rgba(124,92,255,0.12)); border: 1px solid rgba(124,160,255,0.35); }
.ah-bot { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: #22c1ff; box-shadow: inset 0 -5px 0 rgba(0,0,0,0.18); }
.agent-hero b { font-size: 17px; }
.ok-text { color: #6fe28a !important; }
.agent-colors { display: flex; gap: 8px; margin-top: 8px; }
.agent-colors .swatch { width: 30px; height: 30px; border-radius: 50%; }
.agent-url { display: flex; gap: 8px; align-items: center; margin: 8px 0; padding: 8px 8px 8px 12px; border-radius: 12px; background: rgba(0,0,0,0.3); border: 1px solid var(--line); }
.agent-url code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #cfe8ff; }
.agent-steps { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.agent-steps li { margin-bottom: 4px; word-break: break-word; }
.agent-try { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); font-size: 13px; line-height: 1.6; }
.agent-ctrl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.agent-bar { width: 80px; height: 8px; border-radius: 5px; background: rgba(255,255,255,0.1); overflow: hidden; }
.agent-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22c1ff, #7c5cff); }
.agent-ask { position: absolute; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 20; width: min(360px, calc(100vw - 24px)); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.agent-ask .aa-t { font-weight: 900; font-size: 16px; }
.agent-ask .aa-s { font-size: 13px; color: var(--muted); }

/* ---- agent questions: tap a pill to answer ---- */
.agent-q { position: absolute; left: 50%; bottom: calc(160px + var(--safe-b)); transform: translateX(-50%); z-index: 21; width: min(440px, calc(100vw - 24px)); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; animation: aqIn 0.25s ease-out; }
@keyframes aqIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.aq-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.aq-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.aq-x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; padding: 2px 4px; }
.aq-text { font-weight: 800; font-size: 16px; line-height: 1.35; }
.aq-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.aq-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(124,160,255,0.45); background: rgba(90,110,255,0.18); color: var(--text); font: 800 14px Nunito, system-ui, sans-serif; cursor: pointer; transition: transform 0.1s, background 0.1s; }
.aq-pill:hover, .aq-pill:focus-visible { background: rgba(90,110,255,0.32); transform: translateY(-1px); }
.aq-pill:active { transform: scale(0.97); }
.aq-pill.ghost { background: transparent; border-style: dashed; color: var(--muted); }
.aq-k { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: rgba(255,255,255,0.14); font-size: 11px; }
.aq-in { flex: 1 1 100%; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--text); font: 700 14px Nunito, system-ui, sans-serif; padding: 0 12px; outline: none; }
@media (max-width: 760px) { .agent-q { top: calc(64px + var(--safe-t)); bottom: auto; left: 12px; right: 72px; width: auto; transform: none; } @keyframes aqIn { from { opacity: 0; transform: translateY(-8px); } } .aq-pill { padding: 9px 14px; font-size: 15px; } }

/* ---- brand icons (public/brand/icons) ---- */
.ico { width: 20px; height: 20px; object-fit: contain; flex: none; vertical-align: middle; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.hud-btn .ico { width: 32px; height: 32px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)); }
.hud-btn:hover .ico { transform: scale(1.08); }
.tool .ico { width: 24px; height: 24px; }
.tool:not(.on) .ico { opacity: 0.8; }
.invite { display: inline-flex; align-items: center; gap: 6px; }
.invite .ico { width: 22px; height: 22px; }
.star-chip .ico { width: 22px; height: 22px; }
.wp-name { display: flex; align-items: center; gap: 6px; }
.wp-name .ico { width: 20px; height: 20px; }
.tbtn.mode .ico { width: 38px; height: 38px; }
.map-title .mt-row { display: flex; align-items: center; gap: 8px; }
.map-title .ico { width: 26px; height: 26px; }
.action .ico { width: 30px; height: 30px; }
.agent-ask .aa-t, .aq-head #agentQWho { display: inline-flex; align-items: center; gap: 6px; }
.agent-ask .aa-t .ico { width: 24px; height: 24px; }
.aq-head .ico { width: 18px; height: 18px; }
.btn.small .ico { width: 18px; height: 18px; }
@media (max-width: 760px) { .hud-btn .ico { width: 28px; height: 28px; } .tool .ico { width: 22px; height: 22px; } }
.list-item .t, .pick-title { display: flex; align-items: center; gap: 6px; }
.list-item .t .ico { width: 20px; height: 20px; }
.pick-title .ico { width: 26px; height: 26px; }
@media (max-width: 420px) { .tools { gap: 2px; padding: 4px; } .tool { padding: 0 6px; gap: 4px; font-size: 12px; } .tool .ico { width: 20px; height: 20px; } }
/* touch buttons and emote wheel use the brand icons too */
.tbtn .ico { width: 34px; height: 34px; }
.tbtn.small .ico { width: 28px; height: 28px; }
.ico.flip { transform: rotate(180deg); }
.emote-wheel button { display: grid; place-items: center; }
.emote-wheel button .ico { width: 38px; height: 38px; transition: transform 0.12s; }
.emote-wheel button:hover .ico { transform: scale(1.12); }
@media (max-width: 760px) { .emote-wheel { bottom: calc(250px + var(--safe-b)); } }

/* ---- planets to explore (home) ---- */
.planet-rail { position: absolute; z-index: 4; right: calc(20px + var(--safe-r)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 8px; max-height: calc(100% - 150px); overflow-y: auto; scrollbar-width: none; border-radius: 20px; }
.planet-rail::-webkit-scrollbar { display: none; }
.pr-head { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px; }
.pr-item { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; padding: 8px 4px 7px; border-radius: 16px; border: 1px solid transparent; background: none; color: var(--text); cursor: pointer; transition: background 0.15s, transform 0.12s; }
.pr-item:hover { background: rgba(255,255,255,0.07); }
.pr-item:hover .pr-thumb { transform: rotate(-8deg) scale(1.06); }
.pr-item.on { background: rgba(124,160,255,0.16); border-color: rgba(124,160,255,0.55); }
.pr-thumb { width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 0 14px rgba(127,184,255,0.45); transition: transform 0.3s; }
.pr-item.on .pr-thumb { box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(127,184,255,0.8); }
.pr-name { font: 800 12px Nunito, system-ui, sans-serif; max-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-tag { font-size: 10px; font-weight: 900; padding: 1px 7px; border-radius: 999px; }
.pr-tag.ok { background: rgba(74,222,128,0.18); color: #86efac; }
.pr-tag.look { background: rgba(251,191,36,0.18); color: #fcd34d; }
@media (max-width: 760px) {
  .planet-rail { top: auto; right: 0; left: 0; transform: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; padding: 4px 12px; gap: 4px; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .pr-head { display: none; }
  .pr-item { width: 70px; flex: none; padding: 4px 2px; background: rgba(10,14,30,0.55); }
  .pr-thumb { width: 40px; height: 40px; }
  .pr-name { font-size: 11px; max-width: 66px; }
}
/* can you build here? */
.build-note { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: -4px; padding: 6px 10px; border-radius: 12px; font-size: 13px; font-weight: 800; text-align: center; }
.build-note .ico { width: 18px; height: 18px; }
.build-note.ok { background: rgba(74,222,128,0.12); color: #bbf7d0; }
.build-note.look { background: rgba(251,191,36,0.12); color: #fde68a; }
/* jump to a city (Earth) */
.city-jump { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 44px; border-radius: 14px; border: 1px solid rgba(124,160,255,0.45); background: rgba(0,0,0,0.28); }
.city-jump .ico { width: 22px; height: 22px; }
.cj-in { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--text); font: 800 15px Nunito, system-ui, sans-serif; }
.cj-in::placeholder { color: var(--muted); }
.map-title .city-jump { margin-top: 8px; height: 40px; width: min(320px, calc(100vw - 150px)); }
.cj-list { position: fixed; z-index: 60; max-height: min(320px, 50vh); overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; border-radius: 16px; }
.cj-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; border-radius: 10px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.cj-item:hover, .cj-item.on { background: rgba(124,160,255,0.2); }
.cj-name { font: 900 15px Nunito, system-ui, sans-serif; }
.cj-where { font-size: 12px; font-weight: 700; color: var(--muted); }
.cj-none { padding: 10px; font-size: 13px; color: var(--muted); }
.pick-title .ico { width: 22px; height: 22px; }

/* talking to your agent in the chat box */
.agent-chat { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.agent-chat .ac-who { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; color: var(--muted); margin-right: 2px; }
.agent-chat .ac-who .ico { width: 20px; height: 20px; }
.aq-pill.small { padding: 5px 11px; font-size: 13px; }

/* ---- share this spot ---- */
.share-preview { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); background: #0a0e22; }
.share-captions { display: flex; flex-wrap: wrap; gap: 6px; }
.share-captions .aq-pill { text-align: left; }
.aq-pill.on { background: rgba(124,160,255,0.42); border-color: rgba(255,255,255,0.85); }
.share-custom { flex: none; }
.share-go { display: flex; align-items: center; justify-content: center; gap: 8px; }
.share-go .ico { width: 26px; height: 26px; }
.share-more .btn { flex: 1; }
.share-status { min-height: 18px; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
/* someone shared a spot with you */
.shared-spot { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: linear-gradient(135deg, rgba(124,92,255,0.28), rgba(34,193,255,0.22)); border: 1px solid rgba(124,160,255,0.5); flex: none; }
.shared-spot .ss-img { width: 104px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; flex: none; }
.ss-who { font-size: 12px; font-weight: 900; color: #c7d2fe; text-transform: uppercase; letter-spacing: 0.04em; }
.ss-cap { font-size: 15px; font-weight: 900; line-height: 1.25; }
.ss-where { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }

/* ---- talk to us ---- */
.talk-intro { text-align: center; }
.talk-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.talk-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); font: 800 14px Nunito, system-ui, sans-serif; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.talk-tile .ico { width: 40px; height: 40px; }
.talk-tile:hover { background: rgba(255,255,255,0.11); transform: translateY(-2px); }
.talk-tile.on { background: rgba(124,160,255,0.25); border-color: rgba(124,160,255,0.8); }
.talk-form { display: flex; flex-direction: column; gap: 10px; }
.talk-text { min-height: 96px; height: auto; padding: 10px 12px; resize: vertical; }
.talk-shot { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.talk-done { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 0; }
.talk-done .ico.big { width: 64px; height: 64px; }
.talk-done b { font-size: 20px; }
.talk-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.talk-btn .ico { width: 22px; height: 22px; }
.talk-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 8px; border: 0; background: none; color: var(--muted); font: 800 13px Nunito, system-ui, sans-serif; cursor: pointer; flex: none; }
.talk-link .ico { width: 20px; height: 20px; }
.home-legal { text-align: center; font: 700 11px Nunito, system-ui, sans-serif; color: var(--muted); padding-bottom: 4px; flex: none; }
.home-legal a { color: var(--muted); }
.talk-link:hover { color: var(--text); }
.team-msg { padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(34,193,255,0.16)); border: 1px solid rgba(124,160,255,0.45); display: flex; flex-direction: column; gap: 6px; }
.team-from { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; color: #c7d2fe; text-transform: uppercase; letter-spacing: 0.04em; }
.team-from .ico { width: 18px; height: 18px; }
.team-text { font-size: 16px; font-weight: 800; line-height: 1.4; white-space: pre-wrap; }
.team-orig { font-size: 12px; }

/* ---- camera link for OBS (/camera) ---- */
body.cam-mode #home, body.cam-mode #hud, body.cam-mode #toasts, body.cam-mode #mapBar, body.cam-mode #spaceBar, body.cam-mode #touch, body.cam-mode #sheet, body.cam-mode #pickCard, body.cam-mode #chatForm, body.cam-mode .click-hint { display: none !important; }
.cam-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.cam-lower { position: absolute; left: 3.2vw; bottom: 5vh; display: flex; align-items: center; gap: 1.1vw; padding: 1vh 1.8vw 1vh 1vh; border-radius: 999px; background: linear-gradient(90deg, rgba(10,14,34,0.88), rgba(10,14,34,0.6)); border: 1px solid rgba(124,160,255,0.45); box-shadow: 0 1vh 4vh rgba(0,0,0,0.35); }
.cam-lower img { width: 6vh; height: 6vh; }
.cam-lower b { display: block; font: 900 3.2vh Nunito, system-ui, sans-serif; color: #fff; line-height: 1.1; }
.cam-lower span { display: block; font: 800 2vh Nunito, system-ui, sans-serif; color: #b9c4ff; }
.cam-site { position: absolute; right: 3vw; bottom: 5.5vh; padding: 0.8vh 1.6vw; border-radius: 999px; background: linear-gradient(135deg, #7c5cff, #22c1ff); font: 900 2.2vh Nunito, system-ui, sans-serif; color: #fff; box-shadow: 0 1vh 3vh rgba(0,0,0,0.3); }
.cam-wait { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 41; padding: 2vh 3vw; border-radius: 2vh; background: rgba(10,14,34,0.85); border: 1px solid rgba(124,160,255,0.45); font: 800 2.6vh Nunito, system-ui, sans-serif; color: #fff; text-align: center; max-width: 80vw; }

/* ---- creator studio ---- */
.studio-note { text-align: center; }
.studio-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.studio-h { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 16px; }
.studio-h .ico { width: 24px; height: 24px; }
.studio-link { font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.studio-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.studio-steps b { color: var(--text); }
.rec-pill { position: fixed; z-index: 35; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(20,8,14,0.85); border: 1px solid rgba(255,93,115,0.6); font: 900 14px Nunito, system-ui, sans-serif; color: #fff; }
.rec-pill i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: 0.25; } }
.rec-pill button { border: 0; border-radius: 999px; padding: 5px 12px; background: #ff3b5c; color: #fff; font: 900 13px Nunito, system-ui, sans-serif; cursor: pointer; }
.replay-stop { display: none; }
body.replay-mode #home, body.replay-mode #hud, body.replay-mode #toasts, body.replay-mode #touch, body.replay-mode #chatForm, body.replay-mode .click-hint { display: none !important; }
body.replay-mode .replay-stop { display: block; position: fixed; z-index: 45; top: calc(14px + var(--safe-t)); right: calc(14px + var(--safe-r)); border: 0; border-radius: 999px; padding: 8px 16px; background: rgba(10,14,34,0.8); color: #fff; font: 900 14px Nunito, system-ui, sans-serif; cursor: pointer; }
.rec-face { position: fixed; z-index: 41; right: 2.5vw; bottom: 14vh; width: 22vw; max-width: 420px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2vh; border: 3px solid rgba(124,160,255,0.8); box-shadow: 0 1vh 4vh rgba(0,0,0,0.4); }

/* ---------- compact HUD: one dock, a tool picker, and a More menu on phones ---------- */
.dock { display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.dock > * { pointer-events: auto; }
.tool-now, .more-btn { display: none; }
.tool.redo:not(.avail) { opacity: 0.35; }
.tool-pop { position: relative; z-index: 30; pointer-events: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px; border-radius: 18px; width: min(460px, calc(100vw - 24px)); animation: pop2 0.16s ease; }
.tp-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; text-align: center; min-height: 44px; }
.tp-item .ico { width: 34px; height: 34px; }
.tp-item b { font-size: 14px; }
.tp-item span { font-size: 11px; color: var(--muted); line-height: 1.2; }
.tp-item.on { background: rgba(255,255,255,0.16); box-shadow: inset 0 0 0 2px rgba(34,193,255,0.6); }
.more-btn .dots { display: grid; grid-template-columns: 7px 7px; gap: 4px; }
.more-btn .dots i { width: 7px; height: 7px; border-radius: 2px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.badge.dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; min-width: 0; padding: 0; border-radius: 50%; background: #ff5d73; }
.more-menu { position: absolute; top: calc(64px + var(--safe-t)); right: calc(12px + var(--safe-r)); display: grid; grid-template-columns: repeat(4, 76px); gap: 6px; padding: 10px; border-radius: 20px; pointer-events: auto; z-index: 20; animation: pop2 0.16s ease; max-width: calc(100vw - 24px); }
.mm-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 14px; font-size: 12px; font-weight: 800; min-height: 44px; }
.mm-item:active { background: rgba(255,255,255,0.12); }
.mm-ico { position: relative; }
.mm-ico .ico { width: 34px; height: 34px; }
.mm-ico .badge { position: absolute; top: -4px; right: -8px; }
/* places */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,0.06); margin-bottom: 10px; }
.seg button { padding: 7px 14px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: rgba(255,255,255,0.16); color: var(--text); }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pcard { border-radius: 16px; overflow: hidden; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; transform: rotate(-0.4deg); transition: transform 0.15s; }
.pcard:nth-child(even) { transform: rotate(0.5deg); }
.pcard:hover { transform: rotate(0) translateY(-2px); }
.pc-go { position: relative; display: block; padding: 0; }
.pc-go img { display: block; width: 100%; aspect-ratio: 192 / 120; object-fit: cover; }
.pc-world { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 999px; background: rgba(12,16,32,0.7); font-size: 11px; font-weight: 800; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-world .ico { width: 16px; height: 16px; }
.pc-body { padding: 8px 10px 2px; }
.pc-name { font-weight: 900; font-size: 14px; line-height: 1.2; }
.pc-rename { width: 100%; padding: 4px 8px; font-size: 13px; }
.pc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pc-acts { display: flex; gap: 2px; padding: 2px 6px 6px; }
.pc-acts button { min-width: 36px; min-height: 36px; border-radius: 10px; font-size: 17px; color: var(--muted); }
.pc-star.on { color: #ffd34d; }
.empty-note { padding: 18px 8px; text-align: center; color: var(--muted); font-weight: 700; }
.home-places { display: flex; flex-direction: column; gap: 6px; }
.hp-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 900; color: var(--muted); }
.hp-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hp-card { flex: none; width: 104px; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); padding: 0; text-align: left; }
.hp-card img { display: block; width: 100%; aspect-ratio: 192 / 120; object-fit: cover; }
.hp-card span { display: block; padding: 4px 6px 5px; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* phones and small screens: one slim dock, two buttons top-right, tips folded */
@media (max-width: 760px), (max-height: 500px) {
  .dock { flex-direction: row; gap: 0; padding: 4px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .dock .tools, .dock .hotbar { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
  .dock .tools { display: contents; }
  .tool-now { order: 0; margin-right: 2px; }
  .dock .hotbar { order: 1; }
  .tool.full { display: none; }
  .tool-now { display: flex; height: 40px; padding: 0 8px 0 4px; gap: 2px; background: linear-gradient(135deg, rgba(124,92,255,0.55), rgba(34,193,255,0.55)); color: #fff; border-radius: 14px; }
  .tool-now .ico { width: 30px; height: 30px; opacity: 1 !important; }
  .tn-name { display: none; }
  .tn-caret { font-size: 10px; opacity: 0.8; }
  .tool.undo, .tool.redo { height: 40px; padding: 0 5px; order: 2; }
  .tool.redo:not(.avail) { display: none; }
  .dock .hotbar .slot:nth-child(n+7):not(.more) { display: none; }
  .slot { width: 38px; height: 38px; }
  .slot.more { font-size: 20px; }
  .hud-tr .fold { display: none; }
  .more-btn { display: grid; }
  .hud-tr { flex-direction: row; }
  .invite { display: none; }
  .star-chip { padding: 6px 10px; font-size: 13px; }
  .world-pill { padding: 5px 11px; }
  .wp-count { font-size: 10px; }
  .coords { display: none; }
  .quests { padding: 7px 10px; }
  .quests:not(.open) .quest { display: none; }
  .quests .qtitle { cursor: pointer; }
  .quests .qtitle::after { content: ' ▸'; }
  .quests.open .qtitle::after { content: ' ▾'; }
  .plot-chip { font-size: 12px; padding: 4px 5px 4px 11px; }
  .plot-chip .buy { padding: 3px 9px; }
  .bottom { gap: 6px; }
  .stick { bottom: calc(70px + var(--safe-b)); width: 104px; height: 104px; left: calc(16px + var(--safe-l)); }
  .touch-right { bottom: calc(70px + var(--safe-b)); right: calc(12px + var(--safe-r)); gap: 8px; }
  .tbtn { width: 58px; height: 58px; }
  .tbtn.small { width: 46px; height: 46px; }
  .chat-log { bottom: calc(190px + var(--safe-b)); }
}
@media (max-width: 380px) {
  .dock .hotbar .slot:nth-child(n+6):not(.more) { display: none; }
  .slot { width: 36px; height: 36px; }
}
/* phones held sideways: the dock moves left of centre so the joystick and buttons keep their corners */
@media (max-height: 500px) and (orientation: landscape) {
  .stick { bottom: calc(14px + var(--safe-b)); }
  .touch-right { bottom: calc(14px + var(--safe-b)); }
  .more-menu { top: calc(56px + var(--safe-t)); }
}
@media (max-height: 500px) and (orientation: landscape) and (max-width: 700px) {
  .stick, .touch-right { bottom: calc(64px + var(--safe-b)); }
}

/* ---------- Trailhead: the Build Path bar and the passport ---------- */
.trail-bar { pointer-events: auto; flex-basis: 100%; display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; padding: 7px 10px; border-radius: 14px; width: max-content; max-width: min(320px, calc(100vw - 110px)); }
.trail-bar .btn.small { padding: 5px 10px; font-size: 12px; }
.tb-where { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tb-land { width: 12px; height: 12px; border-radius: 4px; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,0.25); }
.tb-pips { display: inline-flex; gap: 4px; margin-left: 4px; }
.tb-pips i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.18); display: inline-block; }
.tb-pips i.on { background: #7bd45a; }
.tb-pips i.star { background: #ffd34d; }
.tb-pips i.next { background: #5fe3ff; animation: tbpulse 1.4s ease-in-out infinite; }
.tb-task { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.3; }
@keyframes tbpulse { 50% { transform: scale(1.35); } }
.pp-page { position: relative; padding: 16px; margin-bottom: 12px; border-radius: 16px; background: linear-gradient(180deg, #fbf3df, #f1e4c4); color: #3b2f22; box-shadow: inset 0 0 0 1px rgba(90,60,30,0.2), 0 6px 18px rgba(0,0,0,0.25); overflow: hidden; }
.pp-page::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: linear-gradient(90deg, rgba(90,60,30,0.25), transparent); }
.pp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pp-head .muted { color: #7a6448; font-size: 12px; }
.pp-stops { display: grid; gap: 6px; margin-bottom: 12px; }
.pp-stop { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1.5px dashed rgba(90,60,30,0.3); font-weight: 800; font-size: 14px; }
.pp-stop.done { border-style: solid; background: rgba(123,212,90,0.18); }
.pp-stop.next { border-color: #2aa7c9; }
.pp-t { flex: 1; }
.pp-m { font-size: 15px; color: #3a7d27; }
.pp-stamp { --ink: #7bd45a; margin: 4px auto 0; width: 190px; height: 110px; border-radius: 50% / 45%; border: 3px dashed rgba(90,60,30,0.3); display: grid; place-content: center; text-align: center; transform: rotate(-6deg); color: rgba(90,60,30,0.45); font-weight: 800; font-size: 12px; }
.pp-stamp.inked { border: 4px double var(--ink); color: var(--ink); filter: saturate(1.2) contrast(1.1); text-shadow: 0 0 1px currentColor; mix-blend-mode: multiply; }
.pp-stamp.inked .pp-s1 { font-size: 16px; letter-spacing: 1.5px; font-weight: 900; }
.pp-stamp.inked .pp-s2 { font-size: 11px; opacity: 0.9; }
.pp-stamp.inked .pp-s3 { font-size: 10px; opacity: 0.8; margin-top: 2px; }
.pp-stamp.slam { animation: stampSlam 0.7s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes stampSlam { 0% { transform: translateY(-60px) scale(1.6) rotate(-14deg); opacity: 0; } 45% { transform: translateY(-40px) scale(1.5) rotate(-12deg); opacity: 1; } 60% { transform: translateY(0) scale(0.94) rotate(-6deg); } 72% { transform: scale(1.03) rotate(-6deg); } 100% { transform: scale(1) rotate(-6deg); } }
@media (max-width: 760px), (max-height: 500px) { .tb-task { display: none; } .trail-bar { padding: 5px 9px; gap: 6px; } .tb-where { font-size: 12px; } .tb-pips i { width: 7px; height: 7px; } }

.pp-now { padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: rgba(95,227,255,0.12); border: 1px solid rgba(95,227,255,0.4); display: grid; gap: 4px; font-size: 14px; }

/* An AI streamer's planet: a strip of their builds, tap one to fly there (public/js/main.js) */
.builds-bar { flex-basis: 100%; display: flex; align-items: center; gap: 6px; max-width: min(92vw, 640px); padding: 6px 6px 6px 12px; border-radius: 16px; overflow-x: auto; scrollbar-width: none; }
.builds-bar::-webkit-scrollbar { display: none; }
.builds-bar .bb-label { font-weight: 800; font-size: 12px; opacity: 0.8; white-space: nowrap; }
.builds-bar .bb-chip { flex: none; white-space: nowrap; font: inherit; font-weight: 800; font-size: 13px; color: #fff; border: 0; border-radius: 999px; padding: 7px 12px; background: rgba(124, 92, 255, 0.55); cursor: pointer; }
.builds-bar .bb-chip:hover { background: rgba(124, 92, 255, 0.85); }
.builds-bar .bb-x { flex: none; border: 0; background: transparent; color: #fff; opacity: 0.7; font-size: 16px; padding: 4px 8px; cursor: pointer; }
.builds-bar.small { padding: 4px; }

/* home → Places: one tidy list of everywhere to go */
.place-row { width: 100%; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; gap: 12px; }
.place-row .place-ico { font-size: 24px; width: 34px; text-align: center; flex: none; }
.place-row .place-go { font-size: 22px; opacity: 0.6; flex: none; }

/* ---- the Powell Play studio mark (kit: brand-assets/references/studio-mark.md). Never during play. */
#splash .pp-fade { position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(to bottom, transparent, rgba(7, 10, 26, 0.69)); pointer-events: none; }
#splash .pp-studio { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(3.5vh + env(safe-area-inset-bottom, 0px)); width: clamp(140px, 34vmin, 280px); height: auto; opacity: .92; animation: pp-in .25s ease-out both; }
@keyframes pp-in { from { opacity: 0 } }
/* the home-screen mark is the front door to Powell Play: it opens the Powell Play sheet (powellplay-ui.md 1b) */
.pp-home-studio { display: block; justify-self: center; align-self: center; margin: 24px auto calc(16px + env(safe-area-inset-bottom, 0px)); padding: 6px; min-height: 44px; background: none; border: 0; cursor: pointer; flex: none; }
.pp-home-studio[hidden] { display: none; }
.pp-home-mark { display: block; width: 104px; height: auto; opacity: .55; transition: opacity .15s; }
.pp-home-studio:hover .pp-home-mark, .pp-home-studio:focus-visible .pp-home-mark, .pp-home-studio:active .pp-home-mark { opacity: .9; }
/* the Powell Play button (top right) is the one place for feedback on the web (W7) */
html.pp-bar-on #talkHome { display: none; }
.pp-settings-studio img { display: block; width: 100%; height: auto; }
.pp-settings-foot { text-align: center; font-size: 12.5px; color: var(--muted); display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; }
.pp-settings-studio { display: block; width: 120px; opacity: .7; }
.pp-settings-studio:focus-visible, .pp-settings-studio:active { opacity: 1; }
.pp-settings-foot a { color: var(--muted); }
html.portal .pp-home-studio, html.portal .pp-settings-studio, html.portal .pp-studio, html.portal .pp-fade, html.portal a[href="/support"] { display: none; }
/* room for the bigger home logo (bottom edge: 14px + 136px wide screens, 14px + 90px phones) */
@media (min-width: 761px) and (min-height: 600px) { .home-card { top: calc(164px + var(--safe-t)); transform: none; max-height: calc(100% - 188px); } }
@media (min-width: 761px) and (max-height: 599px) { .home-card { top: calc(116px + var(--safe-t)); transform: none; max-height: calc(100% - 128px); } }
@media (max-width: 760px) { .space-hero { top: calc(162px + var(--safe-t)); } .planet-hint { top: calc(204px + var(--safe-t)); } }
@media (max-width: 760px) and (max-height: 599px), (max-width: 599px) { .space-hero { top: calc(114px + var(--safe-t)); } .planet-hint { top: calc(156px + var(--safe-t)); } }
/* the Powell Play button's corner (top right): 56 px kept clear of our own controls (W1) */
html.pp-bar-on .home-top .net-pill { margin-top: 44px; }
.home-legal .legal-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
/* inside the Powell Play app, the app is Powell Play: no studio mark on the game's screens (channels.md H6) */
html.pp-host .pp-settings-studio, html.pp-host #splash .pp-studio, html.pp-host #splash .pp-fade, html.pp-host .pp-home-studio { display: none; }
