/* Z3RSim — dark aurora theme (billogna.lol design language: mint/violet/blue on
   near-black, Unbounded headings, DM Mono body, glass cards). */

:root {
  --bg: #070709;
  --mint: #b3ffc8;
  --violet: #8a6bff;
  --blue: #5eadff;
  --ink: #e8e8ee;
  --muted: #9a9aab;
  --card: rgba(255, 255, 255, 0.045);
  --card-edge: rgba(255, 255, 255, 0.09);
  --good: #6dff9e;
  --gold: #ffd76d;
  --bad: #565664;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3, .brand-name { font-family: "Unbounded", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ---------- aurora background ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -2; overflow: hidden; filter: blur(80px); }
.bg-blobs i { position: absolute; border-radius: 50%; opacity: 0.16; }
.bg-blobs i:nth-child(1) { width: 44vw; height: 44vw; left: -10vw; top: -12vw; background: var(--violet); animation: drift1 37s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(2) { width: 36vw; height: 36vw; right: -8vw; top: 22vh; background: var(--blue); animation: drift2 43s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(3) { width: 40vw; height: 40vw; left: 28vw; bottom: -18vw; background: var(--mint); opacity: 0.10; animation: drift3 51s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-7vw, -6vh) scale(0.92); } }
@keyframes drift3 { to { transform: translate(-6vw, -9vh) scale(1.08); } }
.bg-noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
#topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-tri { width: 22px; height: 22px; align-self: center; image-rendering: pixelated; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.brand-name .accent { color: var(--mint); }
.brand-sub { color: var(--muted); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
#game-status { display: flex; align-items: center; gap: 14px; margin-left: auto; }
#game-status span { color: var(--mint); }
.home-link { margin-left: auto; color: var(--muted); font-size: 12px; }
#game-status ~ .home-link { margin-left: 0; }

.view {
  max-width: 1280px; margin: 0 auto; padding: 12px 22px 60px;
  display: flex; flex-direction: column; gap: 18px;
}
#view-game { flex-direction: row; align-items: flex-start; }

.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 16px;
  padding: 20px 22px;
  backdrop-filter: blur(10px);
}

/* ---------- menu ---------- */
.hero h1 { margin: 0 0 12px; font-size: 30px; line-height: 1.25; }
.hero p { max-width: 72ch; color: var(--muted); }
.hero em { color: var(--mint); font-style: normal; }
.hero strong { color: var(--ink); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting-name { font-weight: 500; color: var(--mint); }
.setting-help { color: var(--muted); font-size: 12px; }
select, input[type=text] {
  background: rgba(0, 0, 0, 0.45); color: var(--ink);
  border: 1px solid var(--card-edge); border-radius: 8px;
  padding: 9px 10px; font-family: inherit; font-size: 13px;
}
select:focus, input:focus { outline: 1px solid var(--violet); }

.menu-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.big-btn {
  background: linear-gradient(120deg, var(--violet), var(--blue));
  color: #fff; border: 0; border-radius: 10px;
  padding: 13px 22px; font-size: 15px; font-weight: 500;
  font-family: "Unbounded", sans-serif;
}
.big-btn:hover { filter: brightness(1.15); }
.big-btn.ghost { background: transparent; border: 1px solid var(--violet); color: var(--ink); }
.about ul { color: var(--muted); padding-left: 20px; }
.about li { margin-bottom: 6px; }
.about strong { color: var(--ink); }
.fineprint { color: var(--muted); font-size: 12px; margin-top: 14px; }

.chip {
  background: rgba(255, 255, 255, 0.07); color: var(--ink);
  border: 1px solid var(--card-edge); border-radius: 999px;
  padding: 5px 13px; font-size: 12px;
}
.chip:hover { border-color: var(--mint); }

/* ---------- game: map ---------- */
#map-pane { flex: 1 1 66%; padding: 14px; min-width: 0; }
#map-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.map-tab {
  flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--card-edge);
  background: transparent; color: var(--muted); font-family: "Unbounded", sans-serif; font-size: 13px;
}
.map-tab.active { background: rgba(138, 107, 255, 0.18); color: var(--ink); border-color: var(--violet); }
#map-wrap { position: relative; }
#map-img { width: 100%; display: block; border-radius: 10px; image-rendering: pixelated; user-select: none; }
#nodes { position: absolute; inset: 0; }

.node {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.75);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #08080c;
  background: var(--bad);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.6);
}
.node.available { background: var(--good); }
.node.available:hover { transform: translate(-50%, -50%) scale(1.25); z-index: 5; }
.node.glow { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(109, 255, 158, 0.25), 0 2px 6px rgba(0,0,0,0.6); } }
.node.visible-item { background: var(--gold); }
.node.visible-item img { width: 16px; height: 16px; image-rendering: pixelated; }
.node.unavailable { opacity: 0.62; }
.node.opened { background: #1d1d26; color: #4c4c5c; opacity: 0.75; box-shadow: none; }
.node.partial { background: linear-gradient(135deg, var(--good) 50%, #1d1d26 50%); }
.node.dungeon {
  min-width: 34px; height: 34px; border-radius: 9px;
  font-family: "Unbounded", sans-serif; font-size: 11px; color: #06060a;
  flex-direction: column; gap: 0; line-height: 1.05;
}
.node.dungeon .dg-count { font-size: 9px; font-family: "DM Mono", monospace; }
.node.dungeon.boss-dead::after {
  content: "✔"; position: absolute; right: -7px; top: -7px; font-size: 11px;
  background: #08080c; color: var(--good); border-radius: 50%; width: 15px; height: 15px;
  display: flex; align-items: center; justify-content: center;
}
.node.ganon {
  min-width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9d6d, #c33); color: #fff; font-size: 17px;
}
.node.ganon.unavailable { background: #3a2430; }
.node .medal { position: absolute; left: -9px; top: -9px; width: 17px; height: 17px; image-rendering: pixelated; }
.node .prize { position: absolute; right: -9px; bottom: -9px; width: 17px; height: 17px; image-rendering: pixelated; }

/* ---------- game: sidebar ---------- */
#side { flex: 1 1 34%; display: flex; flex-direction: column; gap: 16px; min-width: 300px; }
#hud { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; margin-top: 8px; }
.hud-slot {
  aspect-ratio: 1; border-radius: 8px; background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--card-edge);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.hud-slot img { width: 78%; height: 78%; object-fit: contain; image-rendering: pixelated; filter: grayscale(1) brightness(0.36); }
.hud-slot.owned img { filter: none; }
.hud-slot .fallback { font-size: 9px; color: #555; text-align: center; }
.hud-slot.owned .fallback { color: var(--mint); }
.hud-slot .qty {
  position: absolute; right: 1px; bottom: 0; font-size: 10px; color: var(--mint);
  text-shadow: 0 1px 2px #000;
}
#prize-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
#prize-row .pr { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
#prize-row img { width: 18px; height: 18px; image-rendering: pixelated; }

#hint-card h3 { margin: 0 0 8px; font-size: 14px; }
#sel-body { font-size: 13px; }
#sel-body .checkline { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.muted { color: var(--muted); }

h2 { font-size: 18px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 6px; }

/* ---------- modals ---------- */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: center; justify-content: center; z-index: 40;
  padding: 20px;
}
.modal { max-width: 620px; width: 100%; max-height: 82vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; flex: 0 0 auto; }
.modal-head .close { margin-left: auto; }
#dg-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
#dg-meta img { width: 18px; height: 18px; image-rendering: pixelated; }
#dg-checks { display: flex; flex-direction: column; gap: 6px; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--card-edge);
  border-radius: 9px; padding: 8px 12px; color: var(--ink); text-align: left;
}
.check-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.check-row.available { border-color: rgba(109, 255, 158, 0.5); }
.check-row.available:hover { background: rgba(109, 255, 158, 0.12); }
.check-row.available .dot { background: var(--good); }
.check-row.unavailable { opacity: 0.55; cursor: not-allowed; }
.check-row.unavailable .dot { background: var(--bad); }
.check-row.opened { opacity: 0.7; cursor: default; }
.check-row.opened .dot { background: transparent; border: 1px solid #444; }
.check-row.boss { border-style: dashed; }
.check-row .got { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--mint); font-size: 12px; }
.check-row .got img { width: 18px; height: 18px; image-rendering: pixelated; }

#log-search { flex: 1; }
#log-body { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
#log-body .logline { display: flex; gap: 12px; padding: 3px 4px; border-radius: 6px; }
#log-body .logline:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
#log-body .lt { color: var(--muted); flex: 0 0 52px; }
#log-body .li { color: var(--mint); flex: 0 0 200px; }
#log-body img { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 5px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: rgba(10, 10, 16, 0.92); border: 1px solid var(--violet);
  border-radius: 10px; padding: 10px 16px; display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.25s ease-out;
  font-size: 13px;
}
.toast img { width: 22px; height: 22px; image-rendering: pixelated; }
.toast .big { color: var(--gold); font-weight: 700; }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } }

/* ---------- win ---------- */
.win { text-align: center; align-items: center; }
.win-tri { width: 64px; image-rendering: pixelated; margin: 6px auto; display: block; }
.win h1 { font-size: 44px; margin: 8px 0; }
.win .menu-actions { justify-content: center; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  #view-game { flex-direction: column; }
  #side { width: 100%; }
  #hud { grid-template-columns: repeat(10, 1fr); }
}
