/* Battle 2.0 look-only prototype (proto_battle2.js). Open the game with ?proto=battle2. Touches nothing else. */
#pb2 { position: fixed; inset: 0; z-index: 100000; background: #05070c; overflow: hidden; font-family: 'Oswald', sans-serif; color: #f3ecd6; }
#pb2 .stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: 50% 50%; }

/* stadium */
#pb2 .sky { position: absolute; inset: 0 0 330px 0; background: url('assets/TEST2.webp') center 32% / cover no-repeat; image-rendering: pixelated; filter: saturate(1.05) brightness(.92); }
#pb2 .sky::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 35%, transparent 40%, rgba(5,7,12,.55) 100%), linear-gradient(transparent 55%, rgba(5,7,12,.85) 100%); }
#pb2 .flash { position: absolute; inset: 0; pointer-events: none; background: #fff6d8; opacity: 0; mix-blend-mode: screen; }
#pb2.hr .flash { animation: pb2Flash 1.1s ease-out; }
@keyframes pb2Flash { 0% { opacity: .85; } 15% { opacity: .1; } 30% { opacity: .6; } 100% { opacity: 0; } }
#pb2.shake .stage { animation: pb2Shake .45s; }
@keyframes pb2Shake { 0%,100% { margin: 0; } 20% { margin: 6px 0 0 -8px; } 40% { margin: -5px 0 0 7px; } 60% { margin: 4px 0 0 -5px; } 80% { margin: -2px 0 0 3px; } }

/* scoreboard: manual green board hung under the lights */
#pb2 .board { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: flex; gap: 0; background: #163d2a; border: 4px solid #0c2418; outline: 3px solid #c8a24a; box-shadow: 0 10px 30px rgba(0,0,0,.6), inset 0 0 0 2px #24573c; padding: 8px 14px; }
#pb2 .board .ls { display: grid; grid-template-columns: 108px repeat(9, 30px) 14px repeat(2, 38px); align-items: center; row-gap: 4px; font-family: 'Alfa Slab One', serif; font-size: 18px; text-align: center; color: #f6f0dc; }
#pb2 .board .ls .h { font-family: 'Oswald', sans-serif; font-size: 13px; color: #c8e6cf; letter-spacing: 1px; }
#pb2 .board .ls .tm { text-align: left; font-family: 'Oswald', sans-serif; font-size: 15px; letter-spacing: 1px; }
#pb2 .board .ls .slot { background: #0e2a1c; margin: 0 2px; border-radius: 2px; line-height: 26px; box-shadow: inset 0 2px 3px rgba(0,0,0,.5); }
#pb2 .board .ls .slot.now { color: #ffd36a; }
#pb2 .board .side { margin-left: 18px; padding-left: 16px; border-left: 2px solid #24573c; display: flex; flex-direction: column; justify-content: center; gap: 6px; font-size: 13px; letter-spacing: 1px; color: #c8e6cf; }
#pb2 .bulbs i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-left: 5px; background: #3a1a12; box-shadow: inset 0 2px 3px rgba(0,0,0,.6); vertical-align: -2px; }
#pb2 .bulbs i.on { background: #ff5a2c; box-shadow: 0 0 10px #ff5a2c, inset 0 -2px 2px rgba(0,0,0,.3); }
#pb2 .bulbs i.b.on { background: #4ade80; box-shadow: 0 0 10px #4ade80; }

/* rival on the mound: card + leather HP strap + bullpen deck */
#pb2 .rival { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 22px; }
#pb2 .rival .cardwrap { position: relative; transform: scale(.92); transform-origin: bottom center; filter: drop-shadow(0 16px 18px rgba(0,0,0,.7)); }
#pb2 .rival.hit .cardwrap { animation: pb2Hit .5s; }
@keyframes pb2Hit { 0%,100% { transform: scale(.92); } 25% { transform: scale(.92) translateX(-10px) rotate(-3deg); filter: brightness(1.8) drop-shadow(0 16px 18px rgba(0,0,0,.7)); } 55% { transform: scale(.92) translateX(7px) rotate(2deg); } }
#pb2 .strap { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); width: 230px; height: 22px; background: #3b2210; border: 2px solid #1e1006; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.6); }
#pb2 .strap::before { content: ''; position: absolute; inset: 3px; border: 1px dashed rgba(255,226,170,.35); border-radius: 2px; }
#pb2 .strap .fill { position: absolute; left: 4px; top: 4px; bottom: 4px; border-radius: 2px; background: linear-gradient(#ff7a5c, #c0392b); transition: width .6s cubic-bezier(.2,.8,.2,1); }
#pb2 .strap .ghost { position: absolute; left: 4px; top: 4px; bottom: 4px; border-radius: 2px; background: #ffd36a; transition: width 1.1s .35s ease-out; }
#pb2 .strap span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 18px; letter-spacing: 1px; text-shadow: 0 1px 2px #000; }
#pb2 .pen { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 20px; }
#pb2 .pen .deck { position: relative; width: 70px; height: 100px; }
#pb2 .pen .deck b { position: absolute; inset: 0; border-radius: 6px; background: repeating-linear-gradient(45deg, #7a1f1f 0 6px, #8c2a26 6px 12px); border: 3px solid #f3ecd6; box-shadow: 0 4px 8px rgba(0,0,0,.6); }
#pb2 .pen .deck b:nth-child(2) { transform: translate(5px, -5px) rotate(4deg); } #pb2 .pen .deck b:nth-child(3) { transform: translate(10px, -10px) rotate(8deg); }
#pb2 .tag { font-size: 12px; letter-spacing: 2px; color: #e9dcb8; background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 3px; }

/* the table, in front of the stands */
#pb2 .table { position: absolute; left: 0; right: 0; bottom: 0; height: 360px; }
#pb2 .rail { position: absolute; left: -20px; right: -20px; top: 0; height: 30px; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg, #6b4423 0 9px, #5d3a1d 9px 13px, #77502a 13px 22px), #6b4423;
  box-shadow: 0 -8px 24px rgba(0,0,0,.6), inset 0 3px 0 rgba(255,220,160,.25), inset 0 -6px 8px rgba(0,0,0,.45); }
#pb2 .felt { position: absolute; left: 0; right: 0; top: 30px; bottom: 0; background: radial-gradient(ellipse 80% 90% at 50% 0%, #1f5a3a, #12371f 70%, #0b2414); }
#pb2 .felt::after { content: ''; position: absolute; inset: 0; background-image: var(--pc2-noise); opacity: .1; mix-blend-mode: multiply; }

/* printed diamond on the felt, with runner tokens */
#pb2 .dia { position: absolute; left: 70px; top: 70px; width: 230px; height: 230px; }
#pb2 .dia .sq { position: absolute; inset: 42px; transform: rotate(45deg); border: 3px solid rgba(240,230,200,.55); border-radius: 4px; background: rgba(176,122,66,.18); }
#pb2 .dia .bs { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; transform: rotate(45deg); background: #f3ecd6; box-shadow: 0 2px 3px rgba(0,0,0,.5); }
#pb2 .dia .runner { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid #ffd36a; background: #222 center / cover; image-rendering: pixelated; box-shadow: 0 4px 8px rgba(0,0,0,.7); transition: left .55s cubic-bezier(.4,.1,.3,1), top .55s cubic-bezier(.4,.1,.3,1), opacity .3s; z-index: 2; }
#pb2 .dia .runner.score { opacity: 0; }
#pb2 .dia .lbl { position: absolute; left: 0; right: 0; bottom: -10px; text-align: center; }

/* at-bat card, standing up from the table */
#pb2 .atbat { position: absolute; left: 345px; bottom: 120px; transform: rotate(-3deg) scale(1.08); transform-origin: bottom left; filter: drop-shadow(0 18px 18px rgba(0,0,0,.75)); transition: transform .35s; }
#pb2 .atbat .lbl { position: absolute; left: 0; right: 0; top: -26px; text-align: center; }
#pb2 .atbat.swap { animation: pb2Swap .5s; }
@keyframes pb2Swap { 0% { transform: translateY(60px) rotate(-8deg) scale(1.08); opacity: 0; } 100% { transform: rotate(-3deg) scale(1.08); opacity: 1; } }
#pb2 .atbat.k::after { content: 'K'; position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%) rotate(-14deg); font-family: 'Alfa Slab One', serif; font-size: 120px; color: #d7261e; text-shadow: 0 0 2px #5a0d09; opacity: .9; animation: pb2Stamp .35s cubic-bezier(.2,1.6,.4,1); mix-blend-mode: multiply; }
@keyframes pb2Stamp { 0% { transform: translate(-50%,-50%) rotate(-14deg) scale(2.4); opacity: 0; } 100% { transform: translate(-50%,-50%) rotate(-14deg) scale(1); opacity: .9; } }

/* dice tray: wooden box with felt and a printed zone ruler */
#pb2 .tray { position: absolute; left: 610px; top: 46px; width: 520px; height: 230px; border-radius: 14px;
  background: #4a2a14; box-shadow: 0 14px 28px rgba(0,0,0,.6), inset 0 0 0 6px #6b4423, inset 0 0 0 8px #3a200d; }
#pb2 .tray .bed { position: absolute; inset: 16px 16px 58px; border-radius: 8px; background: radial-gradient(ellipse at 50% 40%, #8c2a26, #5e1714); box-shadow: inset 0 6px 14px rgba(0,0,0,.65); overflow: hidden; }
#pb2 .die { position: absolute; top: 50%; width: 64px; height: 64px; margin-top: -32px; border-radius: 12px; background: linear-gradient(145deg, #fffaf0, #e7dcc4); color: #241510;
  display: flex; align-items: center; justify-content: center; font-family: 'Alfa Slab One', serif; font-size: 32px;
  box-shadow: 0 8px 0 #b9ab8c, 0 14px 16px rgba(0,0,0,.55), inset 0 -3px 0 rgba(0,0,0,.08); }
#pb2 .die.d1 { left: calc(50% - 76px); } #pb2 .die.d2 { left: calc(50% + 12px); }
#pb2 .die small { position: absolute; bottom: 4px; right: 7px; font-family: 'Oswald', sans-serif; font-size: 10px; opacity: .5; }
#pb2 .rolling .die.d1 { animation: pb2Roll1 .9s cubic-bezier(.2,.7,.3,1); }
#pb2 .rolling .die.d2 { animation: pb2Roll2 .9s cubic-bezier(.2,.7,.3,1); }
@keyframes pb2Roll1 { 0% { transform: translate(-220px, -40px) rotate(-260deg); } 45% { transform: translate(20px, 10px) rotate(40deg); } 70% { transform: translate(-6px, -6px) rotate(-12deg); } 100% { transform: none; } }
@keyframes pb2Roll2 { 0% { transform: translate(240px, 50px) rotate(300deg); } 45% { transform: translate(-24px, -8px) rotate(-30deg); } 70% { transform: translate(5px, 4px) rotate(10deg); } 100% { transform: none; } }
#pb2 .ruler { position: absolute; left: 16px; right: 16px; bottom: 14px; height: 34px; display: flex; border-radius: 4px; overflow: hidden; background: #efe6cf; box-shadow: inset 0 0 0 2px #2a1a0e; }
#pb2 .ruler span { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; letter-spacing: 1px; color: #241510; border-right: 1px dashed rgba(36,21,16,.35); }
#pb2 .ruler span small { font-size: 9px; opacity: .65; letter-spacing: 0; }
#pb2 .ruler span.hitz { filter: brightness(1.15); box-shadow: inset 0 0 0 3px #241510; }
#pb2 .ruler .mark { position: absolute; top: -12px; width: 0; height: 0; border: 9px solid transparent; border-top-color: #ffd36a; margin-left: -9px; transition: left .5s cubic-bezier(.2,.9,.3,1.2); filter: drop-shadow(0 2px 2px #000); }

/* result: stamped sticker + damage count */
#pb2 .result { position: absolute; left: 50%; top: 360px; transform: translateX(-50%); text-align: center; pointer-events: none; z-index: 5; }
#pb2 .result .word { display: inline-block; font-family: 'Alfa Slab One', serif; font-size: 64px; letter-spacing: 2px; padding: 4px 28px; background: #f3ecd6; color: #241510; border: 5px solid #241510; transform: rotate(-4deg); box-shadow: 8px 8px 0 rgba(0,0,0,.55); }
#pb2 .result .dmg { margin-top: 10px; font-family: 'Alfa Slab One', serif; font-size: 34px; color: #ffd36a; text-shadow: 0 3px 0 #7a2a00, 0 0 18px rgba(255,160,40,.6); }
#pb2 .result.show .word { animation: pb2Pop .45s cubic-bezier(.2,1.7,.4,1); }
@keyframes pb2Pop { 0% { transform: rotate(-4deg) scale(.2); opacity: 0; } 100% { transform: rotate(-4deg) scale(1); opacity: 1; } }
#pb2 .result.hr .word { background: #ffd36a; } #pb2 .result.bad .word { background: #d7261e; color: #fff6dd; border-color: #5a0d09; }
#pb2 .result.good .word { background: #a7e8a0; }

/* chips + roll button on the table's right */
#pb2 .ctrl { position: absolute; right: 70px; top: 60px; width: 300px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
#pb2 .team { background: rgba(0,0,0,.35); border: 2px solid rgba(240,230,200,.25); border-radius: 8px; padding: 10px 12px; }
#pb2 .team .row { display: flex; justify-content: space-between; font-size: 14px; letter-spacing: 1px; }
#pb2 .team .bar { height: 12px; border-radius: 3px; background: #2a0f0b; margin: 5px 0 9px; overflow: hidden; }
#pb2 .team .bar i { display: block; height: 100%; background: linear-gradient(#7af0a0, #2f9e5a); transition: width .5s; }
#pb2 .team .bar.sh i { background: linear-gradient(#9fd3ff, #3a7ac0); }
#pb2 .chips { display: flex; gap: 10px; align-items: center; justify-content: center; }
#pb2 .chip { width: 46px; height: 46px; border-radius: 50%; background: #c9a24a; border: 4px dashed #fff6d8; box-shadow: 0 4px 0 #6b4f12, 0 8px 10px rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; font-size: 11px; color: #3b2a05; }
#pb2 .chip.blue { background: #3a7ac0; color: #eaf3ff; box-shadow: 0 4px 0 #1b3f6b, 0 8px 10px rgba(0,0,0,.5); }
#pb2 .roll { font-family: 'Alfa Slab One', serif; font-size: 26px; letter-spacing: 3px; color: #2a1a0e; padding: 14px 0; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(#ffe39a, #e0a93a); box-shadow: 0 7px 0 #8a5a12, 0 12px 18px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,255,255,.6); transition: transform .08s, box-shadow .08s; }
#pb2 .roll:active { transform: translateY(5px); box-shadow: 0 2px 0 #8a5a12, 0 6px 10px rgba(0,0,0,.5); }
#pb2 .note { font-size: 12px; opacity: .6; text-align: center; letter-spacing: 1px; }

/* lineup hand, fanned along the bottom edge */
#pb2 .hand { position: absolute; left: 0; right: 0; bottom: -150px; height: 240px; display: flex; justify-content: center; }
#pb2 .hand .h { width: 76px; margin: 0 -2px; transform-origin: 50% 100%; transition: transform .35s; }
#pb2 .hand .h .player-card { transform: scale(.52); transform-origin: top left; }
#pb2 .hand .h.cur { transform: translateY(-46px) !important; }
#pb2 .hand .h:hover { transform: translateY(-30px) !important; }

/* sparks */
#pb2 .spark { position: absolute; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; z-index: 6; animation: pb2Spark 1.2s ease-out forwards; }
@keyframes pb2Spark { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }
#pb2 .close { position: absolute; right: 14px; top: 12px; z-index: 9; background: rgba(0,0,0,.6); color: #fff; border: 1px solid #fff5; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-family: 'Oswald', sans-serif; }
#pb2 .table { display: block; width: 100%; }
#pb2 .result { top: 408px; }
#pb2 .tray { top: 26px; height: 220px; }
#pb2 .hand { bottom: -168px; }
#pb2 .dia { top: 54px; }
