/* Worldview Timeline web preview. CSP is style-src 'self' — no inline style attributes. */
:root {
  --bg: #0b1a30; --panel: #12253f; --line: #1e3a5c; --ink: #e8f1fb;
  --dim: #8fb0d0; --accent: #7dd3fc; --hot: #facc15; --warn: #fb923c;
  --sat-t: env(safe-area-inset-top, 0px);
  --sat-r: env(safe-area-inset-right, 0px);
  --sat-b: env(safe-area-inset-bottom, 0px);
  --sat-l: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: flex; flex-direction: column; min-height: 100%; min-height: 100dvh;
  overflow-x: clip;
}
.topbar {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  padding-left: max(18px, var(--sat-l));
  padding-right: max(18px, var(--sat-r));
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 28px; height: 28px; }
.brand h1 { font-size: 16px; letter-spacing: .12em; margin: 0; color: var(--accent); }
.tag {
  font-size: 10px; letter-spacing: .14em; color: var(--hot);
  border: 1px solid var(--hot); border-radius: 99px; padding: 1px 8px;
  vertical-align: middle;
}
.ghost {
  background: #0e1f36; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; font: inherit; cursor: pointer;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.help {
  margin: 0; padding: 12px 18px; background: #0e1f36; color: var(--dim);
  border-bottom: 1px solid var(--line); font-size: 13px; max-width: 92ch;
  padding-left: max(18px, var(--sat-l));
  padding-right: max(18px, var(--sat-r));
}
.help[hidden] { display: none !important; }
.help strong { color: var(--ink); }
.controls {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  padding-left: max(18px, var(--sat-l));
  padding-right: max(18px, var(--sat-r));
}
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { color: var(--dim); font-size: 11px; letter-spacing: .08em; }
input, select, button {
  background: #0e1f36; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; font: inherit; font-size: 13px;
}
input[type="range"] { width: min(260px, 100%); padding: 0; accent-color: var(--accent); }
button { cursor: pointer; border-color: var(--accent); color: var(--accent); }
button:hover { background: #16304f; }
.clock { color: var(--hot); font-size: 15px; letter-spacing: .06em; }
.status { color: var(--dim); font-size: 12px; }
#stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: #0a2438 url("poster.jpg") center / cover no-repeat; cursor: grab;
}
@media (min-height: 700px) {
  #stage { min-height: 420px; }
}
@media (max-width: 880px) {
  #stage { min-height: min(56svh, calc(100svh - 14rem)); }
}
#stage.drag { cursor: grabbing; }
#tiles { position: absolute; left: 0; top: 0; }
#tiles img {
  position: absolute; width: 256px; height: 256px;
  image-rendering: pixelated; user-select: none; pointer-events: none;
}
.legend {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(11, 26, 48, .86); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; color: var(--dim); font-size: 11px;
}
.legend b { color: var(--ink); }
.places { display: flex; gap: 6px; flex-wrap: wrap; }
.credit {
  color: var(--dim); font-size: 11px; padding: 10px 18px;
  border-top: 1px solid var(--line);
  padding-left: max(18px, var(--sat-l));
  padding-right: max(18px, var(--sat-r));
  padding-bottom: max(10px, var(--sat-b));
}

@media (max-height: 540px) and (orientation: landscape) {
  body { overflow: hidden; }
  .topbar { padding: 4px 12px; gap: 10px;
    padding-left: max(12px, var(--sat-l)); padding-right: max(12px, var(--sat-r)); }
  .brand h1 { font-size: 14px; }
  .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .status { display: none; }
  .controls { padding: 4px 12px; gap: 8px; align-items: center;
    padding-left: max(12px, var(--sat-l)); padding-right: max(12px, var(--sat-r)); }
  .credit { display: none; }
  #stage { flex: 1; min-height: 0; }
  .legend { font-size: 9px; line-height: 1.25; padding: 4px 6px; left: 8px; bottom: 8px; }
  input[type="range"] { width: min(200px, 32vw); }
}

@media (pointer: coarse) {
  button, .ghost { min-height: 40px; }
  input[type="range"] { min-height: 32px; }
}
