@import url("data:text/css,");
:root {
  color-scheme: dark;
  --bg: #171719;
  --panel: #202126;
  --ink: #e4d3ac;
  --gold: #b38b50;
  --line: #514536;
  --green: #93ad86;
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #29272a;
  padding: 10px 15px;
  border-radius: 3px;
}
button:hover {
  background: #40382d;
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #eed3a1;
  outline-offset: 3px;
}
input,
select,
textarea {
  background: #191b20;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px;
  max-width: 100%;
}
h1,
h2 {
  font-family: Georgia, serif;
  font-weight: normal;
}
h1 {
  font-size: clamp(38px, 5vw, 70px);
  letter-spacing: 5px;
  color: #d8b576;
  margin: 10px 0 16px;
}
h2 {
  font-size: 27px;
  color: #d8b576;
  margin: 9px 0 18px;
}
p {
  line-height: 1.65;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
}
.muted,
small {
  color: #a49e91;
}
.home-copy {
  padding: 65px clamp(30px, 5vw, 85px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-copy h2 {
  font-size: 21px;
}
.intro {
  margin: 20px 0 34px;
}
.home-actions {
  display: grid;
  gap: 10px;
  max-width: 370px;
}
.home-actions button {
  text-align: left;
  padding: 14px 18px;
}
.home-actions button:first-child {
  border-color: var(--gold);
  background: #3c3225;
}
.home-actions span {
  float: right;
}
.edition {
  margin-top: 65px;
  font-size: 12px;
  letter-spacing: 1px;
}
#home {
  display: grid;
  grid-template-columns: 46% 54%;
  min-height: 100vh;
}
.home-scene {
  background: radial-gradient(ellipse, #343029 0%, #111316 70%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
}
.home-scene img,
.scene img {
  image-rendering: pixelated;
  width: 100%;
  height: auto;
}
.scene-caption {
  text-align: center;
  padding: 20px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 2px;
}
.scene-caption small {
  letter-spacing: 0;
  display: block;
  margin-top: 12px;
}
#loading {
  padding: 40px;
}
#game {
  max-width: 1600px;
  margin: auto;
  padding: 0 22px;
}
header {
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  font-family: Georgia, serif;
  letter-spacing: 3px;
  color: #d8b576;
}
#stats {
  font-size: 12px;
  margin-left: 24px;
  color: #b8b1a3;
}
nav {
  display: flex;
  gap: 8px;
}
nav button {
  font-size: 12px;
  padding: 8px 12px;
}
.exploration {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 25px 0;
}
.scene {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #111316;
  border: 1px solid #302c28;
  min-width: 0;
}
.scene-caption# region {
  padding: 8px;
}
.room-info {
  padding: 0 5px;
}
.room-info p {
  font-size: 14px;
}
#description {
  min-height: 50px;
}
.objects {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.objects label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex: 1;
}
.objects select {
  width: 100%;
}
#verbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}
#verbs button {
  font-size: 11px;
  letter-spacing: 1px;
  padding: 8px 10px;
}
#narrative {
  min-height: 42px;
  color: #b6c3a5;
  font-size: 13px;
  white-space: pre-wrap;
}
#exits {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#exits button {
  font-size: 12px;
}
.workbench {
  border: 1px solid var(--line);
  border-radius: 4px;
}
.quest-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #29272a;
  gap: 16px;
}
.quest-bar label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.quest-bar select {
  min-width: 250px;
}
#quest-count {
  font-size: 12px;
  color: #a49e91;
}
.desk {
  display: grid;
  grid-template-columns: 40% 60%;
  min-height: 420px;
}
.lesson-panel {
  border-right: 1px solid var(--line);
  min-width: 0;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  font-size: 12px;
  white-space: nowrap;
  padding: 13px;
  background: transparent;
}
.tabs button[aria-selected="true"] {
  border-bottom: 2px solid var(--gold);
  color: #edcf92;
}
.tab-body {
  padding: 18px;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.tab-body strong {
  font-size: 15px;
  color: #f0d49c;
}
.code-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.code-panel label {
  font-size: 12px;
}
#editor {
  font-family: Consolas, monospace;
  resize: vertical;
  min-height: 115px;
  tab-size: 4;
  line-height: 1.6;
  font-size: 14px;
}
.execution {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.execution button {
  font-size: 12px;
  padding: 9px 12px;
}
.primary {
  border-color: var(--gold);
  background: #493b28;
}
kbd {
  font-size: 10px;
  margin-left: 12px;
  color: #b9ad95;
}
#feedback {
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.55;
  color: #c4d0b4;
  padding: 5px 0;
}
#feedback.error {
  color: #edaaa2;
}
#result {
  background: #16181c;
  min-height: 95px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid #34302b;
  padding: 10px;
}
#result p {
  font-size: 12px;
  margin: 10px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #39342d;
}
th {
  color: var(--gold);
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  font-size: 11px;
  color: #8c877b;
}
dialog {
  background: #202126;
  color: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 5px;
  padding: 26px;
  max-width: 760px;
  width: 90%;
  max-height: 85vh;
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
}
#close-dialog {
  float: right;
  font-size: 12px;
}
#dialog-body {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 14px;
}
#dialog-body label {
  display: block;
  margin: 15px 0;
}
#dialog-body input[type="text"] {
  display: block;
  width: 100%;
  margin: 10px 0;
}
.contrast {
  --ink: #fff8df;
  --line: #a39170;
  --panel: #111;
}
.reduced * {
  animation: none !important;
}
body:not(.reduced) .home-scene img {
  animation: flame 5s ease-in-out infinite;
}
@keyframes flame {
  50% {
    filter: brightness(1.08);
  }
}
@media (max-width: 850px) {
  #home {
    grid-template-columns: 1fr;
  }
  .home-copy {
    padding: 35px;
  }
  .home-scene {
    padding: 20px;
  }
  .edition {
    margin-top: 25px;
  }
  .exploration,
  .desk {
    grid-template-columns: 1fr;
  }
  .scene img {
    max-height: 340px;
    object-fit: contain;
  }
  .lesson-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .tab-body {
    max-height: 300px;
  }
  .quest-bar {
    flex-wrap: wrap;
  }
  header {
    flex-wrap: wrap;
    padding: 12px 0;
  }
  #stats {
    display: block;
    margin: 6px 0;
  }
  #game {
    padding: 0 12px;
  }
  .quest-bar label {
    flex-wrap: wrap;
  }
  #quest-count {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
