/* Lighthouse Ledger: night sea chart. Ink teal, parchment, brass, coral. */
:root{--ll-sea:#0b1c24;--ll-band:#102a35;--ll-ink:#f1e6c8;--ll-brass:#ffcf70;--ll-coral:#e8654f;--ll-line:#1c4453}
body{background:#07141a;color:var(--ll-ink)}
.game-header{background:#0b1c24;border-bottom:1px solid var(--ll-line)}
.game-header a,.game-tag{color:var(--ll-brass)}
.game-title{margin-bottom:.5rem}.game-title h1{font-family:Georgia,'Times New Roman',serif;color:var(--ll-ink)}
.game-title p,.game-title p a{color:#8fb3bd}
.ll{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;font-family:Georgia,'Times New Roman',serif;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.ll button{font-family:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent;color:inherit}
.ll-hud{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:.4rem .2rem;font-size:.95rem;align-items:baseline}
.ll-hud b{color:var(--ll-brass);font-size:1.3rem;font-variant-numeric:tabular-nums}
.ll-hud .r{text-align:right}
.ll-hud small{color:#8fb3bd;font-size:.8rem}
[data-lives="1"]{color:var(--ll-coral)}
.ll-bar{grid-column:1/3;height:5px;background:#16323d;border-radius:3px;overflow:hidden}
.ll-bar i{display:block;height:100%;width:0;background:var(--ll-brass);transition:width .25s}
.ll-stage{position:relative;display:flex;justify-content:center;background:var(--ll-sea);border:1px solid var(--ll-line);border-radius:6px;overflow:hidden}
#ll-canvas{display:block;touch-action:none;cursor:crosshair;outline:none}
.ll-ov{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(7,20,26,.62);padding:12px}
.ll-ov[hidden]{display:none}
.ll-card{width:100%;max-width:330px;background:#0f2630;border:2px solid var(--ll-brass);border-radius:4px;padding:16px 14px;text-align:center;box-shadow:0 0 0 4px #0f2630,0 0 0 5px var(--ll-line)}
.ll-card h2{font-size:1.5rem;color:var(--ll-brass);margin-bottom:6px}
.ll-card .sub{font-size:.95rem;line-height:1.35;margin-bottom:8px}
.ll-card .meta{font-size:.85rem;color:#8fb3bd;margin-bottom:12px}
.ll-card .best{color:var(--ll-brass)}
.ll-card .row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.stars{display:flex;justify-content:center;gap:6px;margin:4px 0 8px}
.stars i{width:26px;height:26px;background:#24444f;clip-path:polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%)}
.stars i.on{background:var(--ll-brass)}
.ll-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:48px;width:100%;padding:8px 10px;background:#16323d;border:1px solid var(--ll-line);border-radius:4px;cursor:pointer;text-align:center}
.ll-btn .bt{font-weight:700;font-size:.98rem}
.ll-btn .bs{font-size:.74rem;color:#8fb3bd;margin-top:2px;line-height:1.2}
.ll-btn.primary{background:var(--ll-brass);color:#1a1405;border-color:var(--ll-brass);min-height:54px;font-size:1.1rem}
.ll-btn.sel{border-color:var(--ll-brass)}
.ll-btn.can{border-color:var(--ll-brass)}
.ll-btn.can .bt{color:var(--ll-brass)}
.ll-btn[aria-disabled="true"]{opacity:.6}
.ll-btn:focus-visible,#ll-canvas:focus-visible{outline:3px solid var(--ll-coral);outline-offset:2px}
.ll-tools{display:flex;justify-content:space-between;align-items:center;margin:.5rem 0 .3rem;font-size:.85rem;color:#8fb3bd}
.ll-tools button{min-height:44px;min-width:44px;padding:0 12px;background:none;border:1px solid var(--ll-line);border-radius:4px}
.ll-shop{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ll-shop .keeper{grid-column:1/3}
.ll-toast{position:fixed;left:50%;bottom:calc(14px + env(safe-area-inset-bottom));transform:translate(-50%,20px);max-width:90vw;background:#0f2630;border:1px solid var(--ll-brass);color:var(--ll-ink);padding:10px 14px;border-radius:4px;font-size:.9rem;opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:20}
.ll-toast.on{opacity:1;transform:translate(-50%,0)}
.ll-help{font-size:.8rem;color:#8fb3bd;margin:.6rem 0}
@media (prefers-reduced-motion:reduce){.ll *{transition:none!important;animation:none!important}.ll-toast{transition:none}}

/* Card and overlay safety: centre with auto margins so a tall card scrolls instead of clipping */
.ll-ov{overflow:auto;-webkit-overflow-scrolling:touch}
.ll-card{margin:auto}
.ll-btn{transition:transform .08s,border-color .15s}
.ll-btn:active{transform:translateY(1px) scale(.985)}
.ll-btn.can{box-shadow:0 0 10px rgba(255,207,112,.25)}
.ll-stage{box-shadow:inset 0 0 18px rgba(0,0,0,.45)}

/* Full screen (shell immersive on iPhone, native Fullscreen API elsewhere): the board fills the stage, nothing scrolls */
html.pip-immersive body .game-wrap.pip-stage,html.pip-native body .game-wrap,.game-wrap:fullscreen{overflow:hidden!important;padding-left:8px!important;padding-right:8px!important;padding-bottom:8px!important;display:flex;flex-direction:column;background:#07141a}
html.pip-immersive .game-wrap>.game-title,html.pip-native .game-wrap>.game-title,html.pip-immersive .game-wrap>.pip-actions,html.pip-native .game-wrap>.pip-actions,html.pip-immersive .ll-help,html.pip-native .ll-help,html.pip-immersive .ll-tools>span,html.pip-native .ll-tools>span{display:none}
html.pip-immersive .ll,html.pip-native .ll{flex:1 1 0;min-height:0;display:flex;flex-direction:column;gap:6px;padding-left:0;padding-right:0}
html.pip-immersive .ll-hud,html.pip-native .ll-hud{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 10px;padding:.15rem .2rem}
html.pip-immersive .ll-hud br,html.pip-native .ll-hud br{display:none}
html.pip-immersive .ll-hud small,html.pip-native .ll-hud small{margin-right:6px}
html.pip-immersive .ll-hud .ll-bar,html.pip-native .ll-hud .ll-bar{flex:0 0 100%}
html.pip-immersive .ll-stage,html.pip-native .ll-stage{flex:1 1 0;min-height:0;align-items:center}
html.pip-immersive .ll-tools,html.pip-native .ll-tools{margin:0;justify-content:flex-end}
html.pip-immersive .ll-shop,html.pip-native .ll-shop{grid-template-columns:repeat(3,1fr);gap:6px}
html.pip-immersive .ll-shop .keeper,html.pip-native .ll-shop .keeper{grid-column:auto}
html.pip-immersive .ll-shop .ll-btn,html.pip-native .ll-shop .ll-btn{min-height:44px;padding:4px 6px;min-width:0}
html.pip-immersive .ll-shop .bt,html.pip-native .ll-shop .bt{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
html.pip-immersive .ll-shop .bs,html.pip-native .ll-shop .bs{font-size:.7rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
html.pip-immersive .ll-card,html.pip-native .ll-card{padding:12px 10px}
html.pip-immersive .ll-toast,html.pip-native .ll-toast{bottom:calc(60px + env(safe-area-inset-bottom))}

/* Landscape full screen: board on the left, hud, shop and sound on the right */
@media (orientation:landscape){
  html.pip-immersive .ll,html.pip-native .ll{display:grid;grid-template-columns:minmax(0,1fr) min(46vw,300px);grid-template-rows:auto auto auto 1fr;column-gap:10px;row-gap:6px}
  html.pip-immersive .ll-stage,html.pip-native .ll-stage{grid-column:1;grid-row:1/5}
  html.pip-immersive .ll-hud,html.pip-native .ll-hud{grid-column:2;grid-row:1}
  html.pip-immersive .ll-shop,html.pip-native .ll-shop{grid-column:2;grid-row:2;grid-template-columns:1fr 1fr;align-content:start}
  html.pip-immersive .ll-tools,html.pip-native .ll-tools{grid-column:2;grid-row:3}
  html.pip-immersive .game-wrap.pip-stage,html.pip-native .game-wrap{padding-bottom:6px!important}
}
