@import url("assets/fonts/fonts.css");

:root {
  color-scheme: dark;
  --muted: #9bb7bf;
  --gold: #ffce7b;
  --white: #edf7f3;
  --line: #28404a;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  color: var(--white);
  background: #04151e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 30%, #123a47 0, #04151e 75%);
  min-height: 100svh;
  touch-action: manipulation;
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}

button:disabled {
  cursor: default;
}

button {
  color: inherit;
}

button,
dialog {
  border: 0;
}

[hidden] {
  display: none !important;
}

.shell {
  max-width: 940px;
  margin: auto;
  padding: 22px 24px 12px;
  height: 100svh;
  display: flex;
  flex-direction: column;
}

.shell > :not(.game) { flex-shrink: 0; }
.shell > .game { flex: 1 1 auto; min-height: 0; max-height: 620px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--muted);
  display: block;
}

.balance {
  position: relative;
  min-width: 0;
  min-height: 42px;
  padding: 5px 21px;
  border-radius: 10px;
  text-align: left;
}

.balance::before,
.balance::after {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-inline: 1px solid #e9d2a3a6;
  background: #ae9068;
  opacity: .72;
  pointer-events: none;
}

.balance::before { left: 7px; }
.balance::after { right: 7px; }

.balance .eyebrow {
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 1px;
  color: #ddc79e;
}

.balance strong {
  display: block;
  font-size: 17px;
  line-height: 1.125;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff08;
  border: 1px solid #ffffff26;
  font-size: 19px;
}

.icon-btn:hover {
  background: #ffffff14;
}

.game {
  position: relative;
  container-type: size;
  height: clamp(400px, 59svh, 620px);
  overflow: hidden;
  border: 1px solid #46666a;
  border-radius: 20px 20px 0 0;
  background: #063846;
  isolation: isolate;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #031e2b45,
    transparent 23%,
    transparent 78%,
    #062330d9
  );
}

.hunt-aim-marker {
  position: absolute;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 2px solid #ffe09d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #edc67824, 0 0 17px #fbd58a9e,
    inset 0 0 10px #fbd58a32;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: hunt-aim-arrive .24s ease-out both,
    hunt-aim-glow 2.2s ease-in-out .24s infinite;
}

.hunt-aim-marker::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #ffe09d;
  box-shadow: 0 0 10px #ffe09d;
}

.hunt-aim-marker::after {
  content: "";
  position: absolute;
  inset: -8px;
  background:
    linear-gradient(#ffe09d, #ffe09d) center top / 2px 7px no-repeat,
    linear-gradient(#ffe09d, #ffe09d) center bottom / 2px 7px no-repeat,
    linear-gradient(#ffe09d, #ffe09d) left center / 7px 2px no-repeat,
    linear-gradient(#ffe09d, #ffe09d) right center / 7px 2px no-repeat;
  filter: drop-shadow(0 0 4px #ffe09d);
}

@keyframes hunt-aim-arrive {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes hunt-aim-glow {
  50% { box-shadow: 0 0 0 5px #edc67818, 0 0 23px #fbd58ab8,
    inset 0 0 12px #fbd58a40; }
}

.expert-hunter-boundary {
  position: absolute;
  z-index: 3;
  top: var(--expert-water-top, 35%);
  right: 12px;
  bottom: var(--expert-water-bottom, 23px);
  left: 12px;
  display: none;
  border: 2px dotted #ffd58e;
  border-radius: 12px;
  box-shadow: inset 0 0 18px #ffc66a18, 0 0 17px #ffc66a38;
  pointer-events: none;
  animation: expert-hunter-outline 2.2s ease-in-out infinite;
}

#game[data-expert-hunter-active]:is([data-expert-hunter-ready], [data-expert-hunter-confirming]) .expert-hunter-boundary {
  display: block;
}

#game:has(.expert-hunter-choice:not([hidden])) .expert-hunter-boundary {
  display: none;
}

.expert-hunter-boundary span {
  position: absolute;
  top: -11px;
  right: 18px;
  padding: 3px 9px 4px;
  border: 1px solid #e9bf77;
  border-radius: 999px;
  background: #092b38;
  color: #ffe0a2;
  font: 800 9px/1 "DM Sans", sans-serif;
  letter-spacing: .12em;
  white-space: nowrap;
  text-shadow: 0 1px 2px #001820;
}

@keyframes expert-hunter-outline {
  50% { opacity: .68; }
}

.expert-hunter-choice {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  grid-template-rows: var(--expert-water-top, 35%) minmax(0, 1fr) var(--expert-water-bottom, 23px);
  justify-items: center;
  padding-inline: clamp(20px, 4cqi, 34px);
  background: linear-gradient(180deg, #041b2514, #041b2533 45%, #041b2547);
  pointer-events: none;
}

.shell:has(.expert-hunter-choice:not([hidden])) .controls {
  visibility: hidden;
}

.expert-hunter-choice-content {
  grid-row: 2;
  align-self: center;
  width: min(100%, 440px);
  max-height: calc(100% - 12px);
  padding: 14px clamp(18px, 4cqi, 24px);
  border: 1px solid #f5d89d80;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b3443a5, #041d2c9c);
  box-shadow: 0 12px 36px #00131a70, inset 0 1px #fff6db36;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  text-align: center;
  text-shadow: 0 2px 8px #001a25;
  animation: expert-hunter-confirm-arrive .28s ease-out both;
  pointer-events: auto;
}

@keyframes expert-hunter-confirm-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.expert-hunter-kicker {
  display: block;
  margin-bottom: 3px;
  color: #abc7c7;
  font: 800 9px/1.2 "DM Sans", sans-serif;
  letter-spacing: .18em;
}

.expert-hunter-choice h2 {
  margin: 0;
  color: #ffdaa0;
  font: italic 800 clamp(27px, 6cqi, 36px)/.95 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: .06em;
  text-shadow: 0 2px 13px #e5ae5c47;
}

.expert-hunter-choice p {
  max-width: 43ch;
  margin: 8px auto 0;
  color: #e8f0ed;
  font: 500 clamp(12px, 2.2cqi, 14px)/1.32 "DM Sans", sans-serif;
}

.expert-hunter-choice .expert-hunter-confirm-note {
  margin-top: 4px;
  color: #c7dcd9;
  font-size: clamp(10px, 1.8cqi, 11px);
}

.expert-hunter-choice-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.expert-hunter-choice-actions button {
  width: fit-content;
  max-width: 100%;
  min-height: 40px;
  padding: 7px 38px;
  border-radius: 9px;
  font: 800 12px/1.25 "DM Sans", sans-serif;
  letter-spacing: .08em;
}

#expert-hunter-enable {
  position: relative;
  overflow: hidden;
  border: 1px solid #c39b66;
  background: repeating-linear-gradient(0deg, #745232 0 2px, #67472c 3px 5px, #573c29 6px 9px);
  box-shadow: inset 0 1px #f4d4a288, inset 0 -2px #382718, 0 3px 0 #2a2119;
  color: #fff3d9;
  text-shadow: 0 1px 2px #24180f;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease, box-shadow .16s ease;
}

#expert-hunter-enable::before,
#expert-hunter-enable::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-inline: 1px solid #e9d0a2;
  background: #a88a63;
  opacity: .88;
  pointer-events: none;
}

#expert-hunter-enable::before { left: 9px; }
#expert-hunter-enable::after { right: 9px; }
#expert-hunter-enable:hover { filter: brightness(1.12); border-color: #f0d59b; }
#expert-hunter-enable:active { transform: translateY(2px); box-shadow: inset 0 2px 6px #25190d, 0 1px 0 #2a2119; }
#expert-hunter-enable:focus-visible { outline: 2px solid #ffe2a8; outline-offset: 3px; }

@container (max-height: 450px) {
  .expert-hunter-choice-content { padding-block: 8px; }
  .expert-hunter-choice h2 { font-size: 30px; }
  .expert-hunter-choice p { margin-top: 5px; font-size: 12px; line-height: 1.22; }
  .expert-hunter-choice .expert-hunter-confirm-note { margin-top: 3px; font-size: 10px; }
  .expert-hunter-choice-actions { margin-top: 7px; }
  .expert-hunter-choice-actions button { min-height: 34px; padding-block: 5px; }
}

@container (max-height: 360px) {
  .expert-hunter-choice-content { padding-block: 5px; }
  .expert-hunter-kicker { display: none; }
  .expert-hunter-choice h2 { font-size: 25px; }
  .expert-hunter-choice p { margin-top: 3px; font-size: 11px; line-height: 1.16; }
  .expert-hunter-choice-actions { margin-top: 5px; }
  .expert-hunter-choice-actions button { min-height: 30px; padding-block: 4px; }
}

@container (max-height: 260px) {
  .expert-hunter-choice { padding-inline: 7px; }
  .expert-hunter-choice-content { max-height: calc(100% - 4px); padding: 2px 10px; }
  .expert-hunter-choice h2 { font-size: 17px; }
  .expert-hunter-choice p { margin-top: 1px; font-size: 9px; line-height: 1.1; }
  .expert-hunter-choice .expert-hunter-confirm-note { margin-top: 0; font-size: 9px; }
  .expert-hunter-choice-actions { margin-top: 1px; }
  .expert-hunter-choice-actions button { min-height: 30px; padding: 3px 27px; font-size: 9px; letter-spacing: .02em; }
  .expert-hunter-boundary { right: 7px; left: 7px; }
  .expert-hunter-boundary span { right: 10px; font-size: 8px; }
}

@container (max-height: 300px) {
  .hunt-aim-marker { width: 30px; height: 30px; }
  .hunt-aim-marker::before { inset: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .hunt-aim-marker, .expert-hunter-boundary, .expert-hunter-choice-content { animation: none; }
}

.scene-toolbar {
  position: absolute;
  top: 16px;
  left: 24px;
  right: 20px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  pointer-events: none;
}

.scene-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  pointer-events: auto;
}

.scene-wallet { justify-self: start; }
.scene-settings { justify-self: end; }

.scene-actions .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.scene-actions button {
  transition: transform .16s ease, border-color .16s ease, filter .16s ease, box-shadow .16s ease;
}

.scene-actions > :is(.balance, button) {
  background: repeating-linear-gradient(0deg, #65472b 0 2px, #5a3d28 3px 5px, #4c3526 6px 9px);
  border: 1px solid #b18d5d;
  box-shadow: inset 0 1px #e9c99180, inset 0 -2px #2b2119, 0 3px 8px #00141b99;
  color: #fff1d3;
  text-shadow: 0 1px 2px #20160e;
}

.scene-actions button:hover:not(:disabled) {
  border-color: #f0d59b;
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.scene-actions button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 6px #25190d, inset 0 1px #e9c9915c;
}

.scene-actions .sound[aria-pressed="true"] {
  border-color: #f4d798;
  background: linear-gradient(160deg, #9b7140, #61422d);
  box-shadow: inset 0 1px #fff0bc94, 0 0 12px #db9a4b68;
}

.scene-actions button:focus-visible {
  outline: 2px solid #ffe2a8;
  outline-offset: 3px;
}

.game-brand {
  justify-self: center;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.game-brand h1 {
  margin: 0;
  font: italic 800 30px/1 "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: -.3px;
  color: #f6d894;
  text-shadow: 0 2px 0 #93632f, 0 4px 12px #001a2f;
}

.game-brand > span {
  display: block;
  margin-top: 5px;
  font-size: 8px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #c8d4dd;
  text-shadow: 0 1px 5px #001a25;
}

.scene-actions svg {
  width: 19px;
  height: 19px;
}

.intro {
  position: absolute;
  left: 7%;
  top: 21%;
  pointer-events: none;
}

.studio-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  color: #c8d4dd;
  font-size: 9px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 1.3px;
  white-space: nowrap;
  text-shadow: 0 1px 5px #001a25;
}

.studio-credit::before,
.studio-credit::after {
  content: "";
  width: 18px;
  border-top: 1px solid #aabecb99;
}

.intro h1 {
  font:
    800 clamp(56px, 7.5vw, 92px)/0.85 "Barlow Condensed",
    "Arial Narrow",
    Impact,
    sans-serif;
  margin: 0 0 16px;
  text-transform: uppercase;
}

.intro h1 em {
  font-style: italic;
}

.studio-credit { width: 100%; max-width: 100%; }

.depth-stat {
  position: absolute;
  top: 79px;
  left: 24px;
  text-shadow: 0 2px 6px #000;
}

.depth-stat {
  left: auto;
  right: 24px;
  text-align: right;
}

.cast-stat strong,
.depth-stat strong {
  font:
    700 32px "Barlow Condensed",
    Impact,
    sans-serif;
  color: var(--white);
}

.cast-stat small,
.depth-stat small {
  font:
    500 13px "DM Sans",
    sans-serif;
  color: var(--muted);
}

.controls {
  padding: 20px 25px 23px;
  border: 1px solid #29454e;
  border-top: 0;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(110deg, #102e3a, #0b2430);
}

.cast-button {
  background: linear-gradient(115deg, #ffdb91, #f3b765);
  color: #202c2c;
  border-radius: 12px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow:
    0 3px 0 #9f723f,
    0 6px 26px #efb66714;
  font-weight: 800;
  letter-spacing: 2px;
  transition:
    filter 0.15s,
    transform 0.15s;
}

.cast-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.cast-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #9f723f;
}

.cast-button svg {
  width: 24px;
  height: 24px;
}

.cast-button:disabled {
  background: #21424d;
  color: #9cbabf;
  box-shadow: 0 3px 0 #071f2b;
}

.cast-button:disabled svg {
  opacity: 0.4;
}

.loading {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 15px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #d3e8e4;
  font-size: 14px;
}

dialog {
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 85svh;
  overflow: auto;
  border: 1px solid #44606a;
  background: #0b2633;
  color: var(--white);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 20px 100px #0008;
}

dialog::backdrop {
  background: #021017c9;
  backdrop-filter: blur(5px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

dialog h2 {
  font:
    700 42px/0.95 "Barlow Condensed",
    Impact,
    sans-serif;
  text-transform: uppercase;
  margin: 15px 0 24px;
  color: var(--gold);
}

dialog p {
  font-size: 14px;
  line-height: 1.7;
  color: #c3d7d8;
}

.payout-list {
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.payout-list > div {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payout-list small {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-left: 9px;
}

.payout-list b {
  color: var(--gold);
  font-size: 19px;
}

.fine-print {
  font-size: 12px !important;
  color: #a6c0c5 !important;
}

details {
  font-size: 13px;
  margin: 18px 0;
}

summary {
  cursor: pointer;
}

table {
  width: 100%;
  font-size: 10px;
  white-space: nowrap;
  text-align: left;
  border-collapse: collapse;
  margin: 12px 0;
}

th,
td {
  padding: 9px 5px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--gold);
}

.odds-table {
  table-layout: fixed;
  white-space: normal;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.odds-table th,
.odds-table td {
  padding: 7px 4px;
  text-align: right;
}

.odds-table th:first-child {
  text-align: left;
}

#catch-odds th:first-child {
  width: 30%;
  overflow-wrap: anywhere;
}

.dialog-play {
  width: 100%;
  background: var(--gold);
  color: #112731;
  font-weight: 800;
  padding: 15px;
  border-radius: 9px;
  letter-spacing: 1px;
  margin-top: 6px;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 1100px) {
  .shell {
    padding-top: 30px;
  }
  .game {
    height: 560px;
  }
  .intro {
    top: 20%;
  }
  .controls {
    padding: 21px 30px;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 14px 12px max(8px, env(safe-area-inset-bottom));
  }
  .game {
    min-height: 355px;
    max-height: 650px;
    border-radius: 16px 16px 0 0;
  }
  .intro {
    left: 8%;
    top: 24%;
  }
  .controls {
    padding: 15px 16px 18px;
    border-radius: 0 0 16px 16px;
  }
  .cast-stat {
    left: 17px;
    top: 65px;
  }
  .depth-stat {
    right: 17px;
    top: 65px;
  }
  .cast-stat .eyebrow,
  .depth-stat .eyebrow {
    font-size: 8px;
  }
  .cast-stat strong,
  .depth-stat strong {
    font-size: 27px;
  }
}

@media (max-width: 350px) {
  .intro h1 {
    font-size: 53px;
  }
  .game {
    min-height: 335px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.eyebrow,
.location,
.bet .eyebrow,
.cast-stat .eyebrow,
.depth-stat .eyebrow,
.payout-list small {
  font-size: 12px;
}

.fine-print,
table {
  font-size: 14px;
}

.cast-button {
  font-size: 16px;
}

.cast-button:disabled {
  font-size: 14px;
}

.location {
  letter-spacing: 1.2px;
}

@media (max-width: 600px) {
  .location {
    font-size: 12px;
    letter-spacing: 0.4px;
  }
  .game {
    height: calc(100svh - 300px);
  }
}

@media (max-width: 360px) {
  .location {
    font-size: 11px;
  }
  .intro h1 {
    font-size: 50px;
  }
  .intro {
    left: 6%;
  }
  .cast-button svg {
    display: none;
  }
}

.loss-banner {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 22%;
  text-align: center;
  pointer-events: none;
  padding: 18px 12px;
  border-radius: 14px;
  background: #082330cf;
  border: 1px solid #ca8b6c80;
  animation: result-in 0.3s ease-out;
}

.loss-banner span {
  display: block;
  color: #e9b193;
  font-size: 12px;
  letter-spacing: 1.3px;
}

.loss-banner strong {
  display: block;
  font:
    700 42px "Barlow Condensed",
    Impact,
    sans-serif;
  color: #ffe8d7;
  margin-top: 4px;
}

.dev-button {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.dev-badge {
  position: absolute;
  bottom: 51px;
  left: 17px;
  right: 17px;
  width: fit-content;
  max-width: calc(100% - 34px);
  padding: 7px 10px;
  border-radius: 6px;
  background: #071f2de6;
  border: 1px dashed #c99b56;
  color: #f4dba8;
  font-size: 12px;
  pointer-events: none;
}

.dev-label {
  display: block;
  font-size: 14px;
  color: #c9dedf;
  margin-bottom: 9px;
}

#dev-outcome {
  font: inherit;
  color: #f0f6f1;
  background: #133a47;
  border: 1px solid #536f78;
  border-radius: 9px;
  min-height: 50px;
  width: 100%;
  padding: 10px 12px;
}

.dev-clear {
  background: none;
  color: #b5d1d4;
  text-decoration: underline;
  padding: 16px 5px 3px;
  width: 100%;
  font-size: 14px;
}

#dev-dialog code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Platform status occupies space only while useful; game rendering is unchanged. */

.connection,
.session-note {
  margin: 10px 0;
  padding: 12px 16px;
  border: 1px solid #375565;
  border-radius: 12px;
  background: #0b2b39;
  color: #d9e8ed;
  font-size: 14px;
  line-height: 1.5;
}

.session-note { padding: 6px 10px; font-size: 12px; line-height: 1.35; }

.connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connection button {
  border: 1px solid #ddb473;
  background: #173848;
  color: #ffe0a8;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font: inherit;
}

.session-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #96b5bf;
  font-size: 13px;
  padding: 0 4px 10px;
}

.session-info:empty,
.session-info:not(:has(> :not([hidden]))) {
  display: none;
}

/* Reserve space for the rig selector beside the headline. */

@media (max-width: 600px) {
  .intro {
    right: 64px;
  }
  .intro h1 {
    font-size: clamp(32px, 10.5vw, 60px);
  }
}

/* Reserve space for controls and platform messages before sizing the scene. */
@media (min-width: 601px) and (min-height: 501px) {
  .shell {
    display: flex;
    flex-direction: column;
    max-height: 100svh;
  }
  .shell > :not(.game) {
    flex-shrink: 0;
  }
  .game {
    flex-shrink: 1;
    min-height: 260px;
  }
}

/* Short landscape windows keep the scene and controls visible together. */

@media (min-width: 601px) and (max-height: 500px) {
  .shell {
    padding: 8px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 8px 12px;
  }
  .game {
    height: 100%;
    border-radius: 14px;
    grid-column: 1;
    grid-row: 3;
  }
  .controls {
    grid-column: 2;
    grid-row: 3;
    border: 1px solid #29454e;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
  }
  .cast-button {
    min-height: 52px;
  }
  .connection,
  .session-note,
  .session-info {
    grid-column: 1/-1;
    margin: 0;
  }
  .session-info {
    padding-bottom: 0;
    grid-row: 4;
  }
  .connection { grid-row: 1; }
  .session-note { grid-row: 2; }
  .intro {
    top: 23%;
    right: 70px;
  }
  .intro h1 {
    font-size: clamp(32px, 5.7vw, 52px);
    margin: 10px 0;
  }
    .depth-stat {
    top: 55px;
  }
}

/* Compact embedded players share the available height with the scene. */

@media (max-width: 600px) and (max-height: 650px) {
  .controls {
    z-index: 3;
    box-shadow: 0 -8px 20px #03192366;
  }
  .shell {
    padding: 8px;
  }
  .game {
    min-height: 260px;
    height: calc(100svh - 235px);
  }
  .controls {
    padding: 10px;
  }
  .intro {
    top: 24%;
  }
  .intro h1 {
    margin: 10px 0;
  }
}

/* Approved Golden Catch direction: gold lettering, moonlit water, studio identity. */

.intro {
  animation: title-arrive 0.55s ease-out both;
}

.intro h1 {
  color: #f6d894;
  font-style: italic;
  letter-spacing: -0.5px;
  text-shadow:
    0 2px 0 #93632f,
    0 4px 0 #46361f,
    0 8px 30px #001a2f;
}

.intro h1 em {
  color: inherit;
}

/* Scale the whole lockup to the scene's available height, including embedded players. */
@container (max-height: 420px) {
  .intro { top: 20%; }
  .intro h1 {
    font-size: clamp(32px, 12cqw, 60px);
    margin: 10px 0;
  }
}

@container (max-height: 320px) {
  .intro h1 { font-size: clamp(26px, 12cqh, 38px); }
  .intro { }
}

@container (max-width: 550px) {
  .scene-toolbar {
    top: 12px;
    left: 12px;
    right: 12px;
    gap: 9px;
  }
  .scene-actions { gap: 5px; }
  .scene-actions .icon-btn { width: 36px; height: 36px; }
  .balance { min-height: 40px; padding: 4px 19px; }
  .balance strong { font-size: 15px; }
  .location { max-width: 90px; }
  .intro { top: max(24%, 94px); }
  .cast-stat, .depth-stat { top: 92px; }
  .result { --result-top: 84px; }
}

@container (max-width: 360px) {
  .scene-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .scene-wallet { grid-area: 1 / 1; }
  .scene-settings { grid-area: 1 / 2; }
  .location { grid-area: 2 / 1 / auto / -1; max-width: 100%; }
}

@container (max-width: 550px) and (max-height: 420px) {
  .intro { top: 88px; }
  .intro h1 { font-size: clamp(26px, 12cqh, 44px); }
}

.loading {
  isolation: isolate;
  overflow: hidden;
  background: #041d2b url("assets/lagoon.webp") center top / cover no-repeat;
  transition: opacity .32s ease-out;
}

.loading.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg, #021a29e8 0, transparent 29%,
    transparent 72%, #0213267a 100%);
}

.loading-scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.loading-scene-art.ready {
  opacity: 1;
}

.loading-target {
  position: absolute;
  z-index: 2;
  width: 25%;
  aspect-ratio: 3 / 2;
  left: 63%;
  top: 59%;
}

.loading-fish {
  width: 100%;
  height: 100%;
  background: url("assets/descent-creatures/anglerfish.webp") center / contain no-repeat;
  filter: brightness(1.18) drop-shadow(0 10px 12px #00141de0)
    drop-shadow(0 0 14px #80e6f347);
}

.loading-aim {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  aspect-ratio: 1;
  border: 2px solid #ffe2a9;
  border-radius: 50%;
  background: linear-gradient(#ffe2a9, #ffe2a9) left center / 10% 1.5px no-repeat,
    linear-gradient(#ffe2a9, #ffe2a9) right center / 10% 1.5px no-repeat;
  box-shadow: 0 0 0 1px #09304288, 0 0 22px #e7d187a6,
    inset 0 0 14px #e7d18738;
  transform: translate(-50%, -50%);
}

.loading-aim::before,
.loading-aim::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -18%;
  width: 1px;
  height: 12%;
  background: #ffe1a6;
}

.loading-aim::after {
  top: auto;
  bottom: -18%;
}

.loading-brand {
  position: absolute;
  z-index: 3;
  top: 11%;
  left: 54%;
  color: #f8d992;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #866038, 0 4px 0 #483822,
    0 7px 24px #001625;
}

.loading-brand strong {
  display: block;
  font: italic 800 clamp(38px, 8cqw, 82px) / .79 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -.042em;
}

.loading-brand small {
  display: block;
  margin-top: 11px;
  color: #fff1d6;
  font: 800 clamp(8px, 1.3cqw, 12px) / 1 "DM Sans", sans-serif;
  letter-spacing: .28em;
  text-shadow: 0 2px 7px #001625;
}

.loading-status {
  position: absolute;
  z-index: 3;
  left: 7%;
  bottom: 7%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  color: #f4e8cc;
  text-align: left;
}

.loading-status strong {
  font: 700 clamp(14px, 2.1cqw, 21px) / 1 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.loading-status > span:last-child {
  color: #c0d7d5;
  font-size: clamp(10px, 1.2cqw, 12px);
  letter-spacing: .04em;
}

.loading-track {
  width: min(240px, 31cqw);
  height: 2px;
  overflow: hidden;
  background: #cfe9df4c;
}

.loading-track::after {
  content: "";
  display: block;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ffdf9d, transparent);
  animation: loading-line 2.15s ease-in-out infinite;
}

@keyframes loading-line {
  from { transform: translateX(-120%); }
  to { transform: translateX(350%); }
}

@container (max-aspect-ratio: 11 / 10) {
  .loading-brand {
    top: 8%;
    left: 54%;
    right: 2%;
    text-align: left;
  }
  .loading-brand strong { font-size: clamp(40px, 11cqw, 58px); }
  .loading-brand small { font-size: 8px; letter-spacing: .23em; }
  .loading-target { width: 40%; left: 55%; top: 56%; }
  .loading-track { width: 55cqw; }
}

@container (max-height: 320px) {
  .loading-brand { top: 7%; }
  .loading-brand strong { font-size: clamp(28px, 11cqh, 44px); }
  .loading-status { bottom: 5%; gap: 5px; }
  .loading-target { top: 57%; }
}

@media (prefers-reduced-motion: reduce) {
  .loading { transition: none; }
  .loading-track::after { animation: none; }
}

#rules {
  max-width: 760px;
  width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  padding: 22px 28px 26px;
  position: relative;
  overscroll-behavior: contain;
  scrollbar-color: #aa8551 #1b2929;
  --muted: #c5bdad;
  --white: #f7ead1;
  --line: #a9927145;
  --gold: #ffdc9f;
  border: 1px solid #bb9b6b;
  border-radius: 12px;
  background: linear-gradient(180deg, #252f2d, #1d2b2c);
  color: #f7ead1;
  box-shadow: 0 20px 48px #00151bd9, inset 0 1px #f5d9a26e, inset 0 0 0 4px #101a1930;
}

#rules .dialog-head {
  position: relative;
  min-height: 58px;
  margin: -22px -28px 0;
  padding: 12px 28px 10px;
  border-bottom: 1px solid #bd9d6f45;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(180deg, #715234 0 5px, #453427 5px 100%);
}

#rules .dialog-head .eyebrow {
  color: #cfac72;
  font-size: 10px;
  letter-spacing: .14em;
}

#rules #close-rules {
  width: 34px;
  height: 34px;
  border: 1px solid #a98960;
  border-radius: 8px;
  background: linear-gradient(165deg, #725136, #493729);
  color: #fff0d2;
  box-shadow: inset 0 1px #ecd19d6b, 0 2px 5px #101a19a8;
}

#rules #close-rules:hover { filter: brightness(1.15); }

#rules h2 {
  margin: 20px 0 16px;
  font-size: clamp(30px, 5vw, 40px);
  color: #ffe7b6;
}

#rules p { color: #dedfd1; }
#rules .fine-print { color: #bdc9be !important; }
#rules .winnings-guide { border-bottom-color: var(--line); }

#rules summary {
  color: #f0dfc4;
  transition: color .15s ease;
}

#rules summary:hover,
#rules details[open] > summary { color: #ffdc9f; }

#rules .dialog-play {
  display: block;
  position: relative;
  width: min(240px, 100%);
  min-height: 46px;
  margin: 22px auto 0;
  padding: 10px 30px;
  border: 1px solid #e4c38a;
  border-radius: 8px;
  background: linear-gradient(165deg, #ac8350, #765331);
  color: #fff4da;
  font: 800 13px/1.2 "DM Sans", sans-serif;
  letter-spacing: .025em;
  box-shadow: inset 0 1px #ffe5b284, inset 0 -2px #523b28, 0 3px 8px #08181999;
}

#rules .dialog-play::before,
#rules .dialog-play::after {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 4px;
  border-inline: 1px solid #f4d6a5;
  background: #b39369;
  pointer-events: none;
}

#rules .dialog-play::before { left: 8px; }
#rules .dialog-play::after { right: 8px; }
#rules .dialog-play:hover { filter: brightness(1.1); }
#rules .dialog-play:active { transform: translateY(1px); }

@media (max-width: 600px) {
  #rules {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px 18px 20px;
  }
  #rules .dialog-head { margin: -18px -18px 0; padding-inline: 18px; }
}

@media (max-height: 500px) {
  #rules {
    max-height: calc(100dvh - 12px);
    padding-block: 12px 14px;
  }
  #rules .dialog-head { min-height: 48px; margin-top: -12px; padding-block: 8px 5px; }
  #rules h2 { margin: 10px 0 8px; font-size: 28px; }
}

#bonus-rules {
  margin-top: -4px;
}

#bonus-rules strong {
  color: var(--gold);
  font-weight: 800;
}

.winnings-guide {
  margin: 20px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.winnings-guide h3 {
  margin: 0 0 14px;
  font: 700 24px/1.15 "Barlow Condensed", Impact, sans-serif;
  color: var(--white);
}

.winnings-factors {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(4px, 1.5vw, 12px);
  align-items: center;
  color: var(--muted);
}

.winnings-factors div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.winnings-factors div > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.winnings-factors strong {
  font: 700 clamp(20px, 3vw, 28px)/1.1 "Barlow Condensed", Impact, sans-serif;
  color: var(--gold);
  white-space: nowrap;
}

.winnings-example {
  margin: 12px 0 0;
  font: 600 clamp(19px, 3vw, 28px)/1.4 "Barlow Condensed", Impact, sans-serif;
}

#bonus-maximum-example { margin-top: 5px; }

.winnings-example > span {
  display: block;
  margin-bottom: 4px;
  font: 400 12px/1.5 "DM Sans", sans-serif;
  color: var(--muted);
}

.winnings-example strong {
  color: var(--gold);
  font-weight: 800;
}

.winnings-example > span strong {
  font: 800 13px/1.5 "DM Sans", sans-serif;
}

#fish-multiplier-note {
  margin: 12px 0 0;
}

#rules details {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

#rules summary {
  font-size: 14px;
  font-weight: 600;
}

.depth-guide {
  list-style: none;
  margin: 8px 0 2px;
  padding: 0;
}

.depth-guide > .special-event {
  display: grid;
  grid-template-columns: minmax(130px, .62fr) minmax(0, 1.6fr);
  gap: clamp(12px, 2vw, 24px);
  min-width: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.depth-guide > .special-event:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.special-heading strong {
  display: block;
  margin-bottom: 3px;
  color: var(--white);
  font: 700 18px/1.1 "Barlow Condensed", Impact, sans-serif;
}

.special-heading .feature-rate {
  color: var(--gold);
  font-size: 11px;
}

.special-content { min-width: 0; }

.special-content p {
  margin: 0;
}

.special-content .feature-action {
  color: #d6e5e4;
  font-size: 12px;
  line-height: 1.45;
}

.special-content .feature-tiers {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}

.feature-tiers span { color: var(--muted); }
.feature-tiers b { color: var(--white); font-weight: 700; }
.feature-tiers--chest b {
  color: var(--gold);
  font: 800 15px/1 "Barlow Condensed", Impact, sans-serif;
  white-space: nowrap;
}

.special-example {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  margin-top: 9px;
}

.special-example-label {
  color: var(--muted);
  font: 700 10px/1.35 "DM Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.special-example-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 5px;
  color: #cbdcdb;
  font: 500 12px/1.45 "DM Sans", sans-serif;
}

.special-example-term {
  white-space: nowrap;
}

.special-example-term b {
  color: var(--white);
  font-weight: 700;
}

.special-plus, .special-equals {
  color: #80a6a9;
  font-weight: 700;
}

.special-example-equation > strong {
  color: var(--gold);
  font: 800 15px/1 "Barlow Condensed", Impact, sans-serif;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .depth-guide > .special-event {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .special-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .special-heading strong { margin: 0; }
  .special-heading .feature-rate { white-space: nowrap; }
  .special-example { grid-template-columns: 50px minmax(0, 1fr); }
}

.studio-logo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100px;
  margin: auto;
}

@keyframes title-arrive {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    animation: none;
  }
}

/* The same catch is measured, weighed and paid in one compact reveal. */
.result {
  position: absolute;
  inset: var(--result-top, 64px) 0 0;
  margin: auto;
  width: min(440px, calc(100% - 32px));
  height: fit-content;
  max-height: calc(100% - var(--result-top, 64px) - 12px);
  overflow: auto;
  padding: 22px 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  container-type: inline-size;
  border: 1px solid #dfb97468;
  border-radius: 18px;
  background: #071e2af5;
  box-shadow: 0 18px 60px #00121d88;
  backdrop-filter: blur(10px);
  animation: result-in .3s ease-out;
}
.catch-details { width: 100%; }
.catch-heading { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 4px 9px; text-align: left; }
.catch-heading strong { font: 700 24px/1.1 "Barlow Condensed", sans-serif; color: #f1e7ca; }
.catch-heading span { color: #e5cb90; font: 600 18px/1 "Barlow Condensed", sans-serif; white-space: nowrap; }
.catch-specimen { position: relative; margin: 8px auto 10px; width: min(100%, 308px); aspect-ratio: 800 / 300; }
.catch-specimen canvas { height: auto; aspect-ratio: 800 / 260; filter: drop-shadow(0 5px 8px #0008); }
.catch-ruler { position: absolute; bottom: 0; height: 10px; left: 50%; transform: translateX(-50%); border-bottom: 1px solid #dfb97455; background: repeating-linear-gradient(90deg,#dfb97466 0 1px,transparent 1px 5%); }
.catch-ruler span { position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: #f4d58c; transform-origin: left; transform: scaleX(var(--measured,0)); }
.catch-ruler span::after { content: ""; position: absolute; right: 0; bottom: 0; height: 95px; width: 1px; background: linear-gradient(transparent,#f4d58c); box-shadow: 0 0 8px #f4d58c; }
.result:not([data-phase="measuring"]) .catch-ruler span::after { opacity: 0; }
.catch-scale { position: absolute; width: 58px; height: 25px; right: 0; bottom: 16px; stroke: #e6c788; stroke-width: 2; opacity: 0; }
.result:is([data-phase="weighing"], [data-phase="awarding"], [data-phase="result"]) .catch-scale { opacity: 1; }
.result[data-phase="weighing"] .catch-specimen canvas { animation: scale-settle 1s ease-out both; }
.game.turbo .result[data-phase="weighing"] .catch-specimen canvas { animation-duration: .5s; }
@keyframes scale-settle { 0% { transform: translateY(-4px); } 35% { transform: translateY(3px); } 65% { transform: translateY(-1px); } 100% { transform: translateY(0); } }
.scale-needle { transform-origin: 50px 33px; transform: rotate(calc(var(--weight,0) * 125deg)); }
/* The seal lands on the fish, then the verdict unfolds from its impact. */
.catch-medal {
  position: absolute;
  z-index: 1;
  left: 42%;
  top: 40%;
  width: 76px;
  aspect-ratio: 96 / 112;
  color: var(--catch-metal, #75d8be);
  transform: translate(-50%, -40%) rotate(-14deg);
  transform-origin: 50% 40%;
  visibility: hidden;
  pointer-events: none;
  filter: drop-shadow(1px 4px 2px #00141dbb);
}
.catch-medal svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.medal-ribbons { fill: #136f69; stroke: var(--catch-metal, #75d8be); stroke-width: 1.3; }
.medal-stitch { fill: none; stroke-width: .7; opacity: .65; }
.medal-rim { fill: url(#catch-metal); stroke: var(--medal-shadow, #398b7b); stroke-width: 1.5; }
.medal-beading { stroke: #143e3c; stroke-width: 2; stroke-dasharray: 1 3; }
.medal-face { fill: url(#catch-enamel); stroke: var(--medal-light, #e5fff3); stroke-width: 1.3; }
.medal-laurel { stroke: url(#catch-metal); stroke-width: 1.2; stroke-linecap: round; }
.medal-fish { fill: url(#catch-metal); stroke: var(--medal-light, #e5fff3); stroke-width: .5; stroke-linejoin: round; }
.medal-engraving { stroke: var(--catch-metal, #75d8be); stroke-width: .8; }
.medal-sparks { fill: var(--medal-light, #e5fff3); opacity: 0; transform-origin: 48px 43px; }
.catch-medal::before {
  content: "";
  position: absolute;
  inset: 8% 8% 22%;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0;
}
.catch-medal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 43%, #fff8dcdd 50%, transparent 57%) 180% 0 / 300% 100%;
  clip-path: circle(36% at 50% 38%);
  opacity: 0;
}
.catch-verdict {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin: 0 0 7px;
  color: var(--catch-metal, #75d8be);
  font: 800 clamp(21px, 7.2cqi, 30px)/1.1 "Barlow Condensed", sans-serif;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  visibility: hidden;
}
.catch-verdict span {
  display: block;
  background: linear-gradient(170deg, var(--medal-light, #e5fff3) 15%, var(--catch-metal, #75d8be) 70%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.catch-verdict::before, .catch-verdict::after {
  content: "";
  flex: 0 1 28px;
  height: 7px;
  background: currentColor;
  clip-path: polygon(0 45%, 72% 45%, 85% 0, 100% 50%, 85% 100%, 72% 55%, 0 55%);
}
.catch-verdict::after { transform: scaleX(-1); }
.result[data-catch-rank] .catch-verdict { visibility: visible; }
.result[data-catch-rank] .catch-verdict span { animation: verdict-reveal .38s .25s cubic-bezier(.16,1,.3,1) both; }
.result[data-catch-rank] .catch-verdict::before,
.result[data-catch-rank] .catch-verdict::after { animation: verdict-flourish .4s .45s ease-out both; }
.result[data-catch-rank] .catch-medal { visibility: visible; animation: medal-stamp .5s linear both; }
.result[data-catch-rank] .catch-medal::before { animation: medal-impact .32s .21s ease-out both; }
.result[data-catch-rank] .catch-medal::after { animation: medal-glint .55s .38s ease-out both; }
.result[data-catch-rank] .catch-specimen { animation: catch-stamp-jolt .26s .21s linear; }
.result[data-catch-rank] .catch-specimen canvas { animation: catch-stamp-tap .22s .21s ease-out; }
.result[data-catch-rank] :is(.catch-ruler, .catch-scale) { visibility: hidden; }
.result[data-catch-rank="0"] { --catch-metal: #92a9ae; --medal-light: #d1dedf; --medal-shadow: #526c74; }
.result[data-catch-rank="0"] .catch-medal { --stamp-opacity: .82; opacity: .82; }
.result[data-catch-rank="0"] .medal-ribbons { fill: #3d6066; }
.result[data-catch-rank="0"] .catch-verdict { font-size: 18px; font-weight: 600; letter-spacing: 1.3px; }
.result[data-catch-rank="0"] .catch-verdict::before,
.result[data-catch-rank="0"] :is(.catch-medal, .catch-verdict)::after { display: none; }
.result[data-catch-rank="2"] { --catch-metal: #e8b96b; --medal-light: #fff1be; --medal-shadow: #98642f; }
.result[data-catch-rank="3"] { --catch-metal: #ffc85c; --medal-light: #fff4c8; --medal-shadow: #a86b27; }
.result[data-catch-rank="4"] { --catch-metal: #ffdb80; --medal-light: #fff9df; --medal-shadow: #bb7d30; }
.result[data-catch-rank="5"] { --catch-metal: #ffe79a; --medal-light: #ffffff; --medal-shadow: #ac7530; }
.result:is([data-catch-rank="3"], [data-catch-rank="4"], [data-catch-rank="5"]) .catch-verdict { font-size: clamp(24px, 8.4cqi, 34px); filter: drop-shadow(0 0 9px #eab95066); }
.result:is([data-catch-rank="3"], [data-catch-rank="4"], [data-catch-rank="5"]) .medal-sparks { animation: medal-sparks .62s .25s ease-out both; }
.result:is([data-catch-rank="4"], [data-catch-rank="5"]) .catch-medal { filter: drop-shadow(1px 4px 2px #00141dbb) drop-shadow(0 0 8px #ffd88766); }
.result[data-catch-rank="5"] .medal-ribbons { fill: #27a795; }
.result:is([data-catch-rank="3"], [data-catch-rank="4"], [data-catch-rank="5"]) .result-prize { animation: catch-prize .5s .22s ease-out; }
@keyframes medal-stamp {
  0% { opacity: 0; transform: translate(-65%, -95%) rotate(-32deg) scale(2.8); }
  8%, 20% { opacity: 1; transform: translate(-65%, -95%) rotate(-32deg) scale(2.8); filter: drop-shadow(14px 22px 7px #00141d88); animation-timing-function: cubic-bezier(.8,0,1,1); }
  42% { opacity: 1; transform: translate(-50%, -36%) rotate(-14deg) scale(1.2,.72); filter: drop-shadow(0 1px 0 #00141ddd); animation-timing-function: ease-out; }
  58% { transform: translate(-50%, -42%) rotate(-12deg) scale(.96,1.06); }
  76% { transform: translate(-50%, -40%) rotate(-15deg) scale(1.02,.98); }
  100% { opacity: var(--stamp-opacity, 1); transform: translate(-50%, -40%) rotate(-14deg) scale(1); }
}
@keyframes catch-stamp-jolt {
  0%, 100% { transform: translate(0,0) rotate(0); }
  12% { transform: translate(5px,6px) rotate(1.5deg); }
  35% { transform: translate(-3px,-2px) rotate(-1deg); }
  60% { transform: translate(2px,1px) rotate(.5deg); }
}
@keyframes catch-stamp-tap { 15% { transform: scale(1.04,.86); } 55% { transform: scale(.99,1.03); } }
@keyframes medal-impact { from { opacity: 1; transform: scale(.8); border-width: 5px; } to { opacity: 0; transform: scale(2.6); border-width: 1px; } }
@keyframes medal-sparks { from { opacity: 0; transform: scale(.65); } 22% { opacity: 1; } to { opacity: 0; transform: scale(1.8) rotate(12deg); } }
@keyframes verdict-reveal {
  from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(8px) rotate(-3deg); }
  55% { opacity: 1; }
  to { opacity: 1; clip-path: inset(0); transform: translateY(0) rotate(0); }
}
@keyframes verdict-flourish { from { opacity: 0; translate: -7px 0; } to { opacity: .8; translate: 0 0; } }
@keyframes medal-glint { from { background-position: 180% 0; opacity: 0; } 30% { opacity: 1; } to { background-position: -80% 0; opacity: 0; } }
@keyframes catch-prize { 45% { transform: scale(1.07); text-shadow: 0 0 24px #ffd88799; } }
.catch-measurements { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; padding: 9px 0 10px; border-top: 1px solid #c6bb8c22; border-bottom: 1px solid #c6bb8c22; }
.catch-measurement > div:not(.catch-range) { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; margin: 3px 0; }
.measure-label { color: #b5c9ca; font-size: 10px; letter-spacing: 1.8px; }
.catch-measurement strong { font: 600 clamp(18px,6.5cqi,27px)/1 "Barlow Condensed",sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.catch-measurement b { font: 700 21px/1 "Barlow Condensed",sans-serif; color: #adc3c4; }
.catch-measurement b.boosted { color: #ffdb91; text-shadow: 0 0 12px #efac4355; }
.catch-range { position: relative; height: 6px; margin: 10px 3px 4px; border-radius: 3px; background: linear-gradient(90deg,#c77d73 0%,#d5ab74 25%,#c5cd83 50%,#92ce91 75%,#4eb78e 100%); }
.catch-range::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 1px solid #e8ebbfaa; }
.catch-range span { position: absolute; top: -3px; left: var(--position,0%); width: 3px; height: 12px; border-radius: 2px; background: #fff2d6; transform: translateX(-50%); box-shadow: 0 0 0 1px #092633,0 0 5px #061c22; }
.catch-range.pending { opacity: .25; }
.catch-range.pending span { visibility: hidden; }
.result-label { font-size: 10px; font-weight: 700; letter-spacing: 1.8px; color: #d8e7e5; }
.result-prize { display: block; max-width: 100%; font: 800 clamp(27px,15cqi,66px)/1.05 "Barlow Condensed",Impact,sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.5px; color: #ffdb91; overflow-wrap: anywhere; }
.result.lost { border-color: #82939866; padding-block: 30px; }
.result.lost .result-prize { color: #cbd9db; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  .result { padding: 15px 18px 12px; border-radius: 14px; }
  .catch-heading strong { font-size: 21px; }
  .catch-specimen { width: min(100%, 246px); }
  .catch-measurements { gap: 14px; }
}
@media (max-height: 650px) {
  .result { padding-block: 10px; gap: 3px; }
  .catch-heading strong { font-size: 19px; }
  .catch-specimen { width: 166px; margin-block: 3px; }
  .catch-scale { right: -40px; width: 40px; height: 20px; }
  .catch-medal { width: 48px; }
  .catch-verdict { min-height: 24px; margin-bottom: 3px; font-size: 21px; }
  .result:is([data-catch-rank="3"], [data-catch-rank="4"], [data-catch-rank="5"]) .catch-verdict { font-size: 24px; }
  .catch-measurements { padding-block: 5px; }
  .result-prize { font-size: clamp(26px,11cqi,44px); }
  .catch-ruler span::after { height: 48px; }
}
@media (max-height: 450px) {
  .result { padding-block: 6px; }
  .catch-specimen { width: 110px; margin-block: 1px; }
  .catch-medal { width: 40px; }
  .catch-verdict { min-height: 21px; }
  .result:is([data-catch-rank="3"], [data-catch-rank="4"], [data-catch-rank="5"]) .catch-verdict { font-size: 21px; }
  .catch-measurements { padding-block: 2px; }
  .measure-label { display: block; line-height: 1.2; }
  .catch-measurement b { font-size: 18px; }
  .catch-range { margin-block: 5px 3px; }
  .result-prize { font-size: clamp(24px,10cqi,38px); }
}
@media (max-width: 600px) and (max-height: 450px) {
  .catch-heading { padding-right: 18px; }
  .catch-heading strong { font-size: 17px; }
  .catch-heading span { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .result, .result[data-phase="weighing"] .catch-specimen canvas,
  .result[data-catch-rank] :is(.catch-medal, .medal-sparks, .catch-verdict span, .catch-specimen, .catch-specimen canvas, .result-prize),
  .result[data-catch-rank] .catch-verdict::before,
  .result[data-catch-rank] .catch-verdict::after { animation: none; }
  .catch-medal::before, .catch-medal::after, .medal-sparks { display: none; }
}

/* Bet, cast, turbo and autoplay controls. */

.action-row {
  display: grid;
  grid-template-columns: fit-content(42%) minmax(0, 1fr);
  gap: 18px;
}

.cast-actions {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.cast-actions .cast-button {
  flex: 1;
  min-width: 0;
}

.turbo-button {
  flex: 0 0 56px;
}

.bet {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid #69827e;
  border-radius: 12px;
  background: #163642;
}

.bet .eyebrow {
  letter-spacing: 1.2px;
  width: 100%;
  text-align: center;
}

.bet-controls {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  justify-content: flex-start;
  gap: 8px;
}

.bet-controls button {
  flex: none;
  width: 34px;
  height: 34px;
  background: #183946;
  border: 1px solid #37515a;
  border-radius: 8px;
  font-size: 21px;
  line-height: 1;
}

.bet-controls button:disabled {
  opacity: 0.35;
}

.bet-controls strong {
  font-size: clamp(14px, 4vw, 24px);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.3em;
  min-width: 0;
  flex: 0 1 auto;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.15;
}

#bet-value {
  min-width: 3ch;
}

.autoplay-button,
.turbo-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 62px;
  padding: 8px 4px;
  border: 1px solid #69827e;
  border-radius: 12px;
  background: #163642;
  color: #e0eeeb;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.autoplay-button svg,
.turbo-button svg {
  width: 23px;
  height: 23px;
  flex: none;
}

.autoplay-button span,
.turbo-button span {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.7px;
  white-space: nowrap;
}

.autoplay-button:hover:not(:disabled),
.turbo-button:hover:not(:disabled) {
  background: #204752;
  border-color: #b0c5b9;
}

.autoplay-button:disabled,
.turbo-button:disabled {
  opacity: 0.4;
}

.autoplay-button.active,
.turbo-button[aria-pressed="true"] {
  border-color: var(--gold);
  background: #263b3c;
  color: var(--gold);
}

.autoplay-button.active span {
  font-size: 12px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* A compact, non-modal panel grows upward from its trigger. */

.autoplay-widget {
  position: relative;
  display: flex;
  align-self: stretch;
  flex: 0 0 64px;
}

.autoplay-widget > .autoplay-button {
  width: 100%;
}

.autoplay-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(280px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid #55716f;
  border-radius: 14px;
  background: #0b2936;
  box-shadow: 0 12px 36px #00131db3;
  z-index: 10;
  transform-origin: bottom right;
  animation: autoplay-open 0.16s ease-out;
}

.autoplay-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.autoplay-heading h3 {
  font-size: 16px;
  margin: 0;
  letter-spacing: 0.2px;
}

#autoplay-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff09;
  color: #bed4d6;
  font-size: 22px;
  line-height: 1;
}

.autoplay-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}

.autoplay-field span {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}

#autoplay-count {
  font:
    700 20px "DM Sans",
    sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--white);
  background: #123440;
  border: 1px solid #4d6c76;
  border-radius: 8px;
  min-height: 42px;
  width: 100%;
  padding: 8px 10px;
  color-scheme: dark;
}

#autoplay-count:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.autoplay-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.autoplay-presets button {
  padding: 7px 4px;
  border: 1px solid #345764;
  border-radius: 6px;
  background: #12313c;
  font-size: 12px;
  color: #d5e4e2;
}

.autoplay-presets button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
  background: #263b3c;
}

.autoplay-summary {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  margin: 14px 0 6px;
}

.autoplay-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 14px;
}

#autoplay-start {
  width: 100%;
  min-height: 42px;
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--gold);
  color: #122b33;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

#autoplay-start:disabled {
  opacity: 0.45;
  cursor: default;
}

@keyframes autoplay-open {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .autoplay-panel {
    animation: none;
  }
}

@media (min-width: 1100px) {
  .action-row {
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .action-row {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 8px;
  }
  .cast-actions {
    display: contents;
    gap: 8px;
  }
  .bet {
    grid-area: 1 / 2;
    display: grid;
    grid-template-columns:
      minmax(28px, 1fr) minmax(0, max-content) minmax(28px, 1fr);
    grid-template-rows: auto auto;
    gap: 0 4px;
    min-height: 32px;
    padding: 2px;
    border-radius: 7px;
  }
  .bet .eyebrow {
    grid-area: 1 / 2;
    align-self: end;
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0.5px;
  }
  .bet-controls {
    display: contents;
  }
  .bet-controls strong {
    grid-area: 2 / 2;
    align-self: start;
    font-size: 16px;
    line-height: 1.05;
  }
  .bet-controls button {
    grid-row: 1 / 3;
    align-self: stretch;
    width: 100%;
    max-width: 44px;
    height: auto;
    border-radius: 5px;
    font-size: 19px;
  }
  #less {
    grid-column: 1;
    justify-self: start;
  }
  #more {
    grid-column: 3;
    justify-self: end;
  }
  .turbo-button {
    flex-basis: 52px;
    grid-area: 1 / 1;
  }
  .autoplay-widget {
    grid-area: 1 / 3;
    flex-basis: 52px;
  }
  .autoplay-button,
  .turbo-button {
    min-height: 32px;
    padding: 2px 4px;
    gap: 1px;
    border-radius: 7px;
  }
  .autoplay-button svg,
  .turbo-button svg {
    width: 15px;
    height: 15px;
  }
  .autoplay-button span,
  .turbo-button span {
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0.2px;
  }
  .autoplay-button.active span {
    font-size: 10px;
  }
  .cast-button {
    grid-row: 2;
    grid-column: 1 / -1;
    min-height: 32px;
    border-radius: 7px;
    font-size: 12px;
    letter-spacing: 0.5px;
    gap: 7px;
  }
  .cast-button:disabled {
    font-size: 12px;
    letter-spacing: 0;
  }
  .cast-button svg {
    width: 16px;
    height: 16px;
  }
  .action-row:has(.turbo-button[hidden]) .bet {
    grid-column: 1 / 3;
  }
  .action-row:has(.autoplay-widget[hidden]) .bet {
    grid-column: 2 / -1;
  }
  .action-row:has(.turbo-button[hidden]):has(.autoplay-widget[hidden]) .bet {
    grid-column: 1 / -1;
  }
  .action-row:has(.bet[hidden]) .cast-actions {
    display: flex;
  }
}

@media (min-width: 601px) and (max-height: 500px) {
  .action-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px 10px;
  }
  .cast-actions {
    gap: 8px;
  }
  .cast-actions .cast-button {
    font-size: 12px;
    letter-spacing: 0.7px;
  }
  .cast-actions .cast-button svg {
    display: none;
  }
  .turbo-button {
    flex-basis: 44px;
  }
  .autoplay-widget {
    flex-basis: 52px;
  }
  .autoplay-button,
  .turbo-button {
    min-height: 52px;
  }
}

.action-row:has(.bet[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 601px) and (max-height: 500px) {
  .controls {
    justify-content: flex-end;
  }
}

@media (max-height: 500px) {
  .autoplay-panel {
    padding: 14px;
  }
  .autoplay-summary {
    margin-top: 10px;
  }
  .autoplay-heading {
    margin-bottom: 8px;
  }
  #autoplay-close {
    width: 24px;
    height: 24px;
  }
  #autoplay-count {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 18px;
  }
  .autoplay-presets button {
    padding: 6px 4px;
  }
  .autoplay-note {
    display: none;
  }
  #autoplay-start {
    min-height: 38px;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -6px 8px #0b2936;
  }
}

/* Treasure uses the full scene; the chest stays visible behind the award. */
.result.treasure {
  inset: 0; width: 100%; height: 100%; max-height: none; padding: 0 16px 5%;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  backdrop-filter: none; pointer-events: none; overflow: hidden;
  justify-content: flex-end; animation: none;
}
.treasure-title { position: absolute; top: max(calc(var(--result-top, 64px) + 8px), 9%); left: 12px; right: 12px; color: #ffe4a1; }
.treasure-title > span { display: block; font-size: clamp(8px, 1.8cqi, 11px); letter-spacing: .24em; color: #d6c6a2; }
.treasure-title strong { display: block; font: italic 800 clamp(32px, 7cqi, 54px)/1.1 "Barlow Condensed", sans-serif; text-transform: uppercase; text-shadow: 0 2px 18px #edb74655; }
.treasure-title b { display: block; margin-top: 4px; font: 700 clamp(18px, 4cqi, 26px)/1 "Barlow Condensed", sans-serif; }
.result.treasure .result-prize { font-size: clamp(28px, 8cqi, 62px); }
.result.treasure[data-phase="opening"] :is(.result-prize, .result-label, .treasure-title b) { visibility: hidden; }
.result.treasure[data-phase="opening"] .treasure-title { animation: treasure-title-in .6s .6s both; }
.game.turbo .result.treasure[data-phase="opening"] .treasure-title { animation-duration: .3s; animation-delay: .3s; }
.treasure-rules { padding: 8px 0; border-bottom: 1px solid #cba76a33; }
.treasure-rules h3 { color: #ffda85; margin: 5px 0 10px; font: 700 24px/1.1 "Barlow Condensed", sans-serif; }
@keyframes treasure-title-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-height: 450px) {
  .treasure-title > span { display: none; }
  .treasure-title strong { font-size: 27px; }
  .treasure-title b { font-size: 18px; }
  .result.treasure { padding-bottom: 2%; }
  .result.treasure .result-prize { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .result.treasure .treasure-title { animation: none; } }

.treasure-reveal .location { visibility: hidden; }
.cast-copy { display: flex; flex-direction: column; gap: 3px; align-items: center; }
#cast-cost { font-size: 11px; font-weight: 600; letter-spacing: .2px; }

.result.multi-result { width: min(850px, calc(100% - 36px)); gap: 5px; padding: 20px 24px 14px; }
.result.multi-result .result-prize { font-size: clamp(44px, 9cqi, 78px); animation: none; }
.result.multi-result.counting .result-prize { animation: haul-total 1.1s ease-out both; }
.game.turbo .result.multi-result.counting .result-prize { animation-duration: .55s; }
@keyframes haul-total {
  0% { transform: scale(.76); opacity: .6; }
  75% { transform: scale(1.045); opacity: 1; text-shadow: 0 0 20px #ffd48166; }
  100% { transform: scale(1); opacity: 1; text-shadow: none; }
}
#multi-details { width: 100%; }
.multi-count { font-size: 12px; color: #c0d7d9; margin: 8px 0 16px; padding-top: 10px; border-top: 1px solid #77959040; }
.multi-haul { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: center; gap: 20px; }
.multi-best { min-width: 0; }
.multi-best > .eyebrow { font-size: 10px; color: #cae5e7; }
.multi-best .catch-specimen { width: 100%; margin: 8px 0 0; aspect-ratio: auto; }
.multi-best canvas { display: block; width: 100%; height: auto; aspect-ratio: 700 / 240; }
.multi-best .catch-medal { width: 26%; }
.multi-best-name { display: block; font: 700 22px/1.1 'Barlow Condensed', sans-serif; color: #edf7f3; }
.multi-best-prize { display: block; font: 800 36px/1.1 'Barlow Condensed', sans-serif; color: var(--gold); overflow-wrap: anywhere; }
.multi-lineup { display: grid; grid-template-columns: repeat(var(--hook-columns), minmax(0, 1fr)); align-content: center; gap: 10px 0; padding-left: 12px; border-left: 1px solid #77959040; }
.multi-catch { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 6px 2px; gap: 2px; border: 0; border-radius: 7px; background: transparent; color: #dfedef; animation: haul-arrive .3s ease-out both; animation-delay: calc(var(--catch-order) * 25ms); }
.multi-catch:hover, .multi-catch[aria-pressed="true"] { background: #8edfc312; }
.multi-catch:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.multi-catch.best b { color: var(--gold); }
.hook-number { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #87a6ac77; border-radius: 50%; color: #c7e0e4; font-size: 10px; }
.multi-catch canvas { display: block; width: 100%; max-width: 100px; height: 44px; object-fit: contain; }
.multi-catch b { max-width: 100%; font: 700 18px/1.1 'Barlow Condensed', sans-serif; overflow-wrap: anywhere; }
.empty-hook { display: grid; place-items: center; color: #87a1aa; }
.empty-hook svg { width: 34px; height: 44px; }
.multi-best .empty-hook svg { width: 74px; height: 90px; }
.multi-inspect { min-height: 2.8em; margin: 12px 0 0; font-size: 11px; line-height: 1.4; color: #b4ccd0; }
@keyframes haul-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  #cast-cost { font-size: 10px; line-height: 1; }
  .cast-copy { gap: 1px; }
  .result.multi-result { width: calc(100% - 24px); padding: 14px 12px 8px; }
  .result.multi-result .result-prize { font-size: clamp(42px, 17cqi, 56px); }
  .multi-count { margin: 5px 0 10px; padding-top: 7px; font-size: 11px; }
  .multi-haul { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .multi-best { width: min(100%, 230px); margin: auto; }
  .multi-best .catch-specimen { margin-top: 2px; }
  .multi-best-name { font-size: 20px; }
  .multi-best-prize { font-size: 28px; }
  .multi-lineup { padding: 8px 0 0; border-left: 0; border-top: 1px solid #77959040; gap: 4px 0; }
  .multi-catch { padding-block: 3px; }
  .multi-catch canvas { height: 34px; }
  .multi-catch b { font-size: 16px; }
  .multi-catch .empty-hook svg { height: 34px; width: 27px; }
  .multi-inspect { margin-top: 8px; font-size: 10px; }
}
@media (max-height: 650px) {
  .result.multi-result { padding: 10px 12px 5px; }
  .result.multi-result .result-prize { font-size: clamp(36px, 15cqi, 44px); }
  .multi-count { margin: 2px 0 6px; padding-top: 4px; }
  .multi-haul { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: 8px; }
  .multi-best-name { font-size: 17px; }
  .multi-best-prize { font-size: 25px; }
  .multi-lineup { border-left: 1px solid #77959040; border-top: 0; padding: 0 0 0 6px; gap: 0; }
  .multi-catch canvas, .multi-catch .empty-hook svg { height: 29px; }
  .multi-catch b { font-size: 14px; }
  .multi-inspect { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .multi-catch, .result.multi-result .result-prize { animation: none; }
}
@media (max-width: 600px) and (min-height: 451px) and (max-height: 750px) {
  .result.multi-result { padding: 10px 12px 5px; }
  .result.multi-result .result-prize { font-size: 40px; }
  .multi-haul { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .multi-best { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 0 10px; width: min(100%, 270px); }
  .multi-best > .eyebrow { grid-column: 1 / -1; }
  .multi-best .catch-specimen { grid-row: 2 / 4; }
  .multi-best-name { align-self: end; }
  .multi-best-prize { align-self: start; }
  .multi-lineup { border-left: 0; border-top: 1px solid #77959040; padding: 5px 0 0; }
  .multi-catch { padding-block: 1px; }
  .multi-catch canvas { height: 33px; }
}
@media (max-height: 450px) {
  .result.multi-result { gap: 3px; padding-top: 8px; }
  .result.multi-result .result-prize { font-size: 40px; }
  .multi-count { font-size: 10px; padding-top: 2px; margin-bottom: 4px; }
  .multi-catch { padding-block: 2px; gap: 1px; }
  .multi-catch .hook-number { width: 14px; height: 14px; font-size: 9px; }
  .multi-catch canvas, .multi-catch .empty-hook svg { height: 26px; }
  .multi-inspect { font-size: 10px; margin-top: 4px; }
}
@container (min-width: 361px) and (max-width: 550px) {
  .scene-toolbar:has(.balance strong.long-balance) { grid-template-columns: minmax(0, 1fr) auto; }
  .scene-toolbar:has(.balance strong.long-balance) .location { grid-area: 2 / 1 / auto / -1; max-width: 100%; }
}
.multi-catch.escaped { color: #76929d; }
.multi-catch.escaped .empty-hook { opacity: .55; }
.multi-catch.escaped b { font: 500 15px/1.1 'DM Sans', sans-serif; color: #76929d; }

/* Engine's 400×225 popout: reserve a full-height scene beside replay controls. */
@media (max-height: 300px) {
  .shell:has(.bet[hidden]) {
    padding: 4px; display: grid; gap: 4px;
    grid-template-columns: minmax(0, 1fr) 84px;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .shell:has(.bet[hidden]) > .game { grid-area: 1 / 1; height: 100%; border-radius: 10px; }
  .shell:has(.bet[hidden]) .controls { grid-area: 1 / 2; padding: 6px; border: 1px solid var(--line); border-radius: 10px; display: grid; align-items: center; }
  .shell:has(.bet[hidden]) .cast-actions { display: flex; flex-direction: column; gap: 8px; }
  .shell:has(.bet[hidden]) .cast-button { min-height: 40px; padding: 6px 2px; font-size: 11px; }
  .shell:has(.bet[hidden]) .cast-button svg { display: none; }
  .shell:has(.bet[hidden]) .turbo-button { flex-basis: auto; min-height: 36px; }
  .shell:has(.bet[hidden]) .session-note { grid-area: 2 / 1 / auto / -1; margin: 0; padding: 4px 6px; font-size: 10px; line-height: 1.25; border-radius: 6px; }
  .shell:has(.bet[hidden]) .connection { grid-column: 1 / -1; margin: 0; padding: 4px 6px; font-size: 10px; }
}
@container (max-height: 300px) {
  .scene-toolbar { top: 5px; left: 7px; right: 7px; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
  .scene-settings { grid-area: 1 / 2; }
  .scene-actions .icon-btn { width: 26px; height: 26px; }
  .location { display: none; }
  .result { --result-top: 35px; max-height: calc(100% - 41px); }
  .intro { top: 32px; }
  .intro h1 { margin: 2px 0; font-size: clamp(24px, 15cqh, 34px); }
  .cast-stat, .depth-stat { top: 38px; }
  .multi-best { display: none; }
  .multi-haul { grid-template-columns: minmax(0, 1fr); }
  .multi-lineup { padding: 0; border: 0; }
  .multi-inspect { min-height: 2.6em; margin-top: 4px; }
}
@container (max-height: 300px) {
  .result.multi-result { width: calc(100% - 12px); padding: 5px 7px; gap: 1px; }
  .result-label { font-size: 8px; letter-spacing: 1px; }
  .result.multi-result .result-prize { font-size: 25px; }
  .multi-count { margin: 1px 0 3px; padding-top: 2px; font-size: 9px; }
  .multi-catch { min-height: 26px; flex-direction: row; padding: 2px 0; }
  .multi-catch canvas, .multi-catch .empty-hook svg { width: 28px; height: 20px; }
  .multi-catch b { display: none; }
  .multi-inspect { font-size: 9px; line-height: 1.2; min-height: 2.4em; }
  .result:not(.multi-result):not(.treasure) { width: calc(100% - 12px); padding: 4px 7px; gap: 1px; }
  .catch-heading strong { font-size: 15px; }
  .catch-heading span { font-size: 12px; }
  .catch-specimen { width: 86px; margin: 0; float: left; }
  .catch-verdict { display: none; }
  .catch-measurements { gap: 7px; padding: 2px 0; border: 0; }
  .measure-label { font-size: 8px; letter-spacing: .5px; }
  .catch-measurement strong, .catch-measurement b { font-size: 13px; }
  .catch-range { height: 3px; margin: 3px 0; }
  .result-prize { font-size: 25px; }
  .result.treasure { padding: 4px 8px; }
  .treasure-title { top: 35px; }
  .treasure-title > span { display: none; }
  .treasure-title strong { font-size: 23px; }
  .treasure-title b { font-size: 14px; margin-top: 0; }
  .result.treasure .result-prize { font-size: 27px; }
}

/* Rig choice lives beside the lagoon, in the former power-meter position. */
.game { --equipment-width: 184px; }
.intro {
  width: 32%;
  right: auto;
}
.equipment {
  position: absolute;
  z-index: 2;
  top: max(88px, 22%);
  right: 24px;
  width: var(--equipment-width);
  display: grid;
  gap: 10px;
}
.equipment-heading {
  color: #deebe5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-align: center;
  text-shadow: 0 2px 8px #001921;
}
.equipment-choice {
  --rig-accent: #82dfc2;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 10px 12px 10px 7px;
  border: 1px solid #75999888;
  border-radius: 13px;
  color: #f0f6eb;
  background: linear-gradient(145deg, #193e48f5, #092735f5);
  box-shadow: 0 5px 14px #0018214d, inset 0 1px 0 #ffffff0c;
  text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
}
.equipment-choice[data-equipment="mid"] { --rig-accent: #ffd47c; }
.equipment-choice[data-equipment="deep"] { --rig-accent: #b6b3ff; }
.equipment-choice:hover:not(:disabled) {
  border-color: var(--rig-accent);
  background: linear-gradient(145deg, #245460f5, #103849f5);
  transform: translateX(-2px);
}
.equipment-choice:focus-visible { outline-offset: 3px; }
.equipment-choice[aria-pressed="true"] {
  border-color: #f0ca7a;
  background: linear-gradient(135deg, #375151f5, #123743f5);
  box-shadow: 0 0 0 1px #f0ca7a66, 0 5px 18px #001c2699, inset 0 1px 0 #fff6d41a;
}
.equipment-choice:disabled { cursor: default; }
.equipment-choice:disabled:not([aria-pressed="true"]) { opacity: .7; }
.equipment-icon {
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #b6ebcc17 0, transparent 72%);
}
.equipment-icon svg { width: 100%; height: 100%; stroke-width: 2.2; }
.rig-line { stroke: #a8c8c8; stroke-width: 1.5; }
.rig-metal { stroke: #e0e6da; stroke-width: 2.5; }
.rig-bait { stroke: #f4a098; stroke-width: 7; }
.rig-detail { stroke: #0b3443; stroke-width: 1.6; opacity: .65; }
.rig-lure { fill: #f2c568; stroke: #fce2a0; }
.rig-squid { fill: #8b80cb; stroke: #c1b8f2; }
.rig-tentacles { stroke: #c1b8f2; stroke-width: 3; }
.rig-glint { stroke: #e6e9d1; stroke-width: 1.5; }
.equipment-copy { min-width: 0; }
.equipment-copy strong {
  display: block;
  font: 700 19px/1.08 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: .1px;
}
.equipment-copy small {
  display: block;
  margin-top: 5px;
  color: var(--rig-accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.equipment-check {
  position: absolute;
  top: 50%;
  right: -1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  transform: translate(50%, -50%);
  border: 1.5px solid #f0ca7a;
  border-radius: 50%;
  background: #163b43;
  box-shadow: 0 2px 6px #001c2666;
  color: #f5d38b;
  font: 800 16px/1 Arial, sans-serif;
  pointer-events: none;
  visibility: hidden;
}
.equipment-choice[aria-pressed="true"] .equipment-check { visibility: visible; }

@container (max-width: 550px) {
  .intro {
    left: 6%;
    right: auto;
    }
  .intro h1 { font-size: clamp(32px, 10cqw, 54px); }
  .equipment { top: max(96px, 24%); right: 16px; width: 126px; gap: 8px; }
  .equipment-heading { font-size: 9px; letter-spacing: 1px; }
  .equipment-choice { min-height: 75px; padding: 8px 5px; gap: 4px; border-radius: 11px; }
  .equipment-icon { flex-basis: 34px; width: 34px; height: 48px; }
  .equipment-copy strong { font-size: 16px; }
  .equipment-copy small { margin-top: 4px; font-size: 10px; }
  .equipment-check { width: 22px; height: 22px; font-size: 14px; }
}
@container (max-height: 420px) {
  .equipment { top: 84px; gap: 6px; }
  .equipment-choice { min-height: 57px; padding-block: 5px; }
  .equipment-icon { height: 42px; }
  .intro { top: 84px; }
}
@container (max-height: 300px) {
  .equipment { top: 37px; right: 16px; width: 110px; gap: 4px; }
  .equipment-heading { display: none; }
  .equipment-choice { min-height: 44px; padding: 4px; gap: 4px; border-radius: 8px; }
  .equipment-icon { flex-basis: 26px; width: 26px; height: 32px; }
  .equipment-copy strong { font-size: 14px; line-height: 1; }
  .equipment-copy small { font-size: 9px; margin-top: 3px; }
  .intro { top: 39px; left: 7%; right: auto; }
  .intro h1 { font-size: clamp(25px, 10cqw, 38px); margin-bottom: 8px; }
  .studio-credit { font-size: 6px; letter-spacing: .4px; gap: 3px; }
  .studio-credit::before, .studio-credit::after { width: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .equipment-choice { transition: none; }
}

/* The compact live player keeps the setup usable beside a full-height scene. */
@media (max-width: 600px) and (max-height: 300px) {
  .shell:not(:has(.bet[hidden])) {
    padding: 4px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 94px;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 4px;
  }
  .shell:not(:has(.bet[hidden])) > .game {
    grid-area: 1 / 1;
    height: 100%;
    min-height: 0;
    max-height: none;
    border-radius: 10px;
  }
  .shell:not(:has(.bet[hidden])) .controls {
    grid-area: 1 / 2;
    display: grid;
    align-items: center;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .shell:not(:has(.bet[hidden])) .action-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .shell:not(:has(.bet[hidden])) .bet {
    min-height: 44px;
    padding: 3px 2px;
    grid-template-columns: 17px minmax(0, 1fr) 17px;
    gap: 0 2px;
  }
  .shell:not(:has(.bet[hidden])) .bet-controls strong { font-size: 12px; }
  .shell:not(:has(.bet[hidden])) .bet-controls button { font-size: 16px; }
  .shell:not(:has(.bet[hidden])) .cast-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .shell:not(:has(.bet[hidden])) .cast-button {
    grid-area: auto / 1 / auto / -1;
    min-height: 44px;
    padding: 5px 2px;
    font-size: 11px;
  }
  .shell:not(:has(.bet[hidden])) .cast-button svg { display: none; }
  .shell:not(:has(.bet[hidden])) :is(.turbo-button, .autoplay-widget) { grid-area: auto; }
  .shell:not(:has(.bet[hidden])) :is(.turbo-button, .autoplay-button) {
    min-height: 36px;
    padding: 3px 1px;
  }
  .shell:not(:has(.bet[hidden])) :is(.connection, .session-note) {
    grid-column: 1 / -1;
    margin: 0;
    padding: 3px 5px;
    font-size: 10px;
    line-height: 1.2;
  }
  .session-info {
    grid-column: 1 / -1;
    margin: 0;
    padding: 1px 4px;
    font-size: 9px;
    line-height: 1.2;
    gap: 8px;
  }
  .session-info > span { white-space: nowrap; }
}

@container (max-width: 350px) and (max-height: 250px) {
  .intro { display: none; }
}
@container (max-width: 350px) and (min-height: 301px) {
  .equipment { width: 110px; }
  .equipment-icon { flex-basis: 28px; width: 28px; }
  .equipment-copy strong { font-size: 15px; }
}

/* The side-on ready camera places the waterline at world y=355. Keep this
   compact brand beneath it so the raft, angler and ring flight own the sky. */
.intro {
  top: calc(35.5cqw + 18px);
  left: 50%;
  width: 24%;
  translate: -50% 0;
  text-align: center;
}
.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5.2cqw, 44px);
  line-height: .88;
}
.intro .studio-credit {
  margin-top: 0;
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: .9px;
  gap: 5px;
}
.intro .studio-credit::before,
.intro .studio-credit::after { width: 12px; }
@container (max-width: 599px) {
  .intro {
    top: calc(71cqw + 18px);
    left: min(50%, calc(100% - 150px - 16cqw));
    width: 32%;
  }
  .intro h1 { font-size: clamp(26px, 8.2cqw, 32px); }
  .intro .studio-credit { font-size: 7px; letter-spacing: .5px; gap: 3px; }
  .intro .studio-credit::before,
  .intro .studio-credit::after { width: 7px; }
}
@container (max-width: 350px) {
  .intro { left: min(50%, calc(100% - 134px - 16cqw)); }
}
/* Short crops reserve their scarce sky for the HUD and casting scene. */
@container (max-height: 300px) {
  .intro { display: none; }
}
@container (max-width: 599px) and (min-aspect-ratio: 1 / 1) {
  .intro { display: none; }
}

/* Keep the brand centred independently of the wallet's current amount. */
.scene-toolbar { left: 20px; align-items: start; }
.game-brand { margin-top: -4px; }
@container (max-width: 550px) {
  .scene-toolbar,
  .scene-toolbar:has(.balance strong.long-balance) {
    left: 12px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
  }
  .scene-wallet { grid-area: 1 / 1; }
  .scene-settings { grid-area: 1 / 3; }
  .game-brand { grid-area: 1 / 2; margin-top: -3px; }
  .game-brand h1 { font-size: 22px; }
  .game-brand > span { margin-top: 3px; font-size: 7px; letter-spacing: .7px; }
  .scene-wallet .dev-button { position: absolute; top: 44px; left: 0; width: 26px; height: 26px; font-size: 8px; }
  .balance { padding-inline: 19px; }
}
@container (max-width: 350px) {
  .game-brand h1 { font-size: 16px; }
  .game-brand > span { font-size: 6px; }
  .balance { padding-inline: 15px; }
  .balance strong { font-size: 13px; white-space: nowrap; }
}
@container (max-height: 300px) {
  .scene-toolbar,
  .scene-toolbar:has(.balance strong.long-balance) {
    left: 7px; right: 7px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
  }
  .scene-wallet { grid-area: 1 / 1; }
  .game-brand { grid-area: 1 / 2; }
  .scene-settings { grid-area: 1 / 3; }
  .game-brand h1 { font-size: 22px; }
  .game-brand > span { margin-top: 2px; font-size: 7px; letter-spacing: .8px; }
}
@container (max-width: 550px) and (max-height: 300px) {
  .game-brand h1 { font-size: 20px; }
  .game-brand > span { font-size: 6px; margin-top: 1px; }
  .scene-wallet .dev-button { top: 40px; }
  .equipment { top: 45px; gap: 3px; }
  .equipment-choice { min-height: 38px; padding-block: 3px; }
  .equipment-icon { height: 28px; }
}
