/* scummbench — intentionally minimal, agent-first styling */

:root {
  --bg: #0b0d10;
  --fg: #e6e6e6;
  --muted: #8b95a1;
  --accent: #5cc8ff;
  --accent-dim: #2c6e8f;
  --warn: #ffb347;
  --err: #ff6b6b;
  --panel-bg: #11161c;
  --panel-border: #1f2a36;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent);
}
a:hover {
  text-decoration: underline;
}

code {
  background: #1a1f27;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.95em;
}

pre {
  background: #0f1318;
  border: 1px solid var(--panel-border);
  padding: 12px;
  border-radius: 4px;
  overflow: auto;
  white-space: pre;
}

/* ---------- homepage / brief ---------- */

.brief {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.brief__header {
  margin-bottom: 32px;
}

.brief__callout {
  border: 2px solid var(--accent);
  background: rgba(255, 200, 50, 0.08);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 0 0 32px;
}

.brief__callout-title {
  color: var(--accent);
  font-size: 16px;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.brief__callout p {
  margin: 0 0 8px;
}

.brief__callout-code {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 14px;
  border-radius: 4px;
  margin: 8px 0;
  font-size: 15px;
}

.brief__callout-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

.brief__eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.brief__title {
  font-size: 28px;
  margin: 0 0 8px;
}

.brief__subtitle {
  color: var(--muted);
  margin: 0;
}

.brief__section {
  margin: 28px 0;
}

.brief__section h2 {
  font-size: 16px;
  margin: 0 0 8px;
  color: var(--accent);
}

.brief__section ul,
.brief__section ol {
  padding-left: 20px;
  margin: 8px 0;
}

.brief__preview {
  font-size: 12px;
  max-height: 260px;
}

/* ---------- /game ---------- */

.page-game {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.game__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.game__title {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
}

.game__main {
  flex: 1;
  padding: 16px;
}

.game__stage-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 320px;
  gap: 0 16px;
  align-items: start;
}

.game__stage-wrap--collapsed {
  grid-template-columns: minmax(0, 1fr) auto;
}

.game__stage-wrap--collapsed .game__panel {
  display: none;
}

@media (max-width: 900px) {
  .game__stage-wrap {
    grid-template-columns: 1fr;
  }
  .game__stage-wrap .panel__controls {
    flex-direction: row;
    justify-self: end;
    margin-top: 8px;
  }
  .game__stage-wrap .panel__controls .panel__toggle {
    writing-mode: horizontal-tb;
    min-width: 56px;
    padding: 8px 12px;
  }
}

.game__stage {
  position: relative;
  background: #000;
  border: 1px solid var(--panel-border);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* Scoped to .game__stage so the global id="canvas" (required by
   scummvm.js's hardcoded SDL3 selector) doesn't style arbitrary
   canvases elsewhere on the site. */
.game__stage > #canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.game__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay-box {
  position: absolute;
  border: 1px solid rgba(92, 200, 255, 0.7);
  background: rgba(92, 200, 255, 0.08);
}

.overlay-box--click {
  border-color: rgba(255, 179, 71, 0.85);
  background: rgba(255, 179, 71, 0.1);
}

.overlay-label {
  position: absolute;
  top: -14px;
  left: 0;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 4px;
  white-space: nowrap;
}

.overlay-hover {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 2px;
}

.game__missing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--warn);
  background: rgba(0, 0, 0, 0.85);
}

.game__missing[hidden] {
  display: none;
}

.game__missing h2 {
  margin: 0 0 8px;
}

/* ---------- loading overlay (shown during WASM boot) ---------- */

.game__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.9);
  z-index: 2;
}

.game__loading[hidden] {
  display: none;
}

.game__loading h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent);
}

.game__loading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(92, 200, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.game__panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 12px;
  max-height: 80vh;
  overflow: auto;
}

.panel__title {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 10px 0 4px;
}

.panel__kv {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 2px 8px;
  margin: 0 0 8px;
}

.panel__kv dt {
  color: var(--muted);
}

.panel__kv dd {
  margin: 0;
}

.panel__list {
  margin: 0 0 8px;
  padding-left: 16px;
}

.panel__list--objs {
  max-height: 180px;
  overflow: auto;
}

.panel__empty {
  color: var(--muted);
  font-style: italic;
}

.panel__hint {
  color: var(--muted);
  font-size: 11px;
}

.panel__controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
}

.panel__toggle {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  writing-mode: vertical-lr;
  letter-spacing: 0.05em;
  align-self: start;
  margin-top: 0;
}

.panel__toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.panel__toggle--skip {
  color: var(--warn);
}

.panel__toggle--skip:hover {
  color: var(--warn);
  border-color: var(--warn);
}

/* ---------- upload ---------- */

.game__upload {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.game__upload[hidden] {
  display: none;
}

.upload__drop {
  border: 2px dashed var(--panel-border);
  border-radius: 8px;
  padding: 48px 32px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.upload__drop--active {
  border-color: var(--accent);
  background: rgba(92, 200, 255, 0.05);
}

.upload__title {
  margin: 0 0 12px;
  font-size: 18px;
}

.upload__text {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.upload__btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent-dim);
  color: var(--fg);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: background 0.15s;
}

.upload__btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.upload__or {
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0 0;
}

.upload__status {
  color: var(--accent);
  margin: 16px 0 0;
  min-height: 1.5em;
}

.game__clear {
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.game__clear:hover {
  color: var(--err);
  border-color: var(--err);
}

.game__clear[hidden] {
  display: none;
}

/* ---------- /status ---------- */

.status__main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.status__block {
  margin-bottom: 32px;
}

.status__block h2 {
  font-size: 14px;
  color: var(--accent);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
