.chart-guide {position:absolute;left:12px;top:12px;padding:7px 11px;border:1px solid #dec78888;border-radius:8px;background:#102b3edb;color:#fff2c9;font-size:12px;pointer-events:none;z-index:3}
.game-shell[data-screen="title"] .chart-guide {display:none}
.island-page .island-main .game-below {display:block}
.game-below p + p {margin-top:6px}
.game-viewport:has(.game-overlay:not([hidden])) :is(.chart-guide,.boss-bar) {visibility:hidden}
.crew-talk {position:absolute;left:50%;bottom:22px;transform:translateX(-50%);z-index:7;background:#23493f;color:#fff0be;border:1px solid #d5b16a;border-radius:8px;padding:10px 16px;font:inherit}
.island-page .ship-dialog {width:min(1000px,94vw);max-height:90dvh;color:#f8edce}
.ship-dialog section {margin-top:24px}
.ship-dialog h3 {font-size:18px;margin:0 0 10px;color:#f3d691}
.ship-dialog p {line-height:1.7}
.island-page .ship-dialog p {color:#d8e5dc}
.ship-scene {position:relative;aspect-ratio:16/8;overflow:hidden;border-radius:12px;border:1px solid #d0ac65}
.ship-scene>img:first-child {width:100%;height:100%;object-fit:cover;display:block;image-rendering:pixelated}
.crew-portrait {width:144px;height:144px;flex-shrink:0;background-size:400% 400%;background-position:0 0;image-rendering:pixelated}
.ship-scene .crew-portrait {position:absolute;left:28%;bottom:11%;width:clamp(90px,18vw,170px);height:clamp(90px,18vw,170px);filter:drop-shadow(0 5px 1px #17292c4d)}
#shipFlag {position:absolute;right:12%;top:6%;width:95px;height:95px;object-fit:contain;image-rendering:pixelated}
#shipCrewLine {position:absolute;left:8%;right:8%;bottom:0;margin:0;padding:9px 14px;background:#102c3ee8;border-radius:10px 10px 0 0;color:#fff1c8;text-align:center;font-size:13px}
#shipMessage {min-height:1.5em;color:#c7f3d4}
.charm-list {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.charm-list article {border:1px solid #d5b16a55;border-radius:10px;padding:12px;background:#153345}
.charm-list img {width:58px;height:58px;object-fit:contain;image-rendering:pixelated;float:left;margin:0 10px 8px 0}
.charm-list h4 {font-size:15px;margin:4px 0 8px;color:#f9df9f}
.charm-list p {clear:both;font-size:13px;min-height:3.4em;margin:8px 0;color:#d8e5dc}
.charm-list article>div {display:flex;gap:6px;flex-wrap:wrap}
.island-page .charm-list button {flex:1;font-size:12px;padding:7px 5px;min-height:38px}
.island-page .ship-dialog [aria-pressed="true"] {background:#39715c;border-color:#f9d88c;color:#fff3c6}
.ship-flags {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.ship-flags button {display:flex;flex-direction:column;align-items:center;gap:5px}
.ship-flags img {width:72px;height:72px;object-fit:contain;image-rendering:pixelated}
.ship-flags span {font-size:12px}
.trial-panel label {display:flex;gap:14px;align-items:center;margin:12px 0}
.trial-panel select {min-width:0;flex:1;background:#153345;border:1px solid #b99b60;border-radius:6px;color:#fff2d2;padding:9px;font:inherit}
.trial-panel>div {display:flex;gap:10px;flex-wrap:wrap}
.trial-panel button {flex:1;min-height:44px}
.ship-log {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.ship-log article {background:#153345;border:1px solid #d5b16a44;border-radius:8px;padding:10px;text-align:center}
.ship-log h4 {font-size:13px;margin:6px 0}
.ship-log p {font-size:11px;margin:0;color:#d3dfda}
.boss-trophy {width:72px;height:72px;margin:auto;background-size:800% 800%;image-rendering:pixelated}
.sea-world button small {display:block;font-size:10px;font-weight:400;white-space:normal;line-height:1.6;margin-top:4px;color:#cce1d9}
.crew-conversation {display:flex;align-items:center;gap:16px}
.island-page .crew-dialog {color:#f8edce}
.island-page .crew-dialog button {color:#fff1cb}
.island-page .crew-dialog #crewSpeech {color:#fff0c9;font-size:15px}
.crew-conversation p {line-height:1.8}
.crew-conversation p:last-child {font-size:13px;color:#cdded9}
.crew-actions {display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.island-page .control-settings label {display:grid;grid-template-columns:110px minmax(70px,1fr) 50px;align-items:center;gap:8px;margin:12px 0;font-size:12px}
.control-settings input {width:100%;min-width:0;accent-color:#d7b66a}
.control-settings output {text-align:right}
.island-page .touch-controls>.touch-actions {opacity:var(--touch-opacity,.85)}
.island-page .game-shell.is-immersive .touch-controls {right:calc(var(--right,0px) + var(--touch-inset,14px));bottom:calc(var(--bottom,0px) + var(--touch-bottom,14px))}
.crew-portrait {animation:crew-frames 1.2s steps(3,end) infinite}
.crew-dialog .crew-portrait {background-position-y:66.6667%}
@keyframes crew-frames {from{background-position-x:0%}to{background-position-x:100%}}
@media(prefers-reduced-motion:reduce){.crew-portrait{animation:none}}
@media(max-width:650px) {
  .charm-list {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .ship-log {grid-template-columns:repeat(2,minmax(0,1fr))}
  .ship-flags {grid-template-columns:repeat(2,minmax(0,1fr))}
  .crew-conversation {align-items:flex-start;gap:8px}
  .crew-conversation .crew-portrait {width:100px;height:100px}
  #shipCrewLine {font-size:11px;left:2%;right:2%;padding:6px}
  #shipFlag {width:60px;height:60px;right:6%;top:3%}
  .charm-list p {min-height:5.1em;font-size:12px}
  .ship-scene {aspect-ratio:16/10}
}
@media(max-width:430px) {
  .charm-list {grid-template-columns:1fr}
  .charm-list p {min-height:0}
  .charm-list h4 {font-size:15px}
  .island-page .charm-list button {min-height:42px}
}
@media(orientation:landscape) and (max-height:530px) {
  .ship-scene {aspect-ratio:24/7}
  .ship-scene .crew-portrait {width:120px;height:120px}
  .island-page .chart-guide {top:52px;font-size:10px;padding:5px 8px}
  .crew-talk {bottom:8px;padding:7px 10px;font-size:11px}
  .island-page .settings-dialog[open] {grid-template-columns:minmax(180px,1fr) minmax(220px,1fr)}
  .settings-dialog .quality-settings {grid-column:1/-1}
  .settings-dialog .quality-settings>div {grid-template-columns:repeat(3,1fr)}
}
@media (pointer:coarse) {
  .island-page .hud-tools .hud-shortcut {display:none}
  .island-page .game-shell .game-hud .sea-health-track {width:64px;height:18px}
  .island-page .game-shell .game-hud .sea-health-track #health {
    inset:4px 6px;width:calc(100% - 12px);height:calc(100% - 8px);
  }
  .island-page .game-shell .game-hud .sea-health .sea-icon {width:15px;height:15px}
  .island-page .boss-bar {top:5px;width:min(55%,216px)}
  .island-page .boss-bar #bossName {font-size:11px;line-height:14px;margin:0 0 2px}
  .island-page .boss-gauge {
    height:13px;aspect-ratio:auto;box-sizing:border-box;
    background:#0b1329;border:1px solid #c99c5f;border-radius:3px;overflow:hidden;
  }
  .island-page .boss-gauge #bossHealth {inset:0;width:100%;height:100%}
  .island-page .boss-gauge #bossHealthCount {inset:0;width:auto;height:auto;font-size:10px}
  .island-page .chart-guide {top:35px;left:8px;font-size:11px;padding:4px 7px}
}
@media (pointer:coarse) and (orientation:landscape) {
  .island-page .game-shell.is-immersive .game-hud {
    flex-wrap:wrap;gap:1px 8px;padding:1px 50px 2px 8px;
  }
  .island-page .game-shell.is-immersive #stageName {
    flex:1 1 88px;min-width:0;margin-right:0;overflow:hidden;
    text-overflow:ellipsis;white-space:nowrap;
  }
  .island-page .game-shell.is-immersive .hud-survival {gap:3px 6px;max-width:100%}
  .island-page .game-shell.is-immersive .hud-tools {
    max-width:100%;flex-wrap:nowrap;justify-content:flex-start;
    overflow-x:auto;scrollbar-width:thin;padding:0 2px 1px;
  }
  .island-page .game-shell.is-immersive .game-hud .hud-tools button {
    flex:none;min-width:36px;min-height:34px;padding:3px 6px;font-size:11px;
  }
  .island-page .game-shell.is-immersive .hud-tools button:focus-visible {outline-offset:-2px}
  .island-page .game-shell.is-immersive .hud-tools button .sea-icon {width:13px;height:13px}
  .island-page .game-shell.is-immersive #shopButton {margin-left:0}
  .island-page .game-shell.is-immersive .chart-guide {top:6px}
  .island-page .game-shell.is-immersive .game-overlay {place-items:safe center;padding:8px}
  .island-page .game-shell.is-immersive .overlay-card {
    width:min(100%,430px);max-width:none;margin:0;padding:12px 16px;
    border-width:8px;border-image-width:10px;
  }
  .island-page .game-shell.is-immersive .overlay-card .pirate-portrait {display:none}
  .island-page .game-shell.is-immersive .overlay-card h2 {font-size:18px;margin:0 0 6px}
  .island-page .game-shell.is-immersive .overlay-card p {
    font-size:12px;line-height:1.6;max-height:none;overflow:visible;margin:0 0 7px;
  }
  .island-page .game-shell.is-immersive .overlay-card button {
    display:inline-flex;align-items:center;justify-content:center;
    min-width:0;min-height:42px;margin:3px;padding:5px 12px;
  }
}
@media (pointer:coarse) and (orientation:landscape) and (max-width:540px) {
  .island-page .game-shell.is-immersive .chart-guide {top:35px}
}
