/* Bridge Tiles: survey-map look. Paper, ink, river blue, brass, vermilion. */
.bt{--paper:#efe3c6;--paper2:#e3d3aa;--ink:#1d2a38;--river:#2a6a8b;--brass:#e3b04b;--verm:#d1432a;--wood:#c68a45;
  background:var(--paper);color:var(--ink);border:3px solid var(--ink);border-radius:18px;padding:.75rem;
  padding-left:max(.75rem,env(safe-area-inset-left));padding-right:max(.75rem,env(safe-area-inset-right));
  padding-bottom:max(.75rem,env(safe-area-inset-bottom));font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  box-shadow:5px 5px 0 rgba(29,42,56,.35);-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
.bt *{box-sizing:border-box}
.bt [hidden]{display:none!important}
.bt-bar{display:flex;align-items:center;gap:.5rem;justify-content:space-between;min-height:48px}
.bt-bar .bt-sc{margin-left:auto;display:flex;align-items:center;gap:.3rem;font-weight:800}
.ib{width:48px;height:48px;border-radius:12px;border:2px solid var(--ink);background:var(--paper2);color:var(--ink);display:grid;place-items:center;cursor:pointer;padding:0}
.ib svg{width:26px;height:26px;fill:var(--ink);stroke:var(--ink)}
.ib svg .x{display:none}.ib.off svg .w{display:none}.ib.off svg .x{display:block}
.st{width:20px;height:20px;fill:none;stroke:var(--ink);stroke-width:1.600;stroke-linejoin:round}
.st.on{fill:var(--brass)}
.btn{min-height:48px;padding:.6rem 1rem;border-radius:12px;border:2px solid var(--ink);background:var(--paper2);color:var(--ink);font-weight:700;font-size:1rem;line-height:1.1;font-family:inherit;cursor:pointer;box-shadow:0 3px 0 var(--ink);transition:transform .08s,box-shadow .08s;touch-action:manipulation}
.btn:active:not(:disabled){transform:translateY(3px);box-shadow:0 0 0 var(--ink)}
.btn:disabled{opacity:.45;cursor:default}
.btn.big{min-height:56px;font-size:1.15rem;background:var(--brass)}
.btn.sm{min-height:48px;padding:.4rem .8rem;font-size:.9rem}
.btn:focus-visible,.ib:focus-visible,.lv:focus-visible{outline:3px solid var(--verm);outline-offset:2px}
.logo{display:block;width:100%;height:auto;border:3px solid var(--ink);border-radius:16px;margin:.4rem 0}
.tag{text-align:center;margin:.6rem 0;line-height:1.4}
.col{display:grid;gap:.7rem;margin:.8rem 0}
.how{margin:.6rem 0 0 1.1rem;font-size:.9rem;line-height:1.6}
.row-h{display:flex;align-items:center;justify-content:space-between;gap:.6rem;margin-bottom:.6rem}
.info{font-weight:700;font-size:.9rem}
.pack h3{font-size:.85rem;margin:.9rem 0 .4rem;text-transform:uppercase;letter-spacing:.06em}
.pack.locked{opacity:.55}
.lv-row{display:grid;grid-template-columns:repeat(5,1fr);gap:.4rem}
.lv{min-height:56px;border-radius:10px;border:2px solid var(--ink);background:var(--paper2);color:var(--ink);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px;touch-action:manipulation}
.lv b{font-size:1rem}.lv span{display:flex}.lv .st{width:11px;height:11px;stroke-width:2}
.lv:disabled{cursor:default}
.hud{display:grid;grid-template-columns:auto 1fr auto auto;gap:.5rem;align-items:center}
.ptitle{font-family:Georgia,"Times New Roman",serif;font-size:1.05rem;text-align:center}
.turns{display:flex;flex-direction:column;align-items:center;border:2px solid var(--ink);border-radius:10px;padding:.15rem .5rem;background:var(--paper2);min-width:64px}
.turns small{font-size:.65rem;text-transform:uppercase;letter-spacing:.06em}
.turns b{font-size:.95rem}
.turns.low b{color:var(--verm)}
.stage{position:relative;display:flex;justify-content:center;margin:.6rem 0}
.cv{display:block;touch-action:none;border-radius:6px;cursor:pointer;max-width:100%}
.msg{min-height:2.6em;text-align:center;font-size:.92rem;line-height:1.3;margin:.2rem 0 .5rem;display:flex;align-items:center;justify-content:center}
.msg.bad{color:#9c2410;font-weight:700}.msg.good{color:#1e5a2a;font-weight:700}
.ctrl{display:grid;grid-template-columns:1fr 1fr 1fr 1.4fr;gap:.45rem}
.ctrl .btn{padding:.6rem .4rem}
.streak{text-align:center;font-weight:700;font-size:.9rem;margin:.4rem 0}
.goal{font-size:.85rem;margin:0}
.result{position:absolute;inset:0;display:grid;place-items:center;background:rgba(239,227,198,.78)}
.result .card{width:min(86%,300px);background:var(--paper);border:3px solid var(--ink);border-radius:16px;padding:1rem;text-align:center;box-shadow:5px 5px 0 rgba(29,42,56,.4);display:grid;gap:.6rem}
.result.in .card{animation:pop .35s cubic-bezier(.2,1.4,.4,1)}
.result h2{font-family:Georgia,serif;font-size:1.3rem}
.rstars{display:flex;justify-content:center;gap:.3rem}.rstars .st{width:40px;height:40px}
.rstars .st.on{animation:spin .5s ease-out both}
.two{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.about{font-size:.88rem;line-height:1.5;margin:1rem 0}
@keyframes pop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
@keyframes spin{from{transform:rotate(-120deg) scale(.2)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.result.in .card,.rstars .st.on{animation:none}.btn{transition:none}}
/* Depth: soft paper light and a lifted board */
.bt{background-image:radial-gradient(120% 80% at 50% 0,#f7edd3 0,var(--paper) 60%,#e6d6ac 100%)}
.cv{box-shadow:0 6px 0 rgba(29,42,56,.28),0 10px 18px rgba(29,42,56,.22)}
.lv:active:not(:disabled){transform:scale(.96)}
/* Full screen (immersive on iPhone, native on Android): the board fills the stage */
html.pip-immersive .game-wrap.pip-stage,html.pip-native .game-wrap.pip-stage,.game-wrap.pip-stage:fullscreen{display:flex;flex-direction:column;padding-bottom:max(.5rem,env(safe-area-inset-bottom));overflow:hidden!important}
html.pip-immersive .about,html.pip-native .about,html.pip-immersive .how,html.pip-native .how,html.pip-immersive .pip-actions,html.pip-native .pip-actions,html.pip-immersive .game-title,html.pip-native .game-title{display:none!important}
html.pip-immersive .bt,html.pip-native .bt{flex:1 1 0;min-height:0;display:flex;flex-direction:column;border-radius:12px;box-shadow:none}
html.pip-immersive .scr:not([hidden]),html.pip-native .scr:not([hidden]){flex:1 1 0;min-height:0;display:flex;flex-direction:column}
html.pip-immersive #s-title .logo,html.pip-native #s-title .logo{flex:0 1 auto;min-height:0;max-height:34vh;object-fit:contain}
html.pip-immersive #s-title .col,html.pip-native #s-title .col{margin:.4rem 0}
html.pip-immersive #s-levels,html.pip-native #s-levels{overflow:auto}
html.pip-immersive #l-grid,html.pip-native #l-grid{overflow:auto;min-height:0;flex:1 1 0}
html.pip-immersive #p-stage,html.pip-native #p-stage{flex:1 1 0;min-height:0;overflow:hidden;align-items:center;margin:.4rem 0}
html.pip-immersive .ctrl .btn,html.pip-native .ctrl .btn{min-height:48px}
@media (orientation:landscape) and (max-height:520px){
 html.pip-immersive #s-play:not([hidden]),html.pip-native #s-play:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) 190px;grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"hud hud" "stage ctrl" "msg ctrl";column-gap:.6rem}
 html.pip-immersive .hud,html.pip-native .hud{grid-area:hud}
 html.pip-immersive #p-stage,html.pip-native #p-stage{grid-area:stage;margin:.2rem 0}
 html.pip-immersive .msg,html.pip-native .msg{grid-area:msg;min-height:1.6em;margin:0}
 html.pip-immersive .ctrl,html.pip-native .ctrl{grid-area:ctrl;grid-template-columns:1fr 1fr;align-content:center}
 html.pip-immersive .ctrl .go,html.pip-native .ctrl .go{grid-column:1/3}
 html.pip-immersive #s-title:not([hidden]) .logo,html.pip-native #s-title:not([hidden]) .logo{max-height:30vh}
}
