* { box-sizing: border-box; }
:root { color-scheme: light; --orange: #ff8a3d; --cream: #fdf7e4; --sea: #7fc6e4; --ink: #174352; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--sea); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, 'PingFang SC', sans-serif; }
button { font: inherit; color: inherit; min-width: 44px; min-height: 44px; border: 0; cursor: pointer; touch-action: none; font-weight: 800; }
button:focus-visible { outline: 3px solid #09475a; outline-offset: 3px; }
button:active, button.held { filter: brightness(.88); }
[hidden] { display: none !important; }
#game { position: relative; isolation: isolate; width: 100%; height: 100%; height: 100dvh; max-width: 600px; margin: auto; overflow: hidden; background: linear-gradient(#80c7e5, #76cec4 70%, #94cf9e); user-select: none; -webkit-user-select: none; }
.art-source, .sea-texture, #world, #touch-area { position: absolute; inset: 0; }
.art-source { overflow: hidden; pointer-events: none; visibility: hidden; }
.has-art .art-source { visibility: visible; }
.art-source img { position: absolute; width: 278.571%; height: 411.707%; left: -78.571%; top: -46.341%; pointer-events: none; }
.sea-texture { pointer-events: none; background: linear-gradient(180deg, #c3eff119, #18bbba30 52%, #8cdea99c); }
#world { overflow: hidden; pointer-events: none; }
#touch-area { touch-action: none; }
.hud { position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.pill { display: flex; align-items: center; gap: 5px; border-radius: 100px; min-height: 38px; padding: 5px 9px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill .mp-icon { font-size: 18px; }
.pill b { font-variant-numeric: tabular-nums; }
.supplies { background: #fff5d5; color: #68460f; }
.hull { background: #e8f6fd; color: #235588; }
.hull.low { color: #9c3027; }
.orange { color: #472709; background: var(--orange); border-radius: 16px; padding: 0 14px; }
.pause { pointer-events: auto; margin-left: auto; display: grid; place-items: center; padding: 0; border-radius: 100px; }
.pause .mp-icon { font-size: 22px; }
.zone { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 53px); left: 14px; font-size: 12px; font-weight: 800; color: #194957; pointer-events: none; }
.bottom { position: absolute; z-index: 2; bottom: max(10px, env(safe-area-inset-bottom)); left: 14px; right: 14px; pointer-events: none; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.controls button, .brief { pointer-events: auto; }
.steering { display: flex; align-items: center; gap: 4px; }
.steering button { width: 50px; padding: 0; border-radius: 16px; color: #fff; background: #2581bb; display: grid; place-items: center; }
.steering button[data-drive='left'] { background: #7654b8; }
.steering button[data-drive='right'] { background: #338151; }
.steering .mp-icon { font-size: 24px; }
.vertical { display: grid; grid-template-columns: 1fr; gap: 3px; }
.vertical button { border-radius: 12px; }
.boost { min-width: 82px; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.boost[aria-disabled='true'] { opacity: .68; }
.boost .mp-icon { font-size: 20px; }
#notice { margin: 0 0 6px; height: 20px; text-align: center; font-size: 13px; font-weight: 800; color: #174352; text-shadow: 0 1px 2px #e0fff4; }
.brief { display: grid; gap: 2px; margin-top: 7px; padding: 7px 11px; border-radius: 14px; background: var(--cream); color: #5a4c2f; box-shadow: 0 3px 10px #185a5530; pointer-events: none; }
.brief strong { font-size: 14px; }
.brief span { font-size: 12px; }
.overlay { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; background: #0c45598c; padding: 18px; }
.dialog { width: min(100%, 290px); padding: 22px; border-radius: 16px; background: var(--cream); text-align: center; }
.dialog h2 { margin: 0 0 7px; font-size: 23px; }
.dialog p { margin: 0 0 15px; }
.dialog button { width: 100%; }
.entity { position: absolute; display: grid; place-items: center; transform: translate(-50%, -50%); text-align: center; }
.entity .mp-icon { font-size: calc(var(--size, 40px) * .82); line-height: 1; }
.entity .label { position: absolute; top: 100%; font-size: 11px; font-weight: 800; white-space: nowrap; padding: 1px 5px; border-radius: 7px; background: #effff2df; }
.sprite { display: none; position: absolute; inset: 0; overflow: hidden; }
.sprite img { position: absolute; width: var(--sprite-w); height: var(--sprite-h); top: var(--sprite-y); left: var(--sprite-x); max-width: none; }
.has-art .sprite { display: block; }
.has-art .building .mp-icon, .has-art .crate .mp-icon { visibility: hidden; }
.building { color: #a44c42; z-index: 1; }
.building .sprite { clip-path: polygon(0 43%, 50% 0, 100% 43%, 91% 43%, 91% 100%, 10% 100%, 10% 43%); }
.crate { color: #83532b; z-index: 2; }
.crate .sprite { border-radius: 19%; }
.boat { color: #a44915; z-index: 3; }
.boat .mp-icon { transform: translateY(17%); filter: drop-shadow(0 2px 1px #1d7b9c); }
.boat .sprite { inset: 0 18% 35%; clip-path: polygon(0 29%, 10% 8%, 28% 0, 68% 0, 85% 10%, 97% 34%, 100% 50%, 92% 56%, 90% 79%, 77% 97%, 66% 100%, 26% 100%, 12% 89%, 0 71%); }
.boat.hurt { opacity: .47; }
.boat.boosting .mp-icon { filter: drop-shadow(0 4px 3px #fff5d7); }
.exit { color: #195a4c; z-index: 1; }
.exit.open { color: #a34c0b; }
.wave, .vortex { color: #e8fdff; filter: drop-shadow(0 2px 2px #257fa4); }
.vortex { color: #1e738f; }
.amenity { color: #325b76; }
@media (max-height: 510px) {
  .brief span { display: none; }
  .vertical { grid-template-columns: repeat(2, 1fr); }
  .steering button { width: 44px; }
  #notice { margin-bottom: 2px; }
}

.entity .mp-icon { width: calc(var(--size, 40px) * .82); height: calc(var(--size, 40px) * .82); }
.platform { color: #8c725b; }
.rider { color: #184e62; z-index: 2; }
.has-art .pause, .has-art .boost, .has-art .steering button, .has-art .brief {
  background-image: var(--ref);
  background-repeat: no-repeat;
  background-size: 3900% 8440%;
}
.has-art .pause, .has-art .boost { background-position: 86.58% 7.32%; }
.has-art .steering button[data-drive='left'] { background-position: 32.37% 60.19%; color: #fff; }
.has-art .steering button[data-drive='right'] { background-position: 80% 60.19%; color: #164833; }
.has-art .vertical button { background-position: 56.84% 60.19%; color: #123849; }
.has-art .brief { background-position: 37.37% 82.51%; }

/* The reference's open sky band is clear of the mockup's labels and farm tiles. */
.art-source img { width: 105.4054%; height: 827.451%; left: -2.7027%; top: -88.2353%; }
.boost { width: 88px; padding-inline: 6px; white-space: nowrap; }
@media (max-width: 300px) {
  .hud { gap: 4px; left: 6px; right: 6px; }
  .pill { padding-inline: 6px; }
  .pill .mp-icon { display: none; }
  .bottom { left: 8px; right: 8px; }
  .steering button { width: 44px; }
}
