.island-page .ability-bar .ability-tile {
  --accent:#70cde1;
  position:relative;
  display:grid;
  grid-template-columns:32px minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  min-height:49px;
  padding:4px 8px 6px 5px;
  background:linear-gradient(#254e58,#173842);
  color:#fff0cc;
  border:1px solid #799495;
  border-radius:3px;
  text-align:left;
  box-shadow:0 2px 0 #0c2730;
}
.island-page .ability-bar .ability-tile[data-action="skill"] { --accent:#6bdfc6 }
.island-page .ability-bar .ability-tile[data-action="shoot"] { --accent:#ffc87b }
.ability-tile canvas { width:32px;height:32px;image-rendering:pixelated }
.ability-tile b,.ability-tile small { display:block;white-space:nowrap }
.ability-tile small { color:#bdd7d3;font-size:10px }
.ability-tile kbd { align-self:start;color:#e9ddba;border:1px solid #81928d;padding:0 4px;border-radius:2px;font-size:10px }
.ability-tile::after,.touch-key[data-status]::after {
  position:absolute;inset:auto 3px 2px;content:"";height:2px;background:var(--accent,#ffe0a0);
  transform:scaleX(calc(1 - var(--cooldown,0)));transform-origin:left;transition:transform .12s linear;
}
.ability-tile[data-status="locked"] canvas,.touch-key[data-status="locked"] canvas { opacity:.55 }
.ability-tile[data-status="locked"]::after,.touch-key[data-status="locked"]::after { opacity:.22 }
.island-page .touch-key { position:relative }
.island-page .touch-key[data-hold="shoot"] { background:#765233;border-color:#f2bb73 }
.island-page .touch-key.is-held { background:#678568;border-color:#ecdfa3 }
.island-page .touch-key[data-hold="jump"].is-held { background:#fff0aa }
.island-page .immersive-exit,.island-page .rotate-hint { display:none }
.island-page .touch-controls {
  --main-key-size:clamp(50px,calc(16dvh * var(--touch-size,1)),80px);
  --skill-key-size:clamp(44px,calc(12dvh * var(--touch-size,1)),60px);
  --key-gap:clamp(12px,3.8dvh,18px);
  align-items:end;
}
.island-page .touch-controls > .touch-stick {
  --stick-half:clamp(47px,14.5dvh,63px);
  position:fixed;z-index:7;flex:none;display:grid;place-items:center;
  width:calc(2 * var(--stick-half));aspect-ratio:1;
  left:clamp(calc(env(safe-area-inset-left,0px) + var(--stick-half)),var(--stick-center-x,0px),calc(56dvw - var(--stick-half)));
  top:clamp(calc(env(safe-area-inset-top,0px) + var(--stick-half)),var(--stick-center-y,0px),calc(100dvh - env(safe-area-inset-bottom,0px) - var(--stick-half)));
  translate:-50% -50%;opacity:0;visibility:hidden;
  cursor:grab;touch-action:none;pointer-events:none;
}
.island-page .touch-controls > .touch-stick.is-held { opacity:.85;visibility:visible }
.island-page .touch-stick::before {
  content:"";position:absolute;inset:0;
  border:2px solid #97b9b7;border-radius:50%;
  background:radial-gradient(circle,#28515bd6 32%,#102d3be6 33%,#183a48e6 62%,#3c6670e6 63%);
  box-shadow:inset 0 0 0 3px #1e414c,0 3px 10px #071c29b0;
  pointer-events:none;
}
.island-page .touch-stick .stick-thumb {
  display:block;width:42%;aspect-ratio:1;border-radius:50%;border:2px solid #decb95;
  background:radial-gradient(circle at 36% 27%,#79a5a6,#335d69 72%);box-shadow:0 2px 6px #0a232d;
  transform:translate(var(--stick-x,0px),var(--stick-y,0px));pointer-events:none;
}
.island-page .touch-stick.is-held .stick-thumb { background:radial-gradient(circle at 36% 27%,#c5d39f,#547d70 72%) }
.island-page .touch-controls > .touch-actions {
  margin-left:auto;display:grid;justify-items:end;
  gap:clamp(14px,4.4dvh,20px);pointer-events:auto;
}
.island-page .touch-action-row { display:flex;gap:var(--key-gap) }
.island-page .touch-controls .touch-key {
  width:var(--skill-key-size);aspect-ratio:1;
  min-width:0;min-height:0;border-radius:50%;
  box-shadow:0 2px 6px #0a232d80;
}
.island-page .touch-controls .touch-key.is-held { transform:none }
.island-page .touch-action-row.is-primary .touch-key { width:var(--main-key-size) }
.island-page .touch-controls .touch-key-label { width:min(86%,58px);height:auto;aspect-ratio:8/5 }
.island-page .touch-key[data-status]::after { border-radius:inherit }
.island-page .mobile-loading:not([hidden]) {
  position:absolute;inset:0;z-index:6;display:grid;place-items:center;padding:16px;
  background:#102c3de8;color:#f5e4b9;text-align:center;
}
.island-page .mobile-loading-card {
  width:min(100%,420px);box-sizing:border-box;padding:clamp(12px,4dvh,26px);
  border:1px solid #be9a63;border-radius:8px;background:#173c4c;box-shadow:0 8px 24px #071e2d;
}
.island-page .mobile-loading-card h2 { margin:4px 0 12px;font-size:clamp(19px,4dvh,26px) }
.island-page .mobile-loading-card p { margin:6px 0;font-size:13px;color:#efd8a3 }
.island-page .mobile-loading-card progress { width:100%;height:12px;accent-color:#edc37f }
.island-page .game-shell:has(#mobileLoading:not([hidden])) :is(.game-hud,.ability-bar) { visibility:hidden }
.island-page #resumeAudio[hidden] { display:none }
.island-page .game-shell[data-screen="ending"] .game-viewport {
  width:100%;min-width:0;max-height:none;background:#0a232f;
}
.island-page .game-shell[data-screen="ending"] :is(#islandCanvas,.game-toast) { visibility:hidden }
.island-page .ending-screen:not([hidden]) {
  position:absolute;inset:0;z-index:4;display:grid;grid-template-rows:minmax(0,1fr) auto;
  background:#0a232f;color:#fff0cc;text-align:center;
}
.island-page .ending-art {
  width:100%;height:100%;min-height:0;object-fit:contain;display:block;
  animation:island-ending-reveal .28s ease-out;
}
.island-page .ending-art[hidden],.island-page .ending-caption[hidden],.island-page #endingAudio[hidden] { display:none }
@keyframes island-ending-reveal { from { opacity:.25 } to { opacity:1 } }
@media (prefers-reduced-motion:reduce) {
  .island-page .ending-art { animation:none }
}
.island-page .ending-caption {
  margin:0 0 5px;color:#fff0cc;font-weight:700;font-size:clamp(13px,2.6vw,19px);line-height:1.4;
}
.island-page .ending-footer { padding:6px 10px 8px;border-top:1px solid #3c686d;background:#132f3a }
.island-page .ending-actions { display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px 10px }
.island-page .ending-actions span { color:#efd29c;font-size:13px }
.island-page .ending-actions button { min-height:44px;padding:5px 12px;font-size:13px }
.island-page .ending-actions button:not(.coral-button) { background:#214958;color:#fff0cc;border-color:#799495 }
.island-page .ending-actions button:not(.coral-button):hover { background:#315f6d }
.island-page .game-shell.is-immersive[data-screen="ending"] { grid-template-rows:minmax(0,1fr) }
#powerStatus { color:#ffdb9d;white-space:nowrap }
#powerStatus:empty { display:none }
html.island-immersive,.island-page.island-immersive { overflow:hidden;overscroll-behavior:none;scroll-behavior:auto }
.island-page .game-shell.is-immersive {
  --play-width:100dvw;
  --play-height:100dvh;
  --top:env(safe-area-inset-top,0px);
  --right:env(safe-area-inset-right,0px);
  --bottom:env(safe-area-inset-bottom,0px);
  --left:env(safe-area-inset-left,0px);
  position:fixed;inset:0;
  z-index:9999;
  width:var(--play-width);height:var(--play-height);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  align-items:center;
  justify-items:stretch;
  box-sizing:border-box;
  margin:0;padding:var(--top) var(--right) var(--bottom) var(--left);
  border:0;border-radius:0;
  background:#0a232f;
  overflow:hidden;
}
.island-page .game-shell.is-immersive .game-viewport {
  display:grid;place-items:center;
  min-width:0;min-height:0;
  width:100%;height:100%;max-height:none;margin:0;
  aspect-ratio:auto;
  overflow:hidden;background:#0a232f;
}
.island-page .game-shell.is-immersive #islandCanvas {
  width:100%;height:100%;min-height:0;object-fit:contain;
}
.island-page .game-shell.is-immersive>.save-strip { display:none }
.island-page .game-shell.is-immersive[data-screen="title"] { grid-template-rows:minmax(0,1fr) }
.island-page .game-shell.is-immersive[data-screen="title"] .immersive-exit,
.island-page .game-shell.is-immersive .immersive-exit {
  display:grid;place-items:center;position:absolute;z-index:5;
  top:calc(var(--top) + 3px);right:calc(var(--right) + 5px);
  width:44px;height:44px;padding:0;background:#163744;color:#ffedc2;border:1px solid #bc9c69;border-radius:4px;
}
.island-page .game-shell.is-immersive .game-hud { padding-right:54px }
.island-page .game-shell.is-immersive #fullscreenButton { display:none }
.island-page .game-shell.is-immersive .game-overlay { overflow:auto }
.island-page .game-shell.is-immersive .overlay-card p { max-height:none }
@media (max-width:760px) {
  .island-page .ability-bar { justify-content:center }
  .island-page .ability-bar>div { width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px }
  .island-page .ability-bar .ability-tile { grid-template-columns:22px minmax(0,1fr);gap:3px;padding-inline:4px }
  .ability-tile canvas { width:22px;height:22px }
  .ability-tile kbd { display:none }
  .island-page .touch-controls { justify-content:space-between;column-gap:4px }
}
@media (pointer:coarse) {
  .island-page .game-shell.is-immersive { grid-template-rows:auto minmax(0,1fr) }
  .island-page .game-shell[data-screen="game"] .game-viewport { touch-action:none;overscroll-behavior:none }
  .island-page .game-shell.is-immersive .game-hud { display:flex;flex-wrap:wrap;gap:2px 8px;padding-block:2px;font-size:11px }
  .island-page .game-shell.is-immersive .game-hud strong { flex:1 1 auto;font-size:11px }
  .island-page .game-shell.is-immersive .hud-survival { width:auto;gap:7px;font-size:10px }
  .island-page .game-shell.is-immersive .hud-tools { width:auto;gap:3px;justify-content:flex-end }
  .island-page .game-shell.is-immersive .hud-tools button,
  .island-page .game-shell.is-immersive .game-settings summary { min-height:36px;padding:2px 6px;font-size:10px }
  .island-page .game-shell.is-immersive .ability-bar { display:none }
  .island-page .game-shell.is-immersive .touch-controls {
    display:flex;position:absolute;z-index:4;justify-content:space-between;align-items:end;
    inset:auto calc(var(--right) + 16px) calc(var(--bottom) + 16px) calc(var(--left) + 16px);
    padding:0;gap:8px;background:none;border:0;pointer-events:none;
  }
  .island-page .game-shell.is-immersive .touch-key {
    pointer-events:auto;
    background:#173a49df;border-color:#afd6cf;
  }
  .island-page .game-shell.is-immersive .touch-key[data-hold="jump"] { background:#e9cc88 }
  .island-page .game-shell.is-immersive .touch-key[data-hold="attack"] { background:#975e50e8;border-color:#efb195 }
  .island-page .game-shell.is-immersive .touch-key[data-hold="shoot"] { background:#8a5d3ce8;border-color:#f2bb73 }
  .island-page .game-shell.is-immersive .touch-key.is-held { background:#729775 }
  .island-page .game-shell.is-immersive .game-toast { bottom:calc(var(--bottom) + 14px);max-width:40% }
  .island-page .game-shell.is-immersive[data-screen="title"] .touch-controls,
  .island-page .game-shell.is-immersive:has(#mobileLoading:not([hidden])) .touch-controls,
  .island-page .game-shell.is-immersive:has(.game-overlay:not([hidden])) .touch-controls { display:none }
  .island-page .game-shell.is-immersive[data-screen="title"] .game-viewport {
    height:100%;min-height:0;aspect-ratio:auto;touch-action:pan-y;
  }
  .island-page .game-shell.is-immersive[data-screen="title"]:fullscreen { display:grid;overflow:hidden }
  .island-page .game-shell.is-immersive .island-title-screen {
    flex-direction:column;align-items:stretch;justify-content:flex-start;padding-block:10px;
  }
  .island-page .game-shell.is-immersive .title-content { flex:none;margin:auto 0 }
  .island-page .game-shell.is-immersive .title-save-strip {
    position:static;flex:none;margin-top:8px;padding:6px 12px;
  }
  .island-page .game-shell.is-immersive .title-actions { gap:5px }
  .island-page .game-shell.is-immersive .title-actions button { min-height:46px;padding-block:3px }
  .island-page .game-shell.is-immersive .title-kicker,
  .island-page .game-shell.is-immersive .title-tagline { margin-block:4px 9px }
  .island-page .game-shell.is-immersive .title-status { margin-top:7px }
}
@media (pointer:coarse) and (max-width:760px) {
  .island-page .game-shell.is-immersive .title-content { align-self:center }
}
.island-page .game-shell:is([data-screen="title"],[data-screen="ending"]) > :is(.game-hud,.ability-bar,.save-strip,.touch-controls) { display:none }
@media (pointer:coarse) and (orientation:portrait) {
  .island-page .game-shell.is-immersive .rotate-hint {
    display:block;position:absolute;z-index:4;inset:auto 0 calc(var(--bottom) + 66px);
    width:max-content;margin:auto;background:#173644f2;color:#ffe0a0;border:1px solid #b89c65;padding:7px 12px;
    pointer-events:none;
  }
}
@media (prefers-reduced-motion:reduce) {
  .ability-tile::after,.touch-key[data-status]::after { transition:none }
}
