.game-shell[data-scene=""]::before {
  background-image:linear-gradient(#8fd8db19,#57accb16),url("../img/chart-water.webp?v=15.5");
  background-size:auto,var(--water-width,1280px) var(--water-height,720px);
  background-position:center,var(--water-x,0px) calc(var(--water-y,0px) + var(--top-h) + env(safe-area-inset-top));
  background-repeat: no-repeat,repeat;
}
#sea { background:none!important; }
#mapFog,#mapGrid { position:absolute; inset:0; width:100%; height:100%; z-index:1; pointer-events:none; }
#mapGrid { opacity:var(--grid-opacity,.5); }
#sea::before { display:none; }
.sea-clouds,.sea-sunlight {
  position:absolute;
  inset:0;
  z-index:1;
  overflow:hidden;
  pointer-events:none;
  animation:none;
  background:none;
  mix-blend-mode:normal;
}
.sea-clouds::before,.sea-clouds::after { content:none; }
.sea-cloud,.sea-glint {
  position:absolute;
  top:var(--sprite-track);
  width:var(--sprite-size);
  height:auto;
  opacity:var(--sprite-alpha);
}
.sea-cloud {
  left:0;
  animation:cloud-sail var(--sprite-duration) var(--sprite-phase) linear infinite,
    cloud-billow var(--sprite-duration) var(--sprite-phase) ease-in-out infinite;
}
@keyframes cloud-sail {
  0% { transform:translate3d(-110%,0,0); opacity:0; }
  20%,72% { opacity:var(--sprite-alpha); }
  48% { opacity:calc(var(--sprite-alpha)*.74); }
  100% { transform:translate3d(calc(100vw + 4rem),var(--sprite-rise),0); opacity:0; }
}
@keyframes cloud-billow {
  0%,100% { scale:.96; rotate:0deg; }
  29% { scale:var(--sprite-spread); rotate:var(--sprite-tilt); }
  60% { scale:.96; rotate:calc(var(--sprite-tilt)*-.55); }
  84% { scale:var(--sprite-spread); rotate:0deg; }
}
.sea-glint {
  left:var(--sprite-rest);
  animation:sea-glint-drift var(--sprite-duration) var(--sprite-phase) ease-in-out infinite;
}
@keyframes sea-glint-drift {
  0% { transform:translate3d(-22px,1px,0); scale:.95; opacity:0; }
  24% { scale:var(--sprite-spread); opacity:var(--sprite-alpha); }
  48% { scale:.97; opacity:calc(var(--sprite-alpha)*.62); }
  67% { scale:var(--sprite-spread); opacity:calc(var(--sprite-alpha)*.88); }
  100% { transform:translate3d(37px,var(--sprite-rise),0); scale:.95; opacity:0; }
}
.contact-hint, .contact-notice:not(:has(.notice-jump)), .notice-jump {
  color: #ffedcf;
  background: linear-gradient(134deg,#26393ff5,#14272ff5);
  border: 1px solid #b78c56;
  border-radius: 8px;
  box-shadow: 0 5px 16px #07162185;
  padding: 9px 12px;
}
.contact-hint { pointer-events:none; }
.contact-hint { position: absolute; z-index: 11; width: max-content; max-width: 225px; font-size: 13px; }
.contact-hint strong { display: block; font: 400 14.667px/1.2 var(--chrome-font); color: #ffe1a9; margin-bottom: 4px; }
.contact-hint span { display: block; }
.sea-notices {
  position:fixed; z-index:46; bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 28px);
  display:grid; grid-template-columns:minmax(0,1fr); justify-items:center; gap:6px; pointer-events:none;
}
.contact-notice { box-sizing:border-box; font-size:14px; min-width:0; max-width:100%; width:max-content; white-space:normal; overflow-wrap:anywhere; }
.notice-jump { box-sizing:border-box; display:block; width:100%; min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; font-weight:700; text-align:left; pointer-events:auto; }
@media (prefers-reduced-motion:reduce) {
  .sea-cloud,.sea-glint { animation:none; opacity:calc(var(--sprite-alpha)*.55); }
  .sea-cloud { left:var(--sprite-rest); }
}

.ship-markers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ship-marker {
  position: absolute;
  display: flex;
  padding: 2px 4px;
  left:0;
  top:0;
  width:max-content;
  border: 1px solid #c39560af;
  border-radius: 7px;
  background: linear-gradient(180deg,#253c43f6,#132630f7);
  box-shadow: inset 0 1px #fff3ca2b, 0 3px 8px #06182199;
  color: #fff0cf;
  white-space: nowrap;
}
.ship-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px;
  font: 600 11px/16px var(--read-font);
  font-variant-numeric: tabular-nums;
  pointer-events: auto;
  cursor: pointer;
}
.ship-stat + .ship-stat { border-left: 1px solid #a889665c; }
.ship-stat .icon { width: 13px; height: 13px; color: #eac680; }
.ship-meters {
  position:absolute;
  bottom:calc(100% + 2px);
  inset-inline:3px;
  display:grid;
  gap:1px;
}
.ship-meter {
  height:5px;
  padding:1px;
  border-radius:3px;
  background:#142d38;
  box-shadow:0 1px 1px #142a30;
}
.ship-meter i { display:block; height:100%; width:var(--fill,0%); border-radius:2px; }
.ship-health i { background:#8dddab; }
.ship-crew i { background:#edb879; }
.island-marker.stale-marker { filter:grayscale(.8); }
.island-marker { max-width:calc(100% - 10px); }
.mapcontrols {
  --controls-top:5px;
  top:var(--controls-top);
  flex-direction:row;
  align-items:stretch;
  max-height:calc(100% - var(--controls-top) - 3px);
  margin-right:-4px;
  gap:4px;
  pointer-events:none;
}
.mapcontrols .control-column {
  display:flex;
  flex:none;
  flex-direction:column;
  gap:9px;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:none;
  padding:3px 4px 6px;
}
.mapcontrols button { flex:none; padding:0; pointer-events:auto; }
.mapcontrols button[aria-pressed="true"] { border-color:#ffda89; background:radial-gradient(#926126,#372417); }
@media(max-height:680px) { .mapcontrols .control-column { gap:5px; } }
.relief-icon,
.dialog .head > .relief-icon {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e5bd77;
  border-bottom-color: #7e4f2c;
  border-radius: 50%;
  background: radial-gradient(ellipse at 31% 14%, #f8e3ae65, transparent 55%),
    linear-gradient(#855739, #503520 55%, #241b1b);
  color: #fff0c9;
  box-shadow: inset 0 1px 2px #ffe8acaa, inset 0 -2px 3px #241305,
    inset 0 0 0 3px #f5c87b21, 0 3px 6px #1a0e0d85;
  vertical-align: middle;
}
.relief-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,transparent 20%,#fff4cf8c,transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.relief-icon:is(:hover,:focus-visible)::after { animation: icon-glint .45s ease-out both; }
@keyframes icon-glint { to { transform: translateX(130%); } }
.relief-icon .icon { width: 19px; height: 19px; filter: drop-shadow(0 1px 2px #241006e6); }
.helpLink.relief-icon { width: 27px; height: 27px; }
.action-unit .action-info.relief-icon { position: absolute; width: 25px; height: 25px; }
.helpLink .icon, .action-info .icon { width: 16px; height: 16px; }
.relief-icon.dismiss-icon { border-radius: 8px; }
#sea:is(.aiming,.box-selecting) #map { cursor: crosshair; }
#sea.aiming .helm-hint { color: #fff6d7; border-color: #efd499; background: #231f1bf5; }
.map-ship-card { display: grid; grid-template-columns: minmax(180px,1fr) minmax(195px,.8fr); gap: 15px; }
.map-ship-detail dl { display: grid; gap: 7px; margin: 12px 0; color: #472b19; }
.map-ship-detail dl div { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.map-ship-detail dt .icon { width: 16px; height: 16px; vertical-align: middle; }
.map-ship-detail dd { font-weight: 700; margin: 0; }
.element-tip {
  position: fixed;
  z-index: 120;
  max-width: min(290px,calc(100vw - 16px));
  padding: 9px 12px;
  color: #ffedcc;
  border: 1px solid #d7ad6c;
  border-radius: 9px;
  background: linear-gradient(150deg,#39352e,#182b33);
  box-shadow: inset 0 1px #ffe5a151, 0 5px 15px #07152191;
  font: 500 13px/1.45 var(--read-font);
  pointer-events: none;
}
.element-tip::after {
  content: "";
  position: absolute;
  top: calc(100% - 4px);
  left: calc(var(--tip-arrow) - 4px);
  width: 8px;
  height: 8px;
  border: solid #d7ad6c;
  border-width: 0 1px 1px 0;
  background: #202d32;
  transform: rotate(45deg);
}
.element-tip[data-below="true"]::after { top: -5px; transform: rotate(225deg); background: #36342e; }
@media(max-width:540px) {
  .map-ship-card { grid-template-columns: minmax(0,1fr); }
  .ship-marker { padding-inline: 2px; }
  .ship-stat { padding-inline: 3px; }
}
@media(prefers-reduced-motion:reduce) { .relief-icon::after { animation: none !important; } }

.mapcontrols #overviewBtn {
  position: relative;
  overflow: hidden;
  color: #b9e7c9;
  background: radial-gradient(circle at 36% 21%,#6f8e7194,transparent 67%),linear-gradient(#244841,#17292e);
}
#overviewBtn .icon { width: 25px; height: 25px; }
.overview-map {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 1px solid #bd9760;
  border-radius: 10px;
  background: radial-gradient(ellipse at 70% 29%,#315d5e,#103444 78%);
  box-shadow: inset 0 0 18px #111b21ad,0 3px 6px #78533252;
  cursor: crosshair;
}
.overview-legend { display: flex; flex-wrap: wrap; gap: 6px 13px; padding: 9px 0 12px; font: 600 12px var(--read-font); }
.overview-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #438774; }
.overview-legend span:nth-child(2)::before { background: #a87848; }
.overview-legend span:nth-child(3)::before { background: none; border-radius: 1px; border: 1px solid #806145; }
/* Overview island index: compact, readable thumbnail tiles instead of squeezed buttons. */
.overview-places {
  display:block;
  min-width:0;
  max-height:clamp(156px,34dvh,320px);
  overflow-x:hidden;
  overflow-y:auto;
  padding:4px 3px 8px;
  scrollbar-width:thin;
  scrollbar-color:#a57740 transparent;
}
.overview-places .overview-fleet-jump {
  display:block;
  width:100%;
  min-height:34px;
  margin:0 0 8px;
  padding:6px 10px;
}
.overview-islands {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(82px,1fr));
  gap:8px;
  min-width:0;
}
.overview-places .overview-island {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:5px;
  min-width:0;
  width:100%;
  min-height:92px;
  margin:0;
  padding:7px 5px 8px;
  border:1px solid #b78a50;
  border-radius:11px;
  background:linear-gradient(170deg,#fff1d2,#e7c999);
  box-shadow:inset 0 1px 0 #fff6db,0 2px 3px #6d441c35;
  color:#593717;
  text-shadow:0 1px #fff3d4;
  text-align:center;
  cursor:pointer;
}
.overview-places .overview-island img {
  display:block;
  flex:none;
  width:clamp(46px,12vw,62px);
  max-width:100%;
  aspect-ratio:1;
  height:auto;
  border:1px solid #b68b52;
  border-radius:10px;
  background:radial-gradient(circle at 50% 40%,#5f8990,#204e5a);
  box-shadow:inset 0 0 8px #183e5040,0 1px 2px #65432155;
  object-fit:contain;
}
.overview-places .overview-island span {
  display:-webkit-box;
  width:100%;
  min-width:0;
  overflow:hidden;
  overflow-wrap:anywhere;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  font:700 clamp(10px,2.3vw,12px)/1.15 var(--read-font);
}
.overview-places .overview-island:hover {
  background:linear-gradient(170deg,#fff8e4,#efd8aa);
  border-color:#956021;
}
.overview-places .overview-island:focus-visible {
  outline:2px solid #a66a1e;
  outline-offset:2px;
}

