@font-face {
  font-family: Archivo;
  src: url('assets/fonts/Archivo-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: Archivo;
  src: url('assets/fonts/Archivo-Italic-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Fell;
  src: url('assets/fonts/IMFell-Roman.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Fell;
  src: url('assets/fonts/IMFell-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Fell SC';
  src: url('assets/fonts/IMFell-SC.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ui: Archivo, 'Arial Narrow', Arial, sans-serif;
  --ink: Fell, Georgia, serif;
  --sc: 'Fell SC', Georgia, serif;
  --coin: #ffc928;
  --bone: #e6dfd0;
  --iron: #121719;
  --rain: #aebab9;
  --crimson: #b73e46;
  --oxblood: #3b1017;
  --line: #e6dfd038;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--iron);
  color: var(--bone);
  font: 16px/1.4 var(--ui);
}
button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 6px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
[hidden] {
  display: none !important;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
}
#vignette,
#grain,
#danger,
#flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#vignette {
  background: radial-gradient(ellipse at 58% 46%, transparent 35%, #07101760);
}
#grain {
  opacity: 0.035;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#danger {
  box-shadow: inset 0 0 170px #b73e4680;
  opacity: 0;
  transition: opacity 0.2s;
}
#flash {
  background: #d4e5f3;
  opacity: 0;
}
#masthead {
  position: absolute;
  top: 5.5vh;
  left: 4.5vw;
  right: 4.5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
  text-shadow: 0 1px 9px #000;
}
.wordmark {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.wordmark small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--rain);
  margin-top: 3px;
}
.cut-mark {
  display: block;
  width: 26px;
  height: 33px;
  flex: none;
  background: url('assets/cadet-insignia.svg') center/contain no-repeat;
}
.icon-button {
  border: 0;
  background: none;
  padding: 10px 0;
  font-size: 14px;
}
.icon-button b {
  font-weight: 600;
  color: var(--bone);
  margin-left: 8px;
}
.panel {
  position: absolute;
  inset: 0;
  padding: 23vh 4.5vw 95px;
  overflow: auto;
  background:
    linear-gradient(90deg, #070d11f0, #0b121aab 36%, #0b121a18 80%),
    linear-gradient(0deg, #070d11a0, transparent 30%);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--rain);
  font-weight: 400;
}
h1 {
  font: 700 extra-condensed clamp(100px, 12vw, 190px)/0.87 var(--ui);
  letter-spacing: -0.045em;
  margin: 30px 0;
}
h1 small {
  display: block;
  font: italic 400 clamp(32px, 3.3vw, 50px)/1 var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
h1 > span {
  display: block;
}
.intro {
  font-size: clamp(19px, 1.65vw, 26px);
  line-height: 1.3;
  margin: 0 0 24px;
}
.primary,
.overlay:not([data-result='paused']) #retry {
  width: 290px;
  max-width: 100%;
  min-height: 53px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  background: var(--bone);
  color: var(--iron);
  border: 0;
  font-size: 20px;
  font-weight: 600;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 9px),
    calc(100% - 9px) 100%,
    0 100%
  );
  transition: background 0.15s;
}
.primary:hover,
.overlay:not([data-result='paused']) #retry:hover {
  background: #fff3dc;
}
.primary b,
#retry b {
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}
.menu-note {
  font-size: 13px;
  color: var(--rain);
  margin-top: 16px;
}
.menu-bottom {
  position: absolute;
  bottom: 5vh;
  left: 4.5vw;
  right: 4.5vw;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: var(--rain);
  font-size: 12px;
}
.menu-bottom > span {
  letter-spacing: 0.06em;
}
.menu-links {
  display: flex;
  gap: 28px;
}
.menu-links button {
  border: 0;
  background: none;
  padding: 5px 0;
  font-size: 15px;
}
.menu-links button:hover {
  color: var(--bone);
}
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #050b1280,
    transparent 28%,
    transparent 70%,
    #050b1290
  );
}
#hud button {
  pointer-events: auto;
}
.playing #masthead {
  top: 20px;
}
.playing .wordmark {
  display: none;
}
.playing #sound {
  margin-left: auto;
  font-size: 12px;
  color: var(--rain);
}
.objective {
  position: absolute;
  top: 9vh;
  left: 4.5vw;
  text-shadow: 0 1px 6px #000;
}
.objective h2 {
  font: 600 clamp(24px, 2.2vw, 34px)/1.2 var(--ui);
  margin: 8px 0;
}
.objective p {
  font-size: 21px;
  color: var(--rain);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.wind-widget {
  position: absolute;
  right: 4.5vw;
  top: 9vh;
  text-align: right;
  text-shadow: 0 1px 6px #000;
}
.wind-widget > .eyebrow {
  font-size: 16px;
  letter-spacing: 0;
}
.wind-widget > div {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
}
.wind-widget b {
  font-size: 30px;
  font-weight: 400;
}
.wind-widget #wind-text {
  font-size: 23px;
  font-weight: 600;
}
.wind-bars {
  gap: 5px !important;
}
.wind-bars i {
  width: 21px;
  height: 3px;
  background: #e6dfd036;
}
.wind-bars i.on {
  background: var(--bone);
}
#toast {
  position: absolute;
  top: 35%;
  left: 4.5vw;
  width: min(290px, 32vw);
  padding-left: 13px;
  border-left: 3px solid var(--crimson);
  text-shadow: 0 1px 7px #000;
  transition: opacity 0.4s;
  opacity: 0;
}
#toast span {
  font: 600 20px/1.2 var(--ui);
}
#toast p {
  font-size: 16px;
  color: var(--bone);
  margin: 5px 0 0;
  line-height: 1.35;
}
.balance-wrap {
  position: absolute;
  bottom: 10%;
  left: 50%;
  width: 300px;
  max-width: 40vw;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
}
.balance-hint {
  order: 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--bone);
  margin-bottom: 14px;
}
.balance-track {
  order: 1;
  height: 2px;
  position: relative;
  background: #e6dfd04d;
}
.safe-zone {
  position: absolute;
  left: 40%;
  width: 20%;
  height: 6px;
  top: -2px;
  background: #e6dfd088;
}
.center-tick {
  display: none;
}
#balance-needle {
  position: absolute;
  width: 4px;
  height: 12px;
  left: calc(50% - 2px);
  top: -5px;
  background: var(--bone);
}
.balance-label {
  order: 2;
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 12px;
  margin-top: 12px;
  color: var(--rain);
}
#stance-label {
  color: var(--bone);
}
.controls-strip {
  position: absolute;
  bottom: 4%;
  left: 4.5vw;
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--rain);
}
.controls-strip span {
  display: flex;
  gap: 6px;
  align-items: center;
}
kbd {
  font: inherit;
  color: var(--bone);
  border: 0;
  padding: 0;
}
.controls-strip span:nth-child(4),
.controls-strip span:nth-child(5) {
  display: none;
}
#pause-button {
  position: absolute;
  bottom: calc(4% - 10px);
  right: 4.5vw;
  font-size: 13px;
  color: var(--rain);
}
#camera-hint {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--rain);
  text-align: center;
  max-width: 400px;
  opacity: 0.7;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #071018dc;
  backdrop-filter: blur(10px);
  z-index: 5;
}
.dialog {
  text-align: center;
  width: min(100%, 850px);
  padding: 40px 24px;
}
.dialog h2 {
  font: 700 extra-condensed clamp(50px, 6vw, 86px)/1 var(--ui);
  letter-spacing: -0.035em;
  margin: 25px 0 20px;
}
.dialog > p {
  font-size: 18px;
  line-height: 1.5;
  max-width: 440px;
  margin: 0 auto;
  color: var(--rain);
}
.dialog .primary {
  margin: 28px auto 12px;
}
.secondary {
  background: none;
  border: 1px solid var(--line);
  padding: 14px 22px;
  width: 290px;
  max-width: 100%;
  font-size: 18px;
}
.text-button {
  display: block;
  border: 0;
  background: none;
  margin: 16px auto 0;
  font-size: 15px;
  padding: 4px;
  color: var(--rain);
}
.text-button:hover {
  color: var(--bone);
}
#result-stats {
  display: flex;
  gap: 55px;
  justify-content: center;
  margin: 28px 0 25px;
  font-size: 14px;
  color: var(--rain);
}
#result-stats b {
  display: block;
  font: 600 28px/1.3 var(--ui);
  color: var(--bone);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.overlay:not([data-result='paused']) #retry {
  margin: 25px auto 0;
}
.overlay[data-result='dead'] {
  background: var(--oxblood);
  backdrop-filter: none;
  animation: death-field 0.16s linear both;
}
.overlay[data-result='dead']::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#090b0d88, transparent 35%, #110b0f77);
}
.overlay[data-result='dead'] .dialog {
  position: relative;
  width: min(100%, 1280px);
  padding: 40px 24px;
}
.overlay[data-result='dead'] .eyebrow {
  color: #c4a6a5;
  font-size: 12px;
}
.overlay[data-result='dead'] h2 {
  font-family: var(--ui);
  font-stretch: extra-condensed;
  font-weight: 900;
  font-size: clamp(68px, 12.8vw, 176px);
  line-height: 0.87;
  letter-spacing: -0.04em;
  margin: 32px 0 25px;
  color: var(--bone);
  animation: type-cut 0.24s ease-out both;
}
#death-verdict {
  width: 90px;
  height: 4px;
  background: var(--crimson);
  transform: skewX(-28deg);
  margin: 0 auto 22px;
}
.overlay[data-result='dead'] .dialog > p {
  font: italic 400 clamp(22px, 2vw, 28px)/1.2 var(--ink);
  color: #cfb0ac;
}
.overlay[data-result='dead'] #result-stats {
  color: #c4a6a5;
  margin: 28px 0 25px;
}
.overlay[data-result='won'] {
  background: #121719e8;
}
.overlay[data-result='won'] h2 {
  color: var(--bone);
}
@keyframes death-field {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes type-cut {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
  }
  to {
    clip-path: inset(0);
    transform: translateY(0);
  }
}
dialog {
  max-width: 680px;
  max-height: 85vh;
  overflow: auto;
  background: var(--iron);
  color: var(--bone);
  border: 1px solid var(--line);
  padding: 40px 45px;
}
dialog::backdrop {
  background: #02090ce0;
  backdrop-filter: blur(8px);
}
dialog h2 {
  font: 700 extra-condensed 44px/1.1 var(--ui);
  margin: 15px 0 24px;
  letter-spacing: -0.03em;
}
dialog p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--rain);
}
dialog h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 25px 0 8px;
}
dialog a {
  color: var(--bone);
  text-underline-offset: 3px;
}
.close {
  position: absolute;
  right: 17px;
  top: 10px;
  border: 0;
  background: none;
  font-size: 30px;
}
.inline-toggle {
  font-size: 14px;
  background: none;
  border: 1px solid var(--line);
  padding: 8px;
  color: var(--bone);
}
.fine {
  font-size: 14px !important;
}
#loading-status {
  position: absolute;
  right: 4.5vw;
  bottom: 12vh;
  color: var(--rain);
  font-size: 14px;
}
.study-title {
  position: absolute;
  top: 16vh;
  left: 4.5vw;
  text-shadow: 0 1px 9px #000;
}
.study-title h2 {
  font: 700 extra-condensed clamp(30px, 3vw, 46px)/1.1 var(--ui);
  letter-spacing: -0.03em;
  margin: 13px 0;
}
.study-title p {
  font-size: 15px;
  color: var(--rain);
}
.study-controls {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.study-controls button {
  font: 400 14px var(--ui);
  border: 1px solid var(--line);
  background: #121719e0;
  padding: 12px 16px;
}
.study-controls button:hover {
  background: var(--bone);
  color: var(--iron);
}
.studying #vignette {
  opacity: 0.45;
}
@media (max-height: 700px) {
  .panel {
    padding-top: 20vh;
  }
  h1 {
    font-size: clamp(88px, 10.5vw, 145px);
    margin: 22px 0;
  }
  .intro {
    font-size: 20px;
    margin-bottom: 18px;
  }
  .menu-note {
    margin-top: 12px;
  }
  .dialog {
    padding: 24px;
  }
  .overlay[data-result='dead'] h2 {
    margin: 22px 0 18px;
  }
  .overlay[data-result='dead'] #result-stats {
    margin: 20px 0;
  }
  .balance-wrap {
    bottom: 11%;
  }
  #camera-hint {
    bottom: 23%;
  }
}
@media (max-width: 750px) {
  #masthead {
    top: 25px;
  }
  .wordmark {
    font-size: 15px;
  }
  .wordmark small {
    font-size: 9px;
  }
  .panel {
    padding-top: 24vh;
  }
  h1 {
    font-size: 19vw;
  }
  h1 small {
    font-size: 7vw;
  }
  .intro {
    font-size: 20px;
  }
  .menu-bottom {
    bottom: 20px;
  }
  .menu-bottom > span {
    display: none;
  }
  .menu-links {
    gap: 24px;
  }
  .menu-links button {
    font-size: 14px;
  }
  .objective,
  .wind-widget {
    top: 11vh;
  }
  .objective h2 {
    font-size: 22px;
  }
  .objective p {
    font-size: 18px;
  }
  .wind-widget #wind-text {
    font-size: 20px;
  }
  .wind-bars i {
    width: 16px;
  }
  #toast {
    width: 42vw;
    top: 32%;
  }
  #toast span {
    font-size: 18px;
  }
  #toast p {
    font-size: 14px;
  }
  .controls-strip {
    gap: 12px;
    font-size: 12px;
  }
  .controls-strip span:nth-child(2) {
    display: none;
  }
  .balance-wrap {
    max-width: 58vw;
  }
  .balance-hint {
    font-size: 12px;
  }
  #camera-hint {
    display: none;
  }
  .study-controls {
    flex-wrap: wrap;
    justify-content: center;
    width: 94%;
    white-space: normal;
  }
  .study-controls button {
    font-size: 12px;
    padding: 10px 12px;
  }
  .study-title {
    top: 16vh;
  }
  .overlay[data-result='dead'] h2 {
    font-size: 12.8vw;
  }
  #result-stats {
    gap: 35px;
  }
  dialog {
    padding: 32px 25px;
    margin: 16px;
  }
  .menu-note {
    font-size: 12px;
  }
  .dialog h2 {
    font-size: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.controls-strip span:nth-child(4),
.controls-strip span:nth-child(5) {
  display: flex;
}
.controls-strip {
  gap: 14px;
  font-size: 12px;
}
.controls-strip span:last-child {
  display: none;
}
@media (max-width: 900px) {
  .controls-strip span:nth-child(3),
  .controls-strip span:nth-child(7) {
    display: none;
  }
}
