/* Screen: hunt (phase 'hunt') — a 🤿 wreck hunt (docs/roadmap/WRECKS.md): a cut-away of the sea beside what she
   knows, the odds of the next dive and the buttons; landed, the treasures' choices and the hunt's receipt. The water
   darkens with the depth; a storm greys the sky. Motion stays small and stops with reduced motion (base.css). */

.screen--hunt {
  gap: var(--sp-4);
}

.screen--hunt.is-rerender,
.screen--hunt .mate.is-still {
  animation: none;
}

/* A wreck's name opens a title with a capital ("The Brave Bess"); in a sentence it stays "the Brave Bess". */
.wh-title {
  display: inline-block;
}

.wh-title::first-letter {
  text-transform: uppercase;
}

.wh-head__sub {
  margin-top: var(--sp-1);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-soft);
}

.wh-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--sp-4) var(--sp-5);
  align-items: start;
}

.wh-side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}

/* ── The cut-away of the sea ───────────────────────────── */
.wh-scene {
  --wh-water: var(--sea-300);
  --wh-deep: var(--sea-500);
  position: relative;
  display: grid;
  grid-template-rows: 64px auto minmax(220px, 1fr);
  min-height: 380px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--sea-50) 0, var(--sea-100) 100%);
  box-shadow: var(--shadow-2);
}

.wh-scene.is-middle { --wh-water: var(--sea-400); --wh-deep: var(--sea-700); }
.wh-scene.is-deep { --wh-water: var(--sea-600); --wh-deep: var(--sea-900); }

.wh-scene.is-storm {
  background: linear-gradient(180deg, var(--line-strong) 0, var(--line) 100%);
}

.wh-sky {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--sp-4);
  font-size: 2rem;
}

.wh-cloud {
  animation: wh-drift 3s var(--ease) infinite alternate;
}

.wh-ship {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-bottom: -18px;
}

.wh-ship svg {
  max-width: 70%;
  height: auto;
  animation: wh-bob 2.6s ease-in-out infinite alternate;
}

.wh-sea {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, var(--wh-water) 0, var(--wh-deep) 100%);
}

.wh-bubbles {
  position: absolute;
  top: 18%;
  left: 30%;
  font-size: 1.4rem;
  opacity: 0.7;
  animation: wh-rise 3.4s linear infinite;
}

.wh-diver {
  --wh-diver-top: 40%;
  position: absolute;
  top: var(--wh-diver-top);
  left: 50%;
  font-size: 2.2rem;
  transform: translateX(-50%);
  animation: wh-sink 1.2s var(--ease) both;
}

.wh-bed {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 72px;
  padding: var(--sp-3);
  background: linear-gradient(180deg, transparent 0, var(--sand-400) 60%, var(--sand-600) 100%);
  font-size: 1.8rem;
}

.wh-wreck {
  font-size: 2.6rem;
  filter: grayscale(0.4);
}

.wh-sand {
  opacity: 0.8;
}

.wh-treasure {
  animation: wh-shine 1.6s ease-in-out infinite alternate;
}

@keyframes wh-bob {
  from { transform: translateY(0); }
  to { transform: translateY(4px); }
}

@keyframes wh-rise {
  from { transform: translateY(80px); opacity: 0; }
  30% { opacity: 0.7; }
  to { transform: translateY(-40px); opacity: 0; }
}

@keyframes wh-sink {
  from { top: 0; opacity: 0; }
  to { top: var(--wh-diver-top); opacity: 1; }
}

@keyframes wh-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-12px); }
}

@keyframes wh-shine {
  from { filter: brightness(1); }
  to { filter: brightness(1.25); }
}

/* ── Cards ─────────────────────────────────────────────── */
.wh-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid rgba(13, 48, 71, 0.06);
  box-shadow: var(--shadow-2);
}

.wh-card__title {
  font-size: var(--fs-md);
}

.wh-now__last {
  font-size: var(--fs-lg);
  font-weight: 900;
}

.wh-now__last.is-storm,
.wh-now__storm {
  color: var(--ink);
}

.wh-now__storm {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--loss-bg);
  font-weight: 800;
}

.wh-now__kind {
  font-weight: 800;
  color: var(--ink-soft);
}

.wh-now__end {
  font-weight: 800;
}

/* A pip a dive. */
.wh-pips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wh-pip {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sea-50);
  border: 2px dashed var(--sea-300);
  color: var(--ink-faint);
  font-weight: 900;
  font-size: 1.1rem;
}

.wh-pip.is-done {
  border-style: solid;
  background: var(--card);
}

.wh-pip.is-find {
  background: var(--accent-100);
  border-color: var(--accent-400);
}

.wh-pip.is-storm {
  background: var(--loss-bg);
  border-color: var(--line-strong);
}

.wh-echo {
  font-weight: 700;
}

.wh-odds {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--sea-50);
  font-weight: 800;
}

.wh-odds.is-storm {
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
}

.wh-money {
  font-weight: 700;
  box-shadow: var(--shadow-1);
}

.wh-money__treasure {
  font-weight: 900;
}

.wh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.wh-actions .btn {
  flex: 1 1 12em;
}

/* ── Landed ────────────────────────────────────────────── */
.wh-truth__main {
  font-size: var(--fs-lg);
  font-weight: 900;
}

.wh-finds__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wh-find {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
}

.wh-find.is-sell {
  background: var(--gain-bg);
  border-color: var(--green-300);
}

.wh-find.is-museum {
  background: var(--accent-100);
  border-color: var(--accent-200);
}

.wh-find__emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.wh-find__name {
  font-weight: 900;
}

.wh-find__choice {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.wh-find__choice .btn {
  flex: 1 1 10em;
}

.wh-find__done {
  font-weight: 900;
}

.wh-lines {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}

.wh-line {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-1);
  border-bottom: 1px dotted var(--line);
}

.wh-line.is-in .wh-line__amount {
  color: var(--gain);
  font-weight: 900;
}

.wh-line__amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wh-kept {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--gain-bg);
  color: var(--gain);
  font-size: var(--fs-md);
  font-weight: 900;
}

.wh-kept.is-down {
  background: var(--loss-bg);
  color: var(--loss);
}

.wh-haul {
  font-weight: 800;
}

.wh-given {
  font-weight: 800;
  color: var(--accent-700);
}

/* ── Tablets in portrait and phones: one column ─────────── */
@media (max-width: 53.75em) {
  .wh-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .wh-scene {
    grid-template-rows: 48px auto minmax(160px, 1fr);
    min-height: 280px;
  }

  .wh-diver {
    --wh-diver-top: 12%;
  }
}

@media (max-width: 37.5em) {
  .wh-card {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
  }

  .wh-actions .btn {
    flex-basis: 100%;
  }
}
