/* R5.1: isolated game-page styles. Shared styles.css and all home-page UI stay unchanged. */
.game-page { background: #f5f6ee; font-family: 'Noto Sans TC', 'Noto Sans CJK TC', 'Microsoft JhengHei', system-ui, sans-serif; }
.game-page header { max-width: 1440px; gap: 28px; }
.game-page header nav { gap: clamp(12px, 1.55vw, 22px); }
.game-page .header-note { display: none; }
.game-page .game-main { max-width: 1360px; margin: 0 auto; padding: 32px 36px 48px; }
.game-page .game-intro { padding: 0 0 26px; max-width: none; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center; }
.game-page .game-intro .eyebrow { display: flex; align-items: center; gap: 9px; font-size: 10px; letter-spacing: 1.8px; margin: 0 0 12px; }
.game-page .practice-dot { width: 7px; height: 7px; border-radius: 50%; background: #587647; box-shadow: 0 0 0 4px #e5ebd9; flex: 0 0 auto; }
.game-page .game-edition { font-size: 10px; letter-spacing: 1px; color: #748071; padding-left: 7px; }
.game-page .game-intro h1 { font-size: clamp(26px, 2.8vw, 40px); letter-spacing: -1.5px; line-height: 1.4; }
.game-page .game-intro h1 span { box-shadow: inset 0 -9px #e9f578; }
.game-page .game-intro-copy { margin: 10px 0 0; font-size: 13px; color: #69766b; }
.game-page .game-rules { border-left: 1px solid #d6ddce; padding: 4px 0 4px 24px; min-width: 246px; display: grid; grid-template-columns: 1fr; gap: 7px; }
.game-page .game-rules > div { display: flex; gap: 12px; align-items: center; font-size: 12px; color: #344e3f; }
.game-page kbd { font: 600 10px ui-monospace, monospace; letter-spacing: .6px; padding: 4px 8px; border: 1px solid #cad2c2; border-bottom-width: 3px; border-radius: 5px; background: #fff; color: #34523f; line-height: 1.2; }
.game-page .game-rules small { color: #788372; font-size: 10px; margin-top: 3px; }
.game-page .mouse-key { display: inline-block; width: 18px; height: 22px; border: 1.5px solid #879580; border-radius: 8px; position: relative; margin: 0 17px; }
.game-page .mouse-key:before { content: ''; position: absolute; top: 2px; left: 2px; width: 5px; height: 8px; border-radius: 4px 0 0 0; background: #547445; }
.game-page .game-shell { max-width: none; padding: 0; border: 1px solid #d2dccb; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 12px 36px #18352b0a; }
.game-page .game-scorebar { border: 0; background: #fff; grid-template-columns: 1.2fr 1fr 1fr 1fr; }
.game-page .game-scorebar > div { padding: 17px 24px 15px; border-right: 1px solid #e7ebe1; min-width: 0; }
.game-page .game-scorebar > div:last-child { border-right: 0; }
.game-page .game-scorebar small { font-size: 9px; letter-spacing: 1px; color: #75816e; }
.game-page .game-scorebar strong { font-size: 22px; font-weight: 800; color: #193e31; font-variant-numeric: tabular-nums; margin-top: 5px; }
.game-page .game-scorebar em { font-size: 11px; color: #718368; }
.game-page .game-scorebar .best-score { background: #f3f6e8; }
.game-page .field-heading { display: flex; align-items: center; justify-content: space-between; background: #183f34; padding: 9px 22px; color: #c1d3ba; font-size: 10px; letter-spacing: 1.4px; }
.game-page .field-heading > span:first-child { display: flex; align-items: center; gap: 8px; }
.game-page .field-heading i { width: 5px; height: 5px; background: #e9f578; border-radius: 50%; }
.game-page .field-heading b { color: #e9f578; font: 600 12px ui-monospace, monospace; padding: 0 2px; }

/* A side-on stadium: every ground decoration stays below the pitching path. */
.game-page .game-field { --contact-x: 80%; --contact-y: 59%; --player-scale: 1; position: relative; height: clamp(310px, 32vw, 440px); border: 0; background: #b8d1c5; touch-action: manipulation; }
.game-page .game-field:focus-visible { outline: 3px solid #c3d456; outline-offset: -3px; }
.game-page .field-sky { inset: 0; background: radial-gradient(ellipse at 75% 5%, #fff6d57a, transparent 48%), linear-gradient(#97bdb9 0%, #cbdccc 46%, #dfe6c7 60%); }
.game-page .field-sky:after { content: ''; position: absolute; top: 11%; left: 72%; width: 44px; height: 44px; border-radius: 50%; background: #fff8d1; box-shadow: 0 0 55px 32px #fff8d13d; clip-path: none; opacity: .8; bottom: auto; right: auto; }
.game-page .stadium-light { position: absolute; width: 4px; height: 23%; top: 11%; background: #658b83; box-shadow: 2px 0 #ffffff3b; z-index: 1; }
.game-page .light-left { left: 9%; }
.game-page .light-right { right: 9%; }
.game-page .stadium-light:before { content: ''; position: absolute; width: 43px; height: 21px; left: -20px; top: 0; border-radius: 4px; border: 3px solid #6d8e82; background: repeating-linear-gradient(90deg, #f4f3d0 0 5px, #aabb9a 5px 7px); box-shadow: 0 0 20px #fff8c540; }
.game-page .stadium-stands { position: absolute; top: 32%; left: -2%; right: -2%; height: 24%; z-index: 1; background: #5b7c69; border-radius: 46% 46% 0 0 / 20% 20% 0 0; overflow: hidden; border-top: 5px solid #c8d7bc; }
.game-page .stadium-stands:before { content: ''; position: absolute; inset: 8% 0 36%; background-image: radial-gradient(ellipse, #c4cdb380 1.5px, transparent 2px), repeating-linear-gradient(0deg, #719078 0 9px, #52775f 9px 12px); background-size: 11px 12px, auto; }
.game-page .stadium-stands:after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 36%; border-top: 3px solid #d5da9e; background: repeating-linear-gradient(90deg, #285341 0 9.9%, #35614b 9.9% 10%); }
.game-page .stadium-stands > span { position: absolute; z-index: 2; bottom: 7%; left: 50%; transform: translateX(-50%); color: #c3d5bb; white-space: nowrap; font: 700 clamp(8px, .9vw, 12px) ui-monospace, monospace; letter-spacing: 4px; }
.game-page .field-grass { left: 0; right: 0; bottom: 0; height: 44%; background: repeating-linear-gradient(165deg, #629260 0 32px, #689965 32px 64px); clip-path: none; z-index: 2; }
.game-page .field-dirt { position: absolute; left: 10%; width: 86%; top: 69%; height: 26%; border-radius: 50%; background: #c6a57b; border-bottom: 5px solid #ae8b65; box-shadow: inset 0 6px 12px #b18c651c; z-index: 3; }
.game-page .field-chalk { position: absolute; left: 68%; top: 88%; width: 29%; height: 1px; background: #f3ebd7b3; transform: rotate(-11deg); z-index: 4; }
.game-page .pitcher-mound { left: 17.5%; top: 74%; width: 9%; height: 3.2%; background: #d7bb96; box-shadow: 0 3px 0 #ad8b65; z-index: 4; }
.game-page .pitcher-mound:after { content: ''; position: absolute; width: 23%; height: 3px; top: 18%; left: 30%; background: #f3ecda; border-radius: 1px; }
.game-page .home-plate { left: var(--contact-x); top: 86%; width: 28px; height: 17px; z-index: 4; background: #f7f2df; transform: translate(-50%, -50%) skewX(-12deg); }
.game-page .strike-zone { left: var(--contact-x); top: var(--contact-y); width: clamp(30px, 3.1vw, 42px); height: clamp(30px, 3.1vw, 42px); border: 2px dashed #f0f3b0; border-radius: 50%; background: none; box-shadow: none; z-index: 8; transition: box-shadow .1s, border-color .1s; }
.game-page .strike-zone span { top: -27px; font-size: 10px; letter-spacing: 1px; color: #f9f9d7; background: #234c37c9; padding: 2px 7px; border-radius: 4px; }
.game-page .strike-zone i { position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; background: #f4f6b7; border-radius: 50%; transform: translate(-50%,-50%); }
.game-page .strike-zone.in-range { border-style: solid; border-color: #f4ff78; box-shadow: 0 0 0 7px #e9f57826, 0 0 30px #edf8ac73; }

/* Player feet share the ground plane; #pitch-release is the measured hand anchor. */
.game-page .pitcher { width: 78px; height: 133px; left: 21%; top: 75%; transform: translate(-50%, -100%) scale(var(--player-scale)); transform-origin: 50% 100%; z-index: 6; }
.game-page .pitcher-head { width: 23px; height: 26px; left: 25px; top: 7px; background: #dcaa7d; border-radius: 9px 11px 9px 10px; box-shadow: inset -3px 0 #c78e66; }
.game-page .pitcher-cap { position: absolute; width: 27px; height: 12px; left: 22px; top: 1px; background: #193e32; border-radius: 11px 11px 2px 2px; }
.game-page .pitcher-cap:after { content: ''; position: absolute; width: 16px; height: 4px; top: 10px; right: -8px; background: #193e32; border-radius: 2px; }
.game-page .pitcher-body { width: 36px; height: 54px; left: 20px; top: 31px; border-radius: 11px 10px 3px 3px; background: #294f3b; border-top: 4px solid #cdd799; box-shadow: inset -7px 0 #153d2e; transform: skew(-5deg); color: #eaf2c5; font: 700 17px Georgia, serif; text-align: center; padding-top: 12px; }
.game-page .pitcher-arm { left: 45px; top: 40px; width: 46px; height: 10px; background: #dcaa7d; border-radius: 8px; transform: rotate(-8deg); transform-origin: left center; }
.game-page .pitcher-glove { position: absolute; width: 18px; height: 23px; top: 51px; left: 5px; border-radius: 8px; background: #99704c; border: 2px solid #795634; transform: rotate(-15deg); }
.game-page .pitch-release { position: absolute; width: 2px; height: 2px; left: 90px; top: 37px; opacity: 0; pointer-events: none; }
.game-page .pitcher-leg { position: absolute; width: 15px; height: 45px; top: 82px; background: #e9edda; border-bottom: 11px solid #183c2e; border-radius: 2px 2px 3px 3px; transform-origin: top center; }
.game-page .pitcher .leg-back { left: 23px; transform: rotate(17deg); }
.game-page .pitcher .leg-front { left: 39px; transform: rotate(-13deg); }
.game-page .pitcher.is-pitching .pitcher-arm { animation: r51-throw .28s ease-out; }
.game-page .batter { width: 72px; height: 153px; left: 88%; top: 86%; transform: translate(-50%, -100%) scale(var(--player-scale)); transform-origin: 50% 100%; z-index: 9; }
.game-page .batter-head { left: 24px; top: 3px; width: 26px; height: 28px; background: #d9aa82; border-radius: 10px; border-top: 10px solid #193e32; box-shadow: inset 4px 0 #bd8863; }
.game-page .batter-head:after { content: ''; position: absolute; width: 16px; height: 4px; left: -7px; top: -4px; border-radius: 2px; background: #193e32; }
.game-page .batter-body { width: 39px; height: 61px; left: 18px; top: 33px; border: 0; border-top: 4px solid #244735; border-bottom: 5px solid #244735; background: #f3f3de; box-shadow: inset -8px 0 #dddcc5; color: #31523a; border-radius: 10px 8px 2px 2px; font: 700 20px Georgia, serif; text-align: center; padding-top: 9px; }
.game-page .batter-arm { position: absolute; top: 48px; left: 2px; width: 31px; height: 11px; border-radius: 9px; background: #d9aa82; transform: rotate(-15deg); }
.game-page .batter-leg { position: absolute; top: 92px; height: 55px; width: 16px; background: #e9ead4; border-bottom: 15px solid #183c2e; border-radius: 3px; transform-origin: top center; }
.game-page .batter .leg-back { left: 39px; transform: rotate(-13deg); }
.game-page .batter .leg-front { left: 20px; transform: rotate(15deg); }
.game-page .bat { width: 8px; height: 92px; left: -5px; top: -13px; transform: rotate(24deg); transform-origin: 50% 88%; background: linear-gradient(90deg, #b38956, #efd3a4 55%, #ac7c47); }
.game-page .batter.swing { animation: none; }
.game-page .batter.swing .bat { animation: r51-swing .26s ease-out forwards; }
.game-page .baseball { width: 21px; height: 21px; z-index: 12; box-shadow: 0 3px 5px #1a342950, 0 0 0 1px #b7b697; pointer-events: none; }
.game-page .hit-ball { z-index: 12; }
.game-page .swing-flash { width: 26px; height: 26px; border-width: 3px; z-index: 13; pointer-events: none; }

/* Instructions and results live outside the playfield, never over the ball path. */
.game-page .game-control-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 18px; padding: 18px 24px; border-bottom: 1px solid #e2e8d9; }
.game-page .field-message { position: static; transform: none; min-width: 0; flex: 1; background: none; padding: 0; text-align: left; color: #294b36; border-radius: 0; }
.game-page .field-message strong { font-size: 14px; color: #264832; line-height: 1.5; }
.game-page .field-message span { font-size: 11px; color: #778372; margin-top: 3px; }
.game-page .game-buttons { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.game-page .game-pitch-button { min-width: 188px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; border-radius: 8px; background: #214a36; border: 1px solid #214a36; color: #f4f7df; padding: 12px 16px; font-size: 13px; font-weight: 700; transition: background .15s; }
.game-page .game-pitch-button:hover:not(:disabled) { background: #315f43; }
.game-page .game-pitch-button:disabled { background: #e9eee2; color: #85967b; border-color: #dfe6d6; opacity: 1; cursor: default; }
.game-page .game-pitch-button kbd { background: #ffffff0f; color: #deecbb; border: 1px solid #ffffff33; border-bottom-width: 2px; font-size: 9px; padding: 3px 5px; }
.game-page .game-pitch-button:disabled kbd { color: #819071; border-color: #b8c4ad; }
.game-page .game-reset-button { color: #788471; font-size: 11px; padding: 8px 4px; }
.game-page .result-panel { display: grid; grid-template-columns: 72px minmax(0,1fr) 186px; align-items: center; gap: 22px; padding: 22px 24px 18px; border: 0; background: #fcfdf8; }
.game-page .result-mark { font: 700 10px ui-monospace, monospace; letter-spacing: 1px; min-height: 72px; padding: 12px 5px 17px; color: #e6f08a; background: #244b37; line-height: 1.5; overflow-wrap: anywhere; }
.game-page .result-panel small { font-size: 9px; letter-spacing: .9px; color: #849079; }
.game-page .result-panel h2 { font-size: 21px; line-height: 1.5; margin: 4px 0; color: #24422f; }
.game-page .result-panel p { font-size: 11px; color: #798672; line-height: 1.8; }
.game-page .distance-display { text-align: right; border-left: 1px solid #e0e7d7; padding-left: 18px; }
.game-page .distance-display strong { gap: 7px; margin-top: 6px; color: #254932; }
.game-page .distance-display strong span { font: 700 49px ui-monospace, monospace; letter-spacing: -3px; font-variant-numeric: tabular-nums; }
.game-page .distance-display em { font: 600 15px ui-monospace, monospace; color: #7c8b71; }
.game-page .timing-analysis { padding: 3px 24px 16px; background: #fcfdf8; }
.game-page .timing-labels { display: flex; justify-content: space-between; font-size: 9px; color: #859178; margin-bottom: 7px; }
.game-page .timing-labels strong { font-weight: 600; color: #647546; }
.game-page .timing-track { height: 7px; position: relative; border-radius: 5px; background: linear-gradient(to right, #e0e5d8 0 17.3%, #c5d7b0 17.3% 34.6%, #9ebd7e 34.6% 42.3%, #b6cd42 42.3% 57.7%, #9ebd7e 57.7% 65.4%, #c5d7b0 65.4% 82.7%, #e0e5d8 82.7%); }
.game-page .timing-center { position: absolute; left: 50%; top: -2px; height: 11px; width: 2px; background: #587430; }
.game-page .timing-marker { position: absolute; top: -4px; width: 4px; height: 15px; border-radius: 3px; background: #1c3d2a; left: var(--timing-pos, 50%); transform: translateX(-50%); box-shadow: 0 0 0 2px #fcfdf8; }
.game-page .timing-marker[hidden] { display: none; }
.game-page .timing-guide { padding: 12px 0 0; justify-content: center; font-size: 9px; gap: 8px 24px; color: #88967c; }
.game-page .timing-guide span { gap: 5px; }
.game-page .timing-guide span:before { width: 5px; height: 5px; }
.game-page .timing-guide span:last-child:before { display: none; }
.game-page .timing-guide b { font-weight: 500; color: #6a7d57; }
.game-page .game-footnote { text-align: center; margin: 18px 0 0; color: #8c9780; font-size: 10px; }
.game-page .game-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
@keyframes r51-throw { 0% { transform: rotate(-38deg); } 55% { transform: rotate(4deg); } 100% { transform: rotate(-8deg); } }
@keyframes r51-swing { 0% { transform: rotate(24deg); } 65% { transform: rotate(-100deg); } 100% { transform: rotate(-117deg); } }
@media (max-width: 1050px) {
  .game-page .game-main { padding: 26px 24px 38px; }
  .game-page .game-intro { gap: 20px; }
  .game-page .game-intro h1 { font-size: 30px; }
  .game-page .game-rules { min-width: 230px; padding-left: 18px; }
  .game-page .game-scorebar > div { padding: 15px 17px; }
  .game-page .game-scorebar strong { font-size: 19px; }
  .game-page .game-field { --player-scale: .9; }
}
@media (max-width: 720px) {
  .game-page header { gap: 14px; padding: 15px 20px; }
  .game-page header nav { width: 100%; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; margin-left: 0; gap: 18px; font-size: 12px; padding: 5px 0; }
  .game-page header nav a { flex: 0 0 auto; display: inline-flex; align-items: center; }
  .game-page .game-main { padding: 24px 16px 32px; }
  .game-page .game-intro { grid-template-columns: 1fr; gap: 16px; padding-bottom: 20px; }
  .game-page .game-intro h1 { font-size: clamp(25px, 4.6vw, 33px); }
  .game-page .game-intro-copy { font-size: 12px; max-width: 32em; }
  .game-page .game-rules { border: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 20px; row-gap: 9px; }
  .game-page .game-rules > div { gap: 8px; font-size: 11px; }
  .game-page .game-rules small { width: 100%; margin: 0; }
  .game-page .mouse-key { margin: 0 2px; }
  .game-page .game-shell { border-radius: 14px; }
  .game-page .game-scorebar { grid-template-columns: 1fr 1fr; }
  .game-page .game-scorebar > div { padding: 11px 16px; }
  .game-page .game-scorebar > div:nth-child(2) { border-right: 0; }
  .game-page .game-scorebar > div:nth-child(-n+2) { border-bottom: 1px solid #e7ebe1; }
  .game-page .game-scorebar small { font-size: 8px; letter-spacing: .7px; }
  .game-page .game-scorebar strong { font-size: 19px; }
  .game-page .field-heading { padding: 8px 14px; font-size: 9px; }
  .game-page .game-field { height: 320px; --contact-x: 78%; --contact-y: 58%; --player-scale: .75; }
  .game-page .stadium-stands > span { letter-spacing: 1.5px; font-size: 8px; }
  .game-page .pitcher { left: 18%; }
  .game-page .pitcher-mound { left: 14%; width: 12%; }
  .game-page .batter { left: 88%; }
  .game-page .field-dirt { left: 4%; width: 97%; }
  .game-page .home-plate { width: 22px; height: 14px; }
  .game-page .strike-zone { width: 32px; height: 32px; }
  .game-page .strike-zone span { font-size: 9px; }
  .game-page .game-control-row { padding: 16px; flex-wrap: wrap; gap: 14px; }
  .game-page .field-message { width: 100%; flex: auto; }
  .game-page .field-message strong { font-size: 13px; }
  .game-page .game-buttons { width: 100%; justify-content: space-between; }
  .game-page .game-pitch-button { min-width: 181px; padding: 11px 13px; }
  .game-page .result-panel { grid-template-columns: 56px minmax(0,1fr); gap: 14px; padding: 18px 16px 14px; }
  .game-page .result-mark { min-height: 61px; font-size: 8px; }
  .game-page .result-panel h2 { font-size: 18px; }
  .game-page .result-panel small { font-size: 8px; }
  .game-page .result-panel p { font-size: 11px; }
  .game-page .distance-display { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #e0e7d7; padding: 12px 0 0; display: flex; justify-content: space-between; align-items: center; }
  .game-page .distance-display strong { margin: 0; }
  .game-page .distance-display strong span { font-size: 38px; }
  .game-page .timing-analysis { padding: 3px 16px 14px; }
  .game-page .timing-guide { gap: 6px 14px; }
  .game-page .game-footnote { padding: 0 6px; font-size: 9px; line-height: 1.9; }
}
@media (max-width: 360px) {
  .game-page .game-main { padding-left: 12px; padding-right: 12px; }
  .game-page .game-edition { padding-left: 0; letter-spacing: 0; }
  .game-page .game-intro .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .game-page .game-intro h1 { font-size: 24px; }
  .game-page .game-field { height: 300px; --player-scale: .7; }
  .game-page .game-buttons { gap: 10px; }
  .game-page .game-pitch-button { min-width: 169px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-page .pitcher.is-pitching .pitcher-arm, .game-page .batter.swing .bat { animation-duration: .01ms !important; }
  .game-page .strike-zone, .game-page .game-pitch-button { transition: none; }
}



