* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #020a12;
  color: #e8e0ce;
  font-family: Georgia, 'Times New Roman', serif;
}
body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  overflow-x: hidden;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  cursor: wait;
  filter: saturate(0.6);
  opacity: 0.72;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #7de5e6;
  outline-offset: 4px;
}
button:hover:not(:disabled) {
  filter: brightness(1.15);
}
img {
  user-select: none;
  pointer-events: none;
}
button img {
  width: 22px;
  filter: invert(86%) sepia(30%) saturate(460%);
}
[hidden] {
  display: none !important;
}
.scene {
  width: min(100vw, 177.685dvh);
  aspect-ratio: 1672/941;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
}
.world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  animation: ocean-breath 16s ease-in-out infinite;
}
.scene:after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 7cqw #02091685;
  pointer-events: none;
  z-index: 8;
}
#water {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}
.back {
  position: absolute;
  top: 3.3%;
  left: 3%;
  color: #e8e0ce;
  font: 600 0.7cqw Arial;
  letter-spacing: 0.18em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5cqw;
  z-index: 10;
}
.back img {
  width: 1.1cqw;
  filter: invert(0.9);
}
header .title {
  position: absolute;
  width: 29%;
  height: 18%;
  object-fit: contain;
  top: -1.5%;
  left: 28.5%;
  z-index: 4;
}
nav {
  position: absolute;
  right: 3%;
  top: 3%;
  display: flex;
  gap: 0.6cqw;
  z-index: 10;
}
.icon {
  height: 2.3cqw;
  min-width: 2.3cqw;
  padding: 0.35cqw;
  border: 1px solid #9aa18c44;
  border-radius: 50%;
  background: #061925bb;
  font: 600 0.48cqw Arial;
  letter-spacing: 0.04em;
}
.icon img {
  width: 1.25cqw;
  height: 1.25cqw;
}
.icon[aria-pressed='false'] {
  opacity: 0.42;
}
.gauge {
  position: absolute;
  width: 23%;
  height: 16%;
  top: 1.1%;
  padding: 0;
  z-index: 3;
  text-align: left;
}
.gauge.pressure {
  left: 3.3%;
}
.gauge.light {
  left: 58.8%;
}
.gauge > img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.gauge-copy {
  position: absolute;
  left: 41%;
  right: 8%;
  top: 36%;
  display: flex;
  flex-direction: column;
  gap: 0.15cqw;
}
.gauge small {
  font: 600 0.52cqw Arial;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.gauge strong {
  font-size: 2.1cqw;
  color: #f9d890;
  line-height: 1.07;
}
.light strong {
  color: #9af8ea;
}
.gauge-copy small:last-of-type {
  font-size: 0.5cqw;
  letter-spacing: 0.08em;
  color: #9bafbb;
}
.gauge progress {
  height: 0.18cqw;
  width: 100%;
  border: 0;
  margin-top: 0.13cqw;
  accent-color: #dfbd79;
  background: #061525;
}
.light progress {
  accent-color: #7beddf;
}
.gauge.powered {
  animation: gauge-charge 1.2s ease;
}
.field {
  position: absolute;
  left: 2.5%;
  top: 16.5%;
  width: 73%;
  height: 66.5%;
}
#ports,
#waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#waves {
  pointer-events: none;
  z-index: 4;
}
.port {
  position: absolute;
  width: 16.8%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: visible;
  z-index: 1;
}
.port img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition:
    filter 0.3s,
    transform 0.4s;
  filter: drop-shadow(0 0.45cqw 0.7cqw #010a14aa);
}
.port.winner {
  z-index: 3;
}
.port.winner img {
  filter: drop-shadow(0 0 0.8cqw #43fffbbb);
  animation: port-win 1.4s ease-in-out infinite;
}
.port.changing img {
  animation: refract 0.75s ease both;
}
.port.beacon img {
  animation: beacon-glow 5s ease-in-out infinite;
}
.port.spinning img {
  animation: submerge 0.85s ease-in-out infinite;
  animation-delay: var(--delay);
}
.win-banner {
  position: absolute;
  left: 29%;
  top: 36%;
  width: 42%;
  z-index: 6;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transform: translateY(1cqw);
  transition: 0.3s;
}
.win-banner.show {
  opacity: 1;
  transform: translateY(0);
}
.win-banner strong {
  font-size: 4.3cqw;
  color: #c9ffed;
  text-shadow:
    0 2px 2px #041622,
    0 0 25px #16b3b5;
}
.win-banner small {
  display: block;
  font: 600 0.7cqw Arial;
  letter-spacing: 0.2em;
  color: #eae1c8;
  text-shadow: 0 2px 4px black;
}
.field-caption {
  position: absolute;
  left: 10%;
  width: 58%;
  top: 85.2%;
  font: 500 0.55cqw Arial;
  letter-spacing: 0.14em;
  display: flex;
  justify-content: space-between;
  color: #bbd1d0;
  text-shadow: 0 1px 2px #000;
}
.pilot {
  position: absolute;
  left: 73%;
  width: 27%;
  height: 71%;
  top: 17%;
  z-index: 3;
  pointer-events: none;
}
.pilot > img {
  position: absolute;
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center bottom;
  animation: pilot-breathe 7s ease-in-out infinite;
  transform-origin: bottom center;
  transition: opacity 0.6s;
  filter: drop-shadow(0 0.3cqw 0.6cqw #02070bb0);
}
.pilot .talk {
  opacity: 0;
}
.pilot.speaking .talk {
  opacity: 1;
}
.pilot.speaking .idle {
  opacity: 0;
}
.speech {
  position: absolute;
  bottom: -1.5%;
  left: 5%;
  right: 8%;
  text-align: center;
  padding: 1cqw 0.6cqw;
  background: #041728d9;
  border: 1px solid #ac8c514c;
  border-radius: 0.4cqw;
  box-shadow: 0 5px 25px #00122166;
  backdrop-filter: blur(8px);
}
.speech small {
  font: 600 0.5cqw Arial;
  letter-spacing: 0.22em;
  color: #aabfc5;
}
.speech p {
  margin: 0.55cqw 0 0;
  font-size: 1cqw;
  font-style: italic;
  line-height: 1.25;
  color: #f3dfb8;
}
.expedition-sign {
  position: absolute;
  right: 3%;
  bottom: 3.5%;
  display: flex;
  align-items: center;
  gap: 0.5cqw;
  z-index: 4;
}
.expedition-sign img {
  width: 3.7cqw;
}
.expedition-sign span {
  font: 500 0.55cqw Arial;
  line-height: 1.6;
  letter-spacing: 0.1em;
}
.expedition-sign b {
  display: inline-block;
  max-width: 11cqw;
  font-size: 0.52cqw;
  color: #9badb7;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.console {
  position: absolute;
  left: 3%;
  width: 73%;
  height: 12.8%;
  bottom: 2.7%;
  z-index: 5;
}
.console-art {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: fill;
}
.readout {
  position: absolute;
  top: 36%;
  display: flex;
  flex-direction: column;
  gap: 0.23cqw;
}
.readout small {
  font: 600 0.58cqw Arial;
  letter-spacing: 0.14em;
  color: #bcc1b7;
}
.readout strong {
  font-size: 1.95cqw;
  line-height: 1.1;
  color: #f1d59e;
  font-variant-numeric: tabular-nums;
}
.balance {
  left: 10%;
  width: 17%;
}
.bet {
  left: 31%;
  width: 11%;
}
.bet > div {
  display: flex;
  align-items: center;
  gap: 0.6cqw;
}
.bet strong {
  font-size: 1.6cqw;
}
.bet button {
  padding: 0.15cqw 0.12cqw;
}
.bet button img {
  width: 0.8cqw;
}
.winnings {
  left: 48%;
  width: 17%;
}
.winnings strong {
  color: #a5eadb;
}
.spin {
  position: absolute;
  left: 69%;
  width: 24%;
  top: 33%;
  height: 51%;
  color: #332311;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8cqw;
  font: 700 1.15cqw Arial;
  letter-spacing: 0.1em;
}
.spin img {
  width: 1.6cqw;
  filter: none;
}
.spin small {
  font: 600 0.48cqw Arial;
  display: block;
  letter-spacing: 0.16em;
  margin-top: 0.35cqw;
}
.lower-controls {
  position: absolute;
  left: 4.5%;
  right: 25%;
  bottom: 0.65%;
  display: flex;
  gap: 0.9cqw;
  align-items: center;
  font: 500 0.52cqw Arial;
  color: #a9c4cd;
  z-index: 10;
}
.lower-controls button {
  display: flex;
  align-items: center;
  gap: 0.3cqw;
  font: 600 0.5cqw Arial;
  letter-spacing: 0.09em;
  padding: 0.2cqw;
}
.lower-controls img {
  width: 0.8cqw;
}
.lower-controls [aria-pressed='true'] {
  color: #ffd898;
}
.lower-controls #status {
  flex: 1;
  text-align: center;
}
.bonus {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #061725;
}
.wreck {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: wreck-drift 20s ease-in-out infinite;
}
.bonus-shade {
  position: absolute;
  inset: 0;
  background: #010e20a8;
}
.bonus-heading {
  position: absolute;
  top: 7%;
  left: 10%;
  width: 80%;
  text-align: center;
  text-shadow: 0 3px 10px #001;
}
.bonus-heading small {
  font: 600 0.65cqw Arial;
  letter-spacing: 0.25em;
  color: #87d9d5;
}
.bonus h1 {
  font-size: 3.3cqw;
  margin: 0.8cqw 0;
  color: #f5d8a2;
  font-weight: 400;
}
.bonus-heading p {
  font-size: 1.1cqw;
  margin: 0;
  color: #c6d6d3;
}
.bonus-pot {
  position: absolute;
  top: 29%;
  left: 38%;
  width: 24%;
  text-align: center;
  padding: 1.2cqw;
  background: #071f2bdd;
  border: 1px solid #b39962;
  border-radius: 1cqw;
  box-shadow: 0 0 40px #227b8c44;
}
.bonus-pot small {
  display: block;
  font: 600 0.6cqw Arial;
  letter-spacing: 0.2em;
}
.bonus-pot strong {
  font-size: 4cqw;
  color: #f2d391;
  display: block;
}
.bonus-pot span {
  font: 500 0.75cqw Arial;
  color: #a9dad6;
}
.dive-trail {
  position: absolute;
  top: 48%;
  left: 22%;
  width: 56%;
  display: flex;
  justify-content: center;
  gap: 1cqw;
}
.trail-port {
  width: 4cqw;
  height: 4cqw;
  opacity: 0.3;
}
.trail-port.active {
  opacity: 1;
  filter: drop-shadow(0 0 8px #78fff2);
}
.routes {
  position: absolute;
  left: 15%;
  width: 70%;
  top: 58%;
  display: flex;
  gap: 2cqw;
}
.route {
  flex: 1;
  background: #051b2dde;
  border: 1px solid #b08f587a;
  border-radius: 1cqw;
  padding: 1cqw;
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  text-align: left;
  transition: 0.25s;
}
.route > img {
  width: 4.5cqw;
}
.route b {
  font-size: 1.05cqw;
  display: block;
  font-weight: 400;
  color: #e8d4ab;
}
.route small {
  font: 500 0.65cqw Arial;
  display: block;
  color: #9dcbc9;
  margin: 0.45cqw 0;
}
.route em {
  font: 0.65cqw Arial;
  color: #d3dad5;
  font-style: normal;
}
.route:hover {
  transform: translateY(-0.3cqw);
  box-shadow: 0 0 20px #58d9d055;
}
.brass-button {
  position: absolute;
  left: 36%;
  width: 28%;
  bottom: 12%;
  height: 7%;
  background: #071f31e8;
  border: 1px solid #c3a261;
  border-radius: 0.6cqw;
  font: 600 0.95cqw Arial;
  letter-spacing: 0.15em;
  box-shadow: 0 0 30px #b799532a;
  color: #f0d28f;
}
.bonus.safe .bonus-pot {
  animation: salvage 1s ease;
}
.bonus.failed .bonus-shade {
  background: #280b18bb;
}
.bonus.failed .wreck {
  animation: collapse 0.7s ease;
}
.bonus.failed .bonus-pot strong {
  color: #f2a9a1;
}
#bonus-event {
  position: absolute;
  bottom: 6%;
  left: 20%;
  width: 60%;
  text-align: center;
  font-size: 1.1cqw;
  color: #d3f5e8;
}
.bonus.failed #bonus-event {
  color: #f3b8a9;
}
dialog {
  width: min(760px, 86vw);
  max-height: 85dvh;
  background: #081f2cf5;
  border: 1px solid #9c854b;
  border-radius: 16px;
  color: #d2dfdb;
  padding: 35px;
  font: 15px/1.65 Arial;
  box-shadow: 0 20px 100px #000a;
}
dialog::backdrop {
  background: #020a15bf;
  backdrop-filter: blur(8px);
}
dialog h2 {
  font: 32px Georgia;
  color: #efcf94;
  margin: 10px 0 20px;
}
dialog h3 {
  font: 21px Georgia;
  color: #a3e7da;
}
dialog small {
  letter-spacing: 0.18em;
  font-size: 10px;
  color: #7cccc9;
}
.close {
  position: absolute;
  right: 16px;
  top: 8px;
  font-size: 30px;
  color: #d4c9aa;
}
.paytable {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 25px;
}
.paytable > div {
  font-size: 12px;
  text-align: center;
  background: #041523;
  padding: 12px;
  border-radius: 12px;
}
.paytable img {
  width: 80%;
  display: block;
  margin: auto;
}
.paytable b {
  display: block;
  font-weight: 400;
  color: #edcf9b;
}
.fine {
  font-size: 12px;
  color: #91aeb7;
}
.history-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid #42647455;
}
.history-row b {
  color: #a9e8d4;
}
.overlay-text {
  font-size: 14px;
}
.scene.fast .port.spinning img {
  animation-duration: 0.4s;
}
.scene.reduced *,
.scene.reduced:after {
  animation: none !important;
  transition: none !important;
}
@keyframes ocean-breath {
  50% {
    transform: scale(1.012);
  }
}
@keyframes pilot-breathe {
  50% {
    transform: translateY(-0.35cqw) rotate(-0.2deg);
  }
}
@keyframes beacon-glow {
  50% {
    filter: drop-shadow(0 0 0.6cqw #79eddb77) brightness(1.12);
  }
}
@keyframes port-win {
  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 1cqw #60fbe9) brightness(1.15);
  }
}
@keyframes submerge {
  0%,
  100% {
    transform: scale(0.98);
    filter: blur(0);
  }
  50% {
    transform: scale(0.85) rotate(5deg);
    filter: blur(4px) brightness(1.2);
  }
}
@keyframes refract {
  0% {
    transform: scale(0.85);
    filter: blur(6px) brightness(2);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes gauge-charge {
  50% {
    filter: drop-shadow(0 0 1cqw #95f3d1) brightness(1.35);
  }
}
@keyframes wreck-drift {
  50% {
    transform: scale(1.06) translateY(-1%);
  }
}
@keyframes salvage {
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 70px #5fecb8aa;
  }
}
@keyframes collapse {
  20%,
  60% {
    transform: translateX(0.5cqw);
  }
  40%,
  80% {
    transform: translateX(-0.5cqw);
  }
}
@media (max-width: 700px) {
  .scene {
    width: 100vw;
    min-width: 0;
  }
  .back {
    font-size: 1cqw;
  }
  .icon {
    min-width: 3.5cqw;
    height: 3.5cqw;
  }
  .icon img {
    width: 2cqw;
    height: 2cqw;
  }
  .icon#voice {
    font-size: 0.7cqw;
  }
  nav {
    gap: 0.5cqw;
  }
  .lower-controls {
    font-size: 0.8cqw;
  }
  .lower-controls button {
    font-size: 0.75cqw;
  }
  .lower-controls img {
    width: 1.4cqw;
  }
  .gauge small {
    font-size: 0.66cqw;
  }
  .gauge-copy small:last-of-type {
    font-size: 0.63cqw;
  }
  .speech p {
    font-size: 1.25cqw;
  }
  .readout small {
    font-size: 0.7cqw;
  }
  .routes {
    left: 8%;
    width: 84%;
  }
  .route small,
  .route em {
    font-size: 0.9cqw;
  }
  .route b {
    font-size: 1.4cqw;
  }
  .brass-button {
    font-size: 1.2cqw;
    height: 9%;
  }
  .bonus-heading p {
    font-size: 1.5cqw;
  }
  dialog {
    padding: 24px;
  }
  .paytable {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.gauge > img,
.route > img {
  filter: none;
}

.gauge-copy {
  left: 44%;
}
@media (max-width: 1000px) {
  .back {
    font-size: 10px;
  }
  .icon {
    height: 26px;
    min-width: 26px;
    padding: 4px;
  }
  .icon img {
    width: 15px;
    height: 15px;
  }
  .icon#voice {
    font-size: 7px;
  }
  .gauge strong {
    font-size: max(17px, 2.1cqw);
  }
  .gauge small {
    font-size: 7px;
  }
  .gauge-copy small:last-of-type {
    font-size: 6px;
  }
  .readout strong {
    font-size: 18px;
  }
  .readout small {
    font-size: 6px;
  }
  .spin {
    font-size: 11px;
    letter-spacing: 0.025em;
  }
  .spin small {
    font-size: 6px;
  }
  .spin img {
    width: 15px;
  }
  .console {
    bottom: 5.5%;
  }
  .speech p {
    font-size: 11px;
  }
  .speech small {
    font-size: 6px;
  }
  .lower-controls {
    bottom: 0.2%;
    font-size: 8px;
    gap: 6px;
  }
  .lower-controls button {
    font-size: 8px;
    min-height: 22px;
  }
  .lower-controls #status {
    font-size: 8px;
  }
  .bonus-heading h1 {
    font-size: 24px;
  }
  .bonus-heading p {
    font-size: 11px;
  }
  .bonus-heading small {
    font-size: 7px;
  }
  .bonus-pot small {
    font-size: 7px;
  }
  .bonus-pot span {
    font-size: 10px;
  }
  .bonus-pot strong {
    font-size: 28px;
  }
  .route b {
    font-size: 12px;
  }
  .route small {
    font-size: 10px;
  }
  .route em {
    font-size: 9px;
  }
  .route > img {
    width: 30px;
  }
  .route {
    gap: 6px;
    padding: 8px;
  }
  .routes {
    left: 5%;
    width: 90%;
    gap: 10px;
    top: 57%;
  }
  .brass-button {
    font-size: 11px;
    width: 40%;
    left: 30%;
  }
  #bonus-event {
    font-size: 10px;
  }
  .field-caption {
    font-size: 7px;
  }
  .expedition-sign {
    display: none;
  }
}
/* The approved composition shows Nera close to the camera, behind the console. */
@media (min-width: 1001px) {
  .pilot > img {
    width: 170%;
    height: 170%;
    left: -35%;
    object-position: center top;
    transform-origin: center 40%;
  }
  .console {
    height: 17%;
    bottom: 1.5%;
  }
  .lower-controls {
    bottom: 0.3%;
  }
}
@media (min-width: 1001px) {
  .pilot > img {
    width: 160%;
    height: 160%;
    left: -45%;
  }
}
/* Keep the observation window fixed when WebKit focuses console controls. */
html,body{height:100dvh;overflow:hidden}
body{min-height:0}
.scene{clip-path:inset(0)}
