:root {
  --bg: #0b0f16;
  --card: rgba(13, 18, 27, 0.86);
  --text: #eef2f7;
  --dim: #95a1b3;
  --accent: #ffb347;
  --blue: #3b82f6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow: hidden; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

#overlay {
  position: fixed; inset: 0; display: flex; align-items: safe center; justify-content: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse at 30% 20%, rgba(59,130,246,0.18), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(255,179,71,0.14), transparent 55%), rgba(6,9,14,0.72);
  backdrop-filter: blur(3px); z-index: 10; transition: opacity 0.4s;
}
body.playing #overlay, body.in-vr #overlay { opacity: 0; pointer-events: none; }
.card { margin: auto 0; width: min(560px, 100%); background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 28px 28px 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.eyebrow { color: var(--accent); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
h1 { margin: 6px 0 10px; font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.01em; }
.lede { color: var(--dim); line-height: 1.5; margin: 0 0 18px; font-size: 15px; }
.progress { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
#bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--accent)); transition: width 0.3s; }
#status { color: var(--dim); font-size: 13px; margin: 8px 0 18px; min-height: 18px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
button { font: inherit; font-weight: 600; font-size: 16px; padding: 13px 22px; border-radius: 12px; border: 0; cursor: pointer; background: var(--blue); color: #fff; flex: 1 1 auto; min-width: 160px; }
button.secondary { background: rgba(255,255,255,0.1); }
button:disabled { opacity: 0.4; cursor: default; }
button:not(:disabled):hover { filter: brightness(1.12); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.quality { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.seed { color: var(--dim); font-size: 13px; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.3); }
.seed:hover { color: var(--text); }
select { font: inherit; background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 6px 10px; }
.note { display: none; color: #f6c177; font-size: 13px; margin: 12px 0 0; }
details { margin-top: 14px; color: var(--dim); font-size: 13px; }
summary { cursor: pointer; color: var(--text); }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; line-height: 1.55; }
@media (max-width: 520px) { .controls { grid-template-columns: 1fr; } }

#hud { position: fixed; left: 14px; bottom: 14px; display: none; background: rgba(10,14,22,0.72); border: 1px solid rgba(255,255,255,0.08); padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; pointer-events: none; z-index: 5; }
#hud .dim { color: var(--dim); font-size: 12px; }
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: rgba(10,14,22,0.82); padding: 10px 18px; border-radius: 12px; font-weight: 600; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 6; }
#toast.show { opacity: 1; }
body.in-vr #hud, body.in-vr #toast, body.in-vr #cross, body.in-vr #aimhint { display: none; }
#cross { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,255,255,0.7); box-shadow: 0 0 0 1px rgba(0,0,0,0.4); display: none; z-index: 4; pointer-events: none; }
body.playing #cross { display: block; }
#cross.aim { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: none; border: 2px solid #ff9a3c; box-shadow: none; }
#aimhint { position: fixed; left: 50%; top: calc(50% + 18px); transform: translateX(-50%); padding: 4px 10px; border-radius: 8px; background: rgba(10,14,22,0.72); font-size: 13px; font-weight: 600; pointer-events: none; z-index: 4; display: none; }
