@import url("/styles.css");

:root {
  color-scheme: dark;
  --paper: #f0e6ca;
  --gold: #d5b777;
}
body {
  background: #10251d;
  color: var(--paper);
  margin: 0;
}
.masthead,
main,
footer {
  width: min(1240px, calc(100% - 48px));
  margin: auto;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 0;
  border-bottom: 1px solid #ffffff20;
  gap: 20px;
}
.brand {
  font-size: 23px;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
  letter-spacing: -1px;
}
.brand span {
  color: var(--gold);
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  margin-top: 9px;
  color: #a8b9a9;
}
.edition,
.eyebrow,
.hud,
.instruction-strip,
footer,
.conditions {
  font-family: ui-monospace, Consolas, monospace;
}
.edition {
  font-size: 10px;
  letter-spacing: 2px;
  color: #a8b9a9;
}
.text-link {
  color: var(--gold);
  font-size: 13px;
}
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 36px 0 24px;
}
.eyebrow {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 2px;
  margin: 0 0 10px;
}
h1 {
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: -2px;
  line-height: 1;
  margin: 0;
  color: var(--paper);
}
h1 em {
  font-family: Georgia, serif;
  font-size: 0.75em;
  font-weight: 400;
}
h1 > span {
  display: block;
  font-size: 10px;
  letter-spacing: 5px;
  color: #a8b9a9;
  margin-top: 14px;
}
button {
  cursor: pointer;
  color: var(--paper);
  background: #243d30;
  border: 1px solid #77907760;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  padding: 11px 16px;
  min-height: 44px;
}
button:hover {
  background: #38543e;
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible,
input:focus-visible {
  outline: 3px solid #f0c56d;
  outline-offset: 3px;
}
.tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.game-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}
.screen-title {
  display: none;
}
.game-frame {
  border: 1px solid #71836b70;
  border-radius: 9px;
  overflow: hidden;
  background: #142b21;
  box-shadow: 0 18px 70px #0004;
}
.career {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  font:
    10px ui-monospace,
    Consolas,
    monospace;
  color: #b9c6af;
}
.career strong,
.career > span:last-child {
  color: var(--gold);
}
.career progress {
  width: min(230px, 25vw);
  height: 7px;
  accent-color: var(--gold);
  border: 0;
  background: #ffffff15;
}
.career progress::-webkit-progress-bar {
  background: #ffffff15;
  border-radius: 4px;
}
.career progress::-webkit-progress-value {
  background: var(--gold);
  border-radius: 4px;
}
.career progress::-moz-progress-bar {
  background: var(--gold);
}
.career > span:last-child {
  margin-left: auto;
}
.objective-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  border-top: 1px solid #ffffff15;
  background: #20392b;
  font:
    11px ui-monospace,
    Consolas,
    monospace;
}
.objective-row strong {
  color: var(--gold);
}
.card.trail-card {
  width: min(700px, 100%);
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
}
.level-grid button {
  text-align: left;
  padding: 12px;
  min-height: 96px;
}
.level-grid button[aria-current="step"] {
  border-color: var(--gold);
  background: #d5b77712;
}
.level-grid span {
  display: block;
}
.level-grid .stage-number {
  color: #a8b9a9;
  font:
    9px ui-monospace,
    Consolas,
    monospace;
  margin-bottom: 5px;
}
.level-grid .stage-name {
  font-size: 13px;
  font-weight: 700;
}
.level-grid .stage-stars {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 2px;
  margin-top: 5px;
}
.card .goal-callout {
  border-left: 2px solid var(--gold);
  padding: 8px 12px;
  background: #ffffff06;
  font-size: 13px;
}
.card .earned-stars {
  color: var(--gold);
  font-size: 30px;
  margin: 10px 0;
  letter-spacing: 8px;
}
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  color: #b9c6af;
  font-size: 11px;
  letter-spacing: 1px;
}
.hud small {
  display: block;
  font-size: 9px;
  color: var(--gold);
  margin-top: 3px;
}
.hud strong {
  font-size: 20px;
  color: var(--paper);
  margin-left: 8px;
  white-space: nowrap;
}
.ranked-rotate-hint {
  display: none;
}
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b1c16;
}
canvas {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #5d9584;
  touch-action: none;
  user-select: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #09221855;
  overflow-y: auto;
}
.overlay[hidden],
[hidden] {
  display: none !important;
}
.card {
  width: min(480px, 100%);
  border: 1px solid #c3ad7660;
  border-radius: 8px;
  padding: 25px 30px;
  background: #142c24f5;
  box-shadow: 0 10px 40px #0005;
  max-height: 100%;
  overflow-y: auto;
}
.card h2 {
  color: var(--paper);
  font:
    700 clamp(24px, 3vw, 35px) / 1.1 Georgia,
    serif;
  margin: 12px 0;
  letter-spacing: -0.5px;
}
.card p {
  font-size: 14px;
  line-height: 1.55;
  color: #c4cfbf;
  margin: 12px 0;
}
.card .eyebrow {
  color: var(--gold);
  font-size: 10px;
}
.card .fine {
  font-size: 11px;
  color: #a8b9a9;
}
.story {
  border-left: 2px solid var(--gold);
  padding-left: 14px;
}
.primary {
  background: #d5b777;
  color: #18271e;
  border-color: #d5b777;
  font-weight: 800;
  margin-top: 8px;
}
.primary:hover {
  background: #ebcf94;
  color: #18271e;
}
.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
}
.hunt-actions {
  margin-top: 8px;
}
.hunt-actions .primary {
  margin-top: 0;
}
.card .text-link {
  display: block;
  margin-top: 20px;
}
.conditions {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  font-size: 9px;
}
.conditions strong {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  color: var(--gold);
}
.chapter-label {
  display: block;
  padding: 0;
  border: 0;
  margin: 12px 0 6px;
  cursor: pointer;
  font-size: 11px;
  color: var(--gold);
}
#chapter-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #77907760;
  border-radius: 5px;
  background: #243d30;
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  padding: 9px;
}
.card .chapter-place {
  color: var(--gold);
  font-size: 11px;
  margin: 8px 0;
}
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.setup-badge {
  display: block;
  margin: 5px 0 5px 24px;
  color: var(--gold);
  font:
    bold 11px ui-monospace,
    Consolas,
    monospace;
}
.setup-option small {
  line-height: 1.4;
}
.setup-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.setup-option {
  margin: 0;
  padding: 9px 7px;
  font-size: 12px;
}
.setup-option small {
  margin: 0;
  font-size: 10px;
}
.setup-option .setup-badge {
  margin: 7px 0;
  font-size: 10px;
  line-height: 1.4;
}
fieldset {
  padding: 0;
  border: 0;
  margin: 10px 0;
}
legend {
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 700;
}
.setup-option {
  display: block;
  border: 1px solid #77907760;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 7px;
  cursor: pointer;
  font-size: 13px;
}
.setup-option:has(input:checked) {
  border-color: var(--gold);
  background: #d5b77710;
}
.setup-option small {
  display: block;
  margin-left: 24px;
  font-size: 11px;
  color: #a8b9a9;
}
input {
  accent-color: var(--gold);
}
.card.leaderboard-card {
  width: min(540px, 100%);
  padding: clamp(14px, 4vw, 26px);
}
.leaderboard-heading {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  background: #142c24;
}
.leaderboard-heading .eyebrow {
  margin: 0;
}
.leaderboard-heading h2 {
  margin: 5px 0 8px;
}
.leaderboard-heading button {
  flex: none;
}
.leaderboard-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #77907760;
  border-radius: 8px;
  background: #0b2118;
}
.leaderboard-player .eyebrow,
.leaderboard-player .leaderboard-player-name {
  margin: 0;
  overflow-wrap: anywhere;
}
.leaderboard-player dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid #77907760;
}
.leaderboard-player dt {
  color: #c4cfbf;
  font-size: 12px;
}
.leaderboard-player dd {
  margin: 2px 0 0;
  color: var(--gold);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.leaderboard-table th,
.leaderboard-table td {
  padding: 9px 6px;
  border-bottom: 1px solid #77907760;
  text-align: left;
  overflow-wrap: anywhere;
}
.leaderboard-table th {
  color: var(--gold);
  background: #0b2118;
  font-size: 12px;
}
.leaderboard-table th:first-child {
  width: 4em;
}
.leaderboard-table th:last-child {
  width: 6em;
}
.leaderboard-table :is(th, td):last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.leaderboard-table .your-score {
  background: #d5b77719;
}
.leaderboard-actions {
  margin-top: 16px;
}
.arcade-form {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  min-width: 0;
}
.arcade-form label {
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
}
.arcade-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #779077;
  border-radius: 6px;
  background: #0b2118;
  color: var(--paper);
  font: inherit;
  font-size: 16px;
}
.arcade-form label:not(:first-child),
.arcade-form .card-actions {
  margin-top: 6px;
}
.arcade-form .primary {
  margin-top: 0;
}
.card .arcade-help {
  margin: 2px 0 0;
  font-size: 12px;
}
.arcade-password-settings {
  margin: 16px 0;
}
.arcade-password-settings summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 700;
}
.arcade-name-summary {
  margin-top: 16px;
  padding: 12px;
  border-left: 3px solid var(--gold);
  background: #0b2118;
  overflow-wrap: anywhere;
}
.arcade-name-summary h3 {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
}
.arcade-name-summary p {
  margin: 4px 0 0;
}
.arcade-name-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--paper);
  font-size: 18px;
}
.arcade-name-summary button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  text-align: left;
}
.arcade-name-summary button:hover strong {
  text-decoration: underline;
}
.arcade-moderation-list {
  list-style: none;
  padding: 0;
}
.arcade-moderation-list li {
  padding: 10px 0;
  border-top: 1px solid #77907760;
  overflow-wrap: anywhere;
}
.arcade-moderation-list fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.instruction-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 12px 22px;
  font-size: 11px;
}
.instruction-strip p {
  margin: 0;
  color: #d6dfce;
}
.instruction-strip > span {
  font-size: 9px;
  color: #a8b9a9;
  white-space: nowrap;
}
.toast {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 9px 16px;
  background: #10251de8;
  border: 1px solid #d5b77770;
  border-radius: 5px;
  color: var(--paper);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  width: max-content;
  max-width: 90%;
}
.toast:empty {
  display: none;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}
.stat-grid div {
  background: #ffffff08;
  border: 1px solid #ffffff15;
  padding: 12px 8px;
  text-align: center;
}
.stat-grid strong {
  display: block;
  color: var(--gold);
  font-size: 23px;
}
.stat-grid span {
  font-size: 10px;
  color: #b9c6af;
}
.species-list {
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.species-list div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ffffff15;
  padding: 6px 0;
}
.below-game {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 50px;
  font-size: 12px;
  color: #a8b9a9;
  padding: 22px 0 35px;
  line-height: 1.7;
}
.below-game p {
  margin: 0;
}
.below-game strong {
  color: #d5dfce;
}
summary {
  cursor: pointer;
  color: var(--gold);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 0 30px;
  border-top: 1px solid #ffffff20;
  color: #a8b9a9;
  font-size: 9px;
  letter-spacing: 1px;
}
footer a {
  color: var(--gold);
}
@media (max-width: 700px) {
  .game-shell {
    --inline-stage-height: 440px;
  }
  .masthead,
  main,
  footer {
    width: calc(100% - 24px);
  }
  .edition {
    display: none;
  }
  .masthead {
    flex-direction: column;
    gap: 12px;
  }
  .title-row {
    display: block;
    padding-top: 24px;
  }
  .tools {
    margin-top: 0;
  }
  .career {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 9px;
  }
  .career progress {
    width: 65px;
  }
  .objective-row {
    padding: 10px 12px;
    font-size: 9px;
  }
  .trail-card h2 {
    font-size: 20px;
    margin: 8px 0;
  }
  .card.trail-card {
    padding: 14px;
  }
  .trail-card #trail-summary,
  .trail-card .fine {
    display: none;
  }
  .level-grid {
    gap: 5px;
    margin: 10px 0;
  }
  .level-grid button {
    min-height: 64px;
    padding: 7px;
  }
  .level-grid .stage-name {
    font-size: 10px;
    line-height: 1.15;
  }
  .level-grid .stage-number {
    font-size: 7px;
  }
  .level-grid .stage-stars {
    font-size: 11px;
  }
  .hud {
    padding: 12px;
    font-size: 9px;
  }
  .hud strong {
    font-size: 16px;
    display: block;
    margin: 4px 0 0;
  }
  .hud > span:first-child {
    flex: 1;
  }
  .hud > span:nth-child(n + 2) {
    flex: 0 0 auto;
  }
  .stage {
    min-height: var(--inline-stage-height);
    height: var(--inline-stage-height);
    aspect-ratio: auto;
  }
  canvas {
    height: var(--inline-stage-height);
    aspect-ratio: auto;
  }
  .overlay {
    padding: 12px;
  }
  .card {
    padding: 20px;
  }
  .card p {
    font-size: 13px;
  }
  .instruction-strip {
    padding: 12px;
  }
  .instruction-strip > span {
    display: none;
  }
  .below-game {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  footer {
    flex-direction: column;
  }
}
@media (max-height: 600px) and (min-width: 701px) {
  .overlay {
    place-items: start center;
  }
}

body.game-expanded {
  overflow: hidden;
}
.game-shell.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  height: var(--game-view-height, 100dvh);
  box-sizing: border-box;
  padding: max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  background: #10251d;
  overflow: hidden;
}
.game-shell::backdrop {
  background: #10251d;
}
.game-shell.is-expanded .game-toolbar {
  flex: 0 0 auto;
  padding-bottom: 6px;
}
.game-shell.is-expanded .screen-title {
  display: block;
  margin-right: auto;
  color: var(--gold);
  font:
    bold 11px ui-monospace,
    Consolas,
    monospace;
}
.game-shell.is-expanded .tools {
  gap: 6px;
  margin: 0;
}
.game-shell.is-expanded .tools button {
  padding: 8px 10px;
  font-size: 11px;
}
.game-shell.is-expanded .career {
  flex: 0 0 auto;
  margin-bottom: 8px;
  font-size: 9px;
}
.game-shell.is-expanded .game-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  box-shadow: none;
}
.game-shell.is-expanded .hud {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 9px;
}
.game-shell.is-expanded .hud strong {
  font-size: 16px;
}
.game-shell.is-expanded .objective-row {
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 9px;
}
.game-shell.is-expanded .stage {
  flex: 1;
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
}
.game-shell.is-expanded .instruction-strip {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 10px;
}
.game-shell.is-expanded .instruction-strip > span {
  display: none;
}
@media (max-width: 700px) {
  .game-shell.is-expanded .screen-title {
    display: none;
  }
}
@media (max-height: 500px) {
  .game-shell.is-expanded .career,
  .game-shell.is-expanded .instruction-strip {
    display: none;
  }
}
@media (pointer: coarse) and (max-width: 700px),
  (pointer: coarse) and (max-height: 500px) {
  .game-shell.is-ranked.is-expanded {
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  }
  .game-shell.is-ranked.is-expanded .game-toolbar,
  .game-shell.is-ranked.is-expanded .career {
    padding-inline: 8px;
  }
  .game-shell.is-ranked .game-frame {
    border-inline: 0;
  }
  .game-shell.is-ranked .hud {
    gap: 8px;
    padding: 5px 10px;
    font-size: 9px;
  }
  .game-shell.is-ranked .hud strong {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 14px;
  }
  .game-shell.is-ranked .objective-row {
    padding: 5px 10px;
    font-size: 9px;
  }
}
@media (pointer: coarse) and (max-width: 700px) {
  .game-shell.is-ranked:not(.is-expanded) .game-frame {
    margin-inline: -12px;
    border-radius: 0;
  }
}
@media (pointer: coarse) and (orientation: portrait) and (max-width: 700px) {
  .game-shell.is-ranked .ranked-rotate-hint {
    display: block;
    margin: 0;
    padding: 6px 10px;
    color: var(--gold);
    font:
      10px ui-monospace,
      Consolas,
      monospace;
    text-align: center;
  }
}
