/* Timestorm Baseball II - broadside / hand-turned-scoreboard UI */
:root {
  --paper: #efe4c8; --paper-2: #e4d5b0; --ink: #1c1612; --ink-2: #4a3c30;
  --red: #c42b2b; --blue: #2659d6; --gold: #d8b04a; --board: #1f4a36; --board-2: #163a2a;
  --rift: #8a5cf0; --rift-2: #e39cf2;
  --slab: 'Alfa Slab One', Georgia, serif; --fell: 'IM Fell English SC', Georgia, serif; --mono: 'Courier Prime', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #150f0c; color: var(--ink); overflow: hidden; font-family: var(--mono); }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
button { font: inherit; }
kbd { font-family: var(--mono); font-size: 0.85em; background: var(--paper-2); border: 1px solid var(--ink-2); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; }

/* ---------- screens */
.screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.screen.show { display: flex; }
.eyebrow { font-family: var(--mono); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px; color: var(--red); margin: 0 0 4px; }
.print-card {
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink), 0 30px 80px rgba(0,0,0,.45);
  padding: 22px 26px; max-width: 760px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; position: relative;
  background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 5px 5px;
}
.print-card.wide { max-width: 980px; }
.print-card.small { max-width: 520px; }
.print-card h2 { font-family: var(--fell); font-weight: 400; font-size: clamp(26px, 4vw, 38px); margin: 0 0 14px; line-height: 1.05; }
.note { color: var(--ink-2); font-size: 14px; }
.menu { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.btn { background: var(--paper); border: 2px solid var(--ink); padding: 9px 18px; cursor: pointer; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--red); color: var(--paper); }
.bar { height: 10px; border: 2px solid var(--ink); background: var(--paper-2); margin: 10px 0; }
.bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--red) 0 6px, #a82222 6px 12px); transition: width .2s; }
.dots::after { content: '...'; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }

/* ---------- title */
#screen-title { align-items: flex-end; justify-content: flex-start; padding: 5vh 5vw; background: linear-gradient(90deg, rgba(20,14,10,.65), rgba(20,14,10,0) 60%); }
.title-block { max-width: 640px; color: var(--paper); }
.title-block .eyebrow { color: var(--gold); }
.misreg { font-family: var(--slab); font-weight: 400; font-size: clamp(40px, 7.4vw, 96px); line-height: .92; margin: 6px 0 4px; color: var(--paper); position: relative;
  text-shadow: 3px 2px 0 rgba(196,43,43,.85), -3px -1px 0 rgba(38,89,214,.75); animation: misreg 6s ease-in-out infinite; }
@keyframes misreg { 0%, 100% { text-shadow: 3px 2px 0 rgba(196,43,43,.85), -3px -1px 0 rgba(38,89,214,.75); } 47% { text-shadow: 3px 2px 0 rgba(196,43,43,.85), -3px -1px 0 rgba(38,89,214,.75); } 50% { text-shadow: 9px 1px 0 rgba(196,43,43,.9), -8px 2px 0 rgba(138,92,240,.9); } 53% { text-shadow: 3px 2px 0 rgba(196,43,43,.85), -3px -1px 0 rgba(38,89,214,.75); } }
.subtitle { font-family: var(--fell); font-size: clamp(22px, 3vw, 34px); margin: 0 0 12px; color: var(--rift-2); }
.blurb { font-size: 15px; line-height: 1.5; max-width: 520px; color: #eadfc5; }
.title-block .menu { justify-content: flex-start; }
.hint { font-size: 12px; opacity: .8; margin-top: 16px; }
.hint kbd { color: var(--ink); }

/* ---------- team select */
.team-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.team-card { border: 2px solid var(--ink); background: var(--paper-2); padding: 14px; cursor: pointer; position: relative; text-align: left; box-shadow: 3px 3px 0 var(--ink); }
.team-card.sel { outline: 4px solid var(--gold); outline-offset: 2px; }
.team-card h3 { font-family: var(--fell); font-weight: 400; font-size: 26px; margin: 2px 0 6px; }
.team-card .faces { display: flex; gap: 4px; margin: 8px 0; }
.team-card .faces img { width: 44px; height: 56px; object-fit: cover; border: 1px solid var(--ink); background: var(--paper); }
.team-card p { margin: 4px 0; font-size: 13px; }
.team-card .swatch { position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; border: 2px solid var(--ink); }
.options { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.options label { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; display: flex; flex-direction: column; gap: 4px; }
.options select { font: inherit; font-size: 14px; padding: 6px 8px; border: 2px solid var(--ink); background: var(--paper); }

/* ---------- lineup */
.lineup { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lcard { border: 2px solid var(--ink); background: var(--paper-2); padding: 6px; font-size: 12px; }
.lcard img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--ink); display: block; background: var(--paper); }
.lcard strong { display: block; font-size: 13px; margin-top: 4px; }
.lcard .rat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 4px; }
.lcard .rat span { background: var(--paper); border: 1px solid var(--ink-2); text-align: center; font-size: 11px; }
.lcard em { display: block; font-style: normal; color: var(--ink-2); font-size: 11px; margin-top: 3px; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.board { position: absolute; left: 14px; top: 14px; background: var(--board); border: 3px solid #0e2a1e; box-shadow: 4px 4px 0 rgba(0,0,0,.45); padding: 6px; color: var(--paper); font-family: var(--slab); }
.board.static { position: static; display: inline-block; margin: 6px 0; }
.board table { border-collapse: separate; border-spacing: 3px; }
.board td, .board th { min-width: 22px; height: 24px; text-align: center; font-weight: 400; font-size: 14px; }
.board th { font-family: var(--mono); font-size: 10px; color: #bcd7c6; }
.board td.n { background: var(--paper); color: var(--ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.board td.n.live { background: #fff4c9; }
.board td.team { text-align: left; padding-right: 6px; font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .05em; }
.board td.tot { background: #0e2a1e; color: #ffe38a; min-width: 26px; }
.board td.bat::before { content: '\25B6'; color: var(--gold); font-size: 9px; margin-right: 3px; }
.countbox { position: absolute; left: 14px; top: 104px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 6px 10px; display: flex; gap: 12px; align-items: center; }
.lamps { display: flex; gap: 4px; align-items: center; font-weight: 700; font-size: 13px; }
.lamps i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper-2); }
.lamps:nth-child(1) i.on { background: #3fa35a; }
.lamps:nth-child(2) i.on { background: #e0a42c; }
.lamps:nth-child(3) i.on { background: var(--red); }
.diamond { width: 46px; height: 46px; }
.diamond rect { fill: var(--paper-2); stroke: var(--ink); stroke-width: 2; }
.diamond rect.on { fill: var(--gold); }
.erabox { position: absolute; right: 14px; top: 14px; background: #3a2616; color: var(--paper); border: 2px solid var(--gold); padding: 8px 12px; text-align: right; box-shadow: 3px 3px 0 rgba(0,0,0,.4); max-width: 280px; }
.erabox .eyebrow { color: var(--gold); }
.erabox strong { display: block; font-family: var(--fell); font-size: 20px; font-weight: 400; }
.erabox em { display: block; font-style: normal; font-size: 11px; opacity: .8; margin-top: 2px; }
.paradox { position: absolute; right: 14px; top: 104px; display: flex; align-items: center; gap: 8px; background: rgba(20,12,30,.8); border: 2px solid var(--rift); padding: 6px 10px; color: #f1e6ff; font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.paradox .tube { width: 120px; height: 12px; border: 2px solid #d8c6ff; background: #1a1026; overflow: hidden; }
.paradox .tube i { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--rift), var(--rift-2)); background-size: 30px 100%; transition: width .4s; animation: swirl 1s linear infinite; }
.paradox.hot .tube i { background: repeating-linear-gradient(90deg, #ff6ad5 0 8px, #8a5cf0 8px 16px); }
.paradox.hot { animation: pulse .6s ease-in-out infinite alternate; }
@keyframes swirl { to { background-position: 30px 0; } }
@keyframes pulse { to { box-shadow: 0 0 18px #c58cff; } }
.paradox em { font-style: normal; font-family: var(--slab); font-size: 15px; min-width: 28px; text-align: right; }
.matchup { position: absolute; left: 14px; bottom: 54px; display: flex; flex-direction: column; gap: 6px; }
.who { background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 6px 10px; display: flex; gap: 10px; align-items: center; min-width: 240px; }
.who img { width: 46px; height: 58px; object-fit: cover; border: 1px solid var(--ink); background: var(--paper-2); }
.who img[src=""] { display: none; }
.who strong { display: block; font-family: var(--fell); font-weight: 400; font-size: 19px; line-height: 1; }
.who em { display: block; font-style: normal; font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.who.pit { padding: 4px 10px; min-width: 0; }
.who.pit strong { font-size: 15px; }
.pitchpad { position: absolute; right: 14px; bottom: 54px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 8px 12px; width: 220px; }
.pitchpad ol { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; }
.pitchpad li { padding: 2px 4px; display: flex; justify-content: space-between; }
.pitchpad li.sel { background: var(--ink); color: var(--paper); }
.pitchpad li.sel kbd { color: var(--ink); }
.pitchpad li.rift b { color: var(--rift); }
.pitchpad li.sel.rift b { color: var(--rift-2); }
.meter { position: relative; height: 16px; border: 2px solid var(--ink); background: var(--paper-2); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--red); }
.meter .sweet { position: absolute; left: 80%; width: 15%; top: -4px; bottom: -4px; border: 2px solid var(--gold); background: rgba(216,176,74,.25); }
.controls { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(28,22,18,.82); color: var(--paper); padding: 5px 12px; font-size: 12px; white-space: nowrap; border: 1px solid #000; max-width: calc(100vw - 20px); overflow: hidden; text-overflow: ellipsis; }
.controls kbd { color: var(--ink); }
.ticker { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 5px 14px; font-size: 13px; max-width: 46vw; text-align: center; }
.ticker:empty { display: none; }
.ticker.storm { background: #2a1840; color: #f1e6ff; border-color: var(--rift); }
.callout { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-4deg); font-family: var(--slab); font-size: clamp(38px, 7vw, 86px); color: var(--red); opacity: 0; text-transform: uppercase; letter-spacing: .02em; border: 6px solid currentColor; padding: 2px 20px; mix-blend-mode: multiply; background: rgba(239,228,200,.55); white-space: nowrap; }
.callout.show { animation: stamp 1.3s ease-out forwards; }
.callout.blue { color: var(--blue); } .callout.gold { color: #b8860b; } .callout.rift { color: var(--rift); }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(2.2); } 12% { opacity: .95; transform: translate(-50%, -50%) rotate(-4deg) scale(.95); } 18% { transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 80% { opacity: .95; } 100% { opacity: 0; } }
.banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: #1e1230; border: 3px solid var(--rift); color: #f4ebff; padding: 14px 24px; text-align: center; box-shadow: 0 0 40px rgba(138,92,240,.6); max-width: 560px; width: calc(100vw - 32px); }
.banner .eyebrow { color: var(--rift-2); }
.banner h3 { font-family: var(--slab); font-weight: 400; font-size: 30px; margin: 2px 0 6px; letter-spacing: .03em; }
.banner p { margin: 0; font-size: 14px; }
#overlay-half { background: rgba(20,14,10,.35); }
.boxscore { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 12px; }
.boxscore table { width: 100%; border-collapse: collapse; }
.boxscore th, .boxscore td { border-bottom: 1px solid rgba(0,0,0,.2); padding: 2px 4px; text-align: right; }
.boxscore th:first-child, .boxscore td:first-child { text-align: left; }
.boxscore h4 { font-family: var(--fell); font-weight: 400; font-size: 18px; margin: 4px 0; }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; font-size: 13px; line-height: 1.5; }
.howto h4 { font-family: var(--fell); font-weight: 400; font-size: 20px; margin: 0; }
.howto p { margin: 2px 0 0; }
#pause { background: rgba(20,14,10,.55); }
.noscript { color: var(--paper); padding: 20px; }

@media (max-width: 760px) {
  .board td, .board th { min-width: 16px; height: 18px; font-size: 11px; }
  .countbox { top: 84px; }
  .erabox { display: none; }
  .paradox { top: auto; bottom: 150px; right: 10px; }
  .paradox .tube { width: 70px; }
  .ticker { top: auto; bottom: 44px; max-width: 90vw; }
  .matchup { bottom: 84px; }
  .who { min-width: 0; }
  .pitchpad { bottom: 200px; width: 180px; }
  .howto, .boxscore { grid-template-columns: 1fr; }
  .controls { font-size: 10px; }
}

.zoneov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#zoneRect { fill: rgba(239,228,200,.06); stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 7 4; }
#zoneGrid { stroke: rgba(28,22,18,.35); stroke-width: 1; fill: none; }
#curRing { fill: rgba(243,211,107,.22); stroke: var(--ink); stroke-width: 3; }
#curDot { fill: var(--ink); }
#curG.power #curRing { stroke: var(--red); fill: rgba(196,43,43,.2); }
#curG.bunt #curRing { stroke: var(--blue); fill: rgba(38,89,214,.18); }
#tgtRing { fill: none; stroke: var(--red); stroke-width: 3; }
#tgtCross { stroke: var(--red); stroke-width: 2; }
@media (max-width: 1000px) { .erabox em { display: none; } .ticker { top: auto; bottom: 44px; max-width: 80vw; } }

/* ---------- front loading screen: an admission ticket */
#loading { background: radial-gradient(ellipse at 50% 40%, #3a2436 0%, #150f0c 70%); z-index: 40; cursor: default; }
#loading.ready { cursor: pointer; }
.ticket { display: flex; max-width: 860px; width: 100%; background: var(--paper); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink), 0 40px 120px rgba(138,92,240,.35);
  background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 5px 5px; position: relative; }
.ticket-main { flex: 1; padding: 26px 30px; min-width: 0; }
.load-title { color: var(--ink); font-size: clamp(38px, 6vw, 72px); margin: 4px 0 2px; text-shadow: 3px 2px 0 rgba(196,43,43,.8), -3px -1px 0 rgba(38,89,214,.7); }
.ticket .subtitle { color: var(--rift); margin-bottom: 14px; }
.ticket-stub { width: 170px; border-left: 3px dashed var(--ink); padding: 18px 14px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
  font-weight: 700; font-size: 11px; letter-spacing: .12em; background: var(--red); color: var(--paper); }
.ticket-stub .big { font-family: var(--slab); font-size: 34px; line-height: .95; letter-spacing: .02em; }
.loadsteps { list-style: none; padding: 0; margin: 10px 0; font-size: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; }
.loadsteps li::before { content: '\25CB  '; color: var(--ink-2); }
.loadsteps li.done::before { content: '\25CF  '; color: #3fa35a; }
.loadsteps li.done { color: var(--ink-2); }
#loading.ready .bar i { background: #3fa35a; }
#loading.ready .note { font-weight: 700; color: var(--red); animation: pulse2 1s ease-in-out infinite alternate; }
@keyframes pulse2 { to { opacity: .45; } }
#enterBtn { margin-top: 6px; }
@media (max-width: 700px) { .ticket-stub { display: none; } .loadsteps { grid-template-columns: 1fr; } }

/* ---------- cut scene */
.cutscene { position: fixed; inset: 0; pointer-events: none; z-index: 15; display: none; }
.cutscene.show { display: block; }
.letterbox { position: absolute; left: 0; right: 0; height: 11vh; background: #0b0807; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }
.cut-text { position: absolute; left: 5vw; right: 5vw; bottom: 15vh; color: var(--paper); text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.cut-text h2 { font-family: var(--slab); font-weight: 400; font-size: clamp(30px, 5vw, 64px); margin: 0; letter-spacing: .03em; }
.cut-text p { font-family: var(--fell); font-size: clamp(18px, 2.4vw, 28px); margin: 4px 0 0; color: #ffd98a; }
.cut-skip kbd { color: var(--ink); }
.cut-skip { position: absolute; right: 18px; bottom: calc(11vh + 10px); color: var(--paper); font-size: 12px; opacity: .7; }

/* ---------- walk mode */
.walkhud { position: fixed; inset: 0; pointer-events: none; z-index: 12; }
.walk-where { position: absolute; left: 14px; top: 14px; background: #3a2616; color: var(--paper); border: 2px solid var(--gold); padding: 8px 14px; box-shadow: 3px 3px 0 rgba(0,0,0,.4); }
.walk-where .eyebrow { color: var(--gold); }
.walk-where strong { display: block; font-family: var(--fell); font-weight: 400; font-size: 24px; }
.walk-prompt { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); background: var(--paper); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 8px 16px; font-weight: 700; }
.walk-help { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(28,22,18,.82); color: var(--paper); padding: 5px 12px; font-size: 12px; white-space: nowrap; max-width: calc(100vw - 20px); overflow: hidden; text-overflow: ellipsis; }
.walk-help kbd, .walk-prompt kbd { color: var(--ink); }

/* ---------- walk mode: clock, driving gauge */
.walk-where em { display: block; font-style: normal; font-size: 11px; color: #ffb4a8; margin-top: 2px; }
.walk-where em:empty { display: none; }
.walkhud .in-car, .walkhud .in-room { display: none; }
.walkhud.inroom .in-room { display: block; }
.walkhud.inroom .on-foot, .walkhud.inroom .in-car { display: none; }
.walkhud.driving .in-car { display: block; }
.walkhud.driving .on-foot { display: none; }
.drive-hud { position: absolute; right: 14px; bottom: 56px; background: #1d1612; color: var(--paper); border: 2px solid var(--gold); box-shadow: 3px 3px 0 rgba(0,0,0,.4); padding: 8px 14px; text-align: center; min-width: 110px; }
.drive-hud strong { display: block; font-family: var(--slab); font-weight: 400; font-size: 40px; line-height: 1; color: #ffe38a; }
.drive-hud > span { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.drive-hud .dmg { height: 8px; border: 1px solid var(--paper); margin: 6px 0 2px; background: #2a201a; }
.drive-hud .dmg i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e0a42c, var(--red)); transition: width .3s; }
.drive-hud .eyebrow { color: var(--gold); font-size: 9px; margin: 0; }

/* ---------- touch controls */
.tlayer { position: fixed; inset: 0; z-index: 14; pointer-events: none; touch-action: none; }
.tstick-zone { position: absolute; left: 0; bottom: 0; width: 46vw; height: 58vh; pointer-events: auto; touch-action: none; }
.tstick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; border: 2px solid rgba(239,228,200,.55); background: rgba(28,22,18,.25); opacity: 0; transition: opacity .15s; left: 90px; top: calc(100% - 110px); }
.tlayer .tstick { opacity: .45; }
.tstick.on { opacity: 1; }
.tstick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.tbtns { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap-reverse; flex-direction: row-reverse; gap: 10px; width: min(52vw, 250px); justify-content: flex-start; align-items: flex-end; pointer-events: auto; }
.tbtn { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.tbtn.big { width: 86px; height: 86px; background: var(--red); color: var(--paper); font-size: 14px; }
.tbtn.small { width: 50px; height: 50px; font-size: 10px; }
.tbtn.rift { background: #2a1840; color: #f1e6ff; border-color: var(--rift); }
.tbtn.down { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); filter: brightness(.9); }
.tmenu { position: absolute; right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); width: 42px; height: 42px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 2px 2px 0 var(--ink); font-size: 20px; pointer-events: auto; padding: 0; }
.tlayer[data-mode="none"] { display: none; }
body.touch .walk-help, body.touch .controls, body.touch .hint { display: none !important; }
body.touch .walk-prompt kbd { display: none; }
body.touch .walk-prompt { bottom: auto; top: 88px; font-size: 13px; }
body.touch .drive-hud { right: auto; left: 14px; bottom: auto; top: 96px; min-width: 90px; padding: 6px 10px; }
body.touch .drive-hud strong { font-size: 30px; }
body.touch .erabox, body.touch .paradox { right: 62px; }
body.touch .pitchpad { right: auto; left: 50%; transform: translateX(-50%); top: 56px; bottom: auto; width: 200px; padding: 6px 10px; }
body.touch .pitchpad ol { display: none; }
body.touch .cut-skip { font-size: 0; } body.touch .cut-skip::after { content: 'Tap to skip'; font-size: 12px; }
body.touch #loading.ready .note { font-size: 0; } body.touch #loading.ready .note::after { content: 'Tap to open the gates.'; font-size: 14px; }

/* ---------- phones: portrait */
@media (max-aspect-ratio: 4/5) {
  .board { left: 8px; top: 8px; padding: 3px; }
  .board td, .board th { min-width: 14px; height: 17px; font-size: 10px; }
  .board td.team { font-size: 10px; }
  .countbox { left: 8px; top: 78px; padding: 4px 8px; gap: 8px; }
  .diamond { width: 36px; height: 36px; }
  .erabox { display: none; }
  .paradox { top: 8px; right: 58px; bottom: auto; padding: 4px 6px; font-size: 10px; }
  .paradox > span { display: none; }
  .paradox .tube { width: 56px; }
  .matchup { left: 8px; right: 8px; bottom: auto; top: 126px; flex-direction: row; gap: 4px; }
  .who { min-width: 0; padding: 4px 6px; gap: 6px; box-shadow: 2px 2px 0 var(--ink); }
  .who img { width: 30px; height: 38px; }
  .who strong { font-size: 14px; } .who em { display: none; }
  .who.pit strong { font-size: 12px; }
  .ticker { top: 178px; bottom: auto; max-width: 92vw; font-size: 12px; }
  body.touch .pitchpad { top: 214px; width: 62vw; }
  .callout { font-size: 34px; top: 42%; }
  .banner h3 { font-size: 22px; }
  .tstick-zone { height: 42vh; width: 55vw; }
  .walk-where { left: 8px; top: 8px; padding: 6px 10px; }
  .walk-where strong { font-size: 18px; }
  #screen-title { padding: 5vh 6vw 8vh; align-items: flex-end; background: linear-gradient(0deg, rgba(20,14,10,.8), rgba(20,14,10,0) 70%); }
  .blurb { font-size: 13px; }
  .title-block .menu .btn { flex: 1 1 100%; }
  .print-card { max-height: calc(100vh - 32px); overflow: auto; }
  .team-cards { grid-template-columns: 1fr; }
  .lineup { grid-template-columns: repeat(3, 1fr); }
  .ticket-main { padding: 18px 18px; }
}
/* ---------- phones: landscape (short screens) */
@media (max-height: 500px) and (min-aspect-ratio: 5/4) {
  .board td, .board th { min-width: 14px; height: 16px; font-size: 10px; }
  .countbox { top: 66px; padding: 3px 8px; }
  .diamond { width: 32px; height: 32px; }
  .erabox { display: none; }
  .paradox { top: 8px; bottom: auto; }
  .matchup { bottom: 8px; left: 50%; transform: translateX(-50%); flex-direction: row; }
  .who img { width: 28px; height: 36px; } .who em { display: none; } .who { min-width: 0; padding: 3px 8px; }
  .who strong { font-size: 14px; }
  .ticker { top: auto; bottom: 62px; max-width: 46vw; font-size: 11px; }
  .countbox { top: 70px; }
  .callout { font-size: 40px; }
  .tbtn { width: 56px; height: 56px; } .tbtn.big { width: 72px; height: 72px; } .tbtn.small { width: 44px; height: 44px; }
  .tbtns { width: 220px; }
  .print-card { max-height: calc(100vh - 24px); overflow: auto; padding: 14px 18px; }
  .ticket-main { padding: 14px 20px; }
  .load-title { font-size: 34px; }
  .loadsteps { font-size: 11px; margin: 4px 0; }
  #screen-title { padding: 4vh 4vw; }
  .misreg { font-size: 44px; }
  .blurb { display: none; }
  .cut-text h2 { font-size: 28px; }
}

/* ---------- walk-in buildings: dialogue, fade, lore */
.dialog { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); min-height: 108px; z-index: 30;
  background: #fbf6e6; border: 4px solid var(--ink); border-radius: 10px; box-shadow: 0 0 0 4px #fbf6e6, 0 0 0 8px var(--ink), 6px 10px 0 8px rgba(0,0,0,.35);
  padding: 16px 22px 18px; box-sizing: border-box; font-family: var(--mono); color: var(--ink); cursor: pointer; }
.dlg-name { position: absolute; left: 18px; top: -30px; background: var(--red); color: var(--paper); border: 3px solid var(--ink); border-radius: 6px 6px 0 0; padding: 3px 12px; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.dlg-text { margin: 0; font-size: 18px; line-height: 1.5; min-height: 54px; white-space: pre-wrap; }
.dlg-more { position: absolute; right: 18px; bottom: 8px; font-style: normal; font-size: 16px; opacity: 0; }
.dialog.more .dlg-more { opacity: 1; animation: dlgbob .6s steps(2) infinite; }
@keyframes dlgbob { 50% { transform: translateY(3px); } }
.dlg-choices { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.dlg-choices:empty { display: none; }
.dlg-choices li { border: 2px solid var(--ink); padding: 5px 12px; font-weight: 700; font-size: 14px; background: var(--paper-2); cursor: pointer; }
.dlg-choices li.sel { background: var(--ink); color: var(--paper); }
.dlg-choices li.sel::before { content: '\25B6  '; }
.fade { position: fixed; inset: 0; background: #0b0807; opacity: 0; pointer-events: none; transition: opacity .26s linear; z-index: 35; }
.toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -20px); background: #1d1612; color: #ffe38a; border: 2px solid var(--gold); padding: 8px 16px; font-weight: 700; font-size: 13px; letter-spacing: .04em; opacity: 0; z-index: 32; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { animation: toast 3.2s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
.walk-where em.lore { color: #ffe38a; }
body.touch .dialog { bottom: 12px; }
@media (max-aspect-ratio: 4/5) { .dlg-text { font-size: 15px; } .dialog { padding: 14px 16px; } }
@media (max-height: 500px) and (min-aspect-ratio: 5/4) { .dlg-text { font-size: 14px; min-height: 40px; } .dialog { min-height: 80px; padding: 10px 16px; width: min(640px, calc(100vw - 260px)); left: calc(50% - 110px); } }

/* ---------- TV commercials */
.adbreak { position: fixed; inset: 0; z-index: 33; pointer-events: none; }
.ad-tv { position: absolute; inset: 0; box-shadow: inset 0 0 0 max(10px, 2vw) #0b0807, inset 0 0 120px 40px rgba(0,0,0,.55); border-radius: 4vw; }
.adbreak.vhs .ad-tv { background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px 4px); }
.adbreak.bw .ad-tv { background: repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 1px, transparent 1px 3px); }
.ad-bug { position: absolute; left: calc(2vw + 18px); top: calc(2vw + 14px); color: #fff; font-size: 12px; letter-spacing: .14em; text-shadow: 1px 1px 0 #000; opacity: .85; }
.ad-bug b { background: var(--red); padding: 2px 6px; margin-right: 6px; }
.adbreak.vhs .ad-bug { font-family: 'Courier New', monospace; font-size: 16px; color: #e8f4ff; }
.ad-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: #fff; opacity: 0; transition: opacity .3s; width: min(760px, 86vw); }
.adbreak.card .ad-card, .adbreak.endcard .ad-card { opacity: 1; }
.adbreak.card { background: #0b0807; }
.adbreak.card .ad-card h2 { font-family: var(--fell); font-weight: 400; font-size: clamp(22px, 4vw, 40px); }
.adbreak.card .ad-card .eyebrow { color: var(--gold); }
.adbreak.endcard .ad-card { top: 36%; }
.adbreak.endcard .ad-card h2 { font-family: var(--slab); font-weight: 400; font-size: clamp(30px, 6.5vw, 76px); margin: 0; line-height: .95; text-shadow: 4px 4px 0 rgba(0,0,0,.55); animation: adpop .5s ease-out; }
.adbreak.endcard .ad-card p { font-family: var(--fell); font-size: clamp(18px, 2.8vw, 30px); margin: 8px 0 0; text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.adbreak.endcard .ad-card .eyebrow { color: #ffe38a; text-shadow: 1px 1px 0 #000; }
@keyframes adpop { 0% { transform: scale(1.8); opacity: 0; } 60% { transform: scale(.95); opacity: 1; } 100% { transform: scale(1); } }
.adbreak.vhs.endcard .ad-card h2 { font-family: 'Courier New', monospace; font-weight: 700; color: #ffe6f4; text-shadow: 3px 0 0 #e86fa0, -3px 0 0 #6fb3e6; }
.ad-caption { position: absolute; left: 50%; bottom: calc(2vw + 44px); transform: translateX(-50%); width: min(720px, 84vw); text-align: center; color: #fff; opacity: 0; transition: opacity .25s; }
.adbreak.talking .ad-caption { opacity: 1; }
.ad-caption strong { display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #ffe38a; text-shadow: 1px 1px 0 #000; }
.ad-caption span { display: inline-block; background: rgba(0,0,0,.72); padding: 6px 14px; font-size: clamp(15px, 2.2vw, 22px); line-height: 1.35; margin-top: 4px; }
.adbreak.bw .ad-caption span { font-family: Georgia, serif; }
.ad-skip { position: absolute; right: calc(2vw + 18px); bottom: calc(2vw + 10px); color: #fff; font-size: 12px; opacity: .6; margin: 0; }
.ad-skip kbd { color: var(--ink); }
body.touch .ad-skip { font-size: 0; } body.touch .ad-skip::after { content: 'Tap to skip'; font-size: 12px; }

/* the small print: tiny, fast, legally binding */
.ad-fine { position: absolute; left: 50%; bottom: calc(1.4vw + 30px); transform: translateX(-50%); width: min(640px, 80vw); margin: 0; text-align: center;
  font: 600 clamp(9px, 1.25vw, 12px)/1.25 'Helvetica Neue', Arial, sans-serif; letter-spacing: .02em; text-transform: uppercase; color: rgba(255,255,255,.85);
  text-shadow: 1px 1px 0 rgba(0,0,0,.8); opacity: 0; transition: opacity .2s; pointer-events: none; }
.adbreak.fineprint .ad-fine { opacity: 1; }
.adbreak.vhs .ad-fine { font-family: 'Courier New', monospace; color: #e8f3ff; }
.adbreak.bw .ad-fine { font-family: Georgia, serif; text-transform: none; font-style: italic; }
