/* Bitcoin MOI live chain in 3D - Bitcoin orange on dark, gold accents.
   Adapted from the Skydoge live-chain viewer's stylesheet. No inline styles
   anywhere in the page, so it runs under a style-src 'self' policy. */
:root {
  --bg: #0c0c10; --ink: #eef0f6; --dim: #a2a4af; --mute: #6b6e7a;
  --orange: #f7931a; --gold: #ffd84a; --amber: #ffd0a8; --red: #ff5a4e; --green: #4fa96a; --cyan: #37f2ff;
  --line: rgba(247,147,26,.22); --glass: rgba(12,12,16,.74);
  --hud: 'Orbitron', 'Share Tech Mono', monospace;
  --mono: 'Share Tech Mono', ui-monospace, Menlo, Consolas, monospace;
  --crt: 'VT323', 'Share Tech Mono', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 15px; overflow: hidden; -webkit-text-size-adjust: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 600; }
.hidden { display: none !important; }
.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2em; text-align: center; color: var(--dim); }

#stage { position: fixed; inset: 0; cursor: grab; touch-action: none; }
#stage.dragging { cursor: grabbing; }
#stage.hover { cursor: pointer; }
#scene, #scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 60%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%); }
.scan { position: absolute; inset: 0; pointer-events: none; opacity: .06; background: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px); }
body.booting #scene { opacity: 0; }
#scene { transition: opacity .9s ease; }

#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-family: var(--hud); font-size: 12px; letter-spacing: .06em; color: var(--ink); text-shadow: 0 0 6px rgba(0,0,0,.9), 0 0 14px rgba(0,0,0,.8); text-align: center; line-height: 1.25; }
.lbl small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: var(--dim); }
.lbl .who { color: var(--orange); }
.lbl .addr { color: var(--gold); }
.lbl.dim { color: var(--mute); font-size: 11px; }
.lbl.big { font-size: 16px; color: var(--gold); }
.lbl.next { color: var(--gold); }
.lbl.miner { font-size: 11px; color: var(--dim); }
.lbl.miner .who { color: var(--amber); }

.tip { position: absolute; z-index: 5; max-width: 320px; padding: 8px 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 4px; font-size: 12.5px; line-height: 1.45; pointer-events: none; backdrop-filter: blur(6px); word-break: break-all; }
.tip .t2 { color: var(--dim); }
.tip .who { color: var(--orange); }
.tip .addr { color: var(--gold); font-family: var(--mono); }

.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: linear-gradient(180deg, rgba(12,12,16,.92), rgba(12,12,16,.55)); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; font-family: var(--hud); }
.brand b { font-size: 17px; font-weight: 800; letter-spacing: .14em; color: var(--orange); text-shadow: 0 0 18px rgba(247,147,26,.45); }
.brand-sub { font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: .04em; }
.conn { font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--mute); color: var(--dim); }
.conn.live { border-color: var(--green); color: var(--green); }
.conn.retrying { border-color: var(--gold); color: var(--gold); }
.conn.offline { border-color: var(--red); color: var(--red); }
.search { display: flex; gap: 4px; flex: 1 1 220px; max-width: 420px; }
.search input { flex: 1; min-width: 0; padding: 5px 8px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font-family: var(--mono); font-size: 13px; }
.search input:focus { outline: none; border-color: var(--orange); }
.search button, .tb { padding: 5px 9px; background: rgba(247,147,26,.08); border: 1px solid var(--line); border-radius: 3px; color: var(--amber); font-family: var(--mono); font-size: 12.5px; cursor: pointer; letter-spacing: .03em; }
.tb:hover, .search button:hover { background: rgba(247,147,26,.2); color: var(--ink); text-decoration: none; }
.tb.on { background: var(--orange); color: #0c0c10; border-color: var(--orange); }
.controls { display: flex; gap: 6px; flex-wrap: wrap; }
/* the 3D | 2D switch: two halves of one control, the lit half is the renderer in use */
.seg { display: inline-flex; }
.seg .tb { border-radius: 0; min-width: 34px; }
.seg .tb:first-child { border-radius: 3px 0 0 3px; }
.seg .tb:last-child { border-radius: 0 3px 3px 0; border-left: 0; }
#hRender { max-width: 240px; white-space: normal; line-height: 1.3; }
/* the renderer notice: shown whenever the page itself changes the renderer */
.rnote { position: fixed; left: 50%; top: 58px; z-index: 8; transform: translateX(-50%); display: none; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 24px); padding: 6px 6px 6px 12px; background: rgba(12,12,16,.92); border: 1px solid rgba(255,216,74,.45); border-radius: 4px; font-size: 12.5px; color: var(--amber); }
.rnote.open { display: flex; }
.rnote .tb { flex: 0 0 auto; white-space: nowrap; }
.rnote .px { flex: 0 0 auto; }
/* "tap anywhere to enable sound": a stored sound waits for the first gesture on the page */
#btnSound { min-width: 6.6em; text-align: center; white-space: nowrap; }   /* fixed width: off/bell/bark never re-wrap the toolbar */
.shint { display: none; position: fixed; left: 12px; top: 92px; z-index: 9; pointer-events: none; white-space: nowrap; font-size: 11.5px; color: var(--dim);
  background: rgba(12,12,16,.92); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; }   /* floats, takes no toolbar space */
.shint.open { display: block; }
.shint.flash { color: var(--gold); }
/* the genesis headline card in the genesis panel */
.ogthumb { display: block; margin: 8px 0 4px; max-width: 420px; }
.ogthumb img { display: block; width: 100%; height: auto; border: 1px solid rgba(255,216,74,.35); border-radius: 4px; }
.tb.hidden { display: none; }
/* my blocks */
.mineform { display: flex; gap: 6px; margin: 8px 0; }
.mineform input { flex: 1; min-width: 0; padding: 5px 8px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font-family: var(--mono); font-size: 12.5px; }
/* stream / screensaver mode: only the scene, the celebration and a one-line overlay */
.streambar, .streamexit { display: none; }
html.stream #topbar, html.stream #hud, html.stream #legend, html.stream #early, html.stream #follow,
html.stream #rnote, html.stream #panel, html.stream #tip, html.stream .scan { display: none !important; }
html.stream .streambar { display: block; position: fixed; left: 24px; bottom: 20px; z-index: 6; padding: 10px 16px; background: rgba(12,12,16,.62); border: 1px solid rgba(255,216,74,.3); border-radius: 6px; font-family: var(--hud); font-size: clamp(14px, 1.6vw, 26px); letter-spacing: .06em; color: var(--ink); white-space: nowrap; max-width: calc(100vw - 48px); overflow: hidden; text-overflow: ellipsis; }
html.stream .streambar b { color: var(--orange); }
html.stream .streambar i { color: var(--mute); font-style: normal; }
html.stream .streambar .sb-url { font-family: var(--mono); color: var(--amber); }
html.stream .streamexit { display: block; position: fixed; top: 10px; right: 10px; z-index: 7; padding: 4px 10px; background: rgba(12,12,16,.6); border: 1px solid var(--line); border-radius: 3px; color: var(--dim); font-family: var(--mono); font-size: 12px; cursor: pointer; opacity: .35; }
html.stream .streamexit:hover { opacity: 1; }
html.stream .mined { top: 40px !important; font-size: clamp(15px, 2vw, 30px); }
/* follow latest: shown when the visitor has the camera; top right, or low and centred on a phone */
.follow { position: fixed; right: 12px; top: 90px; z-index: 6; display: none; padding: 6px 12px; background: rgba(12,12,16,.9); border: 1px solid var(--orange); border-radius: 14px; color: var(--amber); font-family: var(--mono); font-size: 12.5px; cursor: pointer; }
.follow.open { display: block; }
.follow:hover { background: var(--orange); color: #0c0c10; }
/* the new-block banner: in for 4 s, then it fades */
.mined { position: fixed; left: 50%; top: 134px; z-index: 4; transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 6px 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; font-family: var(--hud); font-size: 15px; letter-spacing: .1em; color: var(--ink); background: rgba(12,12,16,.74); border: 1px solid rgba(255,216,74,.55); border-radius: 4px; box-shadow: 0 0 24px rgba(247,147,26,.35); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
.mined.open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.mined b { color: var(--gold); font-weight: 800; }
.mined .by { color: var(--amber); font-family: var(--mono); font-size: 13px; letter-spacing: .03em; }

.hud { position: fixed; left: 12px; bottom: 12px; z-index: 5; min-width: 230px; padding: 10px 28px 10px 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 4px; backdrop-filter: blur(6px); font-size: 12.5px; }
.hrow { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.hrow .k { color: var(--dim); }
.hrow .v { font-family: var(--hud); font-size: 12px; letter-spacing: .04em; text-align: right; }
.hrow .v.hi { color: var(--orange); font-size: 15px; }
.hrow .v.dim { color: var(--mute); font-family: var(--mono); }
.hrow .v.gold { color: var(--gold); }
/* collapsible panels: a corner toggle, and a one-line form when collapsed */
.ptog { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0; background: rgba(247,147,26,.1); border: 1px solid var(--line); border-radius: 3px; color: var(--amber); font-family: var(--mono); font-size: 14px; line-height: 1; cursor: pointer; }
.ptog:hover { background: rgba(247,147,26,.25); color: var(--ink); }
.hud.collapsed { min-width: 0; padding: 6px 28px 6px 10px; }
.hud.collapsed #hudFull { display: none; }
.hud.collapsed .hmini { display: flex; }
.hmini { display: none; align-items: baseline; gap: 10px; font-family: var(--hud); font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
.hmini .hi { color: var(--orange); font-size: 15px; }
.hmini .dim { color: var(--dim); font-family: var(--mono); }
.hmini .gold { color: var(--gold); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.legend.collapsed { padding: 5px 28px 5px 10px; }
.legend.collapsed #legFull { display: none; }
.legend.collapsed .lmini { display: inline; }
.lmini { display: none; color: var(--dim); font-size: 11.5px; letter-spacing: .06em; }
body.nopanels .hud, body.nopanels .legend { display: none; }
.pacebar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; margin-right: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.pacebar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--gold)); }
.hfacts { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--mute); font-size: 11.5px; letter-spacing: .03em; }
.hfacts span { color: var(--dim); }

.legend { position: fixed; right: 12px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; gap: 3px; padding: 8px 28px 8px 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 4px; font-size: 11.5px; color: var(--dim); }
.legend .sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.sw.p1 { background: var(--orange); }
.sw.p0 { background: #b9bec7; }
.sw.px { background: linear-gradient(90deg, #a78bfa, #6ee7b7, #fb7185); }
.sw.dc { background: var(--gold); }
.sw.mp { background: var(--cyan); }
.legend .hint { color: var(--mute); margin-top: 3px; }

.panel { position: fixed; right: 12px; top: 56px; z-index: 7; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 160px); display: none; flex-direction: column; background: var(--glass); border: 1px solid var(--line); border-radius: 4px; backdrop-filter: blur(8px); }
.panel.open { display: flex; }
.phead { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-family: var(--hud); font-size: 13px; letter-spacing: .08em; color: var(--orange); }
.phead .pnav { flex: 1; font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.px { background: none; border: 0; color: var(--dim); font-size: 20px; line-height: 1; cursor: pointer; }
.px:hover { color: var(--ink); }
.pbody { overflow: auto; padding: 10px; font-size: 12.5px; line-height: 1.5; }
.pbody .row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dotted rgba(255,255,255,.06); }
.pbody .row .k { color: var(--dim); flex: 0 0 auto; }
.pbody .row .v { text-align: right; word-break: break-all; }
.pbody .who { color: var(--orange); }
.pbody .addr { font-family: var(--mono); color: var(--gold); }
.pbody h4 { margin: 10px 0 4px; font-family: var(--hud); font-size: 11.5px; letter-spacing: .1em; color: var(--dim); font-weight: 600; }
.pbody .list a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 4px; border-radius: 3px; color: var(--ink); }
.pbody .list a:hover { background: rgba(247,147,26,.12); text-decoration: none; }
.pbody .list .m { color: var(--amber); }
.pbody .list .d { color: var(--mute); }
.pbody .note { color: var(--mute); font-size: 11.5px; margin-top: 6px; }
.pbody .links { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* the early-chain card sits under the toolbar, small, so the genesis cube in the middle of the stage stays in view */
.early { position: fixed; left: 50%; top: 100px; z-index: 4; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); padding: 8px 30px 10px 14px; text-align: center; background: rgba(12,12,16,.78); border: 1px solid rgba(255,216,74,.35); border-radius: 6px; backdrop-filter: blur(8px); box-shadow: 0 0 40px rgba(247,147,26,.12); display: none; }
.early.open { display: block; }
.early .sub { font-family: var(--crt); font-size: 19px; color: var(--gold); margin: 0 0 2px; }
.early .fact { color: var(--dim); margin: 2px 0; font-size: 12px; }
.early .strat { display: inline-block; margin-top: 4px; padding: 3px 8px; background: rgba(0,0,0,.5); border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); font-size: 12.5px; color: var(--amber); word-break: break-all; user-select: all; }
.early .big { font-family: var(--hud); font-size: 18px; color: var(--ink); letter-spacing: .1em; margin: 2px 0; }
.early .px { position: absolute; top: 2px; right: 6px; }
/* after block 1 the strip is a one-line pill that goes away by itself */
.early.pill { top: 92px; width: auto; max-width: calc(100vw - 32px); padding: 4px 30px 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; color: var(--dim); border-color: var(--line); background: rgba(12,12,16,.7); }
.early.pill .big { display: inline; font-size: 13px; margin: 0 8px 0 0; color: var(--gold); }
.early.pill .strat { display: inline; margin: 0 0 0 6px; padding: 1px 6px; font-size: 12px; }
.early.pill .px { top: 0; }
.lbl.genesis { color: var(--gold); font-size: 14px; z-index: 2; padding: 4px 9px 5px; background: rgba(12,12,16,.8); border: 1px solid rgba(255,216,74,.35); border-radius: 4px; }   /* above every other label, readable over the cubes */
.lbl.genesis small { color: var(--amber); max-width: 420px; white-space: normal; }
.lbl.genesis small.t { color: var(--dim); }
.pbody .headline { font-family: var(--crt); font-size: 20px; line-height: 1.2; color: var(--gold); margin: 6px 0 8px; }
.pbody .pushes { color: var(--amber); word-break: break-word; }
.pbody .pushes .sep { color: var(--mute); }
.pbody details { margin: 4px 0 2px; }
.pbody summary { cursor: pointer; color: var(--dim); font-size: 11.5px; letter-spacing: .04em; }
.pbody .hex { font-family: var(--mono); font-size: 11px; color: var(--mute); word-break: break-all; line-height: 1.35; margin-top: 3px; }
.tip .ss { color: var(--amber); }

.toast { position: fixed; left: 50%; top: 64px; z-index: 9; transform: translateX(-50%); padding: 7px 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 4px; font-size: 12.5px; color: var(--amber); display: none; }
.fallback { position: fixed; inset: 56px 12px 12px; z-index: 3; overflow: auto; padding: 12px; color: var(--dim); display: none; }
.fallback.open { display: block; }
.fallback table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fallback td, .fallback th { padding: 4px 6px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); }
.fallback th { color: var(--orange); font-family: var(--hud); font-size: 11px; letter-spacing: .08em; }
.chip { display: inline-block; padding: 0 6px; border: 1px solid rgba(255,216,74,.4); border-radius: 9px; color: var(--gold); font-size: 11px; letter-spacing: .04em; }

@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .brand-sub { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hud { left: 8px; right: 8px; bottom: 8px; min-width: 0; padding: 8px 10px; font-size: 12px; }
  .hrow.phone-hide { display: none; }
  .legend { display: none; }
  .panel { right: 0; left: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 62vh; border-radius: 6px 6px 0 0; }
  .early { top: 136px; padding: 6px 26px 8px 10px; }
  .early.pill { top: 130px; }
  .early .sub { font-size: 16px; }
  .early .big { font-size: 15px; }
  .lbl.genesis small { max-width: 260px; }
  .tip { max-width: 260px; }
  .scan { display: none; }
  .mined { top: 172px; font-size: 13px; padding: 5px 12px; }
  .mined .by { font-size: 12px; }
  .rnote { font-size: 12px; flex-wrap: wrap; justify-content: center; }
  .follow { right: auto; left: 50%; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  #scene { transition: none; }
  .scan { display: none; }
  .mined, .mined.open { transition: none; }
}
