:root {
  --abyss: #071820;
  --ink: #e7f6ff;
  --muted: #9ecbda;
  --cyan: #7eecff;
  --amber: #f0d48a;
  --crimson: #e23d4a;
  --paper: #e7f4f8;
  --paper-ink: #08202c;
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--abyss);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

img,
canvas,
svg {
  max-width: 100%;
}

img {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::selection {
  background: #1a6e86;
  color: #f4fbff;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 16, 24, 0.42), rgba(4, 16, 24, 0.88)),
    url("lake-shore.jpg") center top / cover no-repeat;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(240, 212, 138, 0.45);
}

.brand p,
.kicker,
.choice-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand h1,
.view-title,
.sheet-card h2,
.paper h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.brand h1 {
  margin: 1px 0 0;
  font-size: clamp(22px, 6.4vw, 40px);
  line-height: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-readout {
  flex: 0 0 auto;
  margin: 0;
  min-width: 74px;
  padding: 7px 8px 6px;
  text-align: right;
  border-radius: 12px;
  background: linear-gradient(180deg, #041018, #0c2c3c);
  border: 1px solid rgba(240, 212, 138, 0.55);
  box-shadow: inset 0 0 14px rgba(62, 224, 255, 0.28);
}

.session-readout strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #f7feff;
}

.session-readout span {
  display: block;
  margin-top: 3px;
  color: var(--amber);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ridge {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px;
  border: 1px solid rgba(180, 230, 255, 0.28);
  border-radius: 8px 22px 8px 18px;
  background: rgba(5, 20, 30, 0.82);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.ridge button {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d5eef8;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 500;
}

.ridge button svg {
  width: 18px;
  height: 18px;
}

.ridge button.is-on {
  color: #f4fbff;
  background: linear-gradient(160deg, rgba(126, 236, 255, 0.28), rgba(126, 236, 255, 0.05));
  box-shadow: inset 0 -2px 0 var(--cyan);
  transform: skewX(-8deg);
}

.ridge button.is-on span,
.ridge button.is-on svg {
  transform: skewX(8deg);
}

.view {
  display: none;
  min-width: 0;
}

.view.is-on {
  display: block;
}

.kicker {
  margin-bottom: 4px;
}

.view-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 0.95;
}

.hole-layout,
.control-column,
.stage-column,
.choice-block {
  min-width: 0;
}

.bezel {
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1;
  padding: 11px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #c48955, #4a2c18 62%, #2a180f 100%);
  box-shadow:
    0 0 0 3px rgba(231, 201, 138, 0.5),
    0 18px 40px rgba(0, 0, 0, 0.45);
}

#holeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  background: transparent;
  touch-action: none;
}

.ring-key {
  margin: 8px 0 0;
  text-align: center;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.choice-block {
  margin-top: 12px;
}

.choice-label {
  margin-bottom: 6px;
}

.shelves,
.lures,
.hold-row,
.card-grid,
.stat-grid {
  display: grid;
  gap: 8px;
}

.shelves,
.lures,
.hold-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hold-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shelf,
.lure,
.hold-btn,
.drop {
  min-width: 0;
}

.shelf {
  min-height: 52px;
  padding: 8px 4px;
  border-radius: 12px 12px 3px 3px;
  border: 1px solid rgba(190, 230, 245, 0.28);
  background: rgba(8, 28, 40, 0.72);
  color: #d7f1fa;
}

.shelf b,
.shelf small,
.lure span,
.lure small {
  display: block;
  overflow-wrap: anywhere;
}

.shelf b {
  font-size: 13px;
  font-weight: 700;
}

.shelf small,
.lure small {
  margin-top: 2px;
  color: #9ecbda;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.shelf.is-on {
  background: linear-gradient(180deg, rgba(90, 210, 230, 0.34), rgba(8, 28, 40, 0.88));
  border-color: rgba(160, 244, 255, 0.75);
}

.lure {
  padding: 10px 4px 8px;
  border: 0;
  border-radius: 22px;
  color: #f4fbff;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(180deg, #1c5870, #0a2432);
  box-shadow:
    inset 0 0 0 2px rgba(231, 201, 138, 0.48),
    inset 0 -10px 14px rgba(0, 0, 0, 0.38);
}

.lure span {
  font-size: 12px;
  font-weight: 700;
}

.lure.is-on {
  box-shadow:
    inset 0 0 0 2px var(--cyan),
    0 0 18px rgba(90, 220, 255, 0.4);
}

.lure[data-tone="amber"] {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 236, 200, 0.5), transparent 34%),
    linear-gradient(180deg, #8a5a24, #3c2612);
}

.lure[data-tone="crimson"] {
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 190, 190, 0.4), transparent 34%),
    linear-gradient(180deg, #7a2434, #3a121c);
}

.shelf:disabled,
.lure:disabled {
  opacity: 0.55;
}

.hint,
.lead,
.paper p,
.note-card p,
.entry p,
.quiet {
  overflow-wrap: anywhere;
}

.hint {
  min-height: 2.8em;
  margin: 10px 0 0;
  color: #d5eef8;
  font-size: 14px;
}

.hold-label {
  margin: 10px 0 6px;
  text-align: center;
  font-family: var(--display);
  font-size: 22px;
}

.actions {
  margin-top: 8px;
}

.drop {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 0%, #bdf8ff, #14b8d4 46%, #0c6e86);
  color: #042028;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    0 10px 24px rgba(20, 184, 212, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.drop.is-hot {
  background: radial-gradient(circle at 50% 0%, #ffe7bf, #ffb15a 42%, #d47a22);
  box-shadow:
    0 10px 24px rgba(212, 122, 34, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.drop:disabled {
  opacity: 0.45;
}

.hold-btn {
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #042028;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#easeBtn {
  background: linear-gradient(#e7fbff, #7fd0e4);
}

#haulBtn {
  background: linear-gradient(#ffe6c2, #f0a04a);
}

.text-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: #d5f3ff;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger-text {
  color: #f0b4b8;
}

.status {
  min-height: 2.6em;
  margin: 8px 0 0;
  color: var(--amber);
  font-size: 14px;
}

.ice-notes {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.note-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border-radius: 18px;
  background: rgba(5, 22, 32, 0.78);
  border: 1px solid rgba(180, 226, 240, 0.18);
}

.note-card img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  background: #0b3040;
}

.note-card img.fit {
  object-fit: contain;
  background: radial-gradient(circle at 50% 40%, #16485c, #061820 75%);
}

.note-card h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}

.note-card p,
.lead {
  margin: 0;
  color: #d5e7f0;
  font-size: 14px;
}

.banner {
  width: 100%;
  height: 132px;
  margin-bottom: 12px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(240, 212, 138, 0.28);
}

.lead {
  margin-bottom: 12px;
}

.paper {
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 28%),
    var(--paper);
  color: var(--paper-ink);
  color-scheme: light;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.paper h3 {
  margin: 0;
  font-size: 28px;
}

.paper-head p {
  margin: 4px 0 12px;
  color: #3d6270;
  font-size: 14px;
}

.paper label {
  display: block;
  min-width: 0;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paper input,
.paper select,
.paper textarea,
.sheet-card textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid #9ec5d4;
  border-radius: 12px;
  background: #f7fcff;
  color: var(--paper-ink);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.paper textarea,
.sheet-card textarea {
  min-height: 88px;
  resize: vertical;
}

.paper .drop {
  margin-top: 4px;
}

.count,
.form-error,
.form-status {
  margin: 0 0 8px;
  font-size: 13px;
}

.form-error {
  min-height: 1.2em;
  color: #9d2430;
}

.form-status {
  color: #0e5f46;
}

.sheet-card .count {
  color: var(--muted);
}

.ledger-list {
  min-width: 0;
}

.entry {
  min-width: 0;
  margin-bottom: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(6, 24, 36, 0.8);
  border: 1px solid rgba(170, 220, 236, 0.2);
  border-left: 4px solid var(--entry, #7fd0e4);
}

.entry h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.entry .meta,
.entry .when {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.entry .when {
  font-variant-numeric: tabular-nums;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.entry-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(180, 230, 245, 0.35);
  background: rgba(255, 255, 255, 0.05);
  color: #e7f6ff;
}

.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fish-card,
.stat-tile,
.diagram,
.spark {
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: rgba(6, 24, 36, 0.78);
  border: 1px solid rgba(170, 220, 236, 0.18);
}

.fish-card h3,
.stat-tile b,
.diagram h3,
.spark h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.fish-card h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
}

.fish-card p,
.stat-tile span,
.diagram p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.fish-portrait,
.sheet-portrait {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 42%, #16485c, #061820 74%);
}

.fish-portrait {
  height: 92px;
  margin-bottom: 8px;
}

.fish-portrait img,
.fish-portrait svg,
.sheet-portrait img,
.sheet-portrait svg {
  width: 86%;
  height: 74px;
  object-fit: contain;
}

.fish-portrait.is-pale {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 40%),
    repeating-linear-gradient(135deg, rgba(190, 226, 238, 0.16) 0 6px, transparent 6px 12px),
    #102c3a;
}

.fish-card.is-pale h3 {
  color: #b7d5e2;
}

.stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
}

.stat-tile b {
  display: block;
  font-family: var(--display);
  font-size: clamp(22px, 6vw, 32px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.diagram,
.spark {
  margin-top: 10px;
}

.diagram h3,
.spark h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
}

.bar-row span:first-child {
  overflow-wrap: anywhere;
}

.track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1c8ea8, #d7f7ff);
}

.fill.amber {
  background: linear-gradient(90deg, #a86a28, #ffe1ad);
}

.fill.crimson {
  background: linear-gradient(90deg, #8d2a3a, #ffb3b8);
}

.bar-row b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.spark svg {
  display: block;
  width: 100%;
  height: 84px;
  margin-top: 8px;
}

.spark polyline {
  fill: none;
  stroke: #9af4ff;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(2, 10, 16, 0.72);
}

.sheet[hidden] {
  display: none !important;
}

.sheet-card {
  width: min(100%, 440px);
  max-height: 85vh;
  overflow: auto;
  padding: 16px 16px 20px;
  border-radius: 22px 22px 16px 16px;
  background:
    linear-gradient(180deg, rgba(18, 58, 74, 0.4), transparent 24%),
    #08202c;
  border: 1px solid rgba(240, 212, 138, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.sheet-portrait {
  height: 140px;
  margin: 8px 0 10px;
}

.sheet-portrait img,
.sheet-portrait svg {
  width: 78%;
  height: 112px;
}

.sheet-card h2 {
  margin: 0;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 0.95;
}

.sheet-card p {
  overflow-wrap: anywhere;
}

#sheetMeta {
  margin: 6px 0 12px;
  color: var(--amber);
}

.sheet-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.noscript {
  position: relative;
  z-index: 2;
  padding: 24px;
}

.empty {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(6, 24, 36, 0.72);
  color: var(--muted);
}

@media (max-width: 340px) {
  .note-card,
  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .note-card img {
    width: 100%;
    height: 120px;
  }
}

@media (max-height: 520px) {
  .bezel {
    width: min(46vh, 100%);
  }

  .banner {
    height: 88px;
  }
}

@media (min-width: 700px) {
  .shell {
    width: min(100%, 960px);
  }

  .hole-layout {
    display: grid;
    grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
  }

  .bezel {
    width: min(100%, 52vh, 420px);
  }

  .ice-notes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .note-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .note-card img {
    width: 100%;
    height: 110px;
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (hover: hover) {
  .drop:hover,
  .hold-btn:hover,
  .shelf:hover,
  .lure:hover {
    filter: brightness(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .drop,
  .ridge button,
  .shelf,
  .lure {
    transition: none;
  }
}

@supports (height: 100dvh) {
  .sheet-card {
    max-height: min(92dvh, 680px);
  }
}
