* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a0f2e; color: #f4ecff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
canvas { display: block; }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at bottom, #ff5a1a55, transparent 60%), #1a0f2e; z-index: 10; }
.card { width: min(420px, 100%); background: #2a1a46ee; border: 1px solid #5b3d8a; border-radius: 16px; padding: 24px; }
h1 { margin: 0; font-size: 2.2rem; color: #ff8a3d; letter-spacing: .02em; }
h2 { font-size: 1rem; margin: 24px 0 8px; color: #c9b5ff; }
.tag { margin: 4px 0 20px; color: #c9b5ff; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; background: transparent; color: #c9b5ff; border: 1px solid #5b3d8a; }
.tabs button.active { background: #5b3d8a; color: #fff; }

.tab { display: none; flex-direction: column; gap: 12px; }
.tab.active { display: flex; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: #c9b5ff; }
input { font: inherit; padding: 12px; border-radius: 10px; border: 1px solid #5b3d8a; background: #1a0f2e; color: #fff; }
button { font: inherit; padding: 12px 16px; border-radius: 10px; border: 0; cursor: pointer;
  background: #ff6a2a; color: #1a0f2e; font-weight: 700; }
button:hover { filter: brightness(1.1); }
.hint { margin: 0; font-size: .8rem; color: #9d8bc4; }
.error { color: #ff6b81; min-height: 1.2em; margin: 12px 0 0; }
.muted { color: #9d8bc4; }
ol { margin: 0; padding-left: 1.5em; }
ol li { padding: 2px 0; }
ol li span { float: right; color: #ff8a3d; font-variant-numeric: tabular-nums; }

#whats-new, .popup { z-index: 1000; background: #1a0f2ecc; } /* above the Enter VR button (z-index 999) */
#whats-new .card, .popup .card { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
#whats-new .card > *, .popup .card > * { flex-shrink: 0; }
#whats-new .news, #board-popup-list { flex-shrink: 1; min-height: 0; overflow-y: auto; }
#board-popup-list { margin-bottom: 20px; }
.news { margin: 0 0 20px; padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; line-height: 1.4; }
.news b { color: #ff8a3d; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud-top { position: absolute; top: 12px; right: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; max-width: calc(100% - 24px); pointer-events: auto; }
#hud-top button { padding: 6px 12px; font-size: .85rem; background: #2ecc71; color: #0b2416; } /* green, to match the watch */
#hud-stats { position: absolute; top: 12px; left: 12px; background: #0008; padding: 8px 12px; border-radius: 10px;
  font-variant-numeric: tabular-nums; }
#hud-feed { position: absolute; top: 56px; left: 12px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
#hud-feed div { background: #0008; padding: 4px 10px; border-radius: 8px; }
#hud-top button.off { background: #5b3d8a; color: #fff; }
@media (max-width: 700px) {
  #hud-user { display: none; }
  #hud-stats { top: 100px; }
  #hud-feed { top: 144px; }
  #hud-cores { top: 100px; }
}

/* the controls popup */
#controls-popup .card { width: min(560px, 100%); }
#controls-popup .controls { flex-shrink: 1; min-height: 0; overflow-y: auto; margin-bottom: 20px; }
#controls-popup h2:first-child { margin-top: 16px; }
#controls-popup dl { display: grid; grid-template-columns: 10.5em 1fr; gap: 8px 16px; margin: 0; line-height: 1.35; }
#controls-popup dt { color: #ff8a3d; font-weight: 600; }
#controls-popup dd { margin: 0; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid #5b3d8a; border-bottom-width: 2px; border-radius: 6px;
  background: #1a0f2e; color: #f4ecff; font: 600 .85em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: center; }
@media (max-width: 480px) { #controls-popup dl { grid-template-columns: 1fr; gap: 2px; } #controls-popup dd { margin-bottom: 8px; } }

/* PC: a dot in the middle of the view (what you click on), and a hint under it */
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1.5px #000a; }
#crosshair.on { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #2ecc71; }
#crosshair-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: .85rem; background: #000a; padding: 3px 10px; border-radius: 8px; }
#crosshair-hint:empty { display: none; }

/* the cores badge (the game's currency), with a "+100" that floats up when you earn some */
#hud-cores { position: absolute; top: 54px; right: 12px; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px;
  background: #0b2416; border: 1px solid #2ecc71; color: #8affbf; font-variant-numeric: tabular-nums; font-size: .9rem; }
#hud-cores svg { filter: drop-shadow(0 0 4px #5cffd8); }
#hud-cores-gain { position: absolute; right: 8px; top: -2px; color: #5cffd8; font-weight: 700; opacity: 0; pointer-events: none; }
#hud-cores-gain.show { animation: core-gain 1.8s ease-out; }
@keyframes core-gain { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
@media (prefers-reduced-motion: reduce) { #hud-cores-gain.show { animation: none; opacity: 1; } }
