.modebox { display: flex; gap: 8px; align-items: center; }
.modebox button { height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: #d5deea; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.modebox button.on { background: #f2b84b; color: #1b1406; border-color: #f2b84b; }
#modenote { margin: 0; max-width: 640px; color: #b7c3d4; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.touch .modebox button { height: 26px; padding: 0 8px; font-size: 12px; }
html.touch #modenote { display: none; }

#boat-hud { display: none; position: fixed; inset: 0; z-index: 24; pointer-events: none; --bl: 12px; --br: 12px; --bb: 16px; }
body.boat-on #boat-hud { display: block; }
body.boat-on #hud, body.boat-on #tui { display: none !important; }
body.boat-paused #boat-hud { display: none; }
html.touch #boat-hud { --bl: var(--sl); --br: var(--sr); --bb: calc(var(--sb) + 8px); }

#boat-guide, #boat-guide-full, #boat-sonar, #boat-readout, #boat-fight-hint, #boat-card, #boat-shop {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07);
}
#boat-sonar { position: absolute; top: 16px; left: var(--bl); width: 340px; padding: 10px 12px 8px; color: var(--txt); }
#boat-sonar-cv { width: 100%; height: 188px; display: block; border-radius: 8px; background: #06121f; }
#boat-sonar .snl { display: flex; gap: 10px; margin-top: 6px; font-size: 13px; line-height: 1.35; white-space: nowrap; }
#boat-sonar .sd { color: var(--teal); font-weight: 800; }
#boat-sonar .sb { color: var(--sub); overflow: hidden; text-overflow: ellipsis; }
#boat-sonar .sc { margin-left: auto; color: #ffd25a; font-weight: 800; }
#boat-sonar .snh { margin-top: 2px; font-size: 12.5px; color: var(--amber-2); line-height: 1.35; }
#boat-chart { position: absolute; top: 16px; right: var(--br); width: 284px; padding: 9px 11px 11px; pointer-events: auto; }
#boat-chart .mh, #boat-chart-full .mh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
#boat-chart .mt, #boat-chart-full .mt { font-size: 13.5px; font-weight: 700; color: var(--amber-2); letter-spacing: 1px; }
#boat-chart .ml, #boat-chart-full .ml { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--sub); }
#boat-chart .ml i, #boat-chart-full .ml i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 4px; }
#boat-chart .lg-me { background: #fff; box-shadow: 0 0 5px var(--teal); }
#boat-chart .lg-rec { background: transparent; box-shadow: inset 0 0 0 1.5px var(--amber); }
#boat-chart .lg-echo { background: #7ee0ff; }
#boat-map, #boat-map-full { display: block; width: 100%; height: auto; border-radius: 10px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
#boat-map-open, #boat-map-x { height: 26px; margin-top: 8px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(242,184,75,.45); background: rgba(242,184,75,.12); color: var(--amber-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
#boat-map-x { margin-top: 0; }
#boat-chart-full { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7; width: min(820px, 92vw); max-height: calc(100vh - 32px); overflow: auto; padding: 12px 14px 14px; pointer-events: auto; }
#boat-chart-full[hidden] { display: none; }
#boat-chart-full .chart-note { margin: 8px 0 0; font-size: 13px; color: var(--sub); }
#boat-hud.show-map::before { content: ""; position: absolute; inset: 0; background: rgba(4,8,16,.35); }
#boat-guide { position: absolute; top: 318px; left: var(--bl); width: min(280px, 30vw); max-height: 40px; overflow: hidden; padding: 8px 12px; color: var(--txt); font-size: 13px; line-height: 1.35; pointer-events: none; }
#boat-guide-toggle { position: absolute; top: 282px; left: var(--bl); height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(242,184,75,.45); background: rgba(242,184,75,.12); color: var(--amber-2); font: inherit; font-size: 13px; font-weight: 700; pointer-events: auto; cursor: pointer; }
#boat-guide-toggle:hover { filter: brightness(1.08); }
#boat-guide-full { position: absolute; top: 318px; left: var(--bl); width: min(320px, 34vw); max-height: 28vh; overflow: auto; padding: 14px 16px; color: var(--txt); font-size: 15px; line-height: 1.5; pointer-events: auto; scrollbar-color: rgba(242,184,75,.55) rgba(8,16,32,.4); }
#boat-guide-full::-webkit-scrollbar { width: 8px; }
#boat-guide-full::-webkit-scrollbar-thumb { background: rgba(242,184,75,.55); border-radius: 8px; }
#boat-guide-full::-webkit-scrollbar-track { background: rgba(8,16,32,.35); }
#boat-guide-full[hidden] { display: none; }
#boat-hud.show-guide #boat-guide { display: none; }
#boat-guide-full p { margin: 0 0 8px; color: var(--sub); }
#boat-guide-full b { color: var(--amber-2); }
#boat-cross { position: absolute; left: 50%; top: 46%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border: 1.5px solid rgba(255,255,255,.9); border-radius: 50%; box-shadow: 0 0 4px rgba(0,0,0,.8); pointer-events: none; }
#boat-readout { position: absolute; left: var(--bl); bottom: calc(var(--bb) + 52px); display: flex; flex-wrap: wrap; gap: 6px; max-width: min(520px, 58vw); }
#boat-readout .chip { pointer-events: none; }
#boat-lures { position: absolute; left: var(--bl); bottom: var(--bb); display: flex; gap: 6px; pointer-events: auto; }
#boat-lures button { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.05); color: var(--txt); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
#boat-lures button:hover { border-color: rgba(242,184,75,.55); }
#boat-lures button.on { background: var(--amber); color: #1b1406; border-color: var(--amber); }
#boat-hud.show-fight #boat-lures, #boat-hud.show-card #boat-lures, #boat-hud.show-shop #boat-guide-full, #boat-hud.show-shop #boat-chart, #boat-hud.show-shop #boat-chart-full { visibility: hidden; }
#boat-hud.show-fight #boat-readout { bottom: calc(var(--bb) + 118px); }
#boat-fight { position: absolute; left: 50%; bottom: calc(var(--bb) + 8px); transform: translateX(-50%); width: min(420px, 48vw); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#boat-fight[hidden] { display: none; }
#boat-fight-hint { margin: 0; padding: 6px 14px; color: var(--amber-2); font-size: 16px; font-weight: 800; letter-spacing: 1px; }
#boat-tension { position: relative; width: 100%; height: 16px; border-radius: 8px; background: linear-gradient(90deg, #3a6ea5 0 22%, #3c8f5a 22% 74%, #a3453a 74% 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
#boat-needle { position: absolute; top: -4px; width: 4px; height: 24px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px #fff; }
#boat-toast { position: absolute; left: var(--bl); bottom: calc(var(--bb) + 96px); max-width: 280px; color: var(--txt); font-size: 14px; font-weight: 700; text-align: left; text-shadow: 0 1px 3px #000; }
#boat-touch { display: none; }
html.touch #boat-touch { display: flex; position: absolute; right: var(--br); bottom: var(--bb); gap: 8px; pointer-events: auto; }
html.touch #boat-touch button { width: 64px; height: 64px; border-radius: 50%; border: 0; font: inherit; font-weight: 800; background: #f2b84b; color: #1b1406; }
html.touch #boat-lures { bottom: calc(var(--bb) + 74px); }
html.touch #boat-fight { bottom: calc(var(--bb) + 78px); }

#boat-card { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 88vw); max-height: 86vh; overflow: auto; padding: 22px 22px 16px; color: var(--txt); text-align: center; pointer-events: auto; }
#boat-hud.show-card #boat-card { display: block; }
#boat-card-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 18px; border: 1px solid rgba(255,215,122,.5); background: transparent; color: var(--amber-2); font: inherit; font-weight: 800; cursor: pointer; }
#boat-card h3 { margin: 4px 48px 8px; font-size: 36px; letter-spacing: 3px; background: linear-gradient(#fff, var(--amber-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#boat-card .stats { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
#boat-card .sb { min-width: 120px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(95,224,208,.3); background: rgba(95,224,208,.08); }
#boat-card .sb b { display: block; font-size: 28px; color: #fff; }
#boat-card .sb span { color: var(--sub); font-size: 13px; }
#boat-card .coins { margin: 8px auto; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(242,184,75,.35); background: rgba(242,184,75,.08); color: var(--amber-2); font-size: 28px; font-weight: 800; }
#boat-card-tip { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
#boat-card-tip img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; }
#boat-card-tip span { font-size: 13px; color: var(--sub); text-align: left; }

#boat-shop { display: none; position: absolute; top: 16px; right: var(--br); bottom: var(--bb); z-index: 6; width: min(460px, 92vw); overflow: auto; padding: 14px; color: var(--txt); pointer-events: auto; background: linear-gradient(165deg, rgba(16,28,48,.97), rgba(8,14,26,.98)); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#boat-hud.show-shop #boat-shop { display: block; }
#boat-shop header { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; background: rgba(12,22,40,.98); z-index: 1; padding-bottom: 8px; }
#boat-shop header b { color: var(--amber-2); letter-spacing: 2px; font-size: 18px; }
#boat-shop header button { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--amber); color: #1b1406; font: inherit; font-weight: 800; cursor: pointer; }
#boat-shop header button:hover { filter: brightness(1.06); }
#boat-shop .sitem { margin: 0 0 8px; }
#boat-shop .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#boat-shop .cmp .c { min-width: 0; white-space: normal; }
#boat-shop .shead { display: flex; align-items: baseline; gap: 8px; position: sticky; top: 28px; background: rgba(12,22,40,.98); z-index: 1; padding: 4px 0 8px; }
.shop-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.shop-tabs button { height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: transparent; color: var(--sub); font: inherit; font-size: 13px; cursor: pointer; }
.shop-tabs button.on { background: var(--amber); color: #1b1406; border-color: var(--amber); }
.shop-bal { margin: 0 0 8px; color: var(--amber-2); font-weight: 700; }
#boat-shop .brand { color: var(--teal); font-size: 12px; letter-spacing: 1px; }
#boat-shop .sitem .ico { color: var(--teal); font-weight: 800; }
#boat-shop p { margin: 0 0 4px; font-size: 13px; line-height: 1.4; color: var(--sub); }
#boat-shop article button[disabled] { opacity: .45; cursor: default; }
#boat-craft { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#boat-craft p, #boat-craft button { grid-column: 1 / -1; }
#boat-craft label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); }
#boat-craft input { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--txt); padding: 0 8px; }
@media (max-width: 1100px), (max-height: 760px) {
  #boat-guide, #boat-guide-full { top: 232px; }
  #boat-guide { width: min(420px, 42vw); max-height: 78px; font-size: 12px; }
  #boat-guide-toggle { top: 198px; }
  #boat-chart { width: 200px; }
  #boat-sonar { width: 210px; }
  #boat-sonar-cv { height: 112px; }
}
html.touch #boat-sonar { width: min(220px, 42vw); }
html.touch #boat-sonar-cv { height: 84px; }
html.touch #boat-chart { width: 168px; top: 8px; }
html.touch #boat-chart .ml { display: none; }
html.touch #boat-guide { display: none; }
html.touch #boat-guide-toggle { top: 168px; }
html.touch #boat-guide-full { top: 168px; max-height: 80px; width: min(280px, 48vw); }
html.touch #boat-readout { bottom: calc(var(--bb) + 120px); }
html.touch #boat-toast { bottom: calc(var(--bb) + 156px); }
