:root {
  color-scheme: dark;
  --ink: #0b171a;
  --panel: rgba(10, 23, 26, 0.9);
  --panel-soft: rgba(12, 29, 32, 0.78);
  --panel-solid: #10292d;
  --panel-border: rgba(255, 232, 194, 0.2);
  --ivory: #f8e6c8;
  --ivory-bright: #fff5e2;
  --muted: rgba(248, 230, 200, 0.68);
  --muted-dark: #6f7e7e;
  --amber: #f3aa2d;
  --amber-bright: #ffc24d;
  --amber-deep: #c87718;
  --safe: #64a85f;
  --safe-bright: #8dca72;
  --danger: #df5a3f;
  --water: #0c6670;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 50px rgba(0, 8, 10, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #132c32;
}

body {
  color: var(--ivory);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(15px, 0.9vw, 18px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

button,
kbd {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 3px solid var(--amber-bright);
  outline-offset: 3px;
}

svg {
  display: block;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  cursor: grab;
}

#gameCanvas.dragging {
  cursor: grabbing;
}

body[data-mode="fishing"] #gameCanvas {
  cursor: crosshair;
}

.glass-panel {
  background: linear-gradient(145deg, rgba(19, 38, 41, 0.94), rgba(7, 18, 21, 0.9));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
}

.game-ui,
.fishing-ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}

.game-ui.hidden,
.fishing-ui:not(.active) {
  opacity: 0;
  visibility: hidden;
}

.fishing-ui.active {
  opacity: 1;
  visibility: visible;
}

.mobile-explore-controls,
.mobile-fishing-controls {
  display: none;
}

.top-hud,
.fishing-topbar {
  position: absolute;
  top: clamp(14px, 2.2vh, 26px);
  left: clamp(14px, 1.8vw, 30px);
  right: clamp(14px, 1.8vw, 30px);
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr minmax(420px, auto);
  align-items: start;
  gap: 18px;
}

.profile-panel {
  width: min(100%, 320px);
  padding: 15px 17px 13px;
  border-radius: var(--radius-md);
}

.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.profile-heading div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-heading strong,
.session-card > strong {
  color: var(--amber-bright);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.profile-heading div > span {
  color: var(--ivory);
  font-size: 0.82rem;
}

.level-chip {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(255, 194, 77, 0.54);
  border-radius: 6px;
  color: var(--amber-bright);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.xp-track {
  height: 6px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
}

.xp-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber-bright));
  transition: width 0.5s var(--ease);
}

.xp-label {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.objective-panel {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: min(350px, 100%);
  padding: 12px 18px;
  border-radius: 14px;
}

.objective-panel > div {
  display: grid;
}

.objective-panel small,
.next-hint small,
.menu-card header small,
.catch-kicker {
  color: var(--amber-bright);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.objective-panel strong {
  color: var(--ivory-bright);
  font-size: 0.94rem;
  font-weight: 750;
}

.objective-diamond,
.waypoint-gem {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 3px solid var(--amber-bright);
  transform: rotate(45deg);
  filter: drop-shadow(0 0 6px rgba(243, 170, 45, 0.55));
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-button,
.coin-counter,
.leave-button {
  height: 46px;
  border-radius: 13px;
}

.hud-button,
.leave-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  color: var(--ivory);
  font-size: 0.82rem;
  font-weight: 700;
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s;
}

.hud-button:hover,
.leave-button:hover {
  border-color: rgba(255, 194, 77, 0.66);
  transform: translateY(-2px);
  background: linear-gradient(145deg, rgba(31, 55, 56, 0.96), rgba(10, 25, 27, 0.94));
}

.hud-button:active,
.leave-button:active {
  transform: translateY(0);
}

.hud-button svg,
.coin-counter svg,
.map-detail svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hud-button i {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(255, 194, 77, 0.16);
  color: var(--amber-bright);
  font-size: 0.62rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.hud-button.icon-only {
  width: 46px;
  padding: 0;
}

.coin-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--amber-bright);
  font-variant-numeric: tabular-nums;
}

.coin-counter b {
  color: var(--ivory-bright);
  font-size: 0.9rem;
}

.world-waypoint {
  position: absolute;
  left: 50%;
  top: 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
  transition: opacity 0.2s;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.45));
}

.world-waypoint .waypoint-gem {
  width: 20px;
  height: 20px;
  border-width: 4px;
  animation: waypointFloat 1.7s ease-in-out infinite;
}

.world-waypoint > i {
  width: 2px;
  height: 33px;
  margin-top: 7px;
  background: linear-gradient(var(--amber-bright), transparent);
}

.world-waypoint > b {
  margin-top: -2px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(5, 17, 19, 0.78);
  color: var(--ivory-bright);
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@keyframes waypointFloat {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(-7px) rotate(45deg); }
}

.world-label {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 0.2s;
}

.world-label span {
  display: block;
  padding: 6px 10px;
  border: 1px solid rgba(255, 220, 161, 0.5);
  border-radius: 7px;
  background: rgba(10, 25, 27, 0.82);
  color: var(--ivory-bright);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

.controls-hint,
.fishing-controls-hint {
  position: absolute;
  left: clamp(14px, 1.8vw, 30px);
  bottom: clamp(14px, 2.2vh, 26px);
  display: flex;
  gap: 15px;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--ivory);
  font-size: 0.7rem;
}

.controls-hint span,
.fishing-controls-hint span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

kbd {
  padding: 2px 6px;
  border: 1px solid rgba(255, 230, 190, 0.44);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ivory-bright);
  font-size: 0.64rem;
  font-weight: 750;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.11);
}

.mouse-glyph {
  position: relative;
  width: 12px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 7px;
}

.mouse-glyph::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  height: 4px;
  border-left: 1.5px solid currentColor;
}

.context-action {
  position: absolute;
  left: 50%;
  bottom: clamp(26px, 4.2vh, 48px);
  display: grid;
  grid-template-columns: 50px 1fr 38px;
  align-items: center;
  gap: 14px;
  min-width: min(440px, calc(100vw - 28px));
  padding: 13px 16px;
  border-color: rgba(255, 194, 77, 0.56);
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transform: translate(-50%, 22px) scale(0.97);
  transition: opacity 0.25s, transform 0.28s var(--ease), border-color 0.2s;
}

.context-action.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.context-action:hover {
  border-color: var(--amber-bright);
  transform: translate(-50%, -3px) scale(1.01);
}

.context-key {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--amber-bright);
  border-radius: 10px;
  color: var(--amber-bright);
  font-size: 1.2rem;
  font-weight: 800;
}

.context-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.context-copy strong {
  color: var(--ivory-bright);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.context-copy small {
  color: var(--muted);
  font-size: 0.75rem;
}

.bobber-icon {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(#e9573f 0 48%, #f8e6c8 49% 100%);
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.15);
}

.bobber-icon i {
  position: absolute;
  left: 50%;
  top: -9px;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--ivory-bright);
  transform: translateX(-50%);
}

/* Fishing HUD */
.fishing-topbar {
  grid-template-columns: 230px 1fr 230px;
}

.session-card {
  display: grid;
  width: 230px;
  padding: 13px 16px;
  border-radius: 15px;
}

.session-card > strong {
  margin-bottom: 4px;
}

.session-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.session-card span b {
  color: var(--ivory-bright);
}

.session-card .line-rating {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(248, 230, 200, 0.13);
  color: #9fe2b7;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}
.session-card .fishing-rig-chip { overflow: hidden; margin-top: 4px; color: var(--amber-bright); font-size: 0.58rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }

.step-tracker {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 15px;
  list-style: none;
}

.step-tracker li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.25s;
}

.step-tracker li + li::before {
  content: "";
  width: 30px;
  height: 1px;
  margin-right: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.step-tracker i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(248, 230, 200, 0.35);
  border-radius: 50%;
  font-size: 0.7rem;
  font-style: normal;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.step-tracker li.active {
  color: var(--ivory-bright);
}

.step-tracker li.active i {
  border-color: var(--amber-bright);
  background: var(--amber);
  color: #1d221d;
  box-shadow: 0 0 14px rgba(243, 170, 45, 0.34);
}

.step-tracker li.complete i {
  border-color: var(--safe-bright);
  background: rgba(100, 168, 95, 0.2);
  color: var(--safe-bright);
}

.leave-button {
  justify-self: end;
  pointer-events: auto;
}

.leave-button kbd {
  padding: 4px 7px;
}

.aim-reticle {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 22px;
  height: 22px;
  opacity: 0.95;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: opacity 0.2s;
}

.aim-reticle::before,
.aim-reticle::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--amber-bright);
}

.aim-reticle::after {
  inset: 6px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.85);
}

.aim-reticle.hidden {
  opacity: 0;
}

.bobber-focus {
  position: absolute;
  left: 50%;
  top: 48%;
  display: none;
  width: 88px;
  height: 34px;
  border: 2px solid rgba(184, 239, 237, 0.75);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(119, 220, 217, 0.3);
}

.bobber-focus.visible {
  display: block;
  animation: waterFocus 1.6s ease-out infinite;
}

.bobber-focus.bite {
  border-color: var(--amber-bright);
  box-shadow: 0 0 24px rgba(255, 179, 46, 0.65);
  animation-duration: 0.48s;
}

@keyframes waterFocus {
  0% { transform: translate(-50%, -50%) scale(0.72); opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.next-hint {
  position: absolute;
  right: clamp(14px, 2.2vw, 38px);
  top: 47%;
  width: min(270px, 26vw);
  padding: 13px 15px;
  border-radius: 14px;
  border-color: rgba(243, 170, 45, 0.38);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.next-hint p {
  margin-top: 3px;
  color: var(--ivory-bright);
  font-size: 0.8rem;
  line-height: 1.45;
}

.fishing-controls-hint {
  z-index: 2;
}

.fishing-command {
  position: absolute;
  left: 50%;
  bottom: clamp(22px, 4vh, 46px);
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(590px, calc(100vw - 36px));
  transform: translateX(-50%);
}

.game-meter {
  width: min(520px, 100%);
  padding: 10px 14px 13px;
  border-radius: 14px;
}

.game-meter.hidden {
  display: none;
}

.meter-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.meter-labels strong {
  color: var(--ivory-bright);
  font-size: 0.64rem;
}

.meter-labels span:last-child {
  text-align: right;
}

.meter-track {
  position: relative;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #49665d, #476b64);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.36);
}

.meter-track .safe-zone {
  position: absolute;
  left: 20%;
  top: 0;
  width: 64%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #579851, #79b964);
}

.meter-track > i {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.1);
}

.meter-track > b {
  position: absolute;
  left: 0;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 3px solid var(--amber-bright);
  background: #172628;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 10px rgba(243, 170, 45, 0.42);
  transition: border-color 0.12s;
}

.game-meter.tension .meter-track {
  background: linear-gradient(90deg, #4b8f55 0 58%, #d29a39 72%, #d6533d 100%);
}

.game-meter.tension .safe-zone {
  left: 0;
  width: 65%;
  background: rgba(133, 209, 112, 0.38);
}

.game-meter.tension.danger > .meter-track > b {
  border-color: #ff7657;
  box-shadow: 0 0 13px rgba(255, 91, 57, 0.72);
}

.command-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  min-height: 102px;
  padding: 16px 24px;
  border-color: rgba(243, 170, 45, 0.46);
  border-radius: 19px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s var(--ease), background 0.2s;
}

.command-card.bite {
  border-color: var(--amber-bright);
  background: linear-gradient(145deg, rgba(76, 45, 13, 0.96), rgba(19, 29, 27, 0.95));
  animation: commandPulse 0.55s ease-in-out infinite alternate;
}

@keyframes commandPulse {
  to { transform: translateY(-3px) scale(1.015); box-shadow: 0 22px 60px rgba(245, 157, 31, 0.28); }
}

.command-card > div {
  display: grid;
}

.command-card strong {
  color: var(--ivory-bright);
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  font-weight: 850;
  letter-spacing: 0.018em;
  line-height: 1.15;
  text-transform: uppercase;
}

.command-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.command-input {
  position: relative;
  width: 40px;
  height: 55px;
  flex: 0 0 auto;
  border: 2px solid var(--ivory);
  border-radius: 18px;
}

.command-input::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  height: 14px;
  border-left: 2px solid var(--amber-bright);
}

.command-input i {
  position: absolute;
  left: -6px;
  top: 24px;
  width: 50px;
  border-top: 1px solid rgba(248, 230, 200, 0.45);
}

/* Modal surfaces */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(5, 15, 17, 0.68);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: opacity 0.22s, visibility 0.22s;
}

.modal-layer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  width: min(650px, 100%);
  border: 1px solid rgba(255, 226, 184, 0.2);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(18, 42, 44, 0.98), rgba(8, 22, 25, 0.99));
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.3s var(--ease);
}

.modal-layer.open .modal-card {
  transform: translateY(0) scale(1);
}

.menu-card {
  padding: 24px;
}

.menu-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.menu-card h2,
.catch-body h2 {
  color: var(--ivory-bright);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.close-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(5deg);
}

.close-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 780;
  transition: transform 0.18s var(--ease), filter 0.18s, background 0.18s;
}

.primary-button {
  border: 1px solid var(--amber-bright);
  background: linear-gradient(180deg, var(--amber-bright), #dd8b1d);
  color: #1b241f;
  box-shadow: 0 9px 24px rgba(219, 128, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: saturate(0.2);
  opacity: 0.45;
}

.secondary-button {
  border: 1px solid rgba(248, 230, 200, 0.28);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ivory);
}

.wide-button {
  width: 100%;
}

.loadout-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(243, 170, 45, 0.25);
  border-radius: 13px;
  background: rgba(243, 170, 45, 0.065);
}

.loadout-strip span,
.loadout-strip i {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.loadout-strip b {
  color: var(--ivory-bright);
  font-size: 0.86rem;
}

.catch-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.empty-catch-list {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 24px;
  border: 1px dashed rgba(248, 230, 200, 0.19);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.empty-catch-list svg {
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
  fill: none;
  stroke: var(--amber-bright);
  stroke-width: 1.5;
}

.catch-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(248, 230, 200, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.catch-row img {
  width: 48px;
  height: 34px;
  object-fit: contain;
  image-rendering: auto;
}

.catch-row > div {
  display: grid;
}

.catch-row b {
  color: var(--ivory-bright);
  font-size: 0.82rem;
}

.catch-row span {
  color: var(--muted);
  font-size: 0.68rem;
}

.catch-row em {
  color: var(--amber-bright);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 750;
}

/* Catch card */
.catch-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(330px, 1.1fr);
  width: min(790px, 100%);
  overflow: hidden;
}

.catch-visual {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  background: radial-gradient(circle at 55% 40%, #2d8790, #104852 55%, #09272e);
}

.catch-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(255, 202, 125, 0.14), transparent 42%);
  pointer-events: none;
}

.catch-visual canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.catch-visual canvas:active {
  cursor: grabbing;
}

.rarity-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(8, 24, 27, 0.72);
  color: var(--ivory-bright);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rarity-tag.uncommon { color: #a9dfc3; }
.rarity-tag.rare { color: #cbb9ff; }
.rarity-tag.legendary { color: var(--amber-bright); }

.rotate-note {
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
}

.catch-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.catch-body h2 {
  margin-top: 5px;
}

.catch-body > p {
  margin: 11px 0 21px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.catch-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 24px;
  padding: 15px 0;
  border-top: 1px solid rgba(248, 230, 200, 0.15);
  border-bottom: 1px solid rgba(248, 230, 200, 0.15);
}

.catch-stats div {
  display: grid;
  text-align: center;
}

.catch-stats div + div {
  border-left: 1px solid rgba(248, 230, 200, 0.13);
}

.catch-stats b {
  color: var(--ivory-bright);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.catch-stats span {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catch-actions {
  display: grid;
  grid-template-columns: 0.9fr 1.25fr;
  gap: 10px;
}

/* Map */
.map-illustration {
  position: relative;
  height: 310px;
  overflow: hidden;
  border: 1px solid rgba(248, 230, 200, 0.14);
  border-radius: 16px;
  background: #375c46;
  box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.18);
}

.map-water {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 8%;
  bottom: 9%;
  border-radius: 46% 54% 49% 51% / 40% 43% 57% 60%;
  background: repeating-radial-gradient(ellipse at center, #1c7180 0 8px, #216a77 9px 16px);
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 8px rgba(227, 192, 123, 0.36), 0 0 0 13px rgba(22, 59, 42, 0.34);
}

.map-shore::before,
.map-shore::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle, #284e36 0 14%, transparent 15%) 0 0 / 25px 25px;
}

.map-shore::before { left: 4%; top: 11%; }
.map-shore::after { right: 4%; top: 19%; }

.map-pier {
  position: absolute;
  left: 50%;
  bottom: 7%;
  width: 20px;
  height: 100px;
  border: 2px solid #3b281c;
  background: repeating-linear-gradient(0deg, #9c6235 0 8px, #714525 9px 11px);
  transform: translateX(-50%);
}

.map-place {
  position: absolute;
  padding: 4px 7px;
  border-radius: 5px;
  background: #e6c27f;
  color: #2a352c;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.map-place.shop { left: 10%; bottom: 15%; }
.map-place.market { right: 8%; bottom: 20%; }

.map-player,
.map-hotspot {
  position: absolute;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.map-player {
  bottom: 8%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ivory-bright);
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(243, 170, 45, 0.22);
}

.map-hotspot {
  top: 38%;
  width: 18px;
  height: 18px;
  border: 4px solid var(--amber-bright);
  border-radius: 3px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.map-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.map-detail > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.map-detail svg {
  width: 26px;
  height: 26px;
  color: var(--amber-bright);
}

.map-detail p {
  display: grid;
}

.map-detail strong { color: var(--ivory-bright); }
.map-detail span { color: var(--muted); font-size: 0.7rem; }

/* Guide and shop */
.guide-steps {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.guide-steps article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  padding: 13px;
  border: 1px solid rgba(248, 230, 200, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.guide-steps article > i,
.gear-orb {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(243, 170, 45, 0.54);
  border-radius: 50%;
  background: rgba(243, 170, 45, 0.1);
  color: var(--amber-bright);
  font-style: normal;
  font-weight: 850;
}

.guide-steps h3 {
  color: var(--ivory-bright);
  font-size: 0.94rem;
}

.guide-steps p,
.shop-intro {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.shop-intro {
  margin: -5px 0 18px;
}

.gear-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 13px;
  margin-top: 9px;
  padding: 13px;
  border: 1px solid rgba(248, 230, 200, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.gear-row > div:nth-child(2) {
  display: grid;
}

.gear-row b { color: var(--ivory-bright); font-size: 0.86rem; }
.gear-row span { color: var(--muted); font-size: 0.7rem; }
.gear-row em { color: var(--amber-bright); font-size: 0.7rem; font-style: normal; font-weight: 750; }
.gear-row.locked { opacity: 0.56; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 30px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 196, 76, 0.5);
  border-radius: 11px;
  opacity: 0;
  pointer-events: none;
  background: rgba(8, 23, 25, 0.94);
  color: var(--ivory-bright);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
  text-align: center;
  transform: translate(-50%, 20px);
  transition: opacity 0.22s, transform 0.28s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Loading */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, #16454c, #091d21 68%);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.loading-screen.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-mark {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
}

.loading-mark span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(132, 214, 209, 0.55);
  animation: loadRipple 1.45s ease-out infinite;
}

.loading-mark i {
  position: absolute;
  left: 25px;
  top: 10px;
  width: 14px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(#e9573f 0 48%, #f8e6c8 49% 100%);
  animation: loadBob 1.45s ease-in-out infinite;
}

@keyframes loadRipple {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.3); opacity: 0; }
}

@keyframes loadBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.loading-screen h1 {
  color: var(--ivory-bright);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 850;
  letter-spacing: -0.045em;
}

.loading-screen p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.loading-track {
  width: min(280px, 70vw);
  height: 5px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.11);
}

.loading-track i {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber-bright));
  transition: width 0.35s var(--ease);
}

@media (max-width: 1050px) {
  .top-hud,
  .fishing-topbar {
    grid-template-columns: 240px 1fr auto;
  }

  .profile-panel { width: 240px; }
  .objective-panel { min-width: 0; }
  .objective-panel small { display: none; }
  .hud-button span { display: none; }
  .hud-button { width: 46px; padding: 0; }
  .next-hint { width: 230px; }
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  html,
  body {
    height: 100dvh;
    min-height: 100dvh;
  }

  body { font-size: 15px; }

  #gameCanvas,
  .game-ui,
  .fishing-ui,
  .modal-layer {
    height: 100dvh;
  }

  .top-hud,
  .fishing-topbar {
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .profile-panel {
    width: min(225px, 58vw);
    padding: 11px 12px 9px;
  }

  .profile-heading strong { font-size: 0.86rem; }
  .profile-heading div > span { font-size: 0.7rem; }
  .level-chip { display: none; }
  .xp-track { margin-top: 7px; }

  .objective-panel {
    position: absolute;
    top: 64px;
    left: 50%;
    min-width: min(320px, 88vw);
    padding: 8px 12px;
    transform: translateX(-50%);
  }

  .objective-panel strong { font-size: 0.76rem; }
  .objective-diamond { width: 10px; height: 10px; }

  .top-actions { gap: 5px; }
  .coin-counter { display: none; }
  #soundButton { display: none; }
  .hud-button,
  .hud-button.icon-only { width: 40px; height: 40px; border-radius: 11px; }
  .hud-button svg { width: 18px; height: 18px; }
  .hud-button i { display: none; }

  .controls-hint { display: none; }
  .context-action {
    bottom: calc(150px + env(safe-area-inset-bottom));
    grid-template-columns: 42px 1fr 30px;
    min-width: calc(100vw - 28px);
    max-width: 430px;
    padding: 10px 12px;
    gap: 10px;
  }
  .context-key { width: 42px; height: 42px; font-size: 1rem; }
  .context-copy strong { font-size: 0.88rem; }
  .context-copy small { font-size: 0.68rem; }
  .bobber-icon { width: 28px; height: 28px; }

  .mobile-explore-controls {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .move-control {
    position: absolute;
    left: max(16px, env(safe-area-inset-left));
    bottom: calc(16px + env(safe-area-inset-bottom));
    display: grid;
    justify-items: center;
    gap: 5px;
  }

  .mobile-control-label {
    color: rgba(255, 245, 226, 0.82);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  }

  .move-stick {
    position: relative;
    width: 112px;
    height: 112px;
    overflow: hidden;
    border: 1px solid rgba(255, 232, 194, 0.34);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 39, 42, 0.42) 0 28%, rgba(7, 22, 25, 0.76) 29% 100%);
    box-shadow: 0 12px 35px rgba(0, 7, 8, 0.38), inset 0 0 0 11px rgba(255, 255, 255, 0.025), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    pointer-events: auto;
    touch-action: none;
  }

  .move-stick::before,
  .move-stick::after,
  .move-stick-arrows::before,
  .move-stick-arrows::after {
    position: absolute;
    color: rgba(255, 245, 226, 0.42);
    font-size: 12px;
    line-height: 1;
  }

  .move-stick::before { content: "▲"; top: 8px; left: calc(50% - 6px); }
  .move-stick::after { content: "▼"; bottom: 8px; left: calc(50% - 6px); }
  .move-stick-arrows { font-size: 0; }
  .move-stick-arrows::before { content: "◀"; left: 8px; top: calc(50% - 6px); }
  .move-stick-arrows::after { content: "▶"; right: 8px; top: calc(50% - 6px); }

  .move-thumb {
    --stick-x: 0px;
    --stick-y: 0px;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 2px solid rgba(255, 215, 141, 0.8);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 30%, #f8d18c, #d88b24 65%, #9e5714);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.42), inset 0 2px 2px rgba(255, 255, 255, 0.4);
    transform: translate3d(var(--stick-x), var(--stick-y), 0);
    transition: transform 0.1s ease-out, filter 0.15s;
    pointer-events: none;
  }

  .move-stick.active .move-thumb {
    filter: brightness(1.12);
    transition: none;
  }

  .look-touch-hint {
    position: absolute;
    right: max(17px, env(safe-area-inset-right));
    bottom: calc(31px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ivory-bright);
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.55));
    opacity: 1;
    transition: opacity 0.35s;
  }

  .mobile-explore-controls.look-used .look-touch-hint { opacity: 0; }

  .look-touch-hint > span:last-child {
    display: grid;
    text-align: right;
  }

  .look-touch-hint strong {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .look-touch-hint small { color: rgba(255, 245, 226, 0.68); font-size: 0.62rem; }

  .swipe-icon {
    position: relative;
    width: 31px;
    height: 31px;
    border: 1px solid rgba(255, 232, 194, 0.42);
    border-radius: 50%;
    background: rgba(7, 22, 25, 0.68);
  }

  .swipe-icon::before,
  .swipe-icon::after {
    content: "";
    position: absolute;
    top: 14px;
    width: 7px;
    border-top: 1px solid var(--ivory);
  }

  .swipe-icon::before { left: 4px; transform: rotate(-18deg); }
  .swipe-icon::after { right: 4px; transform: rotate(18deg); }
  .swipe-icon i { position: absolute; left: 14px; top: 7px; height: 17px; border-left: 2px solid var(--amber-bright); }

  .fishing-topbar { grid-template-columns: 1fr auto; }
  .session-card { width: 150px; padding: 9px 11px; }
  .session-card > strong { font-size: 0.82rem; }
  .session-card span { font-size: 0.66rem; }
  .step-tracker {
    position: absolute;
    top: 60px;
    left: 50%;
    padding: 7px 9px;
    transform: translateX(-50%);
  }
  .step-tracker li { gap: 5px; font-size: 0.63rem; }
  .step-tracker li + li::before { width: 13px; }
  .step-tracker i { width: 24px; height: 24px; }
  .leave-button { height: 40px; padding: 0 10px; }
  .leave-button span { display: none; }

  .next-hint {
    top: auto;
    right: 12px;
    bottom: calc(224px + env(safe-area-inset-bottom));
    width: 210px;
    padding: 9px 11px;
  }
  .next-hint p { font-size: 0.7rem; }
  .fishing-controls-hint { display: none; }
  .fishing-command {
    bottom: calc(102px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    gap: 7px;
  }
  .game-meter { padding: 8px 10px 10px; }
  .command-card { display: none; }
  .command-card strong { font-size: 1.04rem; }
  .command-card small { font-size: 0.76rem; }
  .command-input { width: 34px; height: 46px; border-radius: 15px; }

  .mobile-fishing-controls {
    position: absolute;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 9px;
    max-width: 470px;
    margin: 0 auto;
    pointer-events: auto;
  }

  .mobile-retrieve-button,
  .mobile-fish-button {
    min-height: 74px;
    border-radius: 20px;
    touch-action: none;
  }

  .mobile-retrieve-button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1px;
    padding: 6px;
    cursor: pointer;
  }

  .mobile-retrieve-button > span { color: var(--amber-bright); font-size: 1.35rem; line-height: 1; }
  .mobile-retrieve-button small { color: var(--ivory); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
  .mobile-retrieve-button:disabled { opacity: 0.36; filter: saturate(0.3); }

  .mobile-fish-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 9px 18px;
    border: 1px solid #ffd078;
    background: linear-gradient(180deg, #ffc75d, #df8d20);
    color: #17231f;
    box-shadow: 0 13px 30px rgba(164, 86, 10, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.52);
    cursor: pointer;
  }

  .mobile-fish-button > span:last-child { display: grid; text-align: left; }
  .mobile-fish-button strong { font-size: 1rem; font-weight: 900; letter-spacing: 0.05em; line-height: 1.05; text-transform: uppercase; }
  .mobile-fish-button small { font-size: 0.67rem; font-weight: 720; opacity: 0.75; }

  .mobile-fish-button-icon {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 2px solid rgba(23, 35, 31, 0.78);
    border-radius: 50%;
  }

  .mobile-fish-button-icon::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 5px;
    height: 23px;
    border-left: 3px solid currentColor;
    transform: rotate(21deg);
    transform-origin: bottom;
  }

  .mobile-fish-button-icon::after {
    content: "";
    position: absolute;
    right: 5px;
    top: 6px;
    width: 10px;
    height: 16px;
    border: 2px solid currentColor;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0 10px 0 0;
  }

  .mobile-fish-button:active,
  .mobile-fish-button.held { transform: translateY(2px) scale(0.985); filter: brightness(0.98); }
  .mobile-fish-button.bite {
    background: linear-gradient(180deg, #ffdf74, #f39b21);
    box-shadow: 0 0 0 5px rgba(255, 190, 66, 0.2), 0 12px 34px rgba(231, 136, 20, 0.56);
    animation: mobileBite 0.46s ease-in-out infinite alternate;
  }
  .mobile-fish-button.danger { background: linear-gradient(180deg, #ff9b65, #dc513a); border-color: #ffc5a7; color: #2a1612; }
  .mobile-fish-button:disabled {
    color: rgba(248, 230, 200, 0.8);
    border-color: rgba(248, 230, 200, 0.25);
    background: linear-gradient(180deg, rgba(23, 49, 51, 0.94), rgba(9, 28, 31, 0.96));
    box-shadow: var(--shadow);
  }

  @keyframes mobileBite {
    to { filter: brightness(1.1); box-shadow: 0 0 0 8px rgba(255, 190, 66, 0.12), 0 14px 38px rgba(231, 136, 20, 0.62); }
  }

  .modal-layer {
    place-items: start center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    -webkit-overflow-scrolling: touch;
  }
  .menu-card { padding: 18px; }
  .loadout-strip { grid-template-columns: auto 1fr; }
  .loadout-strip i { grid-column: 1 / -1; }
  .catch-card { grid-template-columns: 1fr; max-width: 520px; }
  .catch-card,
  .menu-card { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; }
  .catch-visual { min-height: 235px; }
  .catch-body { padding: 22px; }
  .catch-body > p { margin: 8px 0 16px; }
  .catch-stats { margin-bottom: 17px; padding: 11px 0; }
  .map-illustration { height: 250px; }
  .map-detail { align-items: stretch; flex-direction: column; }
  .map-detail .primary-button { width: 100%; }
}

@media (max-height: 650px) and (min-width: 761px) {
  .top-hud,
  .fishing-topbar { top: 10px; }
  .profile-panel { padding: 10px 13px 8px; }
  .xp-track { margin-top: 6px; }
  .fishing-command { bottom: 12px; gap: 6px; }
  .command-card { min-height: 78px; }
  .next-hint { top: 43%; }
  .catch-card { max-height: calc(100vh - 24px); }
  .catch-visual { min-height: 360px; }
}

@media (max-height: 520px) and (orientation: landscape) and (hover: none),
       (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
  .profile-panel { width: 180px; padding: 8px 10px; }
  .profile-heading div > span,
  .xp-track,
  .xp-label { display: none; }
  .objective-panel { top: 49px; min-width: min(310px, 48vw); }
  .context-action { bottom: calc(94px + env(safe-area-inset-bottom)); min-width: min(390px, 50vw); }
  .move-control { bottom: calc(8px + env(safe-area-inset-bottom)); }
  .mobile-control-label { display: none; }
  .move-stick { width: 82px; height: 82px; }
  .move-thumb { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .look-touch-hint { bottom: calc(15px + env(safe-area-inset-bottom)); }

  .fishing-topbar { grid-template-columns: 150px 1fr auto; }
  .step-tracker { position: static; align-self: start; transform: none; }
  .next-hint { right: max(10px, env(safe-area-inset-right)); bottom: calc(90px + env(safe-area-inset-bottom)); width: 190px; }
  .fishing-command { bottom: calc(86px + env(safe-area-inset-bottom)); width: min(440px, 54vw); }
  .mobile-fishing-controls {
    left: auto;
    width: min(360px, 44vw);
    grid-template-columns: 60px minmax(0, 1fr);
  }
  .mobile-retrieve-button,
  .mobile-fish-button { min-height: 62px; border-radius: 17px; }
  .mobile-fish-button-icon { width: 32px; height: 32px; }

  .catch-card {
    grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.1fr);
    max-height: calc(100dvh - 20px);
  }
  .catch-visual { min-height: calc(100dvh - 20px); }
  .catch-body { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   Stillwater Worlds expansion: onboarding, visual market, travel, and social
---------------------------------------------------------------------------- */
:root { --world-accent: #ffc24d; }

.onboarding-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 42px);
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 19, 22, 0.94), rgba(7, 25, 28, 0.77) 55%, rgba(7, 24, 27, 0.9));
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
  transition: opacity 0.38s var(--ease), visibility 0.38s;
}

.onboarding-layer.open { opacity: 1; visibility: visible; pointer-events: auto; }

.onboarding-shell {
  width: min(1180px, 100%);
  border: 1px solid rgba(255, 226, 184, 0.22);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(16, 43, 45, 0.985), rgba(7, 23, 26, 0.995));
  box-shadow: 0 45px 130px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(22px) scale(0.98);
  transition: transform 0.48s var(--ease);
}

.onboarding-layer.open .onboarding-shell { transform: translateY(0) scale(1); }
.onboarding-header,
.onboarding-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 26px; background: rgba(255, 255, 255, 0.022); }
.onboarding-header { border-bottom: 1px solid rgba(255, 232, 194, 0.12); }
.onboarding-footer { border-top: 1px solid rgba(255, 232, 194, 0.12); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup > span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255, 194, 77, 0.5); border-radius: 12px; background: rgba(243, 170, 45, 0.1); color: var(--amber-bright); font-size: 1.55rem; transform: rotate(-12deg); }
.brand-lockup div { display: grid; }
.brand-lockup small,
.section-kicker,
.market-section-heading small,
.trade-side-heading span { color: var(--amber-bright); font-size: 0.64rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.brand-lockup strong { color: var(--ivory-bright); font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.setup-step { padding: 6px 10px; border: 1px solid rgba(248, 230, 200, 0.15); border-radius: 20px; color: var(--muted); font-size: 0.68rem; }
.onboarding-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.78fr); }
.angler-setup { padding: clamp(24px, 4vw, 46px); }
.angler-setup h1 { max-width: 630px; margin: 7px 0 22px; color: var(--ivory-bright); font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 850; line-height: 0.98; letter-spacing: -0.055em; }
.name-field { display: grid; gap: 7px; margin-bottom: 23px; }
.name-field > span { color: var(--ivory-bright); font-size: 0.74rem; font-weight: 780; }
.name-field input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid rgba(255, 226, 184, 0.25); border-radius: 12px; outline: 0; background: rgba(2, 17, 20, 0.62); color: var(--ivory-bright); font: inherit; font-size: 1rem; user-select: text; -webkit-user-select: text; touch-action: manipulation; transition: border-color 0.18s, box-shadow 0.18s; }
.name-field input:focus { border-color: var(--amber-bright); box-shadow: 0 0 0 3px rgba(255, 194, 77, 0.12); }
.name-field small { color: var(--muted); font-size: 0.64rem; }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.character-card { position: relative; display: grid; gap: 2px; min-width: 0; padding: 0 9px 12px; border: 1px solid rgba(248, 230, 200, 0.13); border-radius: 15px; overflow: hidden; background: rgba(255, 255, 255, 0.035); color: var(--ivory); cursor: pointer; text-align: left; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s; }
.character-card:hover { transform: translateY(-3px); border-color: rgba(255, 194, 77, 0.48); }
.character-card.selected { border-color: var(--amber-bright); background: rgba(243, 170, 45, 0.09); box-shadow: inset 0 0 0 1px rgba(255, 194, 77, 0.22); }
.character-stage { display: grid; place-items: center; height: 142px; margin: 0 -9px 9px; overflow: hidden; background: radial-gradient(circle at 50% 58%, rgba(54, 126, 129, 0.62), rgba(9, 41, 45, 0.12) 70%); }
.character-stage img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.25)); }
.character-card b { overflow: hidden; color: var(--ivory-bright); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.character-card small { overflow: hidden; color: var(--muted); font-size: 0.61rem; text-overflow: ellipsis; white-space: nowrap; }
.character-card > i { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; opacity: 0; background: var(--amber-bright); color: #13211e; font-size: 0.72rem; font-style: normal; font-weight: 900; transform: scale(0.7); transition: opacity 0.2s, transform 0.2s var(--ease); }
.character-card.selected > i { opacity: 1; transform: scale(1); }
.starter-kit { display: flex; flex-direction: column; gap: 20px; padding: clamp(24px, 3.3vw, 42px); border-left: 1px solid rgba(255, 232, 194, 0.12); background: linear-gradient(155deg, rgba(8, 33, 36, 0.58), rgba(3, 17, 20, 0.72)); }
.starter-kit h2 { margin-top: 4px; color: var(--ivory-bright); font-size: clamp(1.55rem, 2.2vw, 2.1rem); letter-spacing: -0.035em; }
.starter-kit > div > p { margin-top: 5px; color: var(--muted); font-size: 0.75rem; }
.starter-items { display: grid; gap: 8px; }
.starter-items article { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 11px; min-height: 76px; padding: 7px 10px 7px 7px; border: 1px solid rgba(248, 230, 200, 0.11); border-radius: 13px; background: rgba(255, 255, 255, 0.035); }
.starter-items article > span { display: grid; place-items: center; width: 70px; height: 60px; border-radius: 9px; background: radial-gradient(circle, rgba(46, 116, 121, 0.65), rgba(8, 35, 39, 0.4)); }
.starter-items img { width: 100%; height: 100%; object-fit: contain; }
.starter-items article > div { display: grid; }
.starter-items b { color: var(--ivory-bright); font-size: 0.78rem; }
.starter-items small { color: var(--muted); font-size: 0.62rem; }
.starter-items em { color: #9fd7b0; font-size: 0.59rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.starter-tip { display: flex; gap: 11px; margin-top: auto; padding: 13px; border: 1px solid rgba(255, 194, 77, 0.22); border-radius: 12px; background: rgba(243, 170, 45, 0.065); }
.starter-tip > span { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border: 1px solid var(--amber-bright); border-radius: 50%; color: var(--amber-bright); font: 800 0.7rem serif; }
.starter-tip p { color: var(--muted); font-size: 0.67rem; }
.starter-tip strong { color: var(--ivory); }
.onboarding-footer p { color: var(--muted); font-size: 0.66rem; }
.onboarding-footer p span { color: #79c596; }
.enter-world-button { min-width: 230px; }
.enter-world-button span { margin-left: 18px; font-size: 1.1rem; }

.market-world-label span { display: grid; padding: 9px 13px; border-color: rgba(255, 194, 77, 0.8); background: linear-gradient(145deg, rgba(67, 42, 14, 0.94), rgba(10, 28, 29, 0.94)); box-shadow: 0 0 0 4px rgba(255, 179, 52, 0.1), 0 9px 25px rgba(0, 0, 0, 0.42); text-align: center; }
.market-world-label b { color: var(--amber-bright); font-size: 0.71rem; }
.market-world-label small { margin-top: 1px; color: var(--ivory); font-size: 0.51rem; letter-spacing: 0.075em; }
.online-button:not(.offline) > i { background: rgba(77, 188, 120, 0.18); color: #8ed8a8; }
.online-button.offline { opacity: 0.65; }

.bag-card { width: min(720px, 100%); }
.loadout-strip { grid-template-columns: 76px 1fr auto; }
.loadout-thumb { display: grid; place-items: center; width: 72px; height: 62px; border-radius: 10px; background: radial-gradient(circle, rgba(48, 117, 122, 0.58), rgba(7, 31, 35, 0.4)); }
.loadout-thumb img { width: 100%; height: 100%; object-fit: contain; }
.loadout-strip > div { display: grid; }
.loadout-strip > em { color: var(--amber-bright); font-size: 0.7rem; font-style: normal; font-weight: 800; }
.supply-pills { display: flex; gap: 8px; margin: -5px 0 17px; }
.supply-pills > span { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 20px; color: var(--muted); font-size: 0.68rem; }
.supply-pills img { width: 27px; height: 22px; object-fit: contain; }
.supply-pills b { color: var(--ivory-bright); }
.bag-subtitle { margin-bottom: 8px; color: var(--ivory-bright); font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; }
.map-route-actions { display: flex; gap: 8px; }

.expanded-card { width: min(1140px, 100%); }
.expanded-card > header { align-items: center; }
.expanded-card > header > div > p { max-width: 630px; margin-top: 5px; color: var(--muted); font-size: 0.73rem; }
.market-card { max-height: min(790px, calc(100dvh - 34px)); overflow: auto; }
.market-card > header { display: grid; grid-template-columns: 1fr auto auto; }
.market-wallet { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid rgba(255, 194, 77, 0.26); border-radius: 11px; background: rgba(243, 170, 45, 0.07); }
.market-wallet svg,
.gear-price svg,
.scale-readout svg,
.sell-fish-card em svg { width: 17px; height: 17px; fill: none; stroke: var(--amber-bright); stroke-width: 1.8; }
.market-wallet b { color: var(--ivory-bright); }
.market-tabs { display: flex; gap: 5px; margin-bottom: 16px; padding: 4px; border: 1px solid rgba(248, 230, 200, 0.1); border-radius: 13px; background: rgba(0, 0, 0, 0.14); }
.market-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.market-tabs button.active { background: rgba(243, 170, 45, 0.14); color: var(--amber-bright); box-shadow: inset 0 0 0 1px rgba(255, 194, 77, 0.28); }
.market-tabs i { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; border-radius: 10px; background: rgba(255, 255, 255, 0.09); font-size: 0.62rem; font-style: normal; }
[data-market-panel] { display: none; }
[data-market-panel].active { display: block; }
.market-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.market-section-heading h3 { margin-top: 2px; color: var(--ivory-bright); font-size: 1.13rem; }
.market-section-heading > span { padding: 5px 9px; border: 1px solid rgba(255, 194, 77, 0.24); border-radius: 7px; color: var(--amber-bright); font-size: 0.65rem; font-weight: 800; }
.text-button { border: 0; background: transparent; color: var(--amber-bright); cursor: pointer; font-size: 0.69rem; font-weight: 800; }
.market-loadout { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin-bottom: 10px; overflow: hidden; border: 1px solid rgba(139, 220, 169, 0.17); border-radius: 12px; background: rgba(62, 154, 102, 0.055); }
.market-loadout > span { display: grid; gap: 1px; min-width: 0; padding: 9px 12px; border-right: 1px solid rgba(248, 230, 200, 0.09); }
.market-loadout > span:last-child { border-right: 0; }
.market-loadout small { color: var(--muted); font-size: 0.54rem; letter-spacing: 0.06em; text-transform: uppercase; }
.market-loadout b { overflow: hidden; color: #adE8c1; font-size: 0.69rem; text-overflow: ellipsis; white-space: nowrap; }
.gear-filters { display: flex; gap: 6px; margin-bottom: 11px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.gear-filters button { flex: 0 0 auto; min-height: 32px; padding: 6px 11px; border: 1px solid rgba(248, 230, 200, 0.13); border-radius: 8px; background: rgba(255, 255, 255, 0.025); color: var(--muted); cursor: pointer; font-size: 0.6rem; font-weight: 800; }
.gear-filters button.active { border-color: rgba(255, 194, 77, 0.54); background: rgba(243, 170, 45, 0.11); color: var(--amber-bright); }
.gear-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: 430px; overflow: auto; padding: 1px 3px 4px 1px; }
.gear-card { position: relative; display: grid; min-width: 0; padding: 0; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, 0.035); color: var(--ivory); cursor: pointer; text-align: left; transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s; }
.gear-card:hover { transform: translateY(-2px); border-color: rgba(255, 194, 77, 0.48); }
.gear-card.equipped { border-color: var(--amber-bright); background: rgba(243, 170, 45, 0.07); }
.gear-card.owned:not(.equipped) { border-color: rgba(126, 214, 158, 0.26); }
.gear-image { position: relative; display: grid; place-items: center; height: 125px; background: radial-gradient(circle at 50% 54%, rgba(48, 123, 127, 0.66), rgba(8, 36, 40, 0.28) 70%); }
.gear-image img { width: 100%; height: 100%; object-fit: contain; }
.gear-image i { position: absolute; top: 7px; left: 7px; padding: 3px 6px; border-radius: 5px; background: rgba(5, 22, 25, 0.78); color: var(--muted); font-size: 0.52rem; font-style: normal; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.gear-copy { display: grid; min-height: 84px; padding: 10px 11px 6px; }
.gear-copy b { overflow: hidden; color: var(--ivory-bright); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.gear-copy small { color: var(--muted); font-size: 0.6rem; line-height: 1.25; }
.gear-copy em { align-self: end; color: #92d5ac; font-size: 0.59rem; font-style: normal; font-weight: 800; }
.gear-price { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 35px; border-top: 1px solid rgba(248, 230, 200, 0.1); color: var(--amber-bright); font-size: 0.66rem; font-weight: 850; }
.gear-card.equipped .gear-price { background: rgba(243, 170, 45, 0.12); }
.gear-card.owned:not(.equipped) .gear-price { color: #9fdeb7; }

.rig-card { max-height: min(820px, calc(100dvh - 34px)); overflow: auto; }
.rig-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr); gap: 14px; }
.rig-slots { display: grid; gap: 10px; }
.rig-slot { padding: 12px; border: 1px solid rgba(248, 230, 200, 0.11); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.rig-slot-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.rig-slot-heading b { color: var(--ivory-bright); font-size: 0.75rem; }
.rig-slot-heading small { color: var(--muted); font-size: 0.59rem; }
.rig-choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 7px; }
.rig-choice { display: grid; grid-template-columns: 50px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 1px 8px; min-width: 0; min-height: 62px; padding: 6px; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 10px; background: rgba(4, 26, 29, 0.45); color: var(--ivory); cursor: pointer; text-align: left; }
.rig-choice:hover { border-color: rgba(255, 194, 77, 0.46); }
.rig-choice.selected { border-color: var(--amber-bright); background: rgba(243, 170, 45, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 194, 77, 0.14); }
.rig-choice > span { grid-row: 1 / 3; display: grid; place-items: center; width: 50px; height: 50px; overflow: hidden; border-radius: 8px; background: radial-gradient(circle, rgba(50, 124, 130, 0.58), rgba(9, 39, 43, 0.25)); }
.rig-choice img { width: 100%; height: 100%; object-fit: contain; }
.rig-choice b { overflow: hidden; align-self: end; color: var(--ivory-bright); font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
.rig-choice small { align-self: start; color: var(--muted); font-size: 0.53rem; line-height: 1.2; }
.rig-forecast { padding: 16px; border: 1px solid rgba(255, 194, 77, 0.24); border-radius: 14px; background: linear-gradient(150deg, rgba(243, 170, 45, 0.09), rgba(30, 101, 91, 0.08)); }
.rig-forecast > small { color: var(--amber-bright); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.rig-forecast h3 { margin: 4px 0 12px; color: var(--ivory-bright); font-size: 1.05rem; }
.rig-fish-forecast { display: grid; gap: 7px; }
.rig-fish-forecast article { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; background: rgba(2, 18, 21, 0.42); }
.rig-fish-forecast article > span { display: grid; place-items: center; width: 58px; height: 45px; }
.rig-fish-forecast img { width: 100%; height: 100%; object-fit: contain; }
.rig-fish-forecast article div { display: grid; min-width: 0; }
.rig-fish-forecast b { overflow: hidden; color: var(--ivory-bright); font-size: 0.67rem; text-overflow: ellipsis; white-space: nowrap; }
.rig-fish-forecast article small { color: var(--muted); font-size: 0.53rem; text-transform: capitalize; }
.rig-fish-forecast em { color: #9fdeb7; font-size: 0.54rem; font-style: normal; font-weight: 800; }
.rig-forecast > p { margin: 13px 0 8px; color: var(--muted); font-size: 0.65rem; line-height: 1.45; }
.rig-forecast > span { display: block; padding-top: 8px; border-top: 1px solid rgba(248, 230, 200, 0.11); color: #9fdeb7; font-size: 0.59rem; font-weight: 750; }
.rig-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.market-scale { display: grid; grid-template-columns: minmax(230px, 0.65fr) 1fr; gap: 12px; margin-bottom: 12px; }
.scale-pan,
.scale-readout { min-height: 80px; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 13px; background: rgba(255, 255, 255, 0.035); }
.scale-pan { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); transition: transform 0.3s var(--ease), border-color 0.3s; }
.scale-pan span { font-size: 1.7rem; }
.scale-pan b { color: var(--ivory-bright); font-size: 0.86rem; }
.scale-pan.weighted { border-color: rgba(255, 194, 77, 0.42); transform: rotate(-0.7deg) translateY(2px); }
.scale-readout { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.scale-readout > span { color: var(--muted); font-size: 0.7rem; }
.scale-readout strong { display: flex; align-items: center; gap: 7px; color: var(--ivory-bright); font-size: 1.7rem; }
.sell-tray { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; min-height: 168px; max-height: 325px; overflow: auto; padding: 1px; }
.sell-fish-card { display: grid; min-width: 0; padding: 7px; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 12px; background: rgba(255, 255, 255, 0.035); color: var(--ivory); cursor: pointer; text-align: left; transition: border-color 0.18s, transform 0.18s, background 0.18s; }
.sell-fish-card:hover { transform: translateY(-2px); }
.sell-fish-card.selected { border-color: var(--amber-bright); background: rgba(243, 170, 45, 0.1); }
.sell-fish-card > span { position: relative; display: grid; place-items: center; height: 78px; border-radius: 8px; background: radial-gradient(circle, rgba(50, 124, 130, 0.56), rgba(9, 39, 43, 0.25)); }
.sell-fish-card img { width: 94%; height: 72px; object-fit: contain; }
.sell-fish-card > span i { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; opacity: 0; background: var(--amber-bright); color: #12231f; font-size: 0.66rem; font-style: normal; font-weight: 900; }
.sell-fish-card.selected > span i { opacity: 1; }
.sell-fish-card > b { margin-top: 6px; overflow: hidden; color: var(--ivory-bright); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.sell-fish-card > small { color: var(--muted); font-size: 0.58rem; text-transform: capitalize; }
.sell-fish-card > em { display: flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--amber-bright); font-size: 0.64rem; font-style: normal; font-weight: 850; }
.sell-fish-card.rare { box-shadow: inset 0 0 20px rgba(142, 111, 216, 0.08); }
.sell-fish-card.legendary { box-shadow: inset 0 0 22px rgba(255, 184, 63, 0.12); }
.empty-sell-tray { grid-column: 1 / -1; display: grid; place-items: center; align-content: center; min-height: 165px; border: 1px dashed rgba(248, 230, 200, 0.16); border-radius: 13px; color: var(--muted); text-align: center; }
.empty-sell-tray span { font-size: 1.65rem; filter: grayscale(0.35); }
.empty-sell-tray p { margin-top: 6px; font-size: 0.7rem; }
.sell-counter > .shop-intro { margin: 10px 0; font-size: 0.68rem; }
.sale-in-progress .scale-pan { animation: weighFish 0.62s ease-in-out both; }
.sale-complete .market-wallet { animation: walletPop 0.65s var(--ease); }
@keyframes weighFish { 40% { transform: rotate(3deg) translateY(7px); } 75% { transform: rotate(-2deg) translateY(3px); } }
@keyframes walletPop { 50% { transform: scale(1.12); border-color: var(--amber-bright); box-shadow: 0 0 28px rgba(255, 183, 56, 0.28); } }

.worlds-card { max-height: min(780px, calc(100dvh - 34px)); overflow: auto; }
.world-list { display: grid; gap: 11px; }
.world-card { display: grid; grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr); min-height: 188px; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 15px; overflow: hidden; background: rgba(255, 255, 255, 0.03); transition: border-color 0.2s, transform 0.2s var(--ease); }
.world-card:not(.current):hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--card-accent), transparent 40%); }
.world-card.current { border-color: var(--card-accent); }
.world-art { position: relative; min-height: 188px; overflow: hidden; background: linear-gradient(0deg, rgba(5, 20, 22, 0.28), transparent), var(--world-image) center / cover no-repeat, #153e46; }
.world-art::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; height: 7px; background: linear-gradient(90deg, var(--water-deep), var(--water-shallow)); box-shadow: 0 -5px 18px color-mix(in srgb, var(--water-shallow), transparent 58%); }
.world-art > .world-status { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 7px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 6px; background: rgba(4, 19, 22, 0.78); color: var(--ivory-bright); font-size: 0.56rem; font-weight: 850; letter-spacing: 0.07em; text-transform: uppercase; }
.world-species { position: absolute; right: 9px; bottom: 14px; z-index: 2; display: flex; gap: 4px; }
.world-species img { width: 42px; height: 30px; object-fit: contain; border-radius: 7px; background: rgba(4, 20, 23, 0.68); }
.world-occupancy { position: absolute; top: 9px; right: 9px; z-index: 3; display: grid; grid-template-columns: auto auto; align-items: center; gap: 3px 7px; min-width: 124px; padding: 7px 8px; border: 1px solid rgba(132, 226, 164, 0.38); border-radius: 10px; background: rgba(4, 19, 22, 0.88); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); }
.world-occupancy > span { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; color: #bff4cf; font-size: 0.57rem; font-weight: 850; text-transform: uppercase; }
.world-occupancy > span > em { width: 7px; height: 7px; border-radius: 50%; background: #72dc9a; box-shadow: 0 0 0 3px rgba(114, 220, 154, 0.14), 0 0 10px rgba(114, 220, 154, 0.55); }
.world-occupancy > div { display: flex; }
.world-occupancy > div > span { width: 28px; height: 27px; margin-right: -5px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 50%; background: #15434a; }
.world-occupancy img { width: 100%; height: 100%; object-fit: contain; }
.world-occupancy small { max-width: 76px; overflow: hidden; color: var(--ivory); font-size: 0.57rem; text-overflow: ellipsis; white-space: nowrap; }
.world-occupancy:has(.world-empty) { grid-template-columns: 1fr; min-width: 112px; border-color: rgba(255, 255, 255, 0.16); }
.world-occupancy .world-empty { color: rgba(248, 230, 200, 0.72); }
.world-occupancy .world-empty > em { background: #718486; box-shadow: none; }
.world-copy { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 13px 20px; padding: 19px 21px; }
.world-copy small { color: var(--card-accent); font-size: 0.59rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.world-copy h3 { margin: 2px 0 4px; color: var(--ivory-bright); font-size: 1.35rem; }
.world-copy p { color: var(--muted); font-size: 0.68rem; }
.world-copy dl { display: flex; grid-column: 1 / -1; gap: 24px; padding-top: 11px; border-top: 1px solid rgba(248, 230, 200, 0.1); }
.world-copy dl > div { display: grid; }
.world-copy dt { color: var(--muted); font-size: 0.53rem; text-transform: uppercase; }
.world-copy dd { color: var(--ivory); font-size: 0.66rem; }
.world-copy > button { grid-column: 2; grid-row: 1; min-width: 150px; }

.social-card { width: min(720px, 100%); }
.social-card header p { margin-top: 4px; color: var(--muted); font-size: 0.7rem; }
.connection-health { display: flex; align-items: center; gap: 7px; min-width: max-content; margin-left: auto; padding: 7px 10px; border: 1px solid rgba(113, 220, 153, 0.22); border-radius: 9px; background: rgba(78, 176, 115, 0.08); color: #aee9c2; font-size: 0.62rem; }
.connection-health i { width: 7px; height: 7px; border-radius: 50%; background: #72dc9a; box-shadow: 0 0 0 3px rgba(114, 220, 154, 0.12); }
.connection-health.slow { border-color: rgba(255, 190, 86, 0.28); color: #ffd38b; }
.connection-health.slow i { background: #f5b44d; }
.connection-health.offline { border-color: rgba(232, 101, 87, 0.3); color: #f0a095; }
.connection-health.offline i { background: #e66b5d; }
.online-list { display: grid; gap: 7px; max-height: 330px; overflow: auto; }
.online-player { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 11px; padding: 7px 11px 7px 7px; border: 1px solid rgba(248, 230, 200, 0.12); border-radius: 12px; background: rgba(255, 255, 255, 0.035); color: var(--ivory); cursor: pointer; text-align: left; }
.online-player.selected { border-color: var(--amber-bright); background: rgba(243, 170, 45, 0.08); }
.online-player > span { width: 58px; height: 52px; border-radius: 9px; overflow: hidden; background: radial-gradient(circle, #2a6970, #12363b); }
.online-player img { width: 100%; height: 100%; object-fit: contain; }
.online-player > div { display: grid; }
.online-player b { color: var(--ivory-bright); font-size: 0.78rem; }
.online-player small { color: var(--muted); font-size: 0.62rem; }
.online-player em { margin-top: 2px; color: #82dca2; font-size: 0.54rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.online-player.off-world { border-left: 3px solid rgba(126, 217, 223, 0.44); }
.online-player.off-world em { color: #8bcfd7; }
.online-player.same-world { border-left: 3px solid #72ce91; }
.online-player > i { color: #7bd19c; font-size: 1rem; font-style: normal; }
.empty-online { display: grid; place-items: center; min-height: 150px; padding: 24px; border: 1px dashed rgba(248, 230, 200, 0.16); border-radius: 13px; color: var(--muted); text-align: center; }
.empty-online > span { color: #79c596; font-size: 1.8rem; }
.empty-online p { margin-top: 6px; font-size: 0.7rem; }
.empty-online strong { color: var(--ivory); }
.social-actions { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 13px; padding-top: 13px; border-top: 1px solid rgba(248, 230, 200, 0.1); }
.social-actions > p { grid-column: 1 / -1; color: var(--muted); font-size: 0.68rem; }
.emoji-bar { display: flex; gap: 5px; }
.emoji-bar button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid rgba(248, 230, 200, 0.14); border-radius: 10px; background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 1.1rem; transition: transform 0.15s, background 0.15s; }
.emoji-bar button:hover:not(:disabled) { transform: translateY(-2px) scale(1.06); background: rgba(255, 255, 255, 0.09); }
.emoji-bar button:disabled { cursor: not-allowed; filter: grayscale(1); opacity: 0.3; }
.trade-request-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.trade-request-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.remote-nameplate { position: fixed; z-index: 18; display: grid; justify-items: center; padding: 0; border: 0; opacity: 0; pointer-events: none; background: transparent; cursor: pointer; transform: translate(-50%, -100%); filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.6)); transition: filter 0.16s; }
.remote-nameplate[data-projected="true"] { pointer-events: auto; }
.remote-nameplate-chip { display: flex; align-items: center; min-height: 30px; padding: 3px 5px 3px 9px; border: 1px solid rgba(255, 230, 192, 0.4); border-radius: 9px; background: rgba(6, 23, 26, 0.9); transition: border-color 0.16s, background 0.16s, transform 0.16s; }
.remote-nameplate b { color: var(--ivory-bright); font-size: 0.61rem; }
.remote-nameplate-chip i { display: grid; place-items: center; width: 21px; height: 21px; margin-left: 5px; border-radius: 6px; background: rgba(255, 194, 77, 0.14); color: var(--amber-bright); font-size: 0.69rem; font-style: normal; }
.remote-nameplate:hover .remote-nameplate-chip,
.remote-nameplate:focus-visible .remote-nameplate-chip,
.remote-nameplate.reacting .remote-nameplate-chip { border-color: var(--amber-bright); background: rgba(20, 48, 48, 0.96); transform: translateY(-2px); }
.remote-emoji { min-height: 24px; font-size: 1.35rem; transform: translateY(2px); }
.remote-nameplate.has-emoji .remote-emoji { animation: emojiPop 0.42s var(--ease); }
@keyframes emojiPop { from { opacity: 0; transform: translateY(10px) scale(0.4); } to { opacity: 1; transform: translateY(2px) scale(1); } }

.quick-reaction { position: fixed; z-index: 42; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; width: max-content; max-width: calc(100vw - 20px); padding: 8px; border: 1px solid rgba(255, 207, 117, 0.38); border-radius: 14px; background: linear-gradient(145deg, rgba(17, 42, 44, 0.98), rgba(7, 22, 25, 0.98)); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: quickReactionIn 0.2s var(--ease) both; }
.quick-reaction[hidden] { display: none; }
.quick-reaction > div:first-child { display: grid; min-width: 76px; padding-left: 4px; }
.quick-reaction > div:first-child span { color: var(--muted); font-size: 0.51rem; letter-spacing: 0.07em; text-transform: uppercase; }
.quick-reaction > div:first-child strong { max-width: 110px; overflow: hidden; color: var(--ivory-bright); font-size: 0.69rem; text-overflow: ellipsis; white-space: nowrap; }
.quick-emoji-bar { display: flex; gap: 4px; }
.quick-emoji-bar button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(248, 230, 200, 0.14); border-radius: 9px; background: rgba(255, 255, 255, 0.045); cursor: pointer; font-size: 1.02rem; transition: transform 0.14s, background 0.14s; }
.quick-emoji-bar button:hover { background: rgba(255, 194, 77, 0.13); transform: translateY(-2px) scale(1.07); }
.quick-reaction-close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.quick-reaction-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--ivory-bright); }
@keyframes quickReactionIn { from { opacity: 0; transform: translateY(7px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.trade-card { max-height: min(760px, calc(100dvh - 34px)); overflow: auto; }
.trade-invite { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid rgba(255, 194, 77, 0.25); border-radius: 13px; background: rgba(243, 170, 45, 0.075); }
.trade-invite[hidden],
.trade-layout[hidden] { display: none; }
.trade-invite p { color: var(--muted); font-size: 0.75rem; }
.trade-invite strong { color: var(--ivory-bright); }
.trade-invite > div { display: flex; gap: 8px; }
.trade-layout { display: grid; grid-template-columns: minmax(0, 1fr) 45px minmax(0, 1fr); align-items: start; gap: 12px; margin-bottom: 15px; }
.trade-layout > section { padding: 13px; border: 1px solid rgba(248, 230, 200, 0.11); border-radius: 13px; background: rgba(255, 255, 255, 0.025); }
.trade-side-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.trade-side-heading b { color: #8bd3a6; font-size: 0.62rem; }
.trade-arrows { align-self: center; color: var(--amber-bright); font-size: 1.6rem; text-align: center; }
.trade-fish-grid { display: grid; gap: 6px; min-height: 215px; max-height: 350px; overflow: auto; }
.trade-fish { display: grid; grid-template-columns: 62px 1fr 22px; align-items: center; gap: 8px; padding: 6px; border: 1px solid rgba(248, 230, 200, 0.11); border-radius: 9px; background: rgba(255, 255, 255, 0.035); color: var(--ivory); cursor: pointer; text-align: left; }
.trade-fish:disabled { cursor: default; opacity: 1; }
.trade-fish.selected { border-color: var(--amber-bright); background: rgba(243, 170, 45, 0.09); }
.trade-fish img { width: 62px; height: 45px; object-fit: contain; border-radius: 7px; background: rgba(33, 92, 98, 0.28); }
.trade-fish > span { display: grid; }
.trade-fish b { overflow: hidden; color: var(--ivory-bright); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.trade-fish small { color: var(--muted); font-size: 0.56rem; text-transform: capitalize; }
.trade-fish > i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; opacity: 0; background: var(--amber-bright); color: #13211e; font-size: 0.61rem; font-style: normal; }
.trade-fish.selected > i { opacity: 1; }
.empty-trade { display: grid; place-items: center; min-height: 210px; color: var(--muted); font-size: 0.68rem; text-align: center; }

.travel-flash { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; align-content: center; gap: 10px; opacity: 0; visibility: hidden; pointer-events: none; background: radial-gradient(circle, rgba(23, 75, 79, 0.94), rgba(4, 18, 21, 0.98)); transition: opacity 0.34s, visibility 0.34s; }
.travel-flash.active { opacity: 1; visibility: visible; animation: travelAway 1.25s var(--ease) both; }
.travel-flash .waypoint-gem { width: 24px; height: 24px; border-color: var(--world-accent); }
.travel-flash small { margin-top: 13px; color: var(--muted); font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; }
.travel-flash strong { color: var(--ivory-bright); font-size: clamp(1.8rem, 5vw, 3.7rem); letter-spacing: -0.05em; }
@keyframes travelAway { 0% { clip-path: circle(0 at 50% 50%); } 28%, 68% { clip-path: circle(100% at 50% 50%); } 100% { clip-path: circle(0 at 50% 50%); } }

@media (max-width: 900px) {
  .onboarding-layout { grid-template-columns: 1fr; }
  .starter-kit { border-top: 1px solid rgba(255, 232, 194, 0.12); border-left: 0; }
  .starter-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .starter-items article { grid-template-columns: 58px 1fr; }
  .starter-items article > span { width: 58px; }
  .starter-items em { grid-column: 2; }
  .gear-shelf,
  .sell-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rig-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .top-actions { width: 130px; flex-wrap: wrap; justify-content: flex-end; }
  .profile-panel { width: min(215px, 55vw); }
  .objective-panel { top: 100px; }
  .onboarding-layer { height: 100dvh; place-items: start center; padding: 10px; -webkit-overflow-scrolling: touch; }
  .onboarding-shell { border-radius: 20px; }
  .onboarding-header,
  .onboarding-footer { padding: 13px 15px; }
  .setup-step { display: none; }
  .brand-lockup > span { width: 34px; height: 34px; }
  .brand-lockup strong { font-size: 0.83rem; }
  .angler-setup,
  .starter-kit { padding: 20px 15px; }
  .angler-setup h1 { margin-bottom: 17px; font-size: 2.05rem; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .character-stage { height: 132px; }
  .starter-items { grid-template-columns: 1fr; }
  .onboarding-footer { align-items: stretch; flex-direction: column; }
  .onboarding-footer p { text-align: center; }
  .enter-world-button { width: 100%; min-width: 0; }
  .expanded-card { width: 100%; }
  .market-card,
  .worlds-card,
  .trade-card { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .market-card > header { grid-template-columns: 1fr auto; }
  .market-wallet { grid-column: 1; grid-row: 2; justify-self: start; margin-top: -8px; }
  .market-card > header .close-button { grid-column: 2; grid-row: 1; }
  .gear-shelf,
  .sell-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gear-image { height: 105px; }
  .market-loadout > span { padding: 8px; }
  .market-loadout b { font-size: 0.62rem; }
  .market-loadout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-loadout > span:last-child { grid-column: 1 / -1; }
  .rig-card { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .rig-slot-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .rig-choice-row { display: flex; overflow-x: auto; padding-bottom: 3px; scroll-snap-type: x proximity; }
  .rig-choice { flex: 0 0 155px; scroll-snap-align: start; }
  .rig-actions { align-items: stretch; flex-direction: column-reverse; }
  .rig-actions button { width: 100%; }
  .market-scale { grid-template-columns: 1fr; }
  .scale-pan,
  .scale-readout { min-height: 64px; }
  .world-card { grid-template-columns: 1fr; }
  .world-art { min-height: 145px; }
  .world-occupancy { min-width: 110px; }
  .world-copy { grid-template-columns: 1fr; padding: 15px; }
  .world-copy > button { grid-column: 1; grid-row: auto; width: 100%; }
  .world-copy dl { flex-wrap: wrap; gap: 12px 20px; }
  .map-route-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .map-route-actions button { width: 100%; }
  .social-actions { grid-template-columns: 1fr; }
  .social-card > header { flex-wrap: wrap; }
  .connection-health { order: 3; margin-left: 0; }
  .emoji-bar { justify-content: space-between; }
  .remote-nameplate-chip { min-height: 38px; padding: 5px 6px 5px 10px; }
  .remote-nameplate b { font-size: 0.68rem; }
  .remote-nameplate-chip i { width: 25px; height: 25px; }
  .quick-reaction { grid-template-columns: 1fr auto; width: min(344px, calc(100vw - 20px)); }
  .quick-reaction > div:first-child { grid-column: 1; grid-row: 1; }
  .quick-reaction-close { grid-column: 2; grid-row: 1; }
  .quick-emoji-bar { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .quick-emoji-bar button { width: 44px; height: 44px; }
  .trade-request-button { width: 100%; }
  .trade-layout { grid-template-columns: 1fr; }
  .trade-arrows { transform: rotate(90deg); }
  .trade-fish-grid { min-height: 120px; max-height: 230px; }
  .trade-invite { align-items: stretch; flex-direction: column; }
  .trade-invite > div { display: grid; grid-template-columns: 1fr 1fr; }
  .loadout-strip { grid-template-columns: 62px 1fr; }
  .loadout-thumb { width: 58px; height: 54px; }
  .loadout-strip > em { grid-column: 2; }
}

@media (max-height: 520px) and (orientation: landscape) and (hover: none),
       (max-height: 520px) and (orientation: landscape) and (max-width: 900px) {
  .top-hud { grid-template-columns: 190px minmax(250px, 1fr) 216px; gap: 8px; }
  .profile-panel { width: 190px; }
  .profile-heading strong { font-size: 0.78rem; white-space: nowrap; }
  .level-chip,
  #soundButton,
  .coin-counter { display: none; }
  .top-actions { width: 216px; flex-wrap: nowrap; gap: 4px; }
  .hud-button,
  .hud-button.icon-only { width: 40px; height: 40px; padding: 0; }
  .objective-panel { min-width: 0; padding: 11px 14px; }
  .objective-panel strong { font-size: 0.7rem; white-space: nowrap; }
  .market-world-label { transform: translate(-50%, -100%) scale(0.86); }
  .onboarding-layer { display: block; overflow: auto; }
  .onboarding-shell { margin: 0 auto; }
  .onboarding-layout { grid-template-columns: 1.15fr 0.85fr; }
  .angler-setup,
  .starter-kit { padding: 16px; }
  .angler-setup h1 { margin: 4px 0 10px; font-size: 1.5rem; }
  .name-field { margin-bottom: 10px; }
  .name-field input { height: 42px; }
  .character-stage { height: 102px; }
  .starter-kit { border-top: 0; border-left: 1px solid rgba(255, 232, 194, 0.12); }
  .starter-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .starter-items article { min-height: 64px; }
  .starter-tip { display: none; }
  .onboarding-footer { flex-direction: row; }
}
