/* Hi-Fi Tuner — web page layout */
:root { --bar: 48px; color-scheme: dark; }
html, body { margin: 0; background: #00000c; color: #c9d0ff; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; font: 12px/1.5 "HFT Mono", ui-monospace, Menlo, Consolas, monospace; }
body[data-look="hifi"] { background: #0e0e0f; }
body[data-look="minimal"] { background: #161616; }
a { color: #6f86ff; }
a:hover { color: #c9d0ff; }

/* top bar */
.wr-bar {
  position: sticky; top: 0; z-index: 10; height: var(--bar); box-sizing: border-box;
  display: flex; align-items: center; gap: 16px; padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  background: rgba(0, 0, 12, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(90, 110, 255, .22);
}
body[data-look="hifi"] .wr-bar { background: rgba(14, 14, 15, .9); border-color: #2a2a2c; }
body[data-look="minimal"] .wr-bar { background: rgba(22, 22, 22, .9); border-color: #2a2a2a; }
.wr-brand { display: flex; align-items: center; gap: 8px; color: #c9d0ff; text-decoration: none; letter-spacing: 2px; font-weight: 600; white-space: nowrap; }
.wr-looks { display: flex; gap: 2px; margin-left: auto; }
.wr-looks button, .wr-install {
  -webkit-appearance: none; appearance: none; font: inherit; cursor: pointer;
  padding: 5px 10px; border-radius: 6px; border: 1px solid transparent; background: none; color: #5d67a8;
}
.wr-looks button:hover, .wr-install:hover { color: #c9d0ff; }
.wr-looks button[aria-pressed="true"] { color: #3cff8f; border-color: rgba(60, 255, 143, .35); background: rgba(60, 255, 143, .06); }
.wr-links { display: flex; align-items: center; gap: 12px; }
.wr-links a { color: #5d67a8; text-decoration: none; }
.wr-links a:hover { color: #c9d0ff; }
.wr-install { color: #ffe14d; border-color: rgba(255, 225, 77, .35); }
.wr-install[hidden] { display: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #6f86ff; outline-offset: 2px; }

#app { flex: 1; width: 100%; margin: 0 auto; }
body[data-look="hifi"] #app, body[data-look="minimal"] #app { max-width: 560px; padding-top: 16px; box-sizing: border-box; }

.wr-foot { max-width: 760px; margin: 0 auto; padding: 18px 16px 28px; box-sizing: border-box; color: #5d67a8; font-size: 11px; }
.wr-foot p { margin: 0 0 6px; }
.wr-foot a { color: inherit; }
.wr-noscript { text-align: center; padding: 40px 16px; }

/* ---------- full-screen globe on wide screens ---------- */
@media (min-width: 980px) {
  body[data-look="globe"] { height: 100vh; height: 100dvh; overflow: hidden; }
  body[data-look="globe"] .wr-foot { display: none; }
  body[data-look="globe"] #app.hfg {
    height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar));
    display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-auto-rows: min-content; align-content: start;
    overflow-y: auto; overflow-x: hidden; border-left: 0;
  }
  body[data-look="globe"] #app.hfg > .hfg-stage {
    grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 0;
    height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar)); min-height: 0;
    border-bottom: 0; border-right: 1px solid rgba(90, 110, 255, .28);
  }
  body[data-look="globe"] #app.hfg > :not(.hfg-stage) { grid-column: 2; }
  body[data-look="globe"] #app.hfg .hfg-name { font-size: 22px; }
  body[data-look="globe"] #app.hfg .hfg-hud { left: 24px; bottom: 22px; }
  body[data-look="globe"] #app.hfg .hfg-list { max-height: 46vh; }
}

/* phones */
@media (max-width: 560px) {
  .wr-bar { gap: 8px; padding: 0 10px; }
  .wr-brand span { display: none; }
  .wr-looks button { padding: 5px 7px; }
  .wr-links { gap: 8px; }
  body[data-look="hifi"] #app, body[data-look="minimal"] #app { padding-top: 0; }
}

/* ---------- globe layers + ISS readout ---------- */
.wr-layers {
  position: absolute; top: 34px; right: 10px; z-index: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 3px; border-radius: 6px; background: rgba(0, 0, 12, .5);
}
.wr-layer {
  -webkit-appearance: none; appearance: none; font: 10px/1.4 "HFT Mono", ui-monospace, Menlo, Consolas, monospace; cursor: pointer;
  padding: 2px 4px; border: 0; border-radius: 4px; background: none; color: #3d4580; letter-spacing: .5px;
}
.wr-layer:hover { color: #c9d0ff; }
.wr-layer[aria-pressed="true"] { color: #8fa0ff; }
.wr-layer[aria-pressed="true"]:nth-child(n+3) { color: #ff9b3d; }
.wr-iss {
  position: absolute; right: 12px; bottom: 12px; z-index: 3; max-width: calc(100% - 24px); box-sizing: border-box;
  padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(255, 155, 61, .25); background: rgba(0, 0, 12, .6);
  color: #ff9b3d; font-size: 10px; letter-spacing: .3px; pointer-events: none; white-space: nowrap;
}
.wr-iss[hidden] { display: none; }
@media (min-width: 980px) { .wr-layers { top: 44px; right: 18px; } .wr-iss { right: 20px; bottom: 22px; font-size: 11px; } }
@media (max-width: 979px) {
  .wr-iss { right: auto; left: 10px; bottom: auto; top: 30px; padding: 2px 6px; font-size: 9px; }
  .wr-iss-more { display: none; }
}
