/* The night scene and what sits on it (the Donate button and its dialog, the sound controls, a soul's details),
   shared by the visitors' page (index.html) and the studio (studio.html). One dark look, chosen for the subject. */
:root {
  --night: #0b1020;
  --panel: #141b2e;
  --ink: #e6ebf3;
  --muted: #9fabc0;
  --soul: #cdf4ff;
  --rule: #283350;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fg: var(--ink); --dim: var(--muted); --accent: var(--soul); --line: var(--rule); /* names the volume slider uses */
  color-scheme: dark;
}
html, body { margin: 0; }
body { background: var(--night); color: var(--ink); font: 14px/1.45 var(--body); }
/* the scene fills the whole window */
.scene { position: relative; width: 100%; height: 100vh; height: 100dvh; min-height: 300px; background: var(--night); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dim { color: var(--muted); }
button, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
input[type=number] { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 6px; }
button.primary { border-color: var(--soul); color: var(--soul); }
button:hover, select:hover { border-color: var(--muted); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--soul); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: default; }
#hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 16px; }
#soul { position: absolute; z-index: 1; display: flex; gap: 12px; align-items: flex-start; width: min(420px, calc(100% - 16px)); box-sizing: border-box; padding: 10px 12px 12px;
  background: rgba(21,19,43,0.94); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.4); font-size: 13px; }
#soul .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#soul .head code { color: var(--muted); font: 12px ui-monospace, monospace; }
#soul .close { margin-left: auto; padding: 0 8px; font-size: 16px; line-height: 22px; }
#soul dl { margin: 0 0 8px; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
#soul dt { color: var(--muted); }
#soul dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#soul a { color: var(--soul); }
/* a close-up of the soul, beside its details */
#soul .portrait { flex: none; width: 108px; height: 140px; border-radius: 6px;
  background: radial-gradient(ellipse at 50% 62%, rgba(70,84,130,0.35), rgba(70,84,130,0) 70%), rgba(8,10,22,0.55); }
#soul .info { flex: 1; min-width: 0; }
@media (max-width: 420px) { #soul .portrait { width: 84px; height: 112px; } }
[hidden] { display: none !important; }
/* top left of the scene: the "Fireworks!" button (the donation dialog) and "About" */
.corner { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); z-index: 1;
  display: flex; gap: 8px; }
.corner button { padding: 8px 16px; border-radius: 999px; font-weight: 600; letter-spacing: 0.02em;
  background: rgba(20,27,46,0.72); backdrop-filter: blur(4px); }
.donate { border-color: rgba(255,214,140,0.55); color: #ffe3ad; box-shadow: 0 0 18px rgba(255,200,110,0.18); }
.donate:hover { border-color: #ffd68c; }
.about-btn { border-color: rgba(205,244,255,0.35); color: var(--soul); }
.about-btn:hover { border-color: var(--soul); }
/* its dialog */
dialog.give, dialog.about { width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; padding: 18px 20px 20px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,0.5); }
dialog.about::backdrop { background: rgba(5,8,18,0.6); }
/* the donation window: not dimming the scene, under the Fireworks! button and below the sky (donate.js places it) */
dialog.give { margin: 0; inset: auto; width: min(520px, calc(100% - 24px)); padding: 14px 16px 16px; scrollbar-color: var(--rule) transparent; }
dialog.give::backdrop { background: transparent; }
.give h2 { padding-right: 36px; }
.give h2, .about h2 { margin: 0 0 4px; font-size: 18px; }
.give .close, .about .close { position: absolute; top: 12px; right: 12px; padding: 0 9px; font-size: 18px; line-height: 26px; }
.give .tabs { display: flex; gap: 6px; margin: 10px 0; }
.give .tabs button { flex: 1; }
.give .tabs [aria-selected=true] { border-color: var(--soul); color: var(--soul); }
.give .amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 10px 0; }
.give .amounts button { display: grid; padding: 6px 8px; text-align: left; }
.give .amounts b { white-space: nowrap; }
.give .amounts span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.give .amounts [aria-pressed=true] { border-color: #ffd68c; background: #2a2a3a; }
.give .qr { display: block; width: 188px; height: 188px; margin: 6px auto 0; background: #fff; border-radius: 8px; padding: 6px; }
.give .qr svg { width: 100%; height: 100%; }
.give .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.give code { font: 12px ui-monospace, monospace; overflow-wrap: anywhere; color: var(--muted); }
.give a.button { color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; }
.give .qrpane { display: flex; gap: 14px; align-items: flex-start; }
.give .qrside { flex: 1; min-width: 0; }
.give .qrside .row { margin-top: 6px; }
.give .qrpane .amounts { flex: none; margin: 6px 0 0; grid-template-columns: repeat(2, 104px); grid-auto-flow: column; grid-template-rows: repeat(5, auto); }
@media (max-width: 480px) {
  .give .qrpane { flex-direction: column; align-items: stretch; }
  .give .qrpane .amounts { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-flow: row; grid-template-rows: none; }
}
.give .status { min-height: 1.4em; margin: 10px 0 0; color: var(--muted); }
.give label { display: flex; gap: 8px; align-items: center; }
/* sound: Volume, with BCH Radio and Mute beneath it, top right of the scene (on the visitors' page); kept
   narrow so it stays clear of the moon */
.sound { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); z-index: 1;
  display: grid; grid-template-columns: auto auto; justify-content: end; justify-items: end; gap: 6px; align-items: center;
  padding: 6px 8px; border-radius: 14px; background: rgba(20,27,46,0.72); border: 1px solid var(--rule); backdrop-filter: blur(4px); }
.sound label.volume { grid-row: 1; grid-column: 1 / -1; padding: 0 2px 0 4px; }
.sound label.volume output { display: none; } /* the dB figure is for the studio; narrower, clear of the moon */
#radio { grid-row: 2; grid-column: 1; }
#mute { grid-row: 2; grid-column: 2; }
/* while BCH Radio plays: a link under the buttons to the music page, where its songs download */
.sound .radio-link { grid-row: 3; grid-column: 1 / -1; justify-self: center; font-size: 12px; color: #ffe3ad; padding: 0 4px 1px;
  text-decoration: underline; text-decoration-color: rgba(255,227,173,0.55); text-underline-offset: 3px; }
.sound .radio-link:hover { text-decoration-color: #ffe3ad; }
.sound > button { border-radius: 999px; padding: 4px 12px; }
.sound label.volume input { width: 110px; }
#radio[aria-pressed=true] { border-color: rgba(255,214,140,0.7); color: #ffe3ad; box-shadow: 0 0 12px rgba(255,200,110,0.2); }
@media (max-width: 560px) { .sound label.volume { font-size: 0; gap: 0; } .sound label.volume output { display: none; } .sound label.volume input { width: 72px; } }
/* the About window */
dialog.about { width: min(580px, calc(100% - 32px)); line-height: 1.55; }
.about h2 { padding-right: 36px; }
.about h3 { margin: 18px 0 4px; font-size: 15px; color: var(--soul); }
.about p { margin: 8px 0 0; }
@media (max-width: 420px) { .corner { gap: 6px; } .corner button { padding: 6px 11px; } .sound { gap: 6px; padding-left: 4px; }
  .sound label.volume, .sound .wide { display: none; } } /* phones: their own volume buttons, and room for Radio */
