/* The Realm: 3d.css. The buttons and panels on top of the 3D scene. */
:root { --ink: #f3f5ef; --glass: rgba(18, 28, 36, 0.62); --edge: rgba(255, 255, 255, 0.22); --weld: #e3b43a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1a22; color: var(--ink);
  font-family: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; touch-action: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

.top, .bottom { position: fixed; left: 0; right: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.7rem; pointer-events: none; z-index: 3; }
.top { top: 0; padding-top: calc(0.6rem + env(safe-area-inset-top, 0px)); background: linear-gradient(180deg, rgba(10,16,22,0.55), transparent); }
.bottom { bottom: 0; padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px)); justify-content: center; flex-wrap: wrap; background: linear-gradient(0deg, rgba(10,16,22,0.5), transparent); }
.top > *, .bottom > * { pointer-events: auto; }
.title { flex: 1; text-align: center; font-weight: 700; font-size: 1.15rem; text-shadow: 0 1px 4px rgba(0,0,0,0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill, .seg button, select {
  min-height: 2.6rem; padding: 0.3rem 0.9rem; border: 1px solid var(--edge); border-radius: 1.4rem;
  background: var(--glass); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
select { appearance: none; -webkit-appearance: none; padding-right: 1.2rem; max-width: 46vw; }
select option { color: #111; }
.pill:active, .seg button:active { transform: translateY(1px); }
.seg { display: inline-flex; border-radius: 1.4rem; overflow: hidden; border: 1px solid var(--edge); }
.seg button { border: 0; border-radius: 0; }
.seg button.is-on { background: var(--weld); color: #1b2421; }

.panel { position: fixed; top: calc(3.6rem + env(safe-area-inset-top, 0px)); right: 0.7rem; z-index: 4; display: grid; gap: 0.6rem; padding: 0.8rem;
  border: 1px solid var(--edge); border-radius: 0.8rem; background: rgba(18, 28, 36, 0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); min-width: 12rem; }
.panel[hidden] { display: none; }
.panel label { display: grid; gap: 0.25rem; font-size: 0.9rem; font-weight: 600; }

.info { position: fixed; left: 0.7rem; bottom: calc(var(--bar-h, 4rem) + 3.6rem); z-index: 3; max-width: min(22rem, 86vw);
  padding: 0.6rem 0.9rem; border: 1px solid var(--edge); border-radius: 0.8rem; background: rgba(18, 28, 36, 0.8);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); line-height: 1.3; }
.info[hidden], .toast[hidden] { display: none; }
.info strong { display: block; font-size: 1.1rem; }
.info span { font-size: 0.92rem; opacity: 0.9; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(4rem + env(safe-area-inset-top, 0px)); z-index: 5; padding: 0.5rem 0.9rem;
  border-radius: 1.2rem; background: rgba(18, 28, 36, 0.9); border: 1px solid var(--edge); font-weight: 600; max-width: 90vw; text-align: center; }
.hint { position: fixed; left: 0; right: 0; bottom: calc(var(--bar-h, 4rem) + 0.4rem); margin: 0; text-align: center; z-index: 2;
  font-size: 0.85rem; opacity: 0.8; text-shadow: 0 1px 3px rgba(0,0,0,0.8); pointer-events: none; padding: 0 1rem; }
.veil { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; gap: 1rem; justify-items: center; text-align: center;
  background: #0f1a22; font-size: 1.15rem; padding: 2rem; transition: opacity 0.5s; }
.veil.is-gone { opacity: 0; pointer-events: none; }
.veil[hidden] { display: none; }
