:root {
  --ink: #1c2229;
  --panel: rgba(20, 24, 30, 0.82);
  --panel-brd: rgba(255, 255, 255, 0.12);
  --txt: #eef1f4;
  --muted: #aeb7c2;
  --accent: #f0b84a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d1117;
  font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--txt);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 50;
  background: var(--accent);
  color: #111;
  padding: 6px 10px;
  border-radius: 6px;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

/* HUD cards */
.hud {
  position: fixed;
  z-index: 10;
  pointer-events: none;
}
.hud h1 {
  margin: 0 0 2px;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.hud p { margin: 4px 0; }
.top-left { left: 14px; top: 14px; }
.top-right { right: 14px; top: 14px; text-align: right; }
.bottom-left { left: 14px; bottom: 14px; }
.bottom-right {
  right: 14px; bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
}
.bottom-right a { color: var(--muted); }

.hud > * {
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: 10px;
  padding: 8px 11px;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.hud > .help { max-width: 300px; font-size: 12px; color: var(--muted); }
.hud > .meta, .hud > .seedline { font-size: 13px; }

.seedline input#seed {
  width: 118px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-brd);
  border-radius: 6px;
  color: var(--txt);
  padding: 3px 6px;
  font: inherit;
  text-transform: lowercase;
}
button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-brd);
  color: var(--txt);
  border-radius: 6px;
  padding: 3px 8px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: rgba(255, 255, 255, 0.16); }
button[aria-pressed="true"] { background: var(--accent); color: #111; }

.ctrl { display: block; }
.ctrl > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
#time { width: 170px; accent-color: var(--accent); }
#time-out { color: var(--accent); font-variant-numeric: tabular-nums; }

.btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.btns button { font-size: 12px; }

kbd {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

/* minimap */
.minimap-wrap { pointer-events: auto; }
#minimap {
  width: 190px;
  height: 190px;
  border-radius: 10px;
  border: 1px solid var(--panel-brd);
  background: #141a22;
  cursor: pointer;
}
.mm-tag {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* dossier */
.dossier {
  position: fixed;
  right: 14px;
  bottom: 90px;
  z-index: 20;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: 12px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  animation: pop 0.16s ease-out;
}
.dossier h2 { margin: 0 0 8px; font-size: 16px; }
.dossier dl { margin: 0; }
.dossier dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.dossier dd { margin: 0 0 8px; }
#d-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  font-size: 12px;
}

@keyframes pop { from { transform: translateY(6px); opacity: 0; } }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* SVG craft tweaks */
.win-on { transition: fill 0.4s ease; }
.lod-window, .lod-fine { }

@media (prefers-reduced-motion: reduce) {
  .dossier { animation: none; }
  .win-on { transition: none; }
}

@media (max-width: 620px) {
  .top-right { display: none; }
  #minimap { width: 130px; height: 130px; }
}
