*{box-sizing:border-box} :root{--navy:#06111f;--panel:#0e2238;--panel2:#132b45;--muted:#9db0c4;--red:#ef4848;--green:#42d780;--blue:#3ca7ff;--cream:#f7f1e7}
body{margin:0;min-height:100vh;background:radial-gradient(circle at 15% 0,rgba(60,167,255,.13),transparent 34%),linear-gradient(#06111f,#081725);color:#fff;font-family:Inter,sans-serif}
button{font:inherit}.topbar{height:84px;padding:16px 4vw;border-bottom:1px solid rgba(255,255,255,.08);display:flex;justify-content:space-between;align-items:center;background:rgba(6,17,31,.92);backdrop-filter:blur(12px);position:sticky;top:0;z-index:30}
.brand{display:flex;align-items:center;gap:13px}.brand-mark{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#ef4848,#ff775b);font-family:"Barlow Condensed";font-size:23px;font-weight:800}.brand-title{font-family:"Barlow Condensed";font-size:24px;font-weight:800}.brand-subtitle{font-size:10px;letter-spacing:.2em;color:var(--muted)}
.top-stats{display:flex;gap:10px}.stat-card{min-width:84px;padding:9px 14px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.045);border-radius:11px}.stat-card span{display:block;font-size:9px;letter-spacing:.16em;color:var(--muted)}.stat-card strong{font-family:"Barlow Condensed";font-size:24px}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 315px;gap:24px;max-width:1440px;margin:auto;padding:30px 4vw 48px}.game-heading{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:16px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.18em;color:var(--blue)}h1,h2{font-family:"Barlow Condensed";margin:0}h1{font-size:clamp(45px,5vw,72px);line-height:.95}.mode-pill{padding:9px 13px;border:1px solid rgba(255,255,255,.09);border-radius:999px;background:rgba(255,255,255,.045);font-size:12px;color:#dce6ef}.mode-pill span{display:inline-block;width:7px;height:7px;border-radius:50%;background:#f4c84b;margin-right:7px;box-shadow:0 0 10px #f4c84b}
.game-screen{position:relative;overflow:hidden;aspect-ratio:16/9;min-height:510px;border-radius:20px;border:1px solid rgba(255,255,255,.09);background:#03070d;box-shadow:0 24px 64px rgba(0,0,0,.4)}
.clip-player{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:none}.clip-player.active{display:block}.simulated-scene{position:absolute;inset:0;overflow:hidden;background:linear-gradient(#142c48 0 20%,#14382d 20% 100%);perspective:800px}.simulated-scene.hidden{display:none}
.stadium-glow{position:absolute;inset:0;background:radial-gradient(ellipse at 50% -8%,rgba(255,255,255,.8),transparent 32%),linear-gradient(rgba(0,0,0,.08),rgba(0,0,0,.38));z-index:1}.upper-deck{position:absolute;top:14%;left:-3%;width:106%;height:22%;background:repeating-linear-gradient(90deg,#172434 0 5px,#536273 5px 8px,#202f41 8px 14px);clip-path:polygon(0 8%,100% 0,100% 95%,0 100%);opacity:.88}.scoreboard{position:absolute;top:8%;left:50%;transform:translateX(-50%);display:flex;gap:9px;align-items:center;background:#07101c;border:3px solid #31485c;padding:8px 16px;border-radius:4px;font-size:9px;z-index:3}.scoreboard b{font-size:18px;color:#f8cc4e}
.outfield{position:absolute;top:29%;left:-8%;width:116%;height:50%;background:linear-gradient(90deg,#24593d,#2c6949 25%,#24593d 50%,#2c6949 75%,#24593d);clip-path:polygon(5% 0,95% 0,74% 100%,26% 100%);transform:rotateX(57deg);transform-origin:top center}.grass-stripe{position:absolute;top:0;height:100%;width:10%;background:rgba(255,255,255,.035)}.stripe-a{left:20%}.stripe-b{left:45%}.stripe-c{left:70%}
.infield-dirt{position:absolute;left:50%;top:47%;width:62%;height:72%;transform:translateX(-50%) rotateX(63deg);transform-origin:top center;background:#a87342;clip-path:polygon(44% 0,56% 0,100% 100%,0 100%);z-index:2}.mound{position:absolute;left:50%;top:43%;width:95px;height:30px;transform:translateX(-50%);border-radius:50%;background:#c08b54;z-index:4}
.pitcher-model{position:absolute;left:50%;bottom:4px;transform:translateX(-50%) scale(.52);width:90px;height:180px}.player-head,.helmet{position:absolute;width:42px;height:42px;border-radius:50%;background:#b97958;left:24px}.pitcher-torso{position:absolute;top:35px;left:12px;width:65px;height:86px;border-radius:21px 21px 9px 9px;background:linear-gradient(90deg,#eee,#cfd7df)}.pitcher-arm{position:absolute;top:54px;left:44px;width:80px;height:17px;border-radius:999px;background:#b97958;transform:rotate(-34deg);transform-origin:left}.pitcher-legs{position:absolute;top:112px;left:21px;width:48px;height:80px;border-left:17px solid #e5e9ed;border-right:17px solid #e5e9ed}
.batter-model{position:absolute;right:22%;bottom:7%;width:100px;height:250px;z-index:7;filter:drop-shadow(0 10px 8px rgba(0,0,0,.45))}.helmet{top:0;left:30px;background:#142339;border:4px solid #0a121d}.batter-torso{position:absolute;top:38px;left:16px;width:72px;height:105px;border-radius:25px 25px 10px 10px;background:linear-gradient(90deg,#b8252d,#ef4a51 60%,#9f1f28)}.batter-arms{position:absolute;top:50px;left:-5px;width:92px;height:22px;border-radius:999px;background:#bd805e;transform:rotate(-24deg)}.batter-legs{position:absolute;top:136px;left:21px;width:65px;height:105px;border-left:23px solid #e8ecef;border-right:23px solid #e8ecef}.bat{position:absolute;top:-58px;left:4px;width:10px;height:190px;border-radius:999px;background:linear-gradient(90deg,#b8854f,#e3bd80);transform:rotate(-31deg);z-index:4}
.catcher-mask{position:absolute;left:50%;bottom:-7%;width:480px;height:300px;transform:translateX(-50%);z-index:9;opacity:.82}.mask-bar{position:absolute;left:50%;width:400px;height:15px;border-radius:999px;background:#071019;transform:translateX(-50%)}.bar-1{top:45px}.bar-2{top:105px}.bar-3{top:170px}.mask-side{position:absolute;top:20px;width:16px;height:220px;background:#071019;border-radius:999px}.mask-side.left{left:65px;transform:rotate(-16deg)}.mask-side.right{right:65px;transform:rotate(16deg)}.catcher-glove{position:absolute;left:58%;bottom:13%;width:100px;height:84px;border-radius:55% 45% 48% 52%;background:radial-gradient(circle at 42% 50%,#25140d 0 18%,#714026 20% 60%,#3f2215);z-index:8;transform:rotate(-13deg);box-shadow:0 10px 20px rgba(0,0,0,.45)}
.home-plate{position:absolute;left:50%;bottom:13%;width:75px;height:60px;transform:translateX(-50%);background:#f5f4ee;clip-path:polygon(14% 0,86% 0,100% 45%,50% 100%,0 45%);z-index:6}
.strike-zone{position:absolute;left:50%;bottom:26%;width:130px;height:165px;transform:translateX(-50%);border:3px solid rgba(255,255,255,.8);box-shadow:0 0 0 1px rgba(0,0,0,.55);z-index:10;opacity:.26;transition:opacity .16s}.strike-zone.flight{opacity:0}.strike-zone.reveal{opacity:1;border-color:#fff}
.baseball{
  position:absolute;
  left:50%;
  top:47%;
  width:17px;
  height:17px;
  border-radius:50%;
  background:radial-gradient(circle at 32% 28%,#fff,#dedede 68%);
  box-shadow:0 5px 12px rgba(0,0,0,.4);
  z-index:12;
  opacity:0;
  will-change:transform,opacity;
  transform:translate3d(-50%,-50%,0) scale(.28);
  backface-visibility:hidden;
}.baseball.animate{animation-name:pitchFlight;animation-fill-mode:forwards;animation-timing-function:linear}@keyframes pitchFlight{
  0%{opacity:1;transform:translate3d(calc(-50% + var(--x0)),calc(-50% + var(--y0)),0) scale(.28)}
  6.67%{opacity:1;transform:translate3d(calc(-50% + var(--x1)),calc(-50% + var(--y1)),0) scale(.32)}
  13.33%{opacity:1;transform:translate3d(calc(-50% + var(--x2)),calc(-50% + var(--y2)),0) scale(.37)}
  20%{opacity:1;transform:translate3d(calc(-50% + var(--x3)),calc(-50% + var(--y3)),0) scale(.42)}
  26.67%{opacity:1;transform:translate3d(calc(-50% + var(--x4)),calc(-50% + var(--y4)),0) scale(.48)}
  33.33%{opacity:1;transform:translate3d(calc(-50% + var(--x5)),calc(-50% + var(--y5)),0) scale(.55)}
  40%{opacity:1;transform:translate3d(calc(-50% + var(--x6)),calc(-50% + var(--y6)),0) scale(.63)}
  46.67%{opacity:1;transform:translate3d(calc(-50% + var(--x7)),calc(-50% + var(--y7)),0) scale(.71)}
  53.33%{opacity:1;transform:translate3d(calc(-50% + var(--x8)),calc(-50% + var(--y8)),0) scale(.80)}
  60%{opacity:1;transform:translate3d(calc(-50% + var(--x9)),calc(-50% + var(--y9)),0) scale(.89)}
  66.67%{opacity:1;transform:translate3d(calc(-50% + var(--x10)),calc(-50% + var(--y10)),0) scale(.98)}
  73.33%{opacity:1;transform:translate3d(calc(-50% + var(--x11)),calc(-50% + var(--y11)),0) scale(1.06)}
  80%{opacity:1;transform:translate3d(calc(-50% + var(--x12)),calc(-50% + var(--y12)),0) scale(1.13)}
  86.67%{opacity:1;transform:translate3d(calc(-50% + var(--x13)),calc(-50% + var(--y13)),0) scale(1.19)}
  93.33%{opacity:1;transform:translate3d(calc(-50% + var(--x14)),calc(-50% + var(--y14)),0) scale(1.24)}
  100%{opacity:1;transform:translate3d(calc(-50% + var(--x15)),calc(-50% + var(--y15)),0) scale(1.28)}
}
  14%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x1)),calc(-50% + var(--y1)),0)
      scale(.36);
  }
  28%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x2)),calc(-50% + var(--y2)),0)
      scale(.47);
  }
  42%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x3)),calc(-50% + var(--y3)),0)
      scale(.60);
  }
  56%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x4)),calc(-50% + var(--y4)),0)
      scale(.76);
  }
  70%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x5)),calc(-50% + var(--y5)),0)
      scale(.94);
  }
  84%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x6)),calc(-50% + var(--y6)),0)
      scale(1.11);
  }
  100%{
    opacity:1;
    transform:
      translate3d(calc(-50% + var(--x7)),calc(-50% + var(--y7)),0)
      scale(1.28);
  }
}
  35%{
    opacity:1;
    left:var(--p1-x);
    top:var(--p1-y);
    transform:translate(-50%,-50%) scale(.48);
  }
  68%{
    opacity:1;
    left:var(--p2-x);
    top:var(--p2-y);
    transform:translate(-50%,-50%) scale(.82);
  }
  100%{
    opacity:1;
    left:var(--end-x);
    top:var(--end-y);
    transform:translate(-50%,-50%) scale(1.28);
  }
}58%{opacity:1;left:var(--mid-x);top:var(--mid-y);transform:translate(-50%,-50%) scale(.68)}100%{opacity:1;left:var(--end-x);top:var(--end-y);transform:translate(-50%,-50%) scale(1.28)}}
.hud{position:absolute;left:17px;right:17px;bottom:16px;display:flex;justify-content:space-between;z-index:15}.count-box,.pitch-meta{padding:8px 11px;border-radius:9px;background:rgba(2,7,12,.78);border:1px solid rgba(255,255,255,.13);font-family:"Barlow Condensed";font-weight:700}.count-box{display:flex;gap:12px}
.play-overlay{position:absolute;inset:0;margin:auto;width:152px;height:52px;border:none;border-radius:999px;background:rgba(5,12,20,.87);color:#fff;display:flex;gap:10px;align-items:center;justify-content:center;z-index:20;cursor:pointer}.play-overlay i{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--red);font-style:normal;font-size:10px;padding-left:2px}.play-overlay.hidden{display:none}
.result-banner{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(3,8,14,.69);backdrop-filter:blur(4px);z-index:18;opacity:0;pointer-events:none;transition:opacity .18s}.result-banner.show{opacity:1}.result-banner>span{font-family:"Barlow Condensed";font-weight:800;font-size:clamp(62px,9vw,112px)}.result-banner small{font-size:15px;color:#dbe5ee}.auto-next{width:190px;height:4px;margin-top:18px;background:rgba(255,255,255,.16);border-radius:999px;overflow:hidden}.auto-next i{display:block;width:0;height:100%;background:#fff}.result-banner.show .auto-next i{animation:autoNext 1.65s linear forwards}@keyframes autoNext{to{width:100%}}
.decision-panel{margin-top:14px;padding:18px;border-radius:17px;background:linear-gradient(rgba(17,38,61,.97),rgba(10,27,44,.97));border:1px solid rgba(255,255,255,.08);text-align:center}.decision-panel>p{margin:0 0 14px;color:#c2cfdb}.call-buttons{display:grid;grid-template-columns:1fr 1fr;gap:13px}.call-button{min-height:92px;border:0;border-radius:15px;color:#fff;display:flex;align-items:center;gap:15px;padding:16px;text-align:left;cursor:pointer;transition:.15s}.call-button:not(:disabled):hover{transform:translateY(-2px);filter:brightness(1.06)}.call-button:disabled{opacity:.42;cursor:not-allowed}.call-button.ball{background:linear-gradient(135deg,#244769,#2b608e)}.call-button.strike{background:linear-gradient(135deg,#bd3636,#ef4848)}kbd{width:46px;height:46px;border:0;border-radius:11px;display:grid;place-items:center;background:rgba(255,255,255,.13);font-family:"Barlow Condensed";font-size:27px;font-weight:800}.call-button strong{display:block;font-family:"Barlow Condensed";font-size:27px;line-height:1}.call-button small{color:rgba(255,255,255,.72)}.replay-button{margin-top:13px;padding:9px 15px;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:transparent;color:#fff;cursor:pointer}.replay-button:disabled{opacity:.3;cursor:not-allowed}
.sidebar{display:flex;flex-direction:column;gap:15px}.panel{padding:19px;border-radius:17px;border:1px solid rgba(255,255,255,.08);background:linear-gradient(rgba(17,38,61,.97),rgba(10,27,44,.97))}.panel-heading{display:flex;justify-content:space-between;align-items:center}.panel-heading h2{font-size:27px}.panel-heading>strong{color:var(--green)}.progress{height:9px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;margin:17px 0}.progress i{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--blue),var(--green));transition:width .2s}.mini-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.mini-grid div,.modal-grid div{padding:10px;background:rgba(255,255,255,.04);border-radius:11px}.mini-grid span,.modal-grid span{display:block;font-size:10px;color:var(--muted);margin-bottom:4px}.mini-grid strong,.modal-grid strong{font-family:"Barlow Condensed";font-size:24px}.scouting h2{font-size:34px;margin-top:5px}.scouting>p{color:#b6c5d3;line-height:1.55}.tip{display:flex;gap:12px;padding:13px;border-radius:13px;background:rgba(255,255,255,.04)}.tip>b{font-family:"Barlow Condensed";font-size:28px;color:#f4c84b}.tip p{margin:4px 0 0;font-size:12px;color:#9eafc0;line-height:1.45}
.modal{position:fixed;inset:0;display:none;place-items:center;background:rgba(2,7,12,.82);backdrop-filter:blur(10px);z-index:50}.modal.show{display:grid}.modal-card{width:min(92vw,470px);padding:29px;border-radius:21px;text-align:center;background:#10243a;border:1px solid rgba(255,255,255,.1)}.modal-card h2{font-size:66px;margin:6px 0}.modal-card>p{color:#c5d1dc}.modal-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:20px 0}.modal-card button{width:100%;padding:13px;border:0;border-radius:11px;background:var(--cream);font-weight:800;cursor:pointer}
@media(max-width:1050px){.layout{grid-template-columns:1fr}.sidebar{display:grid;grid-template-columns:1fr 1fr}}@media(max-width:700px){.topbar{height:auto;gap:12px}.brand-subtitle{display:none}.stat-card{min-width:65px;padding:7px 9px}.layout{padding:22px 3vw}.game-heading{align-items:flex-start;flex-direction:column;gap:12px}.game-screen{min-height:470px;aspect-ratio:auto}.call-buttons,.sidebar{grid-template-columns:1fr}.batter-model{right:8%;transform:scale(.9);transform-origin:bottom}.catcher-mask{transform:translateX(-50%) scale(.78);transform-origin:bottom}.top-stats{gap:5px}}

.replay-stat strong b{color:#f4c84b}
.replay-button.exhausted{border-color:rgba(239,72,72,.45);color:#f39a9a}

.difficulty-selector{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin:0 0 14px;
}
.difficulty-btn{
  border:1px solid rgba(255,255,255,.09);
  background:rgba(255,255,255,.04);
  color:#fff;
  border-radius:14px;
  padding:12px 14px;
  text-align:left;
  cursor:pointer;
  transition:.16s ease;
}
.difficulty-btn:hover{transform:translateY(-1px);background:rgba(255,255,255,.065)}
.difficulty-btn.active{
  background:linear-gradient(135deg,rgba(60,167,255,.22),rgba(66,215,128,.14));
  border-color:rgba(60,167,255,.55);
  box-shadow:0 8px 26px rgba(0,0,0,.18);
}
.difficulty-btn strong{
  display:block;
  font-family:"Barlow Condensed";
  font-size:22px;
  line-height:1;
}
.difficulty-btn small{
  display:block;
  margin-top:4px;
  color:#9db0c4;
}
.game-screen.hard-mode .strike-zone{
  opacity:0 !important;
}
.game-screen.hard-mode .strike-zone.reveal{
  opacity:1 !important;
}
.game-screen.easy-mode .baseball{
  filter:drop-shadow(0 0 7px rgba(255,255,255,.45));
}
.game-screen.hard-mode .baseball{
  box-shadow:0 5px 12px rgba(0,0,0,.4),0 0 8px rgba(255,255,255,.18);
}
@media(max-width:700px){
  .difficulty-selector{grid-template-columns:1fr}
}

.catcher-mask{display:none!important}

.game-screen.hard-mode .baseball.animate{
  filter:drop-shadow(0 0 2px rgba(255,255,255,.22));
}

/* More dimensional generic player models */
.pitcher-model,
.batter-model{
  transform-style:preserve-3d;
}

.player-head{
  background:
    radial-gradient(circle at 34% 28%,rgba(255,255,255,.28),transparent 18%),
    radial-gradient(circle at 60% 70%,rgba(70,28,18,.22),transparent 35%),
    linear-gradient(135deg,#d69a72,#8b5038);
  box-shadow:
    inset -8px -8px 12px rgba(45,18,12,.22),
    inset 5px 5px 8px rgba(255,255,255,.14),
    0 7px 10px rgba(0,0,0,.28);
}

.pitcher-torso{
  background:
    linear-gradient(90deg,rgba(255,255,255,.15),transparent 25% 68%,rgba(0,0,0,.18)),
    linear-gradient(180deg,#f5f7f8,#c6d0d9);
  box-shadow:
    inset -10px 0 15px rgba(0,0,0,.18),
    0 10px 18px rgba(0,0,0,.28);
  transform:rotateY(-8deg);
}

.pitcher-arm{
  background:linear-gradient(90deg,#d89d75,#9c6047);
  box-shadow:inset 0 -5px 7px rgba(0,0,0,.17),0 7px 10px rgba(0,0,0,.22);
}

.pitcher-legs{
  filter:drop-shadow(8px 10px 7px rgba(0,0,0,.3));
}

.helmet{
  background:
    radial-gradient(circle at 35% 23%,rgba(255,255,255,.35),transparent 18%),
    linear-gradient(135deg,#28466d,#08111e 70%);
  box-shadow:
    inset -9px -7px 12px rgba(0,0,0,.34),
    0 7px 12px rgba(0,0,0,.34);
}

.batter-torso{
  background:
    linear-gradient(90deg,rgba(255,255,255,.14),transparent 28% 70%,rgba(0,0,0,.2)),
    linear-gradient(135deg,#f35b62,#9e2029);
  box-shadow:
    inset -10px -5px 15px rgba(0,0,0,.2),
    0 12px 18px rgba(0,0,0,.34);
  transform:rotateY(8deg);
}

.batter-arms{
  background:linear-gradient(90deg,#d89b73,#965a43);
  box-shadow:inset 0 -5px 8px rgba(0,0,0,.2),0 7px 10px rgba(0,0,0,.22);
}

.batter-legs{
  filter:drop-shadow(8px 10px 7px rgba(0,0,0,.34));
}

.bat{
  background:
    linear-gradient(90deg,#79522e,#e3bd80 40%,#8c5f32);
  box-shadow:3px 7px 8px rgba(0,0,0,.32);
}

/* Catcher framing */
.catcher-glove{
  transition:
    transform 360ms cubic-bezier(.16,.78,.28,1),
    left 360ms cubic-bezier(.16,.78,.28,1),
    bottom 360ms cubic-bezier(.16,.78,.28,1);
  transform-origin:center;
  background:
    radial-gradient(circle at 42% 50%,#25140d 0 18%,#714026 20% 60%,#3f2215);
  overflow:hidden;
}

.glove-pocket{
  position:absolute;
  left:25%;
  top:24%;
  width:45%;
  height:48%;
  border-radius:50%;
  background:radial-gradient(circle,#160c08,#3a2015 75%);
  box-shadow:inset 0 0 0 5px rgba(173,105,62,.34);
}

.glove-web{
  position:absolute;
  right:8%;
  top:14%;
  width:34%;
  height:46%;
  border:4px solid rgba(42,20,12,.8);
  border-radius:38% 60% 35% 55%;
  transform:rotate(14deg);
}

.catcher-glove.receive{
  transform:rotate(-13deg) scale(1.08);
}

.catcher-glove.frame-left{
  left:52%;
  bottom:18%;
  transform:rotate(-24deg) scale(1.08);
}

.catcher-glove.frame-right{
  left:63%;
  bottom:18%;
  transform:rotate(2deg) scale(1.08);
}

.catcher-glove.frame-up{
  bottom:21%;
  transform:rotate(-7deg) scale(1.08);
}

.catcher-glove.frame-down{
  bottom:14%;
  transform:rotate(-17deg) scale(1.08);
}

/* Exact crossing-location marker */
.crossing-marker{
  position:absolute;
  left:50%;
  top:50%;
  width:30px;
  height:30px;
  z-index:17;
  opacity:0;
  transform:translate(-50%,-50%) scale(.45);
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.2,.8,.3,1);
  pointer-events:none;
}

.crossing-marker.show{
  opacity:1;
  transform:translate(-50%,-50%) scale(1);
}

.crossing-marker::before,
.crossing-marker::after{
  content:"";
  position:absolute;
  background:#ffd34d;
  box-shadow:0 0 7px rgba(255,211,77,.9);
}

.crossing-marker::before{
  left:14px;
  top:0;
  width:2px;
  height:30px;
}

.crossing-marker::after{
  top:14px;
  left:0;
  width:30px;
  height:2px;
}

.crossing-marker span{
  position:absolute;
  inset:7px;
  border-radius:50%;
  border:2px solid #fff;
  background:rgba(239,72,72,.85);
  box-shadow:0 0 0 2px rgba(0,0,0,.35);
}

.framing-note{
  margin:11px 0 0!important;
  font-size:12px;
  color:#91a5b9!important;
}

/* Hard mode feels more explosive */
.game-screen.hard-mode .baseball.animate{
  filter:drop-shadow(0 0 3px rgba(255,255,255,.28));
}

/* Longer crossing-point reveal */
.crossing-marker.long-show{
  animation:markerPulse 2.65s ease-in-out both;
}
@keyframes markerPulse{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.35)}
  12%{opacity:1;transform:translate(-50%,-50%) scale(1.12)}
  28%{transform:translate(-50%,-50%) scale(1)}
  82%{opacity:1}
  100%{opacity:.9;transform:translate(-50%,-50%) scale(1)}
}

/* Coach loss page */
.modal-card.loss{
  width:min(94vw,560px);
  background:
    radial-gradient(circle at 50% 0,rgba(239,72,72,.22),transparent 34%),
    #10243a;
  border-color:rgba(239,72,72,.38);
}

.modal-card.win{
  background:
    radial-gradient(circle at 50% 0,rgba(66,215,128,.18),transparent 34%),
    #10243a;
}

.modal-card h3{
  font-family:"Barlow Condensed";
  font-size:44px;
  margin:0 0 4px;
}

.coach-scene{
  display:none;
  position:relative;
  width:210px;
  height:190px;
  margin:0 auto 8px;
}

.modal-card.loss .coach-scene{
  display:block;
  animation:coachEnter .45s cubic-bezier(.16,.8,.25,1) both;
}

@keyframes coachEnter{
  from{opacity:0;transform:translateY(26px) scale(.92)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.coach-cap{
  position:absolute;
  left:66px;
  top:8px;
  width:82px;
  height:34px;
  border-radius:50px 50px 12px 12px;
  background:linear-gradient(180deg,#c92d35,#7e1118);
  box-shadow:inset -8px -6px 10px rgba(0,0,0,.22),0 7px 10px rgba(0,0,0,.22);
  z-index:3;
}

.coach-cap::after{
  content:"";
  position:absolute;
  right:-31px;
  top:17px;
  width:52px;
  height:12px;
  border-radius:999px;
  background:#8d151c;
  transform:rotate(7deg);
}

.coach-head{
  position:absolute;
  left:70px;
  top:30px;
  width:74px;
  height:78px;
  border-radius:46% 46% 42% 42%;
  background:
    radial-gradient(circle at 35% 28%,rgba(255,255,255,.22),transparent 16%),
    linear-gradient(135deg,#d79569,#8d5138);
  box-shadow:inset -8px -8px 12px rgba(0,0,0,.2),0 8px 12px rgba(0,0,0,.25);
  z-index:2;
}

.coach-eye{
  position:absolute;
  top:33px;
  width:7px;
  height:5px;
  border-radius:50%;
  background:#1b0e0b;
}
.coach-eye.left{left:20px}
.coach-eye.right{right:20px}

.coach-brow{
  position:absolute;
  top:25px;
  width:20px;
  height:4px;
  border-radius:999px;
  background:#3a1d16;
}
.coach-brow.left{left:11px;transform:rotate(12deg)}
.coach-brow.right{right:11px;transform:rotate(-12deg)}

.coach-mouth{
  position:absolute;
  left:23px;
  bottom:13px;
  width:30px;
  height:10px;
  border-bottom:4px solid #3d1b16;
  border-radius:50%;
  transform:rotate(-7deg);
}

.coach-body{
  position:absolute;
  left:48px;
  top:96px;
  width:118px;
  height:88px;
  border-radius:42px 42px 12px 12px;
  background:
    linear-gradient(90deg,rgba(255,255,255,.12),transparent 25% 70%,rgba(0,0,0,.22)),
    linear-gradient(180deg,#355f8b,#17334f);
  box-shadow:0 12px 18px rgba(0,0,0,.3);
}

.coach-arm{
  position:absolute;
  right:5px;
  top:102px;
  width:82px;
  height:20px;
  border-radius:999px;
  background:linear-gradient(90deg,#d79569,#91543a);
  transform:rotate(-18deg);
  transform-origin:left center;
  box-shadow:0 7px 10px rgba(0,0,0,.24);
}

.speech-bubble{
  position:absolute;
  left:-118px;
  top:27px;
  width:150px;
  padding:10px 12px;
  border-radius:12px;
  background:#fff;
  color:#07111f;
  font-size:12px;
  line-height:1.35;
  font-weight:700;
  text-align:left;
  box-shadow:0 10px 22px rgba(0,0,0,.25);
}

.speech-bubble::after{
  content:"";
  position:absolute;
  right:-12px;
  top:34px;
  border:7px solid transparent;
  border-left-color:#fff;
}

/* Keep the plate visible during answer reveals */
.result-banner{
  inset:0;
  justify-content:flex-start;
  align-items:center;
  padding-top:18px;
  background:transparent;
  backdrop-filter:none;
  pointer-events:none;
}

.result-card{
  min-width:250px;
  max-width:min(86%,420px);
  padding:11px 18px 12px;
  border-radius:14px;
  text-align:center;
  background:rgba(3,8,14,.88);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 12px 28px rgba(0,0,0,.34);
  backdrop-filter:blur(7px);
}

.result-banner .result-card>span{
  display:block;
  font-family:"Barlow Condensed";
  font-weight:800;
  font-size:42px;
  line-height:.95;
}

.result-banner .result-card small{
  display:block;
  margin-top:3px;
  font-size:13px;
  color:#dbe5ee;
}

.result-banner .auto-next{
  width:100%;
  height:3px;
  margin-top:9px;
}

/* Smooth ball rendering for Easy and Medium */
.game-screen.easy-mode .baseball.animate,
.game-screen:not(.hard-mode):not(.easy-mode) .baseball.animate{
  animation-timing-function:linear!important;
  transform-origin:center;
  image-rendering:auto;
}

.game-screen.easy-mode .baseball{
  transition:none;
  filter:drop-shadow(0 0 5px rgba(255,255,255,.25));
}

/* Make the crossing point unmistakable and above other pitch graphics */
.crossing-marker{
  z-index:26;
}

.strike-zone.reveal{
  z-index:21;
}

.result-banner{
  z-index:24;
}

@media(max-width:700px){
  .result-card{
    min-width:210px;
    padding:9px 14px 10px;
  }
  .result-banner .result-card>span{
    font-size:34px;
  }
}

.session-controls{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:12px;
  margin-bottom:12px;
}

.name-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:11px 12px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:14px;
  background:rgba(255,255,255,.04);
}

.name-field span{
  font-size:9px;
  font-weight:800;
  letter-spacing:.15em;
  color:#9db0c4;
}

.name-field input{
  width:100%;
  border:0;
  outline:0;
  padding:0;
  background:transparent;
  color:#fff;
  font-family:"Barlow Condensed";
  font-size:22px;
  font-weight:700;
}

.name-field input::placeholder{color:#71869a}

.game-mode-selector{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.game-mode-btn{
  border:1px solid rgba(255,255,255,.09);
  background:rgba(255,255,255,.04);
  color:#fff;
  border-radius:14px;
  padding:11px 14px;
  text-align:left;
  cursor:pointer;
  transition:.15s ease;
}

.game-mode-btn:hover{transform:translateY(-1px);background:rgba(255,255,255,.065)}
.game-mode-btn.active{
  border-color:rgba(60,167,255,.55);
  background:linear-gradient(135deg,rgba(60,167,255,.22),rgba(66,215,128,.13));
}

.game-mode-btn strong{
  display:block;
  font-family:"Barlow Condensed";
  font-size:21px;
  line-height:1;
}

.game-mode-btn small{
  display:block;
  margin-top:4px;
  color:#9db0c4;
}

.lives-stat{display:none}
.lives-stat.show{display:block}
#livesDisplay{color:#ef4848;letter-spacing:.08em}

.leaderboard-panel h2{font-size:28px}
.tiny-button{
  padding:5px 8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.12);
  background:transparent;
  color:#9db0c4;
  font-size:11px;
  cursor:pointer;
}

.leaderboard-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin:14px 0 10px;
}

.leaderboard-tab{
  border:1px solid rgba(255,255,255,.08);
  border-radius:9px;
  padding:7px;
  background:rgba(255,255,255,.03);
  color:#9db0c4;
  cursor:pointer;
  font-weight:700;
}

.leaderboard-tab.active{
  background:rgba(60,167,255,.15);
  border-color:rgba(60,167,255,.38);
  color:#fff;
}

.leaderboard-list{
  list-style:none;
  counter-reset:rank;
  margin:0;
  padding:0;
}

.leaderboard-list li{
  counter-increment:rank;
  display:grid;
  grid-template-columns:28px 1fr auto;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:7px 8px;
  border-bottom:1px solid rgba(255,255,255,.055);
}

.leaderboard-list li::before{
  content:counter(rank);
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border-radius:7px;
  background:rgba(255,255,255,.05);
  font-family:"Barlow Condensed";
  color:#9db0c4;
}

.leaderboard-list .board-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:700;
}

.leaderboard-list .board-score{
  font-family:"Barlow Condensed";
  font-size:20px;
  color:#42d780;
}

.leaderboard-list .empty-board{
  display:block;
  padding:14px 4px;
  color:#8194a7;
  font-size:12px;
  text-align:center;
  border:0;
}
.leaderboard-list .empty-board::before{display:none}

.leaderboard-note{
  margin:11px 0 0;
  color:#788da1;
  font-size:10px;
  line-height:1.4;
}

@media(max-width:700px){
  .session-controls{grid-template-columns:1fr}
  .game-mode-selector{grid-template-columns:1fr}
}

.name-feedback{
  min-height:14px;
  font-size:10px;
  line-height:1.25;
  color:#ef8d8d;
}

.name-field.invalid{
  border-color:rgba(239,72,72,.65);
  box-shadow:0 0 0 2px rgba(239,72,72,.08);
}

.name-field.valid{
  border-color:rgba(66,215,128,.42);
}

.end-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.submit-score-btn{
  background:linear-gradient(135deg,#3ca7ff,#42d780)!important;
  color:#06111f!important;
}

.submit-score-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.submit-status{
  min-height:18px;
  margin:10px 0 0;
  font-size:12px;
  color:#9db0c4;
}

.submit-status.success{color:#42d780}
.submit-status.error{color:#ef8d8d}

.leaderboard-list li.current-entry{
  background:rgba(66,215,128,.08);
  border-radius:9px;
}

@media(max-width:520px){
  .end-actions{grid-template-columns:1fr}
}

.final-rank{
  margin:4px 0 2px;
  font-family:"Barlow Condensed";
  font-size:28px;
  font-weight:800;
  letter-spacing:.04em;
  color:#f4c84b;
}

.modal-card.endless-loss{
  border-color:rgba(239,72,72,.42);
  background:
    radial-gradient(circle at 50% 0,rgba(239,72,72,.18),transparent 34%),
    #10243a;
}

.modal-card.endless-loss #finalTitle{
  color:#ef6c6c;
}

/* Version 16: always-visible crossing marker during every answer reveal */
.crossing-marker.show{
  z-index:28;
}

.crossing-marker.long-show{
  animation-duration:2.85s;
}

.result-card{
  pointer-events:none;
}

/* Version 17: pitches always begin automatically */
.play-overlay{
  display:none!important;
}

.difficulty-selector{
  grid-template-columns:repeat(2,1fr);
}
