/* Crater Cricket styles. Base screens/buttons follow the Moonshot Pool look so the arcade feels like one place. */
:root {
  --ink: #e9f1ff;
  --muted: #9fb0cc;
  --panel: rgba(9, 13, 26, 0.86);
  --line: rgba(134, 217, 255, 0.28);
  --cy: #86d9ff;
  --pink: #ff7ab6;
  --good: #6dffa6;
  --bad: #ff5d7c;
  --gold: #ffe28a;
  --head: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --body: "Exo 2", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #03050b; color: var(--ink); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ui, .hud, .dock, .pausebtn, .toast, .netbanner, .emotes, .runbar, .loftbtn, .bowlpanel, .meter, .hint, .cards, .comm, .emotebtn { z-index: 2; }
.ui { z-index: 5; }

/* ---------- overlay screens */
.ui { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-y: auto; background: radial-gradient(ellipse at center, rgba(3,5,11,0.3), rgba(3,5,11,0.78)); }
.ui[hidden] { display: none; }
.panel { width: min(560px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: rise 0.3s ease-out; }
.panel.wide { width: min(880px, 100%); }
.panel.small { width: min(440px, 100%); text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.kicker { font: 700 12px/1.2 var(--head); letter-spacing: 0.18em; color: var(--cy); margin-bottom: 6px; }
.kicker.good { color: var(--good); } .kicker.bad { color: var(--bad); }
h1, h2, h3, h4 { font-family: var(--head); margin: 0 0 12px; letter-spacing: 0.03em; }
h2 { font-size: clamp(21px, 4vw, 28px); }
h2.big { font-size: clamp(30px, 6.5vw, 46px); color: var(--gold); }
h3 { font-size: 13px; color: var(--cy); margin-top: 16px; letter-spacing: 0.08em; }
p { line-height: 1.5; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.good { color: var(--good); } .bad { color: var(--bad); }

/* title */
.title { text-align: center; width: min(470px, 100%); }
.logo { font-size: clamp(38px, 9vw, 60px); line-height: 0.95; margin: 4px 0 12px; font-weight: 900; display: flex; flex-direction: column; align-items: center; position: relative; }
.logo span:not(.ball) { background: linear-gradient(180deg, #ffffff, #bfe6ff 55%, #5ab4ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(80,180,255,0.4)); }
.logo .b { background: linear-gradient(180deg, #fff6d6, #ffe28a 55%, #f0a92c) !important; -webkit-background-clip: text !important; background-clip: text !important; letter-spacing: 0.3em; margin-left: 0.3em; filter: drop-shadow(0 0 16px rgba(255,200,90,0.4)) !important; }
.tag { color: var(--muted); margin-bottom: 16px; }
.note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* buttons */
.menu { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.menu .menu { margin-top: 0; }
.menu.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.menu.row button { flex: 1 1 140px; }
.menu.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.menu.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
button { font: 600 16px var(--body); color: var(--ink); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 11px 14px; cursor: pointer; transition: transform 0.08s, background 0.15s, border-color 0.15s; min-height: 46px; }
button:hover:not([disabled]) { background: rgba(134,217,255,0.12); border-color: rgba(134,217,255,0.5); }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button:active:not([disabled]) { transform: scale(0.98); }
button.primary { background: linear-gradient(180deg, #4cc3ff, #1f7fd6); border-color: #7fd6ff; color: #fff; font-weight: 700; box-shadow: 0 6px 22px rgba(40,150,255,0.35); }
button.primary:hover { background: linear-gradient(180deg, #6fd0ff, #2b8fe6); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); min-height: 38px; }
button.danger { border-color: rgba(255,93,124,0.5); color: #ffb3c2; }
button[disabled] { opacity: 0.45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--cy); text-decoration: underline; font-size: inherit; }
.tog.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
.chip { display: inline-block; font: 700 10px/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; vertical-align: middle; margin-left: 6px; }
.chip.house { background: rgba(255,226,138,0.16); color: var(--gold); border: 1px solid rgba(255,226,138,0.35); }

/* levels */
.levels { display: grid; gap: 8px; margin-top: 8px; }
.levels button { display: grid; grid-template-columns: 1fr auto; text-align: left; align-items: center; padding: 12px 16px; }
.levels button b { font: 700 17px var(--head); letter-spacing: 0.04em; }
.levels button small { grid-column: 1; color: var(--muted); font-size: 13px; }
.levels button i { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 12px; color: var(--good); }
.levels button.sel { border-color: var(--gold); }

/* forms */
.pname { margin: 14px 0 6px; text-align: left; }
.pname label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
input { font: 600 16px var(--body); color: var(--ink); background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; padding: 10px 12px; min-width: 0; flex: 1; -webkit-user-select: text; user-select: text; }
input:focus { outline: 2px solid var(--cy); border-color: transparent; }
.nmsg { min-height: 1.3em; margin: 6px 0 0; color: var(--muted); }
.nmsg.bad { color: var(--bad); } .nmsg.good { color: var(--good); }
.slider { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 6px 0 10px; color: var(--muted); }
.slider input { flex: 0 1 220px; padding: 0; }

/* VS card */
.vs { width: min(560px, 100%); text-align: center; }
.vsrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; }
.vcard { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vcard b { font: 700 18px var(--head); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard small { color: var(--cy); }
.vsx { font: 900 26px var(--head); color: var(--gold); text-shadow: 0 0 18px rgba(255,200,90,0.5); }

/* results */
.over .score { font-size: 30px; color: var(--ink); margin: 6px 0; }
.over .score small { font-size: 14px; color: var(--muted); }
.newbest { color: var(--gold); font-weight: 700; }
table.bd { width: 100%; max-width: 300px; margin: 6px auto 10px; border-collapse: collapse; font-size: 14px; }
table.bd td { padding: 3px 4px; color: var(--muted); text-align: left; }
table.bd td:last-child { text-align: right; color: var(--ink); }
table.bd .tot td { border-top: 1px solid rgba(255,255,255,0.15); color: var(--gold); font-weight: 700; }
.statrow { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 8px 0; }
.statrow b { color: var(--ink); font-size: 16px; }
.ranks { font-size: 16px; margin: 6px 0; }
.coins { color: var(--gold); font-weight: 700; margin: 8px 0 0; }
.coins small { color: var(--muted); font-weight: 400; }
h2 .coins { float: right; font-size: 15px; font-family: var(--body); }

/* lobby */
.plist { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.prow { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,0.04); font-size: 14px; }
.prow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6577; display: inline-block; }
.dot.online { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.away { background: var(--gold); }
.roomcode { font: 900 44px var(--head); letter-spacing: 0.25em; color: var(--gold); margin: 6px 0 4px; text-shadow: 0 0 20px rgba(255,200,90,0.35); }
.search .radar { position: relative; width: 120px; height: 120px; margin: 10px auto 14px; border-radius: 50%; border: 2px solid rgba(134,217,255,0.4); display: grid; place-items: center; }
.search .radar i { position: absolute; inset: -2px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(134,217,255,0.45), transparent 30%); animation: sweep 1.4s linear infinite; }
.search .radar b { font-size: 40px; }
@keyframes sweep { to { transform: rotate(360deg); } }

/* tables */
.tabs { display: flex; gap: 6px; margin: 8px 0 12px; flex-wrap: wrap; }
.tabs button { flex: 1; padding: 8px 6px; min-height: 38px; font-size: 14px; }
.tabs button.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
table.scores { width: 100%; border-collapse: collapse; font-size: 14px; }
table.scores th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.12); }
table.scores td { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.scores td:nth-child(2) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.scores tr.me td { color: var(--gold); font-weight: 700; }
table.scores tr.gap td { text-align: center; color: var(--muted); }

/* profile */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.stats div { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 8px 10px; }
.stats small { display: block; color: var(--muted); font-size: 12px; }
.stats b { font-size: 17px; }
.recent { display: grid; gap: 4px; }
.rrow { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 8px; align-items: center; font-size: 14px; padding: 5px 8px; background: rgba(255,255,255,0.03); border-radius: 8px; }
.code { letter-spacing: 0.1em; }


/* ================= Crater Cricket ================= */
.logo .ball { width: 46px; height: 46px; border-radius: 50%; margin-bottom: 8px; position: relative; background: radial-gradient(circle at 34% 30%, #ff7a6c 0, #c8232c 45%, #5e0b12 100%); box-shadow: 0 0 34px rgba(255,170,130,0.45), inset -7px -6px 0 rgba(0,0,0,0.15); transform: rotate(-24deg); }
.logo .ball::after { content: ""; position: absolute; top: 3px; bottom: 3px; left: 19px; right: 19px; border-left: 2px solid #f6e7c8; border-right: 2px solid #f6e7c8; border-radius: 40%; opacity: 0.9; }
.logo .b { background: linear-gradient(180deg, #fff6d6, #ffe28a 55%, #f0a92c) !important; -webkit-background-clip: text !important; background-clip: text !important; letter-spacing: 0.12em; margin-left: 0.12em; filter: drop-shadow(0 0 16px rgba(255,200,90,0.4)) !important; }
.kit { display: inline-block; width: 16px; height: 16px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; background: linear-gradient(135deg, var(--a) 0 58%, var(--b) 58% 76%, var(--a) 76%); box-shadow: 0 0 0 1px rgba(255,255,255,0.35); flex: none; }
.stars { font-size: 11px; letter-spacing: 1px; }
.stars i { font-style: normal; color: rgba(255,255,255,0.18); }
.stars i.on { color: var(--gold); }
.stars i.half { background: linear-gradient(90deg, var(--gold) 50%, rgba(255,255,255,0.18) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tn { display: inline-flex; align-items: center; }
.vs { color: var(--muted); font-size: 0.6em; margin: 0 6px; }

/* setup */
.setup h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.team { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; min-height: 0; text-align: left; font-size: 14px; }
.team b { display: flex; align-items: center; }
.team .kit { width: 22px; height: 22px; margin-bottom: 2px; }
.team.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
.team.other { opacity: 0.45; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 1 90px; min-height: 42px; padding: 8px 6px; font-size: 14px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.seg button small { color: var(--muted); font-size: 11px; }
.seg button.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
.seg.two { margin-top: 14px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .cols2 { grid-template-columns: 1fr; } }

/* squad editor */
.squad .sqform { display: grid; gap: 5px; }
.sqrow { display: grid; grid-template-columns: 22px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr) 74px; gap: 6px; align-items: center; }
.sqrow.head { color: var(--muted); font-size: 12px; }
.sqrow > span:first-child { color: var(--muted); font-size: 13px; text-align: right; }
.sqrow input { padding: 7px 9px; font-size: 15px; }
select { font: 600 14px var(--body); color: var(--ink); background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; padding: 7px 6px; min-width: 0; width: 100%; }
select option { background: #0b1224; }
@media (max-width: 600px) {
  .sqrow { grid-template-columns: 18px 1fr 1fr 1fr; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .sqrow.head { display: none; }
  .sqrow input { grid-column: 2 / 5; }
  .sqrow > span:first-child { grid-row: 1 / 3; align-self: center; }
}

/* toss */
.toss .coin { width: 88px; height: 88px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff6d6, #ffe28a 45%, #c08a1d); box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 0 4px rgba(255,255,255,0.3); font: 900 34px var(--head); color: #6a4708; }
.toss .coin i { font-style: normal; }
.toss .coin.flip { animation: flip 1.2s cubic-bezier(.2,.7,.3,1); }
@keyframes flip { 0% { transform: translateY(0) rotateX(0); } 40% { transform: translateY(-80px) rotateX(900deg); } 100% { transform: translateY(0) rotateX(1800deg); } }

/* chase */
.daily { display: grid; gap: 3px; width: 100%; text-align: left; padding: 14px 16px; background: linear-gradient(135deg, rgba(255,226,138,0.16), rgba(134,217,255,0.08)); border-color: rgba(255,226,138,0.5); }
.daily .k { font: 700 11px var(--head); letter-spacing: 0.16em; color: var(--gold); }
.daily b { font-size: 19px; display: flex; align-items: center; }
.daily small { color: var(--muted); }
.daily em { font-style: normal; color: var(--cy); font-size: 13px; }
.ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
.rung { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; text-align: left; padding: 8px 10px; min-height: 0; font-size: 14px; }
.rung b { grid-row: 1 / 3; font: 800 22px var(--head); color: var(--cy); align-self: center; }
.rung small { color: var(--muted); font-size: 11px; display: flex; align-items: center; }
.rung small .kit { width: 11px; height: 11px; margin-right: 4px; }
.rung i { grid-column: 1 / 3; font-style: normal; color: var(--gold); letter-spacing: 2px; font-size: 13px; }
.rung.done { border-color: rgba(109,255,166,0.45); }

/* results */
.over { text-align: center; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; text-align: left; }
.scard { background: rgba(255,255,255,0.04); border-radius: 12px; padding: 10px 12px; }
.scard h3 { margin: 0 0 6px; display: flex; align-items: center; color: var(--ink); font-size: 13px; }
.scard h3 span { margin-left: auto; color: var(--gold); font-size: 15px; }
.scard h3 small { color: var(--muted); font-size: 11px; }
.scard table.bd { max-width: none; margin: 0; }
.scard tr.bw td { color: var(--cy); }
.scard td small { color: var(--muted); }
.pom { margin: 8px 0; }
.pts { font-size: 17px; margin: 8px 0 2px; }
.pts b { color: var(--gold); font-size: 22px; }
p.big { font-size: 18px; } p.big b { color: var(--gold); font-size: 24px; }
.sheet .blist { display: grid; gap: 6px; text-align: left; }
.brow { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; text-align: left; padding: 9px 12px; min-height: 0; }
.brow small { color: var(--muted); font-size: 12px; }
.brow span { grid-column: 2; grid-row: 1; color: var(--gold); font-size: 9px; letter-spacing: 1px; align-self: center; }
.brow em { grid-column: 2; grid-row: 2; font-style: normal; color: var(--cy); font-size: 12px; text-align: right; }
.brow.sug { border-color: rgba(255,226,138,0.6); }

/* ---------- in-game HUD */
.hud { position: absolute; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: 64px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; pointer-events: none; }
.hud[hidden], .cards[hidden], .comm[hidden] { display: none; }
.sb { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(10,16,34,0.92), rgba(6,10,22,0.92)); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 6px 20px rgba(0,0,0,0.4); max-width: 100%; flex-wrap: wrap; }
.sbteam { display: flex; flex-direction: column; line-height: 1.05; font: 800 15px var(--head); }
.sbteam #sbt { display: flex; align-items: center; }
.sbteam small { font: 600 11px var(--body); color: var(--muted); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; }
.sbs { font: 900 24px var(--head); color: #fff; }
.sbo { font-size: 13px; color: var(--muted); }
.need { font-size: 13px; color: var(--muted); }
.need.on { color: var(--gold); font-weight: 800; font-size: 14px; }
.fh { font: 800 11px var(--head); color: #1a0b00; background: var(--gold); padding: 3px 7px; border-radius: 6px; letter-spacing: 0.08em; animation: pulse 0.9s ease-in-out infinite alternate; }
.fh[hidden] { display: none; }
@keyframes pulse { to { filter: brightness(1.3); transform: scale(1.06); } }
.thisover { display: flex; gap: 4px; }
.thisover .b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--body); font-style: normal; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); }
.thisover .b4 { background: #1f7fd6; border-color: #86d9ff; }
.thisover .b6 { background: #c98a12; border-color: var(--gold); color: #fff; }
.thisover .bw { background: #b3243f; border-color: var(--bad); }
.thisover .bx { background: rgba(199,155,255,0.3); font-size: 9px; }
.thisover .b0 { color: var(--muted); }
.cards { position: absolute; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); display: flex; gap: 6px; pointer-events: none; }
.bcard { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(6,10,22,0.84); border: 1px solid rgba(255,255,255,0.12); font-size: 13px; min-width: 0; }
.bcard b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard span { font-weight: 800; font-size: 15px; white-space: nowrap; }
.bcard span small { color: var(--muted); font-weight: 600; font-size: 11px; margin-left: 2px; }
.bcard.r { margin-left: auto; color: var(--cy); }
.bcard.r small { color: var(--muted); font-size: 11px; }
#bat1 b { color: var(--gold); }
.comm { position: absolute; left: 50%; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 44px); transform: translateX(-50%); width: max-content; max-width: min(92vw, 620px); padding: 7px 14px; border-radius: 12px; background: rgba(6,10,22,0.72); font-size: 14px; text-align: center; pointer-events: none; color: #e9f1ff; }
.comm:empty { display: none; }
.comm.new { animation: commin 0.4s ease-out; }
@keyframes commin { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pausebtn { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; font: 800 15px var(--head); background: rgba(8,12,24,0.8); }
.pausebtn[hidden], .emotebtn[hidden], .loftbtn[hidden], .runbar[hidden], .bowlpanel[hidden], .meter[hidden], .hint[hidden], .emotes[hidden], .netbanner[hidden] { display: none; }
.emotebtn { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 54px); right: max(10px, env(safe-area-inset-right)); width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; font-size: 20px; }
.emotes { position: absolute; right: 64px; top: 64px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.emotes button { min-height: 36px; font-size: 14px; text-align: left; }
.loftbtn { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(8px, env(safe-area-inset-bottom)) + 96px); width: 78px; height: 78px; min-height: 0; padding: 0; border-radius: 50%; font: 800 13px var(--head); background: rgba(8,12,24,0.72); border: 2px solid rgba(255,180,92,0.55); color: #ffcf9a; }
.loftbtn.on { background: linear-gradient(180deg, #ff9a3c, #d9541a); color: #fff; border-color: #ffd1a0; box-shadow: 0 0 24px rgba(255,140,40,0.6); }
.runbar { position: absolute; left: 50%; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 92px); transform: translateX(-50%); display: flex; gap: 10px; }
.runbtn { min-width: 150px; height: 64px; font: 900 22px var(--head); border-radius: 18px; background: #23314f; border: 2px solid rgba(255,255,255,0.3); letter-spacing: 0.06em; }
.runbtn.safe { background: linear-gradient(180deg, #39d97f, #138a4a); border-color: #a6ffcd; box-shadow: 0 0 24px rgba(60,220,130,0.45); }
.runbtn.risky { background: linear-gradient(180deg, #ffb45c, #d9741a); border-color: #ffe0b0; }
.runbtn.danger { background: linear-gradient(180deg, #ff6b84, #b3243f); border-color: #ffc2cd; }
.stopbtn { min-width: 96px; height: 64px; font: 800 15px var(--head); border-radius: 18px; background: rgba(8,12,24,0.85); }
.bowlpanel { position: absolute; left: 50%; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 44px); transform: translateX(-50%); width: min(560px, calc(100vw - 16px)); padding: 10px 12px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.bp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.bp-head small { color: var(--muted); }
.btimer { margin-left: auto; font: 800 14px var(--head); color: var(--cy); }
.btimer.low { color: var(--bad); }
.dtypes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dt { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 7px 6px; min-height: 0; text-align: center; font-size: 13px; }
.dt small { color: var(--muted); font-size: 10.5px; line-height: 1.2; }
.dt kbd { position: absolute; top: 3px; right: 5px; font: 700 9px var(--body); color: var(--muted); }
.dt.sel { border-color: var(--gold); background: rgba(255,226,138,0.12); }
.fields { display: flex; gap: 6px; align-items: center; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
.fields button { flex: 1; min-height: 34px; padding: 4px 6px; font-size: 13px; }
.fields button.sel { border-color: var(--cy); background: rgba(134,217,255,0.12); color: #fff; }
.bp-tip { margin: 4px 0 8px; font-size: 13px; color: var(--muted); text-align: center; }
.bp-tip b { color: var(--gold); }
.bowlgo { width: 100%; font: 900 18px var(--head); letter-spacing: 0.08em; min-height: 50px; }
/* phones: a low panel (four balls in one row, no field map) so the whole pitch stays in view for aiming */
@media (max-width: 520px) {
  .dtypes { gap: 5px; }
  .dt { padding: 8px 2px; font-size: 12.5px; line-height: 1.15; justify-content: center; min-height: 42px; }
  .dt small, .fmap { display: none; }
  .bowlpanel { padding: 8px 10px 10px; }
  .bp-head { margin-bottom: 5px; }
  .fieldrow { margin: 6px 0 0; }
  .bp-tip { margin: 5px 0 6px; }
  .bowlgo { min-height: 46px; }
}
.meter { position: absolute; left: 50%; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 70px); transform: translateX(-50%); width: min(420px, calc(100vw - 30px)); text-align: center; cursor: pointer; }
.mtrack { position: relative; height: 30px; border-radius: 15px; background: linear-gradient(90deg, #b3243f 0%, #d9741a 35%, #d9741a 62%, transparent 62%, transparent 78%, #d9741a 78%, #d9741a 93%, #6a1020 93%); border: 2px solid rgba(255,255,255,0.4); overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.mgood { position: absolute; left: 62%; width: 16%; top: 0; bottom: 0; background: linear-gradient(180deg, #6dffa6, #1fb468); }
.mnb { position: absolute; left: 93%; right: 0; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #6a1020 0 6px, #3a0812 6px 12px); }
.mcur { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; left: 0; background: #fff; border-radius: 3px; box-shadow: 0 0 10px #fff; }
.meter span { display: block; margin-top: 6px; font: 800 13px var(--head); letter-spacing: 0.14em; color: #fff; text-shadow: 0 2px 6px #000; }
.hint { position: absolute; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 74px); transform: translateX(-50%); max-width: min(90vw, 440px); padding: 10px 16px; border-radius: 14px; background: rgba(6,10,22,0.86); border: 1px solid var(--line); text-align: center; font-size: 15px; pointer-events: none; }
.netbanner { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); padding: 8px 16px; border-radius: 20px; background: rgba(255,93,124,0.2); border: 1px solid var(--bad); font-weight: 700; }

/* ---------- controls: keycaps, the cards before you bat and bowl, How to play, the strip during play */
kbd.key { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; margin: 0 2px; border-radius: 7px; background: linear-gradient(180deg, #f6f8ff, #cfd8ea); color: #0b1224; font: 800 14px/1 var(--body); box-shadow: 0 3px 0 #7c88a3, 0 5px 10px rgba(0,0,0,0.35); vertical-align: middle; white-space: nowrap; }
kbd.key.wide { min-width: 84px; letter-spacing: 0.08em; }
body:not(.kind-keys) .k-only, body.kind-keys .t-only { display: none; }
.panel.ctl { width: min(980px, 100%); padding: 0; display: flex; flex-direction: column; overflow: hidden; text-align: left; }
.ctl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 2px; flex: none; }
.ctl-head h2 { margin-bottom: 8px; font-size: clamp(22px, 4.4vw, 30px); }
.ctl-head .kicker { color: var(--gold); font-size: 13px; }
.kind { display: flex; gap: 4px; flex: none; }
.kind button { min-height: 36px; padding: 5px 10px; font-size: 13px; white-space: nowrap; }
.kind button.sel { border-color: var(--gold); background: rgba(255,226,138,0.14); color: #fff; }
.ctl .tabs { margin: 0 22px 8px; flex: none; }
.ctl-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 22px 12px; overscroll-behavior: contain; }
/* a fade with a ▼ at the bottom edge while there is more to scroll to (main.js scrollCue sets .more) */
.ctl-body::after { content: "▼"; display: block; position: sticky; bottom: -12px; height: 40px; margin-top: -40px; padding-top: 18px; text-align: center; font-size: 13px; line-height: 1; color: var(--gold); background: linear-gradient(rgba(9,13,26,0), rgba(9,13,26,0.97) 70%); pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.ctl-body.more::after { opacity: 1; }
.n-only { display: none; }
.ctl-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 22px 16px; border-top: 1px solid rgba(255,255,255,0.1); background: rgba(6,10,22,0.5); }
.ctl-foot .primary { flex: 1 1 220px; min-height: 54px; font: 800 19px var(--head); letter-spacing: 0.04em; }
.tick { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 15px; cursor: pointer; min-height: 40px; }
.tick input { flex: none; width: 22px; height: 22px; padding: 0; margin: 0; accent-color: var(--cy); }
.ctl-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 12px; align-items: start; }
/* PC cards: the keyboard and the mouse side by side (main.js both()) */
.both { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1.3fr); gap: 4px 0; margin-top: 6px; }
.both.two { grid-template-columns: 178px minmax(0, 1fr); }
.both .h { font: 700 11px/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cy); padding: 0 10px 2px; white-space: nowrap; }
.ctl b.t small { font: 600 12.5px var(--body); letter-spacing: 0; color: var(--muted); margin-left: 8px; white-space: nowrap; }
/* wide screens: the card clears the home button in the corner, so it can use the full height */
@media (min-width: 1340px) { body.ca-home-on .ui:has(.panel.ctl) { padding-top: max(16px, env(safe-area-inset-top)); } }
@media (max-height: 720px) { .both .c { min-height: 36px; padding-top: 3px; padding-bottom: 3px; } }
.side { display: grid; gap: 10px; min-width: 0; }
.side .warn { margin-top: 0 !important; }
.both .c { display: flex; align-items: center; min-height: 40px; padding: 4px 10px; background: rgba(255,255,255,0.055); font-size: 14.5px; line-height: 1.3; color: #d9e3f6; }
.both .c:not(.m) + .c { border-left: 1px solid rgba(255,255,255,0.09); }
.both .l, .both.two .k { border-radius: 10px 0 0 10px; }
.both .m { border-radius: 0 10px 10px 0; }
.both b { color: #fff; }
.both small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.25; color: var(--muted); }
.both kbd.key:first-child { margin-left: 0; }
.both .mini { vertical-align: 0; }
.mini.loft { border-color: rgba(255,180,92,0.75); color: #ffcf9a; }
@media (max-width: 520px) { .both { grid-template-columns: minmax(0, 0.9fr) 124px minmax(0, 1.1fr); } .both.two { grid-template-columns: 150px minmax(0, 1fr); } .both .c { padding: 5px 7px; font-size: 13px; } .both kbd.key { min-width: 26px; height: 26px; padding: 0 5px; } .both kbd.key.wide { min-width: 70px; } }
.ctl-grid.one { grid-template-columns: 1fr; }
.panel.ctl.slim { width: min(600px, 100%); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps > li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 12px; align-items: start; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; padding: 10px 12px; }
.steps .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 800 16px var(--head); background: var(--gold); color: #1a1200; }
.ctl b.t { display: block; font: 700 16px/1.25 var(--head); letter-spacing: 0.03em; color: #fff; margin: 6px 0 5px; }
.ctl-body p { margin: 0 0 4px; font-size: 15px; line-height: 1.45; color: #d9e3f6; }
.ctl-body p.sm { font-size: 13px; color: var(--muted); margin-top: 6px; }
.ctl-body .g { color: var(--good); }
.withpic { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.withpic > .pic { grid-column: 2; grid-row: 1; width: 52px; height: 52px; }
.acts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.acts li { display: grid; gap: 10px; align-items: center; font-size: 15px; line-height: 1.35; color: #d9e3f6; }
.acts.kys li { grid-template-columns: 112px minmax(0, 1fr); }
.acts.tch li { grid-template-columns: 46px minmax(0, 1fr); }
.acts .v { display: flex; align-items: center; justify-content: center; }
.acts .pic { width: 44px; height: 44px; }
.acts b, .steps p b { color: #fff; }
.mini { display: inline-block; font: 800 11px/1 var(--head); font-style: normal; letter-spacing: 0.06em; padding: 5px 8px; border-radius: 7px; background: rgba(8,12,24,0.9); border: 1.5px solid rgba(255,255,255,0.35); color: #fff; vertical-align: 1px; }
.mini.go { background: linear-gradient(180deg, #39d97f, #138a4a); border-color: #a6ffcd; }
.mini.blue { background: linear-gradient(180deg, #4cc3ff, #1f7fd6); border-color: #7fd6ff; }
.aimbox { background: rgba(134,217,255,0.07); border: 1px dashed rgba(134,217,255,0.35); border-radius: 14px; padding: 6px 14px 10px; }
.aimbox .aim { display: block; width: 100%; max-width: 250px; height: auto; margin: 2px auto 6px; }
.aim text { font: 800 12px var(--body); fill: #fff; letter-spacing: 0.06em; }
.aim text.kc { font: 800 15px var(--body); fill: #0b1224; letter-spacing: 0; }
.flds { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 5px; font-size: 14px; color: #d9e3f6; }
.flds b { display: inline-block; min-width: 76px; color: var(--cy); }
.mdemo { max-width: 260px; margin: 8px 0 2px; }
.mdemo .mtrack { height: 18px; border-radius: 9px; box-shadow: none; }
.mdemo .mcur { width: 5px; }
.warn { margin: 10px 0 0 !important; padding: 9px 12px; border-radius: 12px; background: rgba(255,226,138,0.1); border: 1px solid rgba(255,226,138,0.3); color: #ffeeb8 !important; font-size: 14px !important; }
.warn b { color: var(--gold); }
.rules h3 { margin-top: 10px; }
.rules > div > h3:first-child { margin-top: 4px; }
@media (max-width: 760px) {
  .ctl-grid { grid-template-columns: 1fr; }
  .ctl-head { padding: 14px 16px 0; }
  .ctl .tabs { margin: 0 16px 8px; }
  .ctl-body { padding: 4px 16px 10px; }
  .ctl-foot { padding: 10px 16px 14px; }
  .aimbox { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 12px; align-items: center; }
  .aimbox b.t { grid-column: 1 / 3; }
  .aimbox .aim { margin: 0; }
  .aimbox .flds, .aimbox p { grid-column: 1 / 3; }
  .aimbox .aim + p { grid-column: 2; }
  .w-only { display: none !important; }
  .n-only { display: block; }
}
/* short screens (small phones, phones held sideways): tighter, and the tick box sits beside the start button */
@media (max-height: 720px) {
  .ctl-head { padding-top: 12px; }
  .ctl-head h2 { font-size: 21px; margin-bottom: 6px; }
  .steps { gap: 6px; }
  .steps > li { padding: 7px 10px; }
  .ctl b.t { font-size: 15px; margin: 5px 0 3px; }
  .ctl-body p, .acts li { font-size: 14px; }
  .acts { gap: 5px; }
  .acts .pic { width: 38px; height: 38px; }
  .withpic > .pic { width: 44px; height: 44px; }
  .warn { margin-top: 8px !important; padding: 7px 10px; }
  .ctl-foot { flex-wrap: nowrap; padding-top: 8px; padding-bottom: 10px; }
  .ctl-foot .primary { flex: 1 1 auto; min-height: 48px; font-size: 16px; }
  .tick { font-size: 13px; flex: 0 1 auto; line-height: 1.2; }
}
@media (max-width: 420px) {
  .steps > li { grid-template-columns: 28px minmax(0, 1fr); gap: 0 10px; padding: 9px 10px; }
  .steps .n { width: 28px; height: 28px; font-size: 14px; }
  .aimbox { grid-template-columns: 124px minmax(0, 1fr); }
  .kind button { padding: 5px 8px; font-size: 12px; }
}
/* a phone held sideways: the three steps sit side by side so the card fits without scrolling */
@media (min-width: 640px) and (max-height: 520px) {
  body.kind-touch .panel.ctl { width: min(1000px, 100%); }
  body.kind-touch .ctl-grid { grid-template-columns: 1fr; }
  body.kind-touch .steps { grid-template-columns: 1fr 1.3fr 1fr; align-items: stretch; }
  body.kind-touch .aimbox, body.kind-touch .warn, body.kind-touch .steps p.sm { display: none; }
  body.kind-touch .ctl-head { padding-top: 10px; align-items: center; }
  body.kind-touch .ctl-head > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  body.kind-touch .ctl-head h2 { font-size: 19px; margin-bottom: 4px; }
  body.kind-touch .steps > li { grid-template-columns: 26px minmax(0, 1fr); gap: 0 8px; }
  body.kind-touch .steps .n { width: 26px; height: 26px; font-size: 13px; }
  body.kind-touch .ctl b.t { font-size: 14px; }
  body.kind-touch .ctl-body p, body.kind-touch .acts li { font-size: 13.5px; }
  body.kind-touch .acts.tch li { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
  body.kind-touch .acts .pic { width: 32px; height: 32px; }
  body.kind-touch .withpic { grid-template-columns: minmax(0, 1fr) 36px; }
  body.kind-touch .withpic > .pic { width: 36px; height: 36px; }
  body.kind-touch .ctl-foot { padding-top: 7px; padding-bottom: 9px; }
  body.kind-touch .ctl-foot .primary { min-height: 44px; }
}
/* the strip during play: what to press right now */
.keys { position: absolute; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 74px); transform: translateX(-50%); z-index: 2; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; width: max-content; max-width: min(94vw, 640px); padding: 7px 14px; border-radius: 14px; background: rgba(6,10,22,0.8); border: 1px solid rgba(255,255,255,0.14); font-size: 14px; color: #d9e3f6; pointer-events: none; text-align: center; }
.keys[hidden] { display: none; }
.keys span { white-space: nowrap; }
.keys b { color: var(--gold); letter-spacing: 0.04em; }
.keys i { font-style: normal; color: rgba(255,255,255,0.35); }
.keys kbd.key { min-width: 24px; height: 24px; padding: 0 6px; font-size: 12px; border-radius: 6px; box-shadow: 0 2px 0 #7c88a3; margin: 0 1px; }
@media (max-width: 900px) { .keys, .hint { top: calc(max(8px, env(safe-area-inset-top)) + 96px); } .keys { font-size: 13px; padding: 6px 10px; gap: 3px 7px; } }
/* key names on the run buttons for keyboard players */
body.kind-keys .runbtn::after, body.kind-keys .stopbtn::after { display: block; margin-top: 3px; font: 700 11px/1 var(--body); letter-spacing: 0.1em; opacity: 0.85; }
body.kind-keys .runbtn::after { content: "SPACE"; }
body.kind-keys .stopbtn::after { content: "S"; }
.bowlgo small { display: block; margin-top: 2px; font: 700 11px/1 var(--body); letter-spacing: 0.14em; opacity: 0.85; }
body.kind-touch .dt kbd { display: none; }

/* toast */
.toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(0.95); max-width: min(90vw, 460px); padding: 10px 18px; border-radius: 14px; background: rgba(8,12,24,0.9); border: 1px solid var(--line); text-align: center; font-size: 16px; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 4; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.bad { border-color: var(--bad); }
.toast.gold { border-color: var(--gold); color: var(--gold); }
.toast.good { border-color: var(--good); color: var(--good); font-weight: 800; }
.toast.cy { border-color: var(--cy); }

@media (max-width: 560px) {
  .sb { gap: 7px; padding: 5px 9px 5px 7px; }
  .sbs { font-size: 20px; }
  .bcard { padding: 5px 7px; font-size: 12px; gap: 5px; }
  .bcard span { font-size: 13px; }
  .cards { flex-wrap: wrap; }
  .bcard.r { margin-left: 0; }
  .comm { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 74px); font-size: 13px; }
  .runbar { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 120px); }
  .loftbtn { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 120px); width: 66px; height: 66px; }
  .bowlpanel { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 74px); }
}

/* ?poster: the share image */
.posterbox { position: absolute; left: 56px; top: 50px; z-index: 3; padding: 18px 26px 16px; border-radius: 22px; background: rgba(6,10,22,0.78); border: 1px solid rgba(134,217,255,0.35); box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center; }
.posterbox .logo { font-size: 50px; margin: 0 0 6px; }
.posterbox p { margin: 0; color: #e9f1ff; font: 700 17px var(--body); letter-spacing: 0.02em; }
body.poster .ca-home { display: none; }

/* wide screens: the bowling controls sit at the side so the pitch stays clear */
@media (min-aspect-ratio: 5/4) {
  .bowlpanel { left: auto; right: max(10px, env(safe-area-inset-right)); bottom: auto; top: 50%; transform: translateY(-50%); width: 252px; }
  .dtypes { grid-template-columns: 1fr 1fr; }
  .fields { flex-wrap: wrap; }
  .fields span { width: 100%; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 640px) { .dt small { display: none; } .bp-tip { margin: 2px 0 6px; } }

.fieldrow { display: flex; gap: 10px; align-items: center; margin: 8px 0 2px; }
.fieldrow .fields { flex: 1; margin: 0; flex-wrap: wrap; }
.fmap { flex: none; border-radius: 50%; background: #0f3d2a; }
@media (min-aspect-ratio: 5/4) { .fieldrow { flex-direction: column; align-items: stretch; } .fmap { align-self: center; } }
@media (min-aspect-ratio: 5/4) and (max-height: 640px) { .fmap { display: none; } }

/* ================= 2026-11-20: simple play. Two hit buttons, a minimal HUD, a one-button menu ================= */
/* batting buttons: ◀ and ▶ in the bottom corners; Expert adds ▲ above ◀ and ⤴ BIG above ▶ */
.batbtns { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 3; pointer-events: none; }
.batbtns[hidden] { display: none; }
.batbtns button { position: absolute; pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
.hitbtn { --b: calc(max(14px, env(safe-area-inset-bottom)) + 44px); width: 108px; height: 108px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; align-content: center; background: rgba(8,12,24,0.6); border: 3px solid rgba(255,255,255,0.5); color: #fff; opacity: 0.72; transition: transform 0.06s, opacity 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.hitbtn:hover:not([disabled]) { background: rgba(8,12,24,0.6); border-color: rgba(255,255,255,0.8); }
.hitbtn b { font-size: 42px; line-height: 1; }
.hitbtn small, .bigbtn small { display: none; font: 800 12px/1 var(--body); letter-spacing: 0.08em; opacity: 0.85; margin-top: 3px; }
body.kind-keys .hitbtn small, body.kind-keys .bigbtn small { display: block; }
.hitbtn.l { left: max(14px, env(safe-area-inset-left)); bottom: var(--b); }
.hitbtn.r { right: max(14px, env(safe-area-inset-right)); bottom: var(--b); }
.hitbtn.s { left: calc(max(14px, env(safe-area-inset-left)) + 12px); bottom: calc(var(--b) + 120px); width: 84px; height: 84px; }
.hitbtn.s b { font-size: 30px; }
.batbtns.ready .hitbtn { opacity: 1; border-color: var(--gold); box-shadow: 0 0 24px rgba(255,226,138,0.45); }
.hitbtn.hit { transform: scale(0.88); background: rgba(255,226,138,0.4); }
.bigbtn { right: calc(max(14px, env(safe-area-inset-right)) + 2px); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 44px + 122px); width: 104px; min-height: 48px; padding: 6px 4px; border-radius: 24px; font: 800 14px/1.1 var(--head); background: rgba(8,12,24,0.72); border: 2px solid rgba(255,180,92,0.6); color: #ffcf9a; }
.bigbtn.on { background: linear-gradient(180deg, #ff9a3c, #d9541a); color: #fff; border-color: #ffd1a0; box-shadow: 0 0 24px rgba(255,140,40,0.6); }
body:not(.expert) .x-only { display: none !important; }
@media (max-width: 560px) {
  .hitbtn { width: 92px; height: 92px; }
  .hitbtn b { font-size: 36px; }
  .hitbtn.s { width: 72px; height: 72px; bottom: calc(var(--b) + 102px); }
  .bigbtn { width: 90px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 44px + 104px); }
}
@media (max-height: 480px) { .hitbtn { --b: calc(max(10px, env(safe-area-inset-bottom)) + 34px); width: 86px; height: 86px; } .hitbtn.s { width: 68px; height: 68px; bottom: calc(var(--b) + 94px); } .bigbtn { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 34px + 96px); width: 86px; min-height: 40px; } }
/* with no name cards at the bottom the commentary line sits on the bottom edge, between the buttons */
.comm { bottom: max(10px, env(safe-area-inset-bottom)); max-width: min(92vw, 560px); font-size: 13.5px; padding: 6px 12px; }
@media (max-width: 560px) { .comm { bottom: max(8px, env(safe-area-inset-bottom)); font-size: 12.5px; } }
.meter { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 64px); }
.meter .mname { display: block; margin-bottom: 7px; font: 700 14px var(--body); color: #fff; text-shadow: 0 2px 6px #000; }
/* title: one big button */
.title .play { min-height: 68px; font: 900 26px var(--head); letter-spacing: 0.1em; }
.matchline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 12px; min-height: 0; padding: 8px 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: transparent; border-color: rgba(255,255,255,0.12); }
.matchline span { display: inline-flex; align-items: center; color: var(--ink); }
.matchline i { font-style: normal; color: var(--muted); margin: 0 7px; }
.matchline u { color: var(--cy); }
.title .grid3 button { padding: 10px 2px; font-size: 14.5px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 18px; font-size: 14px; }
/* the "not affiliated" line under the title screen links: small and quiet, but readable */
.fineprint { margin: 12px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); opacity: .85; }
/* match setup */
.panel.setup { width: min(640px, 100%); }
.panel.setup.wide { width: min(880px, 100%); }
.vsline { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; margin: 8px 0 10px; }
.vsline .vs { margin: 0; font-size: 14px; }
.tpick { display: grid; gap: 3px; text-align: left; padding: 9px 12px; min-height: 0; }
.tpick small { font: 700 10.5px var(--body); letter-spacing: 0.12em; color: var(--muted); }
.tpick b { display: flex; align-items: center; font-size: 16px; min-width: 0; }
.tpick.sel { border-color: var(--gold); background: rgba(255,226,138,0.1); }
.tog.wide { display: block; width: 100%; text-align: left; margin-top: 14px; }
.tog small { display: block; margin-top: 4px; font-weight: 400; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
/* the short how-to cards */
.panel.ctl { width: min(560px, 100%); }
.needchip { align-self: center; flex: none; padding: 7px 12px; border-radius: 10px; background: rgba(255,226,138,0.14); border: 1px solid rgba(255,226,138,0.4); color: var(--gold); font-weight: 800; font-size: 14px; white-space: nowrap; }
.gold { color: var(--gold) !important; }
.mini.hit { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 12px; border-color: var(--gold); vertical-align: -7px; }
.steps > li.plus { border-style: dashed; border-color: rgba(134,217,255,0.4); background: rgba(134,217,255,0.06); }
.steps > li.plus .n { background: var(--cy); }
.ctl h2.sub { font-size: 18px; margin: 16px 0 8px; }
.ctl-body .tog.wide { margin: 14px 0 4px; }
.rules p { margin-bottom: 8px; }

/* ================= 2026-11-20 (later): arrow-key batting. The controls live on a bar along the bottom ================= */
.batbtns, .hitbtn, .bigbtn { display: none !important; }      /* the round buttons of the version before */
.ctlbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr) minmax(0, 0.8fr); gap: 6px; padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(6,10,22,0), rgba(6,10,22,0.82) 30%); }
.ctlbar[hidden] { display: none; }
.cbtn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 6px 8px; border-radius: 12px; background: rgba(8,12,24,0.78); border: 2px solid rgba(255,255,255,0.22); color: #fff; touch-action: none; -webkit-user-select: none; user-select: none; opacity: 0.8; transition: transform 0.06s, opacity 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.cbtn:hover:not([disabled]) { background: rgba(8,12,24,0.78); border-color: rgba(255,255,255,0.5); }
.cbtn i { font-style: normal; font-size: 22px; line-height: 1; }
.cbtn kbd { display: none; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 6px; place-items: center; background: linear-gradient(180deg, #f6f8ff, #cfd8ea); color: #0b1224; font: 800 13px/1 var(--body); box-shadow: 0 2px 0 #7c88a3; white-space: nowrap; }
body.kind-keys .cbtn kbd { display: inline-grid; }
body.kind-keys .cbtn i { display: none; }
.cbtn .lab { font: 800 11.5px/1.15 var(--head); letter-spacing: 0.05em; text-align: left; }
.ctlbar.ready .cbtn:not(.runbtn):not(.pz) { opacity: 1; border-color: var(--gold); box-shadow: 0 0 16px rgba(255,226,138,0.35); }
.cbtn.hit { transform: scale(0.94); background: rgba(255,226,138,0.4); }
.cbtn.runbtn { height: auto; min-width: 0; border-radius: 12px; background: rgba(8,12,24,0.78); letter-spacing: 0.06em; opacity: 0.55; }
.cbtn.runbtn b { font: 900 17px var(--head); }
.cbtn.runbtn.safe { opacity: 1; background: linear-gradient(180deg, #39d97f, #138a4a); border-color: #a6ffcd; box-shadow: 0 0 26px rgba(60,220,130,0.6); animation: runpulse 0.5s ease-in-out infinite alternate; }
.cbtn.runbtn.risky { opacity: 1; background: linear-gradient(180deg, #ffb45c, #d9741a); border-color: #ffe0b0; }
@keyframes runpulse { to { transform: scale(1.05); filter: brightness(1.15); } }
.cbtn.pz { opacity: 0.7; }
body:not(.kind-keys) .cbtn.pz { display: none; }
body:not(.kind-keys) .ctlbar { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr); }
@media (max-width: 760px) {
  /* phones: RUN on its own row above the four shots */
  .ctlbar, body:not(.kind-keys) .ctlbar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .cbtn { flex-direction: column; gap: 3px; min-height: 62px; padding: 6px 2px; }
  .cbtn i { font-size: 24px; }
  .cbtn .lab { font-size: 9.5px; text-align: center; letter-spacing: 0.02em; }
  .cbtn.runbtn { grid-column: 1 / -1; grid-row: 1; flex-direction: row; min-height: 46px; }
  .cbtn.pz { display: none; }
}
@media (max-height: 480px) { .cbtn { min-height: 44px; } .cbtn.runbtn b { font-size: 15px; } }
/* the commentary line and the waiting note move up under the scoreboard, out of the way of the bar */
.comm { top: calc(max(8px, env(safe-area-inset-top)) + 66px); bottom: auto; }
.hint { top: calc(max(8px, env(safe-area-inset-top)) + 108px); }
@media (max-width: 900px) { .comm { top: calc(max(8px, env(safe-area-inset-top)) + 98px); } .hint { top: calc(max(8px, env(safe-area-inset-top)) + 138px); } }
/* bowling: the length buttons (Expert) and the skip button */
.mpick { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.mpick button { min-height: 38px; padding: 6px 10px; font-size: 13.5px; background: rgba(8,12,24,0.8); }
.mpick button.sel { border-color: var(--gold); background: rgba(255,226,138,0.16); }
.mpick kbd { display: none; margin-left: 6px; font: 700 11px var(--body); color: var(--muted); }
body.kind-keys .mpick kbd { display: inline; }
.skipbtn { position: absolute; z-index: 3; right: max(10px, env(safe-area-inset-right)); top: calc(max(10px, env(safe-area-inset-top)) + 56px); min-height: 38px; padding: 6px 12px; font-size: 13px; border-radius: 20px; background: rgba(8,12,24,0.8); }
.skipbtn[hidden] { display: none; }
/* menus */
.matchline.cont { border-color: rgba(109,255,166,0.5); background: rgba(109,255,166,0.08); }
.matchline.cont span:first-child { color: var(--good); font-weight: 800; }
.title .grid2 button { padding: 10px 4px; font-size: 15px; }
.setup .seg + .sub, .setup .seg + .fmtnote { margin-top: 6px; }
.fmtnote { margin: 6px 0 0; }
.shots { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 7px; }
.shots li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 15px; line-height: 1.3; color: #d9e3f6; }
.shots li > :first-child { justify-self: center; }
.shots b { color: #fff; }
.barnote { margin-top: 10px !important; }
@media (max-height: 720px) { .shots { gap: 4px; } .shots li { font-size: 14px; } }
.cbtn.runbtn::after, .runbtn::after, .stopbtn::after { content: none !important; display: none !important; }
