/* Sailmark's peach cloth and ivory controls stay separate from site chrome. */
:root { color-scheme: light; --sail-ink: #3b302d; --sail-cream: #fff0d6; --sail-peach: #e99e79; }
* { box-sizing: border-box; }
html { margin: 0; background: #e8a37e; scroll-behavior: smooth; }
body[data-mobile-std="1"] { margin: 0; overscroll-behavior: contain; color: var(--sail-ink); background: radial-gradient(ellipse at 50% 15%, #f6c5a2, #d88864); font-family: system-ui, -apple-system, sans-serif; }
body[data-mobile-std="1"] #egm-play-header { background: #e8ad87; color: #49372d; border-color: #bb8060; }
body[data-mobile-std="1"] #egm-play-header > a { color: #49372d; }
.sail-game { width: min(100%, 460px); height: calc(100vh - var(--sail-nav-height, 0px)); height: calc(100dvh - var(--sail-nav-height, 0px)); min-height: 580px; margin: 0 auto; padding: max(4px, env(safe-area-inset-top)) 10px max(4px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; position: relative; isolation: isolate; overflow: hidden; touch-action: none; background: linear-gradient(#f1b48f30, #e3a27d80), url('../assets/play/sailmark/cloth.webp') center / 100% 100%; box-shadow: 0 0 70px #6d392e35; }
.sail-brand { height: 112px; flex: 0 0 112px; text-align: center; position: relative; }
.sail-brand img { display: block; width: min(100%, 350px); height: 97px; object-fit: contain; margin: 0 auto; pointer-events: none; }
.sail-brand > span { display: block; font-size: 9px; font-weight: 800; letter-spacing: .19em; color: #663d2c; margin-top: -3px; }
.sail-hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 54px; flex: 0 0 54px; padding: 4px 16px 7px; margin: 0 3px 3px; border-radius: 14px; background: #fff0d6dc; box-shadow: 0 3px 0 #a9684645, inset 0 1px 0 #fff8eb; }
.sail-hud small { display: block; font-size: 9px; font-weight: 800; letter-spacing: .08em; line-height: 1.5; }
.sail-hud strong { display: block; font: 700 19px Georgia, serif; line-height: 1.1; }
.sail-tally { text-align: center; min-width: 49px; }
.sail-tally strong { font: 800 21px system-ui, sans-serif; }
.sail-stage-wrap { flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sail-stage-inner { position: relative; width: 100%; height: 100%; max-width: 100%; overflow: hidden; border-radius: 12px; }
#sailmark-canvas { display: block; width: 100%; height: 100%; margin: 0; touch-action: none; background: #dfa07a; outline-offset: -4px; }
.sail-start-card { position: absolute; top: 116px; left: 22%; right: 22%; z-index: 2; text-align: center; }
.is-ready .sail-hud { visibility: hidden; }
.sail-button { min-width: 48px; min-height: 48px; border: 0; border-radius: 22px; color: var(--sail-ink); background: #f9e2bd url('../assets/play/sailmark/button.webp') center / 100% 100% no-repeat; box-shadow: 0 4px 1px #8f543e75; font: 800 13px system-ui, sans-serif; letter-spacing: .01em; cursor: pointer; padding: 10px 12px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sail-button:active { transform: translateY(2px); box-shadow: 0 2px 1px #8f543e75; }
.sail-button:focus-visible, .sail-text-button:focus-visible, .sail-foot a:focus-visible { outline: 3px solid #49362f; outline-offset: 2px; }
.sail-button:disabled { opacity: .62; cursor: default; }
.sail-button.primary { width: 100%; font-size: 16px; }
.sail-text-button { display: inline-block; border: 0; background: none; color: #634432; min-height: 48px; font-size: 12px; font-weight: 750; text-decoration: underline; cursor: pointer; padding: 5px 10px; }
.sail-aim-line { flex: 0 0 24px; height: 24px; display: flex; align-items: center; justify-content: center; color: #4b3328; font-size: 11px; font-weight: 650; text-align: center; }
.sail-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: 0 0 52px; margin: 0 3px; padding-bottom: 4px; }
.sail-foot { display: flex; justify-content: space-between; flex: 0 0 36px; padding: 0 8px; font-size: 10px; font-weight: 650; }
.sail-foot a { color: #593b2f; display: flex; align-items: center; min-height: 36px; text-decoration: none; }
.sail-panel { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: #563e2e36; padding: 12px; }
[hidden] { display: none !important; }
.sail-panel-card { width: min(100%, 320px); max-height: 100%; padding: 18px; color: var(--sail-ink); background: #fff0d9f5; border-radius: 22px; border: 2px solid #f9d9aa; box-shadow: 0 12px 30px #57332155; text-align: center; }
.sail-eyebrow { font-size: 9px; letter-spacing: .16em; font-weight: 850; }
.sail-panel h2 { margin: 5px 0 10px; font: 700 29px Georgia, serif; }
.sail-panel p { margin: 6px 0 12px; font-size: 12px; line-height: 1.5; }
#panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#panel-actions .wide { grid-column: 1 / -1; }
.sail-guide { text-align: left; display: grid; gap: 8px; margin-bottom: 14px; font-size: 12px; line-height: 1.4; }
.sail-guide strong { font: 700 15px Georgia, serif; margin-right: 5px; }
.sail-score { margin: 10px 0 15px; }
.sail-score div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed #bb9774; }
.sail-score .total { font-weight: 800; font-size: 15px; border-bottom: 0; }
.sail-record { font-size: 10px !important; color: #795841; }
.sail-toast { position: absolute; top: 36%; left: 12%; right: 12%; text-align: center; color: #fff2d7; font-weight: 800; font-size: 13px; text-shadow: 0 2px 3px #65402f; pointer-events: none; }
.sail-help { margin: 0 auto; padding: 50px 24px 70px; max-width: 760px; line-height: 1.75; background: #fff0dc; color: #48352e; }
.sail-help h1 { font: 700 clamp(25px, 5vw, 37px)/1.2 Georgia, serif; }
.sail-help h2 { margin-top: 30px; font: 700 24px Georgia, serif; }
.sail-help p { font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-height: 740px) { .sail-brand { height: 82px; flex-basis: 82px; } .sail-brand img { height: 71px; } .sail-brand > span { font-size: 8px; } .sail-start-card { top: 84px; } .sail-hud { height: 48px; flex-basis: 48px; } .sail-foot { flex-basis: 28px; } .sail-foot a { min-height: 28px; } .sail-panel-card { padding: 12px; } .sail-panel h2 { font-size: 25px; } }
@media (min-width: 700px) { .sail-game { border-left: 1px solid #b86e4a; border-right: 1px solid #b86e4a; } .sail-help { border-radius: 20px 20px 0 0; } }
@media (max-height: 740px) {
  .sail-panel-card { padding: 10px; }
  .sail-panel h2 { font-size: 22px; margin: 4px 0 6px; }
  .sail-panel p { font-size: 11px; line-height: 1.35; margin: 4px 0 8px; }
  .sail-guide { font-size: 11px; line-height: 1.35; gap: 5px; margin-bottom: 8px; }
  .sail-guide strong { font-size: 13px; }
  .sail-score { margin: 6px 0 8px; }
  .sail-score div { font-size: 11px; line-height: 1.2; padding: 3px 0; }
  .sail-score .total { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .sail-button:active { transform: none; } }
