* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #e4dccb;
  color: #1c1712;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.top {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 18px 28px 14px;
  border-bottom: 1px solid #c9bda5;
}
.mark {
  font: 600 22px/1 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.line {
  margin: 0;
  font: 17px/1.35 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color: #1c1712;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 28px;
  padding: 24px 28px 8px;
  align-items: start;
}
.sheet { margin: 0; }
#map {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: #ebdfc4;
  box-shadow: 0 1px 0 rgba(28, 23, 18, 0.25), 0 6px 18px -10px rgba(28, 23, 18, 0.5);
}
figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: #5b5045;
}

.panel { font-size: 14px; }
fieldset { border: 0; margin: 0 0 16px; padding: 0; }
legend, .seedrow label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b5045;
}
.choice { display: flex; flex-wrap: wrap; gap: 0; }
.choice legend { width: 100%; }
.choice label { flex: 1 1 auto; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block;
  padding: 7px 8px;
  text-align: center;
  border: 1px solid #c9bda5;
  margin-left: -1px;
  background: #f6f1e5;
  cursor: pointer;
  white-space: nowrap;
}
.choice label:first-of-type span { margin-left: 0; border-radius: 3px 0 0 3px; }
.choice label:last-of-type span { border-radius: 0 3px 3px 0; }
.choice input:checked + span { background: #1c1712; color: #f6f1e5; border-color: #1c1712; position: relative; }
.choice input:focus-visible + span { outline: 2px solid #7d2a1a; outline-offset: 1px; }

.seedrow input, .desktop input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #c9bda5;
  border-radius: 3px;
  background: #f6f1e5;
}
.hint { margin: 6px 0 14px; font-size: 13px; color: #5b5045; }

button {
  padding: 8px 12px;
  border: 1px solid #1c1712;
  border-radius: 3px;
  background: #f6f1e5;
  cursor: pointer;
}
button:hover { background: #fffaf0; }
button.primary { background: #7d2a1a; border-color: #7d2a1a; color: #fbf4e6; }
button.primary:hover { background: #69200f; }
button:disabled { opacity: 0.55; cursor: progress; }
button.link {
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #5b5045;
  font-size: 13px;
}
.buttons { display: flex; gap: 8px; }
.buttons button { flex: 1; }
.opts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 0;
  color: #5b5045;
}
.opts select { margin-left: 6px; padding: 3px 4px; background: #f6f1e5; border: 1px solid #c9bda5; border-radius: 3px; }
.check { display: flex; align-items: center; gap: 6px; }

.exports {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #c9bda5;
  display: grid;
  gap: 8px;
}
.note { margin: 4px 0 0; font-size: 13px; color: #5b5045; }
.status { margin: 0; font-size: 13px; min-height: 1.5em; color: #7d2a1a; }

.about, .desktop { max-width: 640px; padding: 0 28px; }
.about p { font: 17px/1.5 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; margin: 22px 0 0; }
.desktop { margin-top: 36px; padding-top: 0; }
.desktop h2 { font: 600 20px/1.3 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; margin: 0 0 6px; }
.desktop p { margin: 0 0 12px; }
#signup { display: flex; gap: 8px; max-width: 460px; }
#signup input { flex: 1; min-width: 0; }
.small { font-size: 13px; color: #5b5045; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.foot {
  margin-top: 40px;
  padding: 16px 28px 28px;
  border-top: 1px solid #c9bda5;
  font-size: 13px;
  color: #5b5045;
}
.foot p { margin: 0 0 4px; }

@media (max-width: 860px) {
  .top { display: block; padding: 14px 16px 12px; }
  .mark { display: inline-block; margin-bottom: 6px; }
  .line { font-size: 16px; }
  .stage { grid-template-columns: 1fr; gap: 18px; padding: 14px 16px 0; }
  #map { max-height: none; }
  .about, .desktop { padding: 0 16px; }
  .foot { padding: 16px; }
  #signup { flex-direction: column; }
}

/* Recording mode (?replay=1&clean=1): only the map, centered, at any size. */
body.clean { background: #d9cfba; min-height: 100vh; display: grid; place-items: center; overflow: hidden; }
body.clean > :not(.stage):not(script) { display: none; }
body.clean .stage { display: block; padding: 0; width: 100vw; }
body.clean .panel, body.clean figcaption { display: none; }
body.clean .sheet { display: grid; place-items: center; width: 100vw; height: 100vh; padding: 3vmin; }
body.clean #map { position: fixed; left: 50%; top: 50%; max-width: none; max-height: none; box-shadow: 0 8px 30px -14px rgba(28, 23, 18, 0.6); }
button.dark { background: #1c1712; border-color: #1c1712; color: #f6f1e5; }
button.dark:hover { background: #3a3027; }
