/* Current basketaki_new controls geometry, adapted for NBA HUD and pause card. */
#touch { touch-action: none; -webkit-user-select: none; user-select: none; }
#touch [data-btn] { position: relative; padding: 6px; font: 900 10px/1.25 Arial, sans-serif;
  text-align: center; touch-action: none; -webkit-appearance: none; appearance: none; }
#touch [data-btn]::before { position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  color: #c4d3eb; font: 700 9px Arial, sans-serif; opacity: .7; }
#touch [data-btn=shoot]::before { content: 'A'; }
#touch [data-btn=pass]::before { content: 'B'; }
#touch [data-btn=pass] { border-color: #6dd8ff; }
#touch [data-btn=turbo]::before { content: 'R'; }
#touch [data-btn=turbo] { border-color: #ffb347; }
/* Invisible eight-way touch input starts anywhere; retained geometry keeps its sizing stable. */
#touch .court-zone { position: absolute; inset: 0; pointer-events: auto; touch-action: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#touch .direction-pad { position: absolute; left: 0; top: 0; width: 164px; height: 164px;
  box-sizing: border-box; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 7px; gap: 3px; border: 1px solid #d0deec40; border-radius: 28px;
  background: #0b152333; pointer-events: none; visibility: hidden; }
#touch .direction-pad [data-dir] { display: grid; place-items: center; border: 1px solid #d0deec35;
  border-radius: 12px; color: #eff6ffb3; background: #101c2b70; font: 500 25px/1 Arial, sans-serif; }
#touch .direction-pad [data-dir].on { color: #fff8dc; background: #e99622c4; border-color: #ffe4a6;
  box-shadow: 0 0 16px #ffb31a40; }
#touch .direction-center { display: grid; place-items: center; color: #eff6ff85; font: 10px Arial, sans-serif; }
#touch .direction-hint { position: absolute; left: max(20px, env(safe-area-inset-left));
  bottom: max(100px, calc(env(safe-area-inset-bottom) + 86px)); width: 172px; color: #edf4fbc4;
  text-shadow: 0 1px 3px #000; font: 800 11px/1.5 Arial, sans-serif; pointer-events: none; }
#touch .direction-hint small { display: block; font-size: 8px; font-weight: 500; color: #c5d4e1b3; }
#touch .direction-pad.active ~ .direction-hint { visibility: hidden; }
#touch [data-btn] { -webkit-touch-callout: none; }
/* Only the round buttons take a touch; the space around them still accepts the movement thumb. */
#touch .btns { display: block; width: 186px; height: 160px; gap: 0; pointer-events: none; }
#touch .btns [data-btn] { position: absolute; pointer-events: auto; }
#touch .btns [data-btn=shoot] { right: 0; bottom: 0; width: 98px; height: 98px; font-size: 13px; }
#touch .btns [data-btn=pass] { left: 0; top: 0; width: 82px; height: 82px; font-size: 10px; }
#touch .btns [data-btn=turbo] { left: 0; bottom: 0; width: 74px; height: 66px; font-size: 10px; }
#touch .touch-tools { z-index: 2; }
#touch .touch-tools { position: absolute; left: max(12px, env(safe-area-inset-left));
  top: max(94px, calc(env(safe-area-inset-top) + 82px)); display: flex; gap: 7px; pointer-events: none; }
#touch .touch-tools button { min-width: 76px; min-height: 44px; padding: 7px 10px; pointer-events: auto;
  color: #eff6ff; background: #101b2ed9; border: 1px solid #98b2d58c; border-radius: 7px;
  font: 800 10px Arial, sans-serif; touch-action: manipulation; -webkit-appearance: none; appearance: none; }
#touch button:focus-visible { outline: 2px solid #ffc61a; outline-offset: 2px; }
@media (pointer: coarse) {
  :root { --corner-tools-top: max(132px, calc(env(safe-area-inset-top) + 120px)); }
  #hud.corners ~ #touch .touch-tools { top: var(--corner-tools-top); }
  #hint { bottom: max(180px, calc(5vh + 172px)); padding: 0 16px; }
  #hud.corners #hint { top: calc(50% - 138px); bottom: auto; }
  #hud.corners ~ #touch .direction-hint { visibility: hidden; }
  #help { display: none; }
}
@media (orientation: landscape) and (max-height: 540px) {
  #touch .direction-pad { width: 144px; height: 144px; border-radius: 24px; }
  #touch .direction-pad [data-dir] { font-size: 22px; border-radius: 10px; }
  #touch .btns { width: 170px; height: 146px;
    right: max(16px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  #touch .btns [data-btn=shoot] { width: 90px; height: 90px; font-size: 11px; }
  #touch .btns [data-btn=pass] { width: 74px; height: 74px; font-size: 8px; }
  #touch [data-btn]::before { top: 5px; font-size: 8px; }
  #touch .touch-tools { top: max(82px, calc(env(safe-area-inset-top) + 72px)); }
  #pause { gap: 8px; padding: 12px; }
  #pause .t { font-size: 34px; }
  #pause button { font-size: 13px; padding: 8px 18px; min-height: 36px; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  :root { --corner-tools-top: max(146px, calc(env(safe-area-inset-top) + 136px)); }
  #hint { bottom: max(180px, calc(env(safe-area-inset-bottom) + 172px)); }
}


#touch .btns { right: max(20px, env(safe-area-inset-right)); bottom: max(25px, env(safe-area-inset-bottom)); }
#touch .touch-tools { right: auto; }
#pause { align-items: flex-start; overscroll-behavior: contain; }
#pause .modal-card { margin-block: auto; flex-shrink: 0; }
#pause-touch-response { margin: 16px 0 0; padding: 12px; border: 1px solid #65748a66; }
#pause-touch-response legend { font-size: 12px; padding: 0 6px; }
#pause-touch-response button { min-height: 44px; padding: 9px 14px; border: 1px solid #65748a; background: #182b49; color: #fff; }
#pause-touch-response button[aria-pressed=true] { background: #ffcc00; color: #182b49; border-color: #ffcc00; }
@media (orientation: landscape) and (max-height: 540px) {
  #touch .btns { right: max(16px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  #pause .modal-card { padding: 20px 26px; }
}

/* Large loading text, same size as Panathinaikos 7; NBA and Telekom colours stay. */
#load-status, #mp-sync { font: 800 clamp(24px, 6.5vmin, 38px)/1.2 Arial, sans-serif !important; opacity: 1 !important; text-shadow: 0 2px 8px #000; }
