:root {
  --bg: #1F2023;
  --raised: #2A2B2F;
  --line: #3A3B40;
  --text: #E8E6E1;
  --muted: #8E8D89;
  --blue: #4BA3E3;
  --green: #8FD694;
  --yellow: #F5C66B;
  --red: #FF6B6B;
  --magenta: #D78BE5;
  --cyan: #5FD3D9;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
}

.tile {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  gap: 8px;
}

.top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: none;
}
.top h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--yellow);
  letter-spacing: 0.02em;
}
.where { color: var(--muted); font-size: 12px; }

.stage {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  position: relative;
}
/* The scene is pixel art painted by scene.js at a whole-number scale; never smooth it. */
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.status {
  flex: none;
  margin: 0;
  min-height: 2.8em;
  color: var(--text);
  font-size: 13px;
}

.actions {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.actions button {
  font: inherit;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 6px;
  cursor: pointer;
}
.actions button:hover { border-color: var(--muted); }
.actions button:active { background: var(--line); }
.actions button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.actions .k { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .actions button { transition: border-color 0.15s, background 0.15s; }
}

@media (max-height: 330px) {
  .tile { padding: 8px 10px 10px; gap: 6px; }
  .status { min-height: 2.6em; font-size: 12px; }
}
