/* 4Muses World: a full-screen 3D view with floating bars. */
:root {
  --panel: rgba(255, 255, 255, .88); --ink: #221a36; --muted: #625a77; --line: rgba(34, 26, 54, .14);
  --glow: #ff6a45; --on-glow: #ffffff; --soft: rgba(34, 26, 54, .06);
  --f-display: "Syne", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --panel: rgba(31, 26, 46, .88); --ink: #efeaf9; --muted: #a9a1bf; --line: rgba(239, 234, 249, .16);
  --glow: #ff8566; --on-glow: #1a1016; --soft: rgba(239, 234, 249, .08); color-scheme: dark; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: #bcd7ee; color: var(--ink); font: 15px/1.4 var(--f-body); overscroll-behavior: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 7px 12px; font-weight: 700; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--glow); color: var(--on-glow); border-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }

.bar { position: fixed; left: 0; right: 0; display: flex; gap: 8px; align-items: center; padding: 8px 12px; pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar.top { top: 0; padding-top: max(8px, env(safe-area-inset-top)); flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); background: var(--panel); border-radius: 12px; padding: 6px 10px; font: 800 1rem var(--f-display); backdrop-filter: blur(8px); }
.logo img { width: 22px; height: 22px; }
.logo i { font-style: normal; color: var(--glow); }
.logo b { font-weight: 700; color: var(--muted); }
.pick { display: flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 12px; padding: 4px 4px 4px 10px; backdrop-filter: blur(8px); min-width: 0; }
.pick span { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pick select { border: 0; background: transparent; padding: 4px; max-width: 46vw; font-weight: 700; }
.seg { display: flex; background: var(--panel); border-radius: 12px; padding: 3px; gap: 2px; backdrop-filter: blur(8px); }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 6px 12px; }
.seg button[aria-pressed=true] { background: var(--glow); color: var(--on-glow); }
body[data-shape=flat] .globe-only, body[data-shape=globe] .flat-only { display: none; }
.panel select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: transparent; }
.round { margin-left: auto; width: 38px; height: 38px; padding: 0; border-radius: 50%; background: var(--panel); font-size: 1.2rem; backdrop-filter: blur(8px); }

.panel { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 54px); right: 12px; width: min(360px, calc(100vw - 24px)); background: var(--panel); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); z-index: 2; }
.panel .row { display: flex; gap: 8px; flex-wrap: wrap; }
.panel label { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.panel input[type=number] { width: 4.2em; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: transparent; }
.about { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 52px); left: 12px; max-width: min(520px, calc(100vw - 24px)); margin: 0; background: var(--panel); border-radius: 12px; padding: 8px 12px; font-size: .84rem; backdrop-filter: blur(8px); }
.about { cursor: pointer; }
.about b { font-family: var(--f-display); }
.note { margin: 0; font-size: .8rem; color: var(--muted); }

.bar.bottom { bottom: 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); justify-content: center; }
.bar.bottom > div { background: var(--panel); border-radius: 16px; padding: 10px; backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0, 0, 0, .15); max-width: 100%; }
.look-only { display: flex; align-items: center; gap: 12px; }
.build-only { display: flex; flex-direction: column; gap: 8px; width: min(920px, 100%); }
body[data-mode=look] .build-only, body[data-mode=build] .look-only { display: none; }
.hint { margin: 0; font-size: .8rem; color: var(--muted); }
.tools { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tool { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 6px; font-size: .72rem; font-weight: 700; min-width: 54px; }
.tool::before { content: ""; width: 26px; height: 18px; border-radius: 5px; background: var(--c, var(--soft)); border: 1px solid var(--line); }
.tool.t-up::before { content: "▲"; background: none; border: 0; height: auto; font-size: .9rem; line-height: 18px; text-align: center; }
.tool.t-down::before { content: "▼"; background: none; border: 0; height: auto; font-size: .9rem; line-height: 18px; text-align: center; }
.tool.t-river::before, .tool.t-road::before { height: 6px; margin: 6px 0; border-radius: 3px; }
.tool.t-erase::before { content: "✕"; background: none; border: 0; height: auto; font-size: .9rem; line-height: 18px; text-align: center; }
.tool[aria-pressed=true] { border-color: var(--glow); box-shadow: inset 0 0 0 1px var(--glow); background: var(--panel); }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions #brush { margin-right: auto; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 150px; background: var(--ink); color: var(--panel); padding: 8px 14px; border-radius: 10px; font-size: .88rem; max-width: calc(100vw - 32px); z-index: 3; }
@media (max-width: 520px) {
  .logo span { display: none; }
  .pick span { display: none; }
  .about { top: calc(max(8px, env(safe-area-inset-top)) + 96px); font-size: .78rem; }
  .bar.bottom .hint { display: none; }
}
