* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #181d18;
  color: #ececd8;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #68715a;
  background: #3f4937;
  color: #f3f0d5;
  border-radius: 3px;
  cursor: pointer;
}
button:hover {
  background: #536048;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #e4c474;
  outline-offset: 3px;
}
button[aria-pressed='true'] {
  background: #aa7a39;
  color: #fff;
}
a {
  color: #d6c992;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.topbar {
  min-height: 60px;
  background: #2c3329;
  border-bottom: 1px solid #56604b;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 9px max(20px, env(safe-area-inset-right)) 9px
    max(20px, env(safe-area-inset-left));
  box-shadow: 0 2px 0 #0a100b;
}
.brand {
  letter-spacing: 2px;
  font-size: 13px;
  white-space: nowrap;
}
.brand strong {
  color: #d6b871;
}
.edition {
  font-size: 10px;
  letter-spacing: 2px;
  color: #a4ad95;
}
.topbar > button {
  margin-left: auto;
}
main {
  flex: 1;
}
.launcher {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 32px 42px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: #baa775;
  margin-bottom: 20px;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(38px, 5vw, 65px);
  font-weight: 400;
  line-height: 1.07;
  margin: 0 0 20px;
  letter-spacing: -1px;
}
h1 em {
  font-style: normal;
  color: #bfceac;
}
.intro {
  max-width: 620px;
  color: #bac2ae;
  font-size: 16px;
  line-height: 1.8;
}
.campaigns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 36px 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.campaigns legend {
  padding: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}
.campaign {
  position: relative;
  cursor: pointer;
  padding: 24px 19px 20px;
  background: linear-gradient(160deg, #3a4533, #293226);
  border: 1px solid #606b50;
  box-shadow: inset 0 0 0 3px #202a20;
  min-height: 175px;
}
.campaign:hover {
  border-color: #b9c794;
}
.campaign:has(input:checked) {
  border-color: #e2c77f;
  box-shadow: inset 0 0 0 3px #8b7842;
  background: linear-gradient(160deg, #485239, #303b29);
}
.campaign:focus-within {
  outline: 2px solid #f3dfac;
  outline-offset: 3px;
}
.campaign input[type='radio'] {
  position: absolute;
  top: 17px;
  right: 12px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #e2c77f;
}
.campaign .number {
  display: block;
  padding-right: 22px;
  font-family: monospace;
  letter-spacing: 2px;
  color: #b59d64;
  font-size: 12px;
}
.campaign-title {
  display: block;
  font-weight: 600;
  font-size: 18px;
  margin: 16px 0 10px;
  color: #e7e7ce;
}
.campaign-description {
  display: block;
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  color: #b0bba3;
}
.campaign small {
  display: block;
  color: #d0bc7d;
  margin-top: 15px;
}
.launch-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.launch-actions > a {
  font-size: 12px;
  margin-left: 8px;
}
.primary {
  background: #c5ae6b;
  border-color: #ddca8f;
  color: #1c251c;
  padding: 14px 28px;
}
.primary:hover {
  background: #dfc57b;
}
.primary span {
  margin-left: 45px;
}
.fine {
  color: #a6af99;
  font-size: 12px;
  line-height: 1.7;
}
.player {
  height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}
.player[hidden],
section[hidden] {
  display: none;
}
.viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #10170f;
  scrollbar-color: #637453 #202820;
}
.viewport:fullscreen {
  width: 100%;
  height: 100%;
  background: #10170f;
}
#canvas-frame {
  position: relative;
  margin: auto;
}
canvas {
  display: block;
  image-rendering: pixelated;
  outline: none;
  touch-action: none;
}
#canvas-frame canvas {
  width: 100%;
  height: 100%;
}
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  background: #1b241bef;
  padding: 25px;
  text-align: center;
}
.loading[hidden] {
  display: none;
}
.loading strong {
  font-size: 21px;
  letter-spacing: 1px;
}
.loading span {
  font-size: 13px;
  color: #acb49e;
  max-width: 450px;
}
.loading progress {
  width: min(360px, 90%);
  height: 8px;
  accent-color: #c5ad68;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px max(8px, env(safe-area-inset-right)) 7px
    max(8px, env(safe-area-inset-left));
  background: #363f2e;
  border-top: 2px solid #747d5b;
  flex-wrap: wrap;
}
.toolbar button {
  padding: 8px 12px;
  min-width: 40px;
  background: #49523b;
  border-color: #77825c #212a1c #212a1c #77825c;
  border-radius: 1px;
}
.toolbar button:hover {
  background: #66714f;
}
.toolbar button[aria-pressed='true'] {
  background: #a38146;
}
.divider {
  height: 28px;
  border-left: 1px solid #6d7757;
  margin: 0 2px;
}
.status {
  font: 10px monospace;
  color: #b2bd9a;
  background: #262e22;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px max(6px, env(safe-area-inset-bottom));
}
.status span:last-child {
  color: #8f9a7f;
}
footer {
  display: flex;
  gap: 20px;
  padding: 18px 24px;
  font-size: 10px;
  color: #89967d;
  border-top: 1px solid #374330;
  flex-wrap: wrap;
}
body.playing footer {
  display: none;
}
dialog {
  background: #283222;
  color: #e2e7d6;
  border: 1px solid #83936a;
  border-radius: 4px;
  max-width: 560px;
  width: calc(100% - 30px);
  max-height: 85dvh;
  padding: 28px;
  box-shadow: 0 25px 80px #000b;
}
dialog::backdrop {
  background: #061008c9;
}
dialog h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 16px;
}
dialog p,
dialog dd {
  font-size: 13px;
  line-height: 1.75;
  color: #c0c9b3;
}
dialog dt {
  font-weight: bold;
  font-size: 13px;
  margin-top: 17px;
}
dialog dd {
  margin: 4px 0;
}
dialog button {
  margin: 8px 5px 0 0;
}
dialog input {
  width: 100%;
  font: 16px system-ui;
  background: #121e13;
  color: #f1efdc;
  border: 1px solid #819165;
  padding: 14px;
  margin: 10px 0;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #4c593e;
  padding: 8px 0;
  font: 12px monospace;
}
.file-row span {
  flex: 1;
  overflow-wrap: anywhere;
}
.file-row button {
  font: 12px system-ui;
  min-height: 36px;
}
.error {
  max-width: 650px;
  margin: 40px auto;
  padding: 30px;
  background: #3b3024;
  border: 1px solid #a99169;
}
.error a {
  margin-left: 20px;
  font-size: 13px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 300px;
  overflow: auto;
}
body.playing .topbar {
  min-height: 48px;
  height: 48px;
}
body.playing .player {
  height: calc(100dvh - 48px);
}
@media (max-width: 800px) {
  .campaigns {
    grid-template-columns: repeat(2, 1fr);
  }
  .launcher {
    padding: 35px 20px;
  }
  .edition {
    display: none;
  }
  .topbar {
    gap: 8px;
  }
  .toolbar button {
    font-size: 11px;
    padding: 8px;
    min-height: 40px;
  }
  .toolbar {
    gap: 4px;
  }
  .status span:last-child {
    display: none;
  }
}
@media (max-width: 450px) {
  .campaign {
    min-height: 155px;
    padding: 19px 13px;
  }
  .campaign-title {
    font-size: 16px;
  }
  .campaign-description {
    font-size: 14px;
  }
  .campaigns {
    gap: 9px;
    margin: 25px 0;
  }
  .launch-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .launch-actions > a {
    margin: 12px 0;
  }
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .brand {
    font-size: 11px;
  }
  .toolbar {
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .divider {
    display: none;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  body.playing .topbar {
    display: none;
  }
  body.playing .player {
    height: 100dvh;
  }
  .toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px;
  }
  .toolbar button {
    flex-shrink: 0;
    min-height: 34px;
  }
  .status {
    display: none;
  }
}
.player:fullscreen {
  width: 100vw;
  height: 100dvh;
  padding: 0;
}
.player:fullscreen .viewport {
  height: auto;
}
.file-row button:focus-visible {
  outline: 2px solid #ecd280;
}
#toolbar-help {
  display: none;
}
.player:fullscreen #toolbar-help {
  display: block;
}
.toolbar button:disabled {
  opacity: 0.4;
  cursor: wait;
}
.file-row span {
  min-width: 0;
}
.error {
  max-width: min(650px, calc(100% - 30px));
  overflow-wrap: anywhere;
}
#error-saves[hidden] {
  display: none;
}
@media (max-height: 500px) and (orientation: landscape) {
  #toolbar-help {
    display: block;
  }
}
