 :root {
  color-scheme: dark;
  --bg: #0f1320;
  --card: #1a2134;
  --muted: #b8c1db;
  --accent: #5fb3ff;
  --danger: #ff8a7a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: #f1f5ff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #2b3652;
}
.topbar h1 { margin: 0; font-size: 22px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
#scoreboard { color: #ffd18f; font-weight: 700; white-space: nowrap; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  gap: 14px;
  padding: 14px;
  min-height: calc(100vh - 64px);
}

.left, .right {
  display: grid;
  gap: 12px;
  align-content: start;
}

.card {
  background: var(--card);
  border: 1px solid #2b3652;
  border-radius: 12px;
  padding: 12px;
}

.scene-view {
  width: 100%;
  height: 540px;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1320;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0f1320;
  animation: fadeIn 0.35s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fallback-scene-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #c6d1ec;
  font-size: 16px;
  text-align: center;
  padding: 20px;
}

.scene-fallback {
  margin-top: 10px;
  padding: 8px;
  border-radius: 6px;
  background: #2e2230;
  color: #ffcfbf;
}
.hidden { display: none; }

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.card-heading h2 { margin: 0; font-size: 19px; }
#clue-penalty { color: #ffd18f; font-size: 13px; white-space: nowrap; }

.clues-card ul {
  margin: 10px 0;
  padding-left: 20px;
  color: var(--muted);
}

.source-line {
  margin-top: 10px;
  font-size: 13px;
  color: #9fb0d8;
}
.source-line a { color: #8ec6ff; }
.mode-card small { display: block; margin-top: 5px; color: var(--muted); }

.map-card .guess-map {
  height: 410px;
  border-radius: 10px;
  overflow: hidden;
}
.map-card small { display: block; margin-top: 8px; color: var(--muted); }

input[type="range"] { width: 100%; margin-top: 12px; }
button {
  border: 1px solid #3b4a70;
  background: #263353;
  color: #eaf2ff;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #314166; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-box { min-height: 92px; color: var(--muted); line-height: 1.5; }
.good { color: #9ef0b2; }
.warn { color: #ffd18f; }
.bad { color: var(--danger); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .scene-view { height: 380px; }
}
