* { box-sizing: border-box; }
body.ch-game { margin: 0; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible,a:focus-visible,canvas:focus-visible { outline: 2px solid var(--ch-amber); outline-offset: 4px; }
[hidden] { display: none !important; }
.boaty-stage { max-width: 1080px; margin: 18px auto; gap: 14px; }
.boaty-nav { display: flex; align-items: center; gap: 10px; }
.boaty-brand { display: flex; flex-shrink: 0; }
.boaty-brand img { display: block; }
.boaty-stage .ch-topbar { gap: 16px; }
.boaty-stage .ch-title h1 { white-space: nowrap; }
.boaty-bezel { width: 100%; max-width: 650px; margin: auto; padding: 18px; }
#fit { margin: auto; position: relative; }
#cabinet { width: 600px; height: 700px; transform-origin: top left; position: relative; border: 1px solid #669d9666; border-radius: 12px; overflow: hidden; background: #092c38; color: #e8f5ed; }
#sea { display: block; touch-action: none; width: 600px; height: 700px; max-height: none; image-rendering: auto; z-index: 0; }
.expedition-label { position: absolute; top: 28px; left: 28px; right: 28px; color: #b6d4cb; font: 10px var(--ch-mono); letter-spacing: 1.5px; }
.expedition-label span { float: right; }
.eyebrow { font: 700 10px var(--ch-mono); letter-spacing: 2px; color: #8fc9c5; margin: 0 0 10px; }
/* The card sits over the scaled ocean at CSS-pixel size; when the result (board + Play next) is taller than the
   water it scrolls inside the card instead of spilling out. */
.overlay-wrap { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 14px 40px; pointer-events: none; }
#overlay { position: relative; width: 100%; max-width: 520px; max-height: 100%; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; pointer-events: auto; text-align: center; padding: 30px 24px; background: #062530d9; border: 1px solid #99d7bd30; backdrop-filter: blur(7px); border-radius: 18px; }
#overlay h2 { font-family: var(--ch-display); font-size: 44px; line-height: 1.05; letter-spacing: -1.7px; margin: 10px 0 18px; }
#message { color: #b5d6d5; font-size: 15px; line-height: 1.7; margin-bottom: 24px; }
#launch { font-family: var(--ch-font); background: #f4cf68; color: #163039; width: 100%; padding: 17px 22px; border: 0; border-radius: 8px; font-weight: 700; font-size: 16px; box-shadow: 0 4px 0 #b99139; }
#launch:hover { background: #ffe094; }
#launch span { float: right; }
.keys { font: 10px monospace; color: #89b8b8; letter-spacing: 2px; margin: 20px 0 0; }
#result { margin-top: 14px; text-align: left; }
#result .lg-board-slot:empty { display: none; }
.bottom { position: absolute; bottom: 24px; left: 28px; right: 28px; }
#status { font: 9px var(--ch-mono); letter-spacing: 1.5px; color: #a9d7bd; }
.boaty-stage .game-overview { margin: 0 auto 30px; max-width: 650px; }
@media(max-width:760px) {
 .boaty-stage { margin: 10px auto; gap: 10px; }
 .boaty-nav { grid-area: back; gap: 6px; }
 .boaty-stage .ch-topbar { gap: 12px 8px; }
 .boaty-stage .ch-title h1 { font-size: 17px; white-space: normal; }
 .boaty-stage .ch-eyebrow { font-size: 8px; letter-spacing: 1px; }
 .boaty-nav .ch-back { padding: 8px; font-size: 11px; }
 .boaty-brand img { width: 28px; height: 28px; }
 .boaty-bezel { padding: 12px; }
 .boaty-stage .ch-hint { gap: 10px; padding: 4px; font-size: 9px; }
 .overlay-wrap { padding: 10px 12px; }
}
/* Keep the UI at readable CSS-pixel sizes; only the ocean scales. */
#overlay { padding: 18px; border-radius: 14px; }
#overlay h2 { font-size: clamp(23px,4vw,32px); margin: 6px 0 10px; letter-spacing: -.7px; }
#message { font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
#launch { min-height: 44px; padding: 12px 18px; font-size: 14px; }
.keys { margin: 12px 0 0; font-size: 9px; }
.boaty-stage .ch-btn { min-height: 44px; }
.boaty-stage .ch-btn-icon { min-width: 44px; }
.expedition-label,.bottom { pointer-events: none; }
.boaty-expanded { overflow: hidden; }
.boaty-expanded .boaty-stage { position: fixed; inset: 0; z-index: 100; max-width: none; margin: 0; padding: 8px; background: #0a211e; gap: 8px; }
.boaty-expanded .boaty-bezel { padding: 4px; max-width: none; box-shadow: none; background: transparent; }
.boaty-expanded .ch-hint,.boaty-expanded .game-overview,.boaty-expanded .boaty-stage > div:not(.ch-bezel) { display: none; }
.boaty-expanded .ch-topbar { padding: 6px 10px; gap: 6px 10px; }
.boaty-expanded .ch-eyebrow { display: none; }
@media (max-width: 760px) { .boaty-stage .ch-controls { gap: 4px; } .boaty-stage .ch-btn { padding: 8px; font-size: 11px; } }
@media (orientation: landscape) and (max-height: 550px) {
 .boaty-stage { margin: 6px auto; }
 .boaty-stage .ch-topbar { padding: 4px 10px; gap: 8px; }
 .boaty-stage .ch-eyebrow,.boaty-stage .ch-hint { display: none; }
 .boaty-stage .ch-title h1 { font-size: 16px; }
 .overlay-wrap { padding: 8px; }
 #overlay { padding: 12px; }
 #overlay h2 { font-size: 22px; }
 #message { font-size: 12px; margin-bottom: 10px; }
 .keys,#overlay .eyebrow { display: none; }
 .boaty-expanded .boaty-stage { padding-right: 190px; }
 .boaty-expanded .ch-topbar { position: absolute; right: 8px; top: 8px; bottom: 8px; width: 174px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; }
 .boaty-expanded .ch-title h1 { white-space: normal; text-align: center; }
 .boaty-expanded .ch-scores { justify-content: center; }
 .boaty-expanded .ch-controls { justify-content: center; flex-wrap: wrap; }
 .boaty-expanded .boaty-bezel { margin: auto; }
}
