/* Game framing: the harbor is the screen, not a card inside a landing page.
   This layer changes presentation only; engine and input selectors are intact. */
:root {
  --game-ink: #173d53;
  --game-edge: #275d74;
  --game-gold: #ffc84e;
  background: var(--game-ink);
}

.game-shell { position: relative; min-height: max(680px, 100svh); }
.topbar {
  position: absolute; z-index: 6; top: calc(18px + env(safe-area-inset-top)); left: max(28px, env(safe-area-inset-left)); right: max(28px, env(safe-area-inset-right));
  height: 60px; padding: 0; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { position: relative; gap: 0; min-height: 54px; }
.brand img { display: block; width: 142px; height: auto; }
.brand-prefix { position: absolute; top: 1px; left: 15px; z-index: 1; font-size: 13px; font-weight: 800; color: #fff3b8; transform: rotate(-9deg); -webkit-text-stroke: 2px var(--game-ink); paint-order: stroke fill; }
.game-shell:has(#welcome:not([hidden])) .brand { visibility: hidden; }
.header-right { margin-left: auto; gap: 12px; }
.angler-level {
  min-width: 72px; color: var(--game-ink); font-size: 12px;
  padding: 7px 10px; background: #fffbe7; border: 2px solid var(--game-ink);
  border-radius: 6px; box-shadow: 0 3px 0 #173d5330;
}
.level-track { background: #d4e3df; }
.level-track i { background: #378db0; }
.wallet {
  min-width: 132px; padding: 7px 14px 7px 8px; border-radius: 7px;
  border: 2px solid var(--game-ink); background: #fffbe9;
  box-shadow: 0 3px 0 #173d5340;
}
.wallet output { font-size: 18px; }
.topbar .icon-button, .pause-button {
  background: #fffbe9; border: 2px solid var(--game-ink); border-radius: 8px;
  color: var(--game-ink); box-shadow: 0 3px 0 #173d5340;
}
.topbar .icon-button:hover, .pause-button:hover { background: #ffe6a0; }

.ocean-stage {
  min-height: max(680px, 100svh); margin: 0; border-radius: 0; box-shadow: none;
}
.ocean-stage > canvas { filter: none; touch-action: none; }
.stage-shade { background: none; }
.stage-topline { top: calc(100px + env(safe-area-inset-top)); left: max(32px, env(safe-area-inset-left)); right: max(32px, env(safe-area-inset-right)); }
.location { gap: 10px; }
.location strong { font-size: 15px; text-shadow: 0 1px #fff8; }
.location small { font-size: 10px; letter-spacing: 0; margin-top: 3px; }
.spot-number {
  display: grid; place-items: center; width: 35px; height: 40px;
  background: var(--game-ink); border: 2px solid #fcf8da; outline: 1px solid var(--game-ink);
  color: #fff0af; border-radius: 4px; font-size: 16px; font-weight: 800;
}
.weather { color: var(--game-ink); }
.stage-bottomline { left: 32px; right: 32px; bottom: 124px; }
.equipped-rod { font-size: 12px; }
.save-status { font-size: 10px; }

.welcome {
  --title-width: min(560px, calc(100vw - 42px));
  inset: 0; transform: none; width: 100%; height: 100%; max-width: none;
  text-align: center; pointer-events: none;
}
.welcome h1 { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: var(--title-width); height: calc(var(--title-width) / 2); margin: 0; font-size: inherit; line-height: 1; }
.welcome h1 img { display: block; width: 100%; height: 100%; object-fit: contain; }
.dream-prefix { position: absolute; left: 10%; top: 0; z-index: 1; font-size: clamp(22px, 3.2vw, 40px); letter-spacing: -2px; font-weight: 800; color: #fff4c0; transform: rotate(-9deg); -webkit-text-stroke: 4px var(--game-ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--game-ink); }
.welcome-actions, .welcome.charging .welcome-actions { position: absolute; top: calc(50% + var(--title-width) / 4 + 20px); left: 50%; transform: translateX(-50%); width: 100%; margin: 0; pointer-events: auto; }
.cast-button {
  width: 278px; margin: 0 auto; justify-content: center; gap: 14px;
  min-height: 70px; padding: 15px 21px; font-size: 23px; letter-spacing: -1px;
  color: #393d31; background: var(--game-gold);
  border: 3px solid var(--game-ink); border-bottom-width: 3px; border-radius: 14px;
  box-shadow: inset 0 3px 0 #fff3a9, 0 6px 0 #a6632c, 0 8px 0 2px var(--game-ink);
}
.cast-button:hover { background: #ffda6e; }
.cast-button:not(:disabled):active {
  transform: translateY(5px);
  box-shadow: inset 0 3px 0 #fff3a9, 0 1px 0 #a6632c, 0 3px 0 2px var(--game-ink);
}
.cast-button svg { width: 27px; height: 27px; stroke-width: 2px; }
.control-hint {
  justify-content: center; margin-top: 23px; gap: 9px; color: #123e51;
  text-shadow: 0 1px 1px #efffffaa; font-size: 11px; font-weight: 600;
}
.control-hint kbd { background: #fff9e2; border: 2px solid var(--game-ink); padding: 4px 7px; text-shadow: none; }
.charge-box {
  margin: 26px auto 0; text-align: left; padding: 12px 16px;
  background: #fffbe9; border: 2px solid var(--game-ink); border-radius: 8px;
  box-shadow: 0 4px 0 #173d5330; max-width: 300px;
}
.charge-box small { font-size: 10px; }

.dock-bar {
  position: absolute; z-index: 5; bottom: max(22px, env(safe-area-inset-bottom)); left: max(32px, env(safe-area-inset-left)); right: max(32px, env(safe-area-inset-right));
  min-height: 0; padding: 0; gap: 20px; background: none;
}
.trip-summary { color: #fff9de; text-shadow: 0 2px 2px #153e50; }
.trip-summary strong { font-size: 13px; font-weight: 800; }
.trip-summary div > span { font-size: 11px; color: #e9f5e7; }
.trip-icon { background: #173d53; border: 1px solid #afcdbf; color: #f5dc8c; border-radius: 7px; }
.dock-menu { gap: 9px; }
.dock-menu button {
  min-width: 78px; min-height: 76px; padding: 9px 7px 8px;
  color: var(--game-ink); font-size: 11px; font-weight: 800;
  background: #e6f4ed; border: 2px solid var(--game-ink); border-radius: 9px;
  box-shadow: inset 0 2px 0 #fffef2, 0 4px 0 #173d53; gap: 7px;
}
.dock-menu button:nth-child(1), .dock-menu button:nth-child(2) { background: #ffe19a; }
.dock-menu button:hover { background: #fff4c8; transform: translateY(-2px); }
.dock-menu button:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 2px 0 #fffef2, 0 1px 0 #173d53; }
.dock-menu svg { width: 26px; height: 26px; stroke-width: 2px; }
.menu-count { border-color: #f1eedc; background: #c96536; right: 5px; top: -7px; }
.reward-dot { background: #ed7540; outline: 2px solid #fff1c6; right: 12px; top: 4px; }

.fishing-hud {
  left: 6%; top: 26%; width: 365px; padding: 23px;
  background: #fff9e9f2; border: 3px solid var(--game-ink); border-radius: 12px;
  box-shadow: 0 6px 0 #173d5340;
}
.fishing-hud h2 { font-size: 27px; }
.action-button { width: 100%; min-width: 0; border: 2px solid var(--game-ink); border-bottom-width: 4px; }
.action-button.reeling { background: #296d8a; border-color: var(--game-ink); }
.rarity-pill.advanced { color: #194c80; background: #e2efff; border: 1px solid #6a95c1; }
.result-card { border: 3px solid var(--game-ink); box-shadow: 0 7px 0 #173d5370, 0 20px 70px #14474e40; border-radius: 17px; }
dialog { border: 3px solid var(--game-ink); border-radius: 14px; }
.panel-header { border-color: #bdd0cb; }
#panel-eyebrow { display: none; }
.panel-header .icon-button { border-radius: 7px; background: #e5ecdb; }
.toast { border: 2px solid var(--game-ink); border-radius: 7px; background: #fff4c9; color: var(--game-ink); }

@media (max-width: 1100px) {
  .dock-bar { justify-content: center; }
  .dock-menu { gap: 12px; }
  .trip-summary { display: none; }
}
@media (max-width: 760px) {
  .topbar { top: calc(15px + env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); height: 48px; }
  .brand img { width: 108px; }
  .header-right { gap: 7px; }
  .wallet { min-width: 91px; gap: 6px; padding: 6px 9px 6px 6px; }
  .wallet output { font-size: 14px; }
  .topbar .icon-button { min-width: 44px; min-height: 44px; }
  .stage-topline { top: calc(83px + env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); right: max(20px, env(safe-area-inset-right)); }
  .location strong { font-size: 13px; }
  .location small { font-size: 9px; }
  .spot-number { width: 29px; height: 34px; font-size: 13px; }
  .weather { display: none; }
  .welcome { --title-width: calc(100vw - 38px); }
  .welcome h1 { margin: 0; font-size: inherit; }
  .welcome-actions, .welcome.charging .welcome-actions { margin-top: 0; }
  .brand-prefix { font-size: 10px; left: 11px; top: 7px; -webkit-text-stroke-width: 2px; }
  .dream-prefix { font-size: 26px; -webkit-text-stroke-width: 3px; }
  .cast-button { width: 240px; min-height: 66px; font-size: 20px; }
  .control-hint { font-size: 9px; gap: 5px; margin-top: 23px; }
  .control-hint kbd { font-size: 9px; }
  .stage-bottomline { bottom: 112px; left: 18px; right: 18px; gap: 12px; }
  .equipped-rod { font-size: 10px; }
  .save-status { font-size: 8px; }
  .dock-bar { left: max(11px, env(safe-area-inset-left)); right: max(11px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); }
  .dock-menu { gap: 5px; width: 100%; }
  .dock-menu button {
    width: calc((100% - 25px) / 6); min-width: 44px; min-height: 70px;
    padding: 8px 0 7px; font-size: 9px; letter-spacing: -.5px; gap: 8px; border-radius: 7px;
  }
  .dock-menu svg { width: 24px; height: 24px; }
  .menu-count { right: -3px; }
  .fishing-hud {
    left: 18px; top: 24%; width: calc(100% - 36px); padding: 20px;
  }
  .fishing-hud h2 { font-size: 26px; }
  .result-card { width: calc(100% - 36px); max-width: 350px; }
  .charge-box { max-width: 270px; margin-top: 24px; }
}
@media (max-width: 380px) {
  .topbar { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); gap: 5px; }
  .header-right { gap: 5px; }
  .brand img { width: 95px; }
  .welcome { --title-width: calc(100vw - 24px); }
  .cast-button { width: 224px; }
  .dock-bar { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); }
  .dock-menu { gap: 4px; }
  .dock-menu button { width: calc((100% - 20px) / 6); font-size: 8px; }
  .fishing-hud { left: 12px; width: calc(100% - 24px); padding: 17px; }
}
@media (max-height: 720px) and (min-width: 761px) {
  .welcome { --title-width: 400px; }
  .welcome-actions { margin-top: 0; }
  .fishing-hud { top: 23%; }
}
@media (prefers-reduced-motion: reduce) {
  .dock-menu button, .cast-button { transition: none; }
}
