:root{--bg:#0b1d0e;--fg:#e8f5d0;--acc:#ffd23f;--red:#ff4d4d;--blue:#4dc3ff;--muted:#8fa98a;--panel:#14301a}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--fg);font-family:'Press Start 2P',ui-monospace,monospace;-webkit-tap-highlight-color:transparent}
#app{max-width:480px;margin:0 auto;padding:6px 8px calc(20px + env(safe-area-inset-bottom))}
.small{font-size:10px}.tiny{font-size:8px;line-height:1.6}.muted{color:var(--muted)}.big{font-size:18px;color:var(--acc);margin-bottom:12px;animation:blink 1s steps(2) infinite}
a{color:var(--blue)}
header{display:flex;flex-direction:column;gap:4px;padding:4px 0;position:relative;z-index:30;overflow:visible}
.toggles{display:flex;gap:6px;align-items:center}
.tbtn{font-size:16px;background:var(--panel);border:2px solid #2d5a34;border-radius:0;padding:4px 6px;color:var(--fg)}
.tbtn.off{opacity:.35;filter:grayscale(1)}
.badge{font-size:8px;padding:4px 6px;background:#333;color:#fff}
.badge.live{background:var(--red);animation:blink 1.2s steps(2) infinite}.badge.sim{background:#a35cff}.badge.replay{background:#2a7fff}
h1{font-size:20px;text-align:center;color:var(--acc);line-height:1.5;text-shadow:3px 3px 0 #a33}
h3{margin:10px 0 4px;color:var(--acc)}
#scoreboard{background:#000;border:3px solid #444;padding:6px 8px;text-align:center}
#sbMain{font-size:16px;margin:6px 0;color:var(--acc)}#sbScore{font-size:20px;color:#fff}
#sbTeam{font-size:12px}
#stage{position:relative;margin-top:6px;border:3px solid #2d5a34;background:#1d4d22}
#cv,#cv16{display:block;width:100%;height:auto;image-rendering:pixelated;image-rendering:crisp-edges}
#banner{position:absolute;left:0;right:0;top:38%;text-align:center;font-size:26px;pointer-events:none;opacity:0;text-shadow:3px 3px 0 #000,-2px -2px 0 #000}
#banner.show{animation:pop var(--dur,1.6s) ease-out forwards}
#banner small{display:block;font-size:9px;margin-top:8px;color:#fff}
#nameTag{background:#000;color:#fff;padding:5px 6px;font-size:8px;line-height:1.6;min-height:22px;border:3px solid #2d5a34;border-top:0}
@keyframes pop{0%{opacity:0;transform:scale(.3)}12%{opacity:1;transform:scale(1.25)}22%{transform:scale(1)}80%{opacity:1}100%{opacity:0}}
@keyframes blink{50%{opacity:.35}}
#panel{background:var(--panel);padding:6px;margin-top:6px;font-size:9px;line-height:1.9}
.row{display:flex;gap:6px}.lbl{width:42px;color:var(--muted);flex:none}.pl{flex:1}
.chips span{display:inline-block;min-width:18px;padding:1px 3px;margin:1px;background:#000;text-align:center;font-size:8px}
.chips .c4{background:#1f8f3a}.chips .c6{background:#a35cff}.chips .cW{background:var(--red)}.chips .cx{background:#8a6d00}
#controls{margin-top:6px}
.btns{display:flex;gap:4px;margin-top:4px;flex-wrap:wrap}
.btns button,#fixtureList button{font-family:inherit;font-size:9px;background:#24452a;color:var(--fg);border:2px solid #4b7d52;padding:7px 6px;flex:1;border-radius:0}
.btns button.on{background:var(--acc);color:#000}
#progressWrap{height:6px;background:#000}#progress{height:100%;width:0;background:var(--acc)}
#feed{list-style:none;padding:0;margin:0;font-size:8px;line-height:1.7;max-height:220px;overflow:auto;background:#000;border:2px solid #333}
#feed li{padding:3px 6px;border-bottom:1px solid #1a1a1a}
#feed li.w{color:var(--red)}#feed li.b4{color:#7dff8a}#feed li.b6{color:#d6a8ff}#feed li.o{color:var(--acc)}
details{margin-top:8px}summary{cursor:pointer;color:var(--acc)}
#card table{width:100%;border-collapse:collapse;font-size:7px;margin:6px 0}#card td,#card th{padding:3px 2px;text-align:right;border-bottom:1px solid #223}
#card td:first-child,#card th:first-child{text-align:left}
#card h4{font-size:9px;margin:10px 0 2px;color:var(--acc)}
.fx{background:var(--panel);margin:6px 0;padding:8px;font-size:8px;line-height:1.8;border-left:4px solid #4b7d52}
.fx.next{border-left-color:var(--acc);background:#2a3a10}
.fx .t{color:var(--acc)}.fx .btns button{font-size:8px;padding:6px 4px}
#tapStart{position:fixed;inset:0;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;text-align:center;z-index:9;padding:20px}
#tapStart[hidden],section[hidden]{display:none}
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--acc);color:#000;padding:8px 10px;opacity:0;transition:opacity .3s;z-index:10;pointer-events:none}
#toast.show{opacity:1}
#crumbs{margin:2px 0 6px;color:var(--muted)}#crumbs a{margin-right:4px}
.search{display:flex;gap:4px;margin:8px 0}.search input{flex:1;font-family:inherit;font-size:9px;padding:8px;background:#000;color:var(--fg);border:2px solid #4b7d52;border-radius:0}
.search button{font-family:inherit;font-size:9px;background:var(--acc);border:0;padding:0 10px}
.tabs{display:flex;gap:3px;margin:8px 0;flex-wrap:wrap}.tabs a{flex:1;text-align:center;font-size:8px;padding:8px 2px;background:#24452a;color:var(--fg);text-decoration:none;border:2px solid #4b7d52}
.tabs a.on{background:var(--acc);color:#000}
.list a.item{display:block;background:var(--panel);margin:4px 0;padding:9px 8px;font-size:8px;line-height:1.7;color:var(--fg);text-decoration:none;border-left:4px solid #4b7d52}
.list a.item:active{background:#2a5a30}.list h4{font-size:9px;color:var(--acc);margin:12px 0 4px}
table.t{width:100%;border-collapse:collapse;font-size:7px;margin:6px 0}table.t td,table.t th{padding:4px 2px;text-align:right;border-bottom:1px solid #223}
table.t td:first-child,table.t th:first-child,table.t td.l{text-align:left}table.t tr.me{background:#3a3a10}
.lead{display:flex;align-items:center;gap:8px;background:var(--panel);margin:4px 0;padding:6px;font-size:8px;color:var(--fg);text-decoration:none}
.lead img{width:32px;height:32px;image-rendering:pixelated;background:#000}.lead .n{flex:1;line-height:1.6}.lead .v{font-size:12px;color:var(--acc)}
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.pcard{background:linear-gradient(#2a3a10,#14301a);border:3px solid var(--acc);padding:5px;text-align:center;font-size:7px;line-height:1.6;color:var(--fg);text-decoration:none}
.pcard img{width:100%;image-rendering:pixelated;background:#0b1d0e;display:block}.pcard b{color:var(--acc)}
.bigcard{border:4px solid var(--acc);background:linear-gradient(#3a2a60,#14301a);padding:10px;text-align:center}
.bigcard img{width:60%;image-rendering:pixelated;border:3px solid #000;background:#0b1d0e}.bigcard h2{font-size:12px;color:var(--acc);margin:8px 0}
.statgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:8px}.statgrid div{background:#000;padding:6px 2px;font-size:7px;line-height:1.8}.statgrid b{display:block;font-size:12px;color:#fff}
#worm,#manhattan{width:100%;display:block;background:#000;margin-top:6px;border:2px solid #333}
.cheer{background:#a33!important;font-size:11px!important}
.note{font-size:7px;line-height:1.7;color:var(--muted);margin:6px 0}

/* legibility: digits in a clear monospace (the pixel font's 8 looks like & at small sizes) */
.num,#card td:not(:first-child),table.t td:not(.l):not(:first-child),.statgrid b,.lead .v{font-family:ui-monospace,"SF Mono",Menlo,Consolas,"Roboto Mono",monospace;font-weight:700}
.num{font-size:12px}#card td:not(:first-child),table.t td:not(.l):not(:first-child){font-size:11px}
#card td.how{font-family:inherit;font-weight:400;font-size:7px;text-align:left;color:var(--muted)}
#card td.ext{text-align:left!important;font-family:inherit!important;font-weight:400!important;font-size:8px!important;color:var(--muted);padding:6px 2px}
#sbFirst{font-size:9px;color:#ccc;margin-top:6px}#sbFirst .num{font-size:13px;color:#fff}
#sbScore{font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-weight:800;font-size:26px}
#sbOvers{font-family:ui-monospace,Menlo,Consolas,monospace;font-weight:700;font-size:13px}

/* graphics toggle + 16-bit extras */
.tbtn.gfx{font:9px/1 'Press Start 2P',monospace;padding:6px 5px}.tbtn.gfx b{color:var(--acc)}.tbtn.gfx .dim{opacity:.45}
#cv[hidden],#cv16[hidden]{display:none}
#stage{border-color:#6a5a3a}

/* segmented controls: team switch, batting/bowling */
.seg{display:flex;gap:0;margin:4px 0}.seg button{flex:1;font-family:inherit;font-size:9px;background:#24452a;color:var(--fg);border:2px solid #4b7d52;padding:7px 4px;border-radius:0}
.seg button+button{border-left:0}.seg button.on{background:var(--acc);color:#000;border-color:var(--acc)}
.teamsw button{font-size:11px;padding:6px 4px;line-height:1.4}.teamsw small{display:block;font-size:6px;opacity:.75}
/* lineup strip (inside the stage, right edge, over the stands) */
#lineup{position:absolute;top:0;right:0;bottom:0;width:54px;overflow-y:auto;background:rgba(5,10,8,.62);border-left:2px solid rgba(255,210,63,.5);-webkit-overflow-scrolling:touch;scrollbar-width:none}
#lineup::-webkit-scrollbar{display:none}
#lineup .luh{font-size:5px;color:var(--acc);text-align:center;padding:3px 1px;line-height:1.4}
#lineup .lu{display:block;width:100%;background:none;border:0;border-bottom:1px solid rgba(255,255,255,.12);padding:3px 1px 2px;color:#fff;font-family:inherit;position:relative;cursor:pointer}
#lineup .lu .nm{display:block;font:700 8px/1.1 ui-monospace,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#lineup .lu img{width:36px;height:42px;image-rendering:pixelated;display:block;margin:1px auto 0}
#lineup .lu .tg{position:absolute;right:2px;bottom:3px;font-size:5px;background:#000;color:var(--acc);padding:1px 2px}
#lineup .lu.in{background:rgba(255,210,63,.18)}#lineup .lu.in .tg{background:var(--acc);color:#000}
#lineup .lu.out{opacity:.38;filter:grayscale(1)}#lineup .lu.out img{height:30px;width:26px}#lineup .lu.out .tg{color:#ff9a9a}
/* tappable names */
.tappable{cursor:pointer;text-decoration:underline dotted rgba(255,255,255,.35);text-underline-offset:3px}
/* modal sheets */
.modal{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.72);display:flex;align-items:flex-start;justify-content:center;padding:14px 8px;overflow-y:auto}
.modal .sheet{position:relative;width:100%;max-width:420px;background:var(--bg);border:3px solid var(--acc);padding:10px;margin:auto 0}
.modal .x{position:absolute;top:4px;right:4px;width:44px;height:44px;font-size:20px;background:#000;color:#fff;border:2px solid var(--acc);z-index:2}
.modal .bigcard{margin-top:18px}.modal .bigcard h3{margin:10px 0 2px;color:var(--acc)}
.portrait{position:relative;display:inline-block;width:60%}.portrait img{width:100%}
.shirtno{position:absolute;left:50%;bottom:4%;transform:translateX(-50%);font:700 11px ui-monospace,monospace;color:#c22;background:#fff;padding:0 3px}
.h2 .no,.bigcard h2 .no{color:#fff;font-size:10px}
.tgame{background:#000;padding:6px;line-height:1.9;text-align:left}
.statgrid.g4{grid-template-columns:repeat(4,1fr)}
.teams-sheet .cards{margin-top:8px}.teams-sheet #tgSeg{margin-right:50px}.teams-sheet .pcard{font-family:inherit;cursor:pointer;position:relative}.teams-sheet .pcard i{color:var(--muted);font-style:normal}
.teams-sheet .pcard .shirtno{bottom:auto;top:40%}
/* bowling view */
#bowlView{background:var(--panel);padding:6px;margin-top:4px}
.bhead{display:flex;gap:8px;align-items:center;cursor:pointer}.bhead img{width:48px;height:48px;image-rendering:pixelated;border:2px solid var(--acc);background:#000}
.bhead .bn{font-size:11px;color:var(--acc);margin-bottom:3px}.bfig{font-size:14px}
.lbl2{color:var(--muted);margin:8px 0 3px}
.bchips{display:flex;flex-wrap:wrap;gap:3px}
.bchip{min-width:24px;height:24px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;font:700 11px/1 ui-monospace,Menlo,monospace;background:#e8e8e0;color:#111;border:2px solid #000;box-shadow:2px 2px 0 #000;padding:0 3px}
.bchips.big .bchip{min-width:34px;height:34px;font-size:15px}
.bchip small{font-size:7px;line-height:1;margin-top:1px}
.bchip.dot{background:#3a4a3c;color:#cfe}.bchip.c4{background:#2fbf4f;color:#000}.bchip.c6{background:#a46be8;color:#fff}.bchip.cW{background:#e23a3a;color:#fff}
.bchip.cwd{background:#ffd23f}.bchip.cnb{background:#ff8a2a}.bchip.cby{background:#6ab4ff}
.spell .srow{display:flex;align-items:center;gap:6px;margin:3px 0}.spell .ovn{width:38px;color:var(--muted)}.spell .num{margin-left:auto;color:var(--muted)}
table.bl tr.me td{color:var(--acc)}table.bl tr[data-n]{cursor:pointer}
/* voice picker */
.voice-sheet .vrow{display:flex;align-items:center;gap:6px;border-bottom:1px solid #24452a;padding:6px 0;font:12px/1.3 -apple-system,system-ui,sans-serif}
.voice-sheet .vrow label{flex:1}.voice-sheet .vrow small{display:block;color:var(--muted);margin-left:22px}.voice-sheet .vrow.on{color:var(--acc)}
.voice-sheet .vrow button{font-family:'Press Start 2P',monospace;font-size:8px;padding:8px 6px;background:#24452a;color:var(--fg);border:2px solid #4b7d52}
#teamSwitch{position:relative;z-index:10}

.modal .custom{margin-top:10px;width:100%;font-family:inherit;font-size:8px;padding:8px;background:#222;color:#888;border:2px dashed #555}
#card td:first-child{cursor:pointer;text-decoration:underline dotted rgba(255,255,255,.35)}

/* duck badges */
img.duckb{width:21px!important;height:19px!important;image-rendering:pixelated;vertical-align:-4px;margin:0 0 0 3px!important;background:none!important;border:0!important;display:inline-block!important;filter:none!important;opacity:1!important}
#banner img.duckb.big{width:56px!important;height:52px!important;display:block!important;margin:0 auto 2px!important}
#lineup .lu img.duckb{position:absolute;left:1px;bottom:2px;width:16px!important;height:15px!important;margin:0!important}
.dkrow{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:6px;align-items:center}
.teams-sheet .pcard img.duckb{width:14px!important;height:13px!important;margin-left:1px!important}

/* team + round drop-downs (retro select) */
.pickers{display:flex;gap:4px;margin:0}
.pick{flex:1;min-width:0;display:flex;flex-direction:column;background:#24452a;border:2px solid #4b7d52;box-shadow:2px 2px 0 #000;padding:2px 4px 4px}
.pick:first-child{flex:0.9}.pick:last-child{flex:1.1}
.pick span{font-size:6px;color:var(--acc);letter-spacing:1px}
.pick select{-webkit-appearance:none;appearance:none;width:100%;min-width:0;font-family:inherit;font-size:9px;line-height:1.5;color:var(--fg);background:#0e2412 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffd23f' d='M0 0h10v2H8v2H6v2H4V4H2V2H0z'/%3E%3C/svg%3E") no-repeat right 4px center;border:2px solid #000;border-radius:0;padding:5px 18px 5px 4px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
.pick select:focus{outline:2px solid var(--acc)}
.pick select:disabled{opacity:.5}
#roundMsg{padding:8px 0}
.rmsg{background:#000;border:4px solid var(--acc);box-shadow:4px 4px 0 #000;padding:18px 12px;text-align:center;line-height:1.7}
.rmsg .ricon{font-size:40px;line-height:1.2}.rmsg .rhead{font-size:16px;color:var(--acc);margin:8px 0}
.rmsg .rround{font-size:9px;color:#9fd8a8;margin-bottom:12px}.rmsg .rbody{font-size:10px}.rmsg .rbody p{margin:10px 0}.rmsg .rbody b{color:#fff}
.rmsg .rbtn{margin-top:12px;font-family:inherit;font-size:10px;background:var(--acc);color:#000;border:2px solid #000;box-shadow:2px 2px 0 #000;padding:10px 12px}

/* main menu: music toggle, drop-downs, LOAD GAME */
.menu{position:relative;z-index:10;margin:4px 0;background:#10260f;border:2px solid #4b7d52;box-shadow:2px 2px 0 #000;padding:4px}
.menuTop{display:flex;align-items:center;justify-content:space-between;margin:0 0 4px}.menuTop span{font-size:7px;color:var(--acc);letter-spacing:2px}
.musicbtn{position:relative;font-size:14px;padding:2px 8px;line-height:1.2}
.musicbtn.off{opacity:.45;filter:grayscale(1)}
.musicbtn.off::after{content:'';position:absolute;left:3px;right:3px;top:50%;height:3px;background:#ff4d4d;transform:rotate(-35deg);box-shadow:0 0 0 1px #000}
.loadbtn{display:block;width:100%;margin-top:4px;font-family:inherit;font-size:12px;letter-spacing:1px;background:var(--acc);color:#000;border:2px solid #000;box-shadow:3px 3px 0 #000;padding:10px 6px}
.loadbtn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #000}

/* app name + beta, fullscreen toggle */
.brand{min-width:0}
.appName{font-size:8px;color:var(--acc);letter-spacing:.4px;line-height:1.6;display:flex;align-items:center;gap:6px;flex-wrap:nowrap;white-space:nowrap}
.beta{font-size:6px;letter-spacing:1px;color:#000;background:var(--acc);border:2px solid #000;box-shadow:1px 1px 0 #000;padding:2px 3px 1px;line-height:1;flex:none}
.headerSub{display:flex;justify-content:space-between;align-items:center;gap:6px}
#title{margin:0;min-width:0;flex:1}
.menuBtns{display:flex;gap:4px;align-items:center}
.fsbtn{font-family:inherit;font-size:8px;letter-spacing:1px;padding:4px 6px;line-height:1.2;color:var(--acc)}
.fsbtn.on{background:var(--acc);color:#000}
.fsbtn.ios-tip{color:var(--muted)}
html:fullscreen,html:-webkit-full-screen{background:var(--bg)}

/* landing: WATCH LIVE / WATCH REPLAY */
.homeActions{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.homeActions[hidden]{display:none}
.homebtn{display:block;width:100%;min-height:52px;font-family:inherit;font-size:12px;letter-spacing:1px;border:3px solid #000;box-shadow:3px 3px 0 #000;padding:14px 8px}
.homebtn.live{background:var(--acc);color:#000}
.homebtn.replay{background:#2a7fff;color:#fff}
.homebtn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #000}

.homebtn.bgrade{min-height:40px;font-size:8px;letter-spacing:.4px;line-height:1.5;padding:10px 8px;background:#0c1c0c;color:var(--acc);border:2px solid #4b7d52;box-shadow:2px 2px 0 #000}

/* voice commentary menu: sits under the header 🗣️ icon in live/replay, not on the load page */
.voiceMenuWrap{display:flex;justify-content:flex-end;position:relative;z-index:40;margin:2px 0 0;overflow:visible}
.voiceMenuInner{position:relative;flex:none;overflow:visible}
.voiceMenuWrap[hidden]{display:none!important}
.voiceMenuBtn{font-family:inherit;font-size:7px;letter-spacing:.4px;line-height:1.3;color:var(--fg);background:var(--panel);border:2px solid #000;box-shadow:2px 2px 0 #000;padding:8px 8px;min-height:40px;max-width:100%;display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.voiceMenuBtn:active{transform:translate(1px,1px);box-shadow:1px 1px 0 #000}
.voiceMenuBtn[aria-expanded="true"]{background:#1a3a14;border-color:var(--acc)}
.voiceMenu{position:absolute;top:calc(100% + 4px);right:0;left:auto;z-index:50;min-width:100%;width:max-content;max-width:min(calc(100vw - 16px), 260px);background:#0c1c0c;border:3px solid #000;box-shadow:3px 3px 0 #000;padding:0;overflow:visible}
.voiceMenu[hidden]{display:none!important}
.voiceOpt{display:flex;align-items:center;gap:8px;width:100%;box-sizing:border-box;min-height:48px;padding:10px 10px;text-align:left;font-family:inherit;font-size:8px;letter-spacing:.3px;line-height:1.3;color:var(--fg);background:transparent;border:0;border-bottom:2px solid #2d5a34;box-shadow:none;opacity:.55}
.voiceOpt:last-child{border-bottom:0}
.voiceOpt.on{opacity:1;background:#1a3a14;color:var(--acc);box-shadow:inset 0 0 0 2px var(--acc)}
.voiceOpt:active{background:#24452a}
.vemoji{font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:16px;line-height:1;flex:none}
.voiceMenuBtn .vemoji{font-size:14px}
