/* Shared phone / tablet adjustments for every page. Loaded after each page's own styles.
   html.compact = little height (phone sideways, small window); html.touch = no keyboard/mouse expected. */

/* ---------- rotate prompt (phones/tablets held upright) ---------- */
#fitRotate{display:none}
html.touch.portrait:not(.native) #fitRotate{display:flex;position:fixed;inset:0;z-index:9999;align-items:center;justify-content:center;text-align:center;background:#05070d;color:#fff;font:800 22px "Segoe UI",system-ui,sans-serif;padding:24px}
#fitRotate .fr-ico{font-size:64px;margin-bottom:14px;animation:frTurn 1.6s ease-in-out infinite}
@keyframes frTurn{0%,30%{transform:rotate(0)}60%,100%{transform:rotate(-90deg)}}

/* ---------- notches: keep things clear of the camera cut-out in landscape ---------- */
html.touch .screen{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
html.touch #hud{left:env(safe-area-inset-left);right:env(safe-area-inset-right)}

/* ---------- touch: drop keyboard and mouse hints ---------- */
html.touch .kbd,html.touch .key,html.touch #mouseBtn,html.touch #mouseHelp{display:none!important}
html.touch button,html.touch a{-webkit-tap-highlight-color:transparent}
html.touch .seg button{min-height:38px}

/* ---------- compact: short landscape screens ---------- */
html.compact .screen{padding-top:8px;padding-bottom:8px}
html.compact .panel{padding:14px 18px;border-radius:16px;max-height:calc(100dvh - 16px)}
html.compact .panel.slim{padding:14px 18px}
html.compact h1{font-size:34px!important}
html.compact h2{font-size:22px;margin-bottom:4px}
html.compact h3{margin:10px 0 6px}
html.compact .tag,html.compact .hint,html.compact .fit-long{display:none!important}
html.compact .row{margin:5px 0}
html.compact .seg button{padding:6px 9px;font-size:13px}
html.compact .big,html.compact .bigbtn{padding:11px;font-size:17px;margin-top:10px}
html.compact .btns{margin-top:10px}
html.compact .btns button{padding:9px 14px}
html.compact details{margin:6px 0;padding-top:6px}
html.compact .status{margin-top:4px;min-height:0}
html.compact .back{margin-top:8px}
html.compact .stats{gap:6px;margin:8px 0 4px}
html.compact .stats div,html.compact .totals div{padding:6px}
html.compact .stats b,html.compact .totals b{font-size:18px}
html.compact .bigscore{font-size:44px}

/* menus become two columns of settings with the start button always in view */
html.compact .fit-menu{display:grid;grid-template-columns:1fr 1fr;column-gap:22px;align-content:start;max-width:min(900px,100%)}
html.compact .fit-menu>*{grid-column:1/-1}
html.compact .fit-menu>.row{grid-column:auto;min-width:0}
html.compact .fit-menu .row{flex-wrap:wrap;gap:4px 10px}
html.compact .fit-menu>.big,html.compact .fit-menu>.bigbtn{position:sticky;bottom:0;z-index:2;box-shadow:0 -10px 18px rgba(0,0,0,.45)}
html.compact .fit-go{position:sticky;bottom:0;z-index:2;display:flex;gap:10px;align-items:stretch}
html.compact .fit-go>*{flex:1;margin-top:10px!important;box-shadow:0 -10px 18px rgba(0,0,0,.45)}
html.compact .fit-go .big.alt{background:#2a2410;padding:8px}

/* results: score on the left, numbers on the right */
html.compact .fit-results{max-width:min(860px,100%)}

/* in-game text that is too small to read from 2-3 m away */
html.compact .fit-gametext{display:none!important}

/* Iron Week's planner panels: wider and shorter on a phone */
html.compact .fit-wide{max-width:min(780px,100%)}
html.compact .fit-wide .statrow{grid-template-columns:1.3fr 1fr;margin-top:8px}
html.compact .fit-wide .week{margin:6px 0 4px}
html.compact .fit-wide .dcard{min-height:64px;padding:5px 2px}
html.compact .fit-wide .bigbtn{position:sticky;bottom:0;z-index:2;box-shadow:0 -10px 18px rgba(0,0,0,.45)}
html.compact .fit-wide #mapC{max-width:170px}

/* ---------- account dialog ---------- */
#fitAcct{position:fixed;inset:0;z-index:9000;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(2,4,10,.72);backdrop-filter:blur(4px);font-family:"Segoe UI",system-ui,sans-serif;color:#f8fafc}
#fitAcct.hidden{display:none}
#fitAcct .hidden{display:none!important}
.fa-panel{position:relative;width:100%;max-width:400px;max-height:calc(100dvh - 24px);overflow:auto;background:#0d1020;border:1px solid rgba(255,255,255,.14);border-radius:20px;padding:22px 22px 18px;box-shadow:0 24px 70px rgba(0,0,0,.6);text-align:left}
.fa-x{position:absolute;top:10px;right:12px;font-size:16px;padding:6px 9px;border-radius:10px;color:#94a3b8;background:none;border:0;cursor:pointer}
.fa-title{font-size:22px;font-weight:900;margin:0 0 12px}
.fa-tabs{display:flex;background:rgba(255,255,255,.07);border-radius:12px;padding:3px;margin-bottom:12px}
.fa-tabs button{flex:1;padding:8px;border-radius:9px;font-family:inherit;font-weight:700;font-size:14px;color:#94a3b8;background:none;border:0;cursor:pointer}
.fa-tabs button.on{background:#fff;color:#0b1020}
.fa-f{display:block;margin:8px 0}
.fa-f span{display:block;font-size:13px;font-weight:700;color:#cbd5e1;margin-bottom:4px}
.fa-f input{width:100%;padding:11px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);color:#fff;font:16px "Segoe UI",system-ui,sans-serif;outline:none}
.fa-f input:focus{border-color:#2dd4bf}
.fa-msg{min-height:18px;font-size:13px;color:#94a3b8;margin:6px 0 0}
.fa-msg.err{color:#fb7185}
.fa-go{display:block;width:100%;margin-top:10px;padding:13px;border-radius:14px;border:0;background:linear-gradient(90deg,#14b8a6,#a3e635);color:#032321;font:900 16px "Segoe UI",system-ui,sans-serif;letter-spacing:.06em;cursor:pointer}
.fa-go:disabled{opacity:.6;cursor:wait}
.fa-link{display:block;margin:10px auto 0;font-size:13px;color:#7dd3fc;text-decoration:underline;background:none;border:0;cursor:pointer}
.fa-note{font-size:12px;color:#94a3b8;margin-top:12px;line-height:1.45}
html.compact .fa-panel{max-width:620px;display:grid;grid-template-columns:1fr 1fr;column-gap:14px;padding:14px 16px 12px}
html.compact .fa-panel>*{grid-column:1/-1}
html.compact .fa-panel>.fa-f{grid-column:auto;margin:4px 0}
html.compact .fa-title{font-size:18px;margin-bottom:8px}
html.compact .fa-tabs{margin-bottom:6px}
html.compact .fa-note{display:none}
