:root { --ink:#f4f8ff; --muted:#a9bfd6; --gold:#ffd36e; --panel:rgba(14,32,58,.86); --line:rgba(160,200,255,.2); --good:#5ee6a0;
  --font: system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,sans-serif; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; overflow:hidden; background:#0b2a4a; color:var(--ink); font-family:var(--font);
  user-select:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent; }
canvas#game { position:fixed; inset:0; display:block; touch-action:none; }
#ui { position:fixed; inset:0; pointer-events:none; }
#ui > * { pointer-events:auto; }
button { font-family:inherit; color:inherit; cursor:pointer; border:0; background:none; }
#hud { position:absolute; left:1rem; top:.8rem; pointer-events:none; text-shadow:0 2px 10px rgba(0,0,0,.6); }
#coins { font-size:2.3rem; font-weight:900; font-variant-numeric:tabular-nums; }
#coins::before { content:""; display:inline-block; width:1.7rem; height:1.7rem; margin-right:.5rem; vertical-align:-.2rem;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.35' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='%23fff6c9'/%3E%3Cstop offset='.45' stop-color='%23ffd23f'/%3E%3Cstop offset='1' stop-color='%23d98a12'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='16' cy='16' r='15' fill='%23b86e0a'/%3E%3Ccircle cx='16' cy='15' r='14' fill='url(%23g)'/%3E%3Ccircle cx='16' cy='15' r='10.5' fill='none' stroke='%23c47c0c' stroke-width='1.6' opacity='.7'/%3E%3Cpath d='M16 8.5v13M12.5 11h7M10.5 16.5c.8 3.2 3 5 5.5 5s4.7-1.8 5.5-5' fill='none' stroke='%23a35f08' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='8.5' r='1.6' fill='none' stroke='%23a35f08' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat; filter:drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
#rate { margin-left:1.8rem; font-weight:700; color:var(--gold); }
#panel { position:absolute; right:0; bottom:0; width:min(26rem,100%); padding:.7rem; display:grid; gap:.5rem; background:var(--panel);
  border-top-left-radius:1rem; border:1px solid var(--line); }
.row { display:flex; align-items:center; gap:.7rem; padding:.55rem .8rem; border-radius:.8rem; text-align:left; width:100%;
  background:rgba(255,255,255,.07); border:1px solid var(--line); }
.row .t { flex:1; } .row b { display:block; font-size:1rem; } .row small { color:var(--muted); font-size:.8rem; }
.row .c { font-weight:800; color:var(--gold); font-variant-numeric:tabular-nums; }
.row.ok { background:linear-gradient(180deg,#2bb673,#1f8f5a); border-color:#6af0ae; }
.row.ok .c, .row.ok small { color:#fff; }
.row:disabled { opacity:.55; cursor:default; }
#hint { position:absolute; left:50%; transform:translateX(-50%); top:38%; padding:.6rem 1rem; border-radius:.8rem; background:#fff; color:#10233b;
  font-weight:800; pointer-events:none; }
#hint[hidden] { display:none; }
#lighthouse { background:linear-gradient(180deg,#ffb02e,#e0801a); border-color:#ffe29a; }
#modal { position:absolute; inset:0; display:grid; place-items:center; background:rgba(5,15,30,.6); }
#modal[hidden] { display:none; }
#modal .card { width:min(22rem,90%); padding:1.2rem; border-radius:1rem; background:#16345c; border:1px solid var(--line); text-align:center; }
#modal h2 { margin:.2rem 0 .6rem; } #modal p { color:var(--muted); }
#modal button { margin:.3rem; padding:.6rem 1.2rem; border-radius:.7rem; font-weight:800; background:var(--gold); color:#2a1a00; }
#modal button.alt { background:rgba(255,255,255,.12); color:var(--ink); }
#menu { position:absolute; right:.8rem; top:.8rem; width:2.6rem; height:2.6rem; border-radius:50%; background:var(--panel); border:1px solid var(--line); font-size:1.2rem; }
body.portrait #panel { width:100%; border-top-right-radius:1rem; }
.row[hidden], #lighthouse[hidden] { display:none; }
#goal { position:absolute; left:1rem; top:5.4rem; max-width:calc(100% - 4rem); padding:.35rem .8rem; border-radius:999px; font-size:.85rem; font-weight:800; background:rgba(14,32,58,.8); border:1px solid var(--line); color:var(--ink); text-align:left; }
#goal.done { background:linear-gradient(180deg,#2bb673,#1f8f5a); border-color:#6af0ae; animation:pulse 1s infinite alternate; }
#goal[hidden] { display:none; }
@keyframes pulse { to { transform:scale(1.04); } }
#adboost { position:absolute; left:1rem; top:7.6rem; padding:.45rem 1rem; border-radius:999px; font-size:.95rem; font-weight:800; color:#0b0d12; background:#f59e2c; border:none; box-shadow:0 3px 0 #a8650f, 0 6px 18px rgba(0,0,0,.25); animation:adpulse 1.8s ease-in-out infinite; } /* 20.11: was pale blue on the quay and hard to see (10 rewarded ads in 228 sessions) */
@keyframes adpulse { 50% { transform:scale(1.05); box-shadow:0 3px 0 #a8650f, 0 6px 26px rgba(245,158,44,.6); } }
#adboost[hidden] { display:none; }
/* in-app purchase row (18.11) */
.shop-row[hidden] { display: none; }
.shop-row { border: 1px solid rgba(255, 210, 90, .55); background: linear-gradient(180deg, rgba(255, 210, 90, .18), rgba(255, 210, 90, .06)); }
.shop-row.owned { opacity: .7; }
/* 21.11 itch.io demo: permanent link to the full game */
#btn-full { display: block; margin: 0.5rem auto 0; padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.85rem; font-weight: 800; color: #2e1a00; background: #f59e2c; text-decoration: none; text-align: center; }
/* 21.11 leaderboard */
#lb { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); background: rgba(10,30,60,0.45); color: #ffe7a3; padding: 8px; z-index: 5; }
#lb[hidden] { display: none !important; }
#lb svg { width: 100%; height: 100%; display: block; }
ol.lb { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; max-height: 50vh; overflow-y: auto; text-align: left; }
ol.lb li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 0.5em; padding: 0.35em 0.2em; border-bottom: 1px solid rgba(255,255,255,0.12); }
ol.lb b { color: #ffd36e; } ol.lb em { font-style: normal; } .lb-sub { opacity: 0.75; }
/* 23.11 theme button + light theme (owner: light by default, follow the system, switch light ↔ dark). The sea, the ships
   and the coin counter over the sea keep their art; the panel, goals and windows turn light. */
#theme { position: absolute; top: 10px; right: 58px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); background: rgba(10,30,60,0.45); color: #ffe7a3; padding: 9px; }
#theme svg { width: 100%; height: 100%; display: block; }
html[data-theme="light"] { --muted: #4d6478; --panel: rgba(250, 252, 255, 0.96); --line: rgba(30, 70, 120, 0.2); }
html[data-theme="light"] #panel { color: #10233b; box-shadow: 0 -6px 30px rgba(10, 40, 80, 0.18); }
html[data-theme="light"] .row { background: rgba(30, 70, 120, 0.05); color: #10233b; }
html[data-theme="light"] .row .c { color: #b06d00; }
html[data-theme="light"] .row.ok { color: #fff; background: linear-gradient(180deg,#2bb673,#1f8f5a); border-color: #1f8f5a; }
html[data-theme="light"] .shop-row { background: linear-gradient(180deg, rgba(255, 200, 60, 0.3), rgba(255, 200, 60, 0.1)); border-color: rgba(200, 140, 20, 0.5); }
html[data-theme="light"] #goal { background: rgba(250, 252, 255, 0.94); color: #10233b; border-color: rgba(30, 70, 120, 0.25); }
html[data-theme="light"] #goal.done { color: #fff; }
html[data-theme="light"] #modal { background: rgba(10, 30, 60, 0.35); }
html[data-theme="light"] #modal .card { background: #fbfdff; color: #10233b; box-shadow: 0 20px 60px rgba(10, 40, 80, 0.3); }
html[data-theme="light"] #modal button.alt { background: rgba(30, 70, 120, 0.1); color: #10233b; }
html[data-theme="light"] ol.lb li { border-bottom-color: rgba(30, 70, 120, 0.15); }
html[data-theme="light"] ol.lb b { color: #b06d00; }
html[data-theme="light"] #theme, html[data-theme="light"] #lb { background: rgba(250, 252, 255, 0.9); color: #10233b; border-color: rgba(30, 70, 120, 0.25); }
#lb[hidden] ~ #theme { right: 10px; }
#theme { z-index: 5; }
html[data-theme="light"] .row.ok .c, html[data-theme="light"] .row.ok small { color: #fff; }
/* 23.11 (owner): ship hints point at the ship; the goal pill keeps its contrast when it is ready to claim */
#hint.at { top: auto; }
#hint.at::after { content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-top: 0; border-bottom-color: #fff; }
html[data-theme="light"] #goal.done { background: linear-gradient(180deg,#2bb673,#1f8f5a); color: #fff; border-color: #1f8f5a; }

/* 24.11 (owner: flat cards): icon tile, raised card, price on a pill with a coin */
.row { box-shadow: 0 2px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08); transition: transform .08s; }
.row:not(:disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.row .ic { flex: none; width: 2.5rem; height: 2.5rem; border-radius: .7rem; display: grid; place-items: center;
  background: linear-gradient(180deg, #2f6fb0, #1d4a80); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.25); }
.row.ok .ic { background: linear-gradient(180deg, #34c47f, #188a52); }
.row[id^="buy-"] .c:not(:empty) { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem .25rem .35rem; border-radius: 999px; background: rgba(0,0,0,.25); }
.row[id^="buy-"] .c:not(:empty)::before { content: ""; width: 1rem; height: 1rem; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.35' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='%23fff6c9'/%3E%3Cstop offset='.45' stop-color='%23ffd23f'/%3E%3Cstop offset='1' stop-color='%23d98a12'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='16' cy='16' r='15' fill='%23b86e0a'/%3E%3Ccircle cx='16' cy='15' r='14' fill='url(%23g)'/%3E%3Ccircle cx='16' cy='15' r='10.5' fill='none' stroke='%23c47c0c' stroke-width='1.6' opacity='.7'/%3E%3Cpath d='M16 8.5v13M12.5 11h7M10.5 16.5c.8 3.2 3 5 5.5 5s4.7-1.8 5.5-5' fill='none' stroke='%23a35f08' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='8.5' r='1.6' fill='none' stroke='%23a35f08' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat; }
html[data-theme="light"] .row { box-shadow: 0 2px 0 rgba(16,35,59,.12); }
html[data-theme="light"] .row[id^="buy-"] .c:not(:empty) { background: #fff3d6; }
html[data-theme="light"] .row.ok[id^="buy-"] .c:not(:empty) { background: rgba(0,0,0,.18); }
