/* Storm Ship UI. Display font Oswald (condensed, maritime / poster feel). Big numbers with a dark outline so they
   read over a black sea AND over a white lightning frame. */
:root { font-family: 'Oswald', 'Arial Narrow', system-ui, sans-serif; --ink: #05090e; --accent: #ffb43c; --ok: #4dffa6; --bad: #ff4d4d; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070b10; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas { display: block; position: fixed; inset: 0; }
[hidden] { display: none !important; }

.hud { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0; text-align: center; z-index: 2; pointer-events: none; }
.dist { font-size: clamp(46px, 13vw, 84px); font-weight: 700; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,0.6), 0 0 20px rgba(0,0,0,0.6); -webkit-text-stroke: 2px rgba(5, 9, 14, 0.6); paint-order: stroke fill; }
.dist span { font-size: 0.3em; margin-left: 6px; opacity: 0.85; letter-spacing: 0.06em; text-transform: uppercase; }
.row { display: flex; justify-content: space-between; padding: 4px 16px 0; }
.hull { display: flex; gap: 6px; }
.hull i { width: 30px; height: 14px; border-radius: 3px 3px 10px 10px; background: var(--accent); box-shadow: 0 0 10px rgba(255, 180, 60, 0.8); }
.hull i.off { background: rgba(255, 255, 255, 0.15); box-shadow: none; }
.waves { font-size: 26px; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,0.6); }
.bump { animation: bump 0.45s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.5); color: var(--ok); } 100% { transform: scale(1); } }

/* wave compass: bow = up. The arrow shows where the monster comes from; green when within the safe angle */
.compass { position: fixed; z-index: 2; left: 14px; bottom: max(60px, calc(env(safe-area-inset-bottom) + 50px)); text-align: center; pointer-events: none; }
.dial { position: relative; width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; border: 3px solid rgba(255,255,255,0.5); background: rgba(5, 9, 14, 0.45); }
.bow { position: absolute; left: 50%; top: 10px; width: 0; height: 0; transform: translateX(-50%); border: 10px solid transparent; border-bottom: 26px solid #fff; border-top: 0; }
.arrow { position: absolute; inset: 0; }
.arrow i { position: absolute; left: 50%; top: -14px; width: 0; height: 0; transform: translateX(-50%); border: 12px solid transparent; border-top: 22px solid var(--bad); border-bottom: 0; filter: drop-shadow(0 0 6px rgba(255, 60, 60, 0.9)); }
.compass.ok .arrow i { border-top-color: var(--ok); filter: drop-shadow(0 0 6px rgba(80, 255, 160, 0.9)); }
.compass.ok .dial { border-color: var(--ok); }
.compass.bad .dial { border-color: var(--bad); animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 rgba(255, 60, 60, 0); } to { box-shadow: 0 0 26px rgba(255, 60, 60, 0.9); } }
.compass p { margin: 6px 0 0; font-size: 24px; font-weight: 700; letter-spacing: 0.04em; text-shadow: 0 2px 0 rgba(0,0,0,0.7), 0 0 12px rgba(0,0,0,0.8); }
.compass.bad p { color: #ffd0d0; }

.banner { position: fixed; left: 0; right: 0; top: 28%; text-align: center; font-size: clamp(46px, 14vw, 96px); font-weight: 700; z-index: 2; pointer-events: none; text-shadow: 0 5px 0 rgba(0,0,0,0.6), 0 0 30px rgba(160, 200, 255, 0.6); -webkit-text-stroke: 3px rgba(5, 9, 14, 0.6); paint-order: stroke fill; letter-spacing: 0.03em; animation: pop 1.8s ease-out forwards; }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 12% { transform: scale(1.15); opacity: 1; } 22% { transform: scale(1); } 75% { opacity: 1; } 100% { transform: scale(1.05) translateY(-16px); opacity: 0; } }
.hint { position: fixed; z-index: 2; left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 20px; letter-spacing: 0.05em; text-shadow: 0 2px 0 rgba(0,0,0,0.8); pointer-events: none; }
.edge { position: fixed; z-index: 2; left: 0; right: 0; top: 46%; text-align: center; font-size: 28px; font-weight: 700; color: #ffd0d0; opacity: 0; transition: opacity 0.3s; pointer-events: none; text-shadow: 0 2px 0 rgba(0,0,0,0.8); }
.danger { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; box-shadow: inset 0 0 120px 30px rgba(255, 50, 40, 0.8); }

.mute { position: fixed; z-index: 4; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 20px; background: rgba(5, 9, 14, 0.55); color: #fff; cursor: pointer; }

.panel { position: fixed; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, calc(100% - 32px)); text-align: center; padding: 22px 20px 16px; border-radius: 22px; background: rgba(5, 9, 14, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); border: 1px solid rgba(255,255,255,0.08); }
.title { margin: 0; font-size: 78px; font-weight: 700; line-height: 0.9; letter-spacing: 0.04em; text-shadow: 0 5px 0 #a3600e, 0 0 30px rgba(255, 180, 60, 0.35); color: #ffe8c2; }
.sub { margin: 10px 0 0; font-size: 19px; opacity: 0.92; }
.sub.small { margin-top: 0; font-size: 16px; opacity: 0.8; letter-spacing: 0.05em; text-transform: uppercase; }
.rtitle { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: 0.05em; }
.rtitle.good { color: var(--ok); }
.rtitle.bad { color: #ff8b7a; }
.big { margin: 0; font-size: 92px; font-weight: 700; line-height: 1.0; color: #ffe8c2; text-shadow: 0 5px 0 #a3600e; }
.big b { font-weight: inherit; }
.stats { margin: 8px 0 0; font-size: 20px; opacity: 0.9; }
.newbest { margin: 0 0 4px; font-size: 24px; color: var(--accent); animation: wob 0.8s ease-in-out infinite alternate; }
@keyframes wob { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.1); } }
.bestline { margin: 8px 0 0; font-size: 18px; color: var(--accent); }
.how { margin: 14px 0 0; font-size: 14px; opacity: 0.82; line-height: 1.4; font-family: system-ui, sans-serif; }
.credit { margin: 14px 0 0; font-size: 12px; opacity: 0.55; font-family: system-ui, sans-serif; }
.cta { margin-top: 16px; width: 100%; border: 0; border-radius: 14px; padding: 12px; font: inherit; font-weight: 700; font-size: 26px; letter-spacing: 0.06em; color: #1a0f02; background: var(--accent); box-shadow: 0 5px 0 #a3600e, 0 0 24px rgba(255, 180, 60, 0.35); cursor: pointer; }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #a3600e; }
.cta.ghost { margin-top: 10px; font-size: 19px; padding: 9px; color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.cta.ghost:active { transform: none; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

body.og .mute, body.og .panel, body.og .banner, body.og .hud, body.og .compass, body.og .hint { display: none !important; }
body.og .ogtitle { display: block; }
body.shot .mute { display: none; }
body.shot .banner { animation: none; opacity: 1; }
.ogtitle { display: none; position: fixed; z-index: 2; left: 4%; bottom: 6%; font-size: 120px; font-weight: 700; line-height: 0.9; color: #ffe8c2; text-shadow: 0 6px 0 #a3600e, 0 14px 30px rgba(0, 0, 0, 0.6); letter-spacing: 0.03em; }

@media (max-height: 460px) {
  .panel { padding: 12px 16px; }
  .title { font-size: 46px; }
  .big { font-size: 54px; }
  .cta { margin-top: 8px; padding: 7px; font-size: 20px; }
  .how, .credit { margin-top: 6px; }
  .dist { font-size: 46px; }
  .compass { bottom: 10px; }
  .dial { width: 70px; height: 70px; }
  .compass p { font-size: 18px; }
}
