/* Voxel Streetball — playground UI */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #101318; }
body { font-family: 'Courier New', ui-monospace, Menlo, monospace; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; color: #f4f1e8; }
.hidden { display: none !important; }
.clickable { pointer-events: auto; cursor: pointer; }

/* ---------- HUD ---------- */
#hud {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 2px;
  font-weight: bold; letter-spacing: 1px;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.45));
}
#hud .team {
  display: flex; align-items: center; gap: 8px;
  background: #14161cee; padding: 6px 12px;
  border: 3px solid #2e3742;
}
#hud .team.home { border-left-color: #11b5a4; border-left-width: 6px; }
#hud .team.away { border-right-color: #b03be0; border-right-width: 6px; }
#hud .tname { font-size: 13px; color: #b9c2cc; }
#hud .team.home .tname { color: #4fd8c9; }
#hud .team.away .tname { color: #cf7fe8; }
#hud .tscore { font-size: 26px; color: #ffb347; min-width: 34px; text-align: center; }
#hud .poss { color: #ffd166; font-size: 10px; transition: opacity 0.2s; }
#hud .mid {
  background: #14161cee; border: 3px solid #2e3742; padding: 4px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#target { font-size: 11px; color: #8d97a3; }
#clock { font-size: 18px; color: #ff5f45; }

#fireTag, #gamePointTag {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%);
  font-weight: bold; font-size: 13px; letter-spacing: 2px;
  padding: 4px 14px; border: 2px solid;
}
#fireTag { color: #ffb347; border-color: #ff5f45; background: #2a120bd9; animation: firePulse 0.5s infinite alternate; }
#gamePointTag { top: 74px; color: #ffd166; border-color: #ffd166; background: #14161cd9; animation: gpBlink 1s infinite; }
#fireTag:not(.hidden) ~ #gamePointTag:not(.hidden) { top: 108px; }
@keyframes firePulse { from { box-shadow: 0 0 4px #ff5f45; } to { box-shadow: 0 0 16px #ff9d2e; } }
@keyframes gpBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.55; } }

#takeback {
  position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%);
  font-weight: bold; font-size: 14px; letter-spacing: 1px; color: #ffd166;
  background: #14161cd9; border: 2px dashed #ffd166; padding: 5px 14px;
  animation: gpBlink 0.8s infinite;
}

/* ---------- banners ---------- */
#bannerWrap { position: absolute; top: 24%; left: 0; right: 0; text-align: center; }
#banner {
  display: inline-block; font-size: clamp(26px, 5.4vw, 52px); font-weight: bold; letter-spacing: 3px;
  color: #f4f1e8; text-shadow: 4px 4px 0 #000a, 0 0 24px #0008;
  -webkit-text-stroke: 1px #1a1a1a;
}
#banner.gold { color: #ffd166; }
#banner.steal { color: #6ee7f0; }
#banner.brick { color: #ff7a66; }
#banner.pop, #banner.pop.gold, #banner.pop.steal, #banner.pop.brick { animation: popIn 0.22s cubic-bezier(0.2, 2.4, 0.4, 1) both; }
#subbanner {
  display: block; margin-top: 8px; font-size: clamp(13px, 2vw, 19px); font-weight: bold; letter-spacing: 2px;
  color: #b9c2cc; text-shadow: 2px 2px 0 #000c;
}
#subbanner.pop-sub { animation: popIn 0.25s ease-out both; }
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- shot meter ---------- */
#meter {
  position: absolute; width: 16px; height: 120px;
  transform: translate(0, -50%);
  background: #14161cd9; border: 3px solid #f4f1e8;
  box-shadow: 3px 3px 0 #000a;
}
#meterFill {
  position: absolute; bottom: 0; left: 0; right: 0; height: 0%;
  background: linear-gradient(to top, #4cc9f0, #ffd166, #ff5f45);
}
#meterSweet {
  position: absolute; left: -3px; right: -3px;
  background: #ffffffcc; border: 1px solid #14161c;
  z-index: 2;
}

/* ---------- hint / toast ---------- */
#hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: bold; letter-spacing: 1.5px; color: #aab4bf;
  background: #14161cbb; padding: 5px 14px; border: 2px solid #2e3742;
  white-space: nowrap;
}
#toast {
  position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
  font-size: 14px; font-weight: bold; letter-spacing: 1px; color: #14161c;
  background: #ffd166; padding: 8px 18px; border: 3px solid #14161c;
  box-shadow: 4px 4px 0 #000a;
}
#toast.pop-toast { animation: popIn 0.3s ease-out both; }

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 20px;
}
#title { background: linear-gradient(to bottom, #101318cc 0%, #10131833 40%, #10131833 70%, #101318dd 100%); }
#title h1 {
  font-size: clamp(40px, 9vw, 96px); line-height: 0.95; letter-spacing: 4px;
  color: #f4f1e8; text-shadow: 5px 5px 0 #11b5a4, 10px 10px 0 #0009;
  -webkit-text-stroke: 2px #14161c;
}
#title h1 span { display: block; }
#title h1 .t2 { color: #ffd166; text-shadow: 5px 5px 0 #b03be0, 10px 10px 0 #0009; }
.t-sub { font-size: clamp(12px, 2vw, 17px); font-weight: bold; letter-spacing: 3px; color: #b9c2cc; text-shadow: 2px 2px 0 #000c; }
.t-menu { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.t-opt {
  font-size: clamp(14px, 2.4vw, 21px); font-weight: bold; letter-spacing: 2px;
  color: #d7dde3; background: #14161cd9; border: 3px solid #2e3742;
  padding: 9px 22px; min-width: 320px;
  transition: transform 0.08s, border-color 0.08s;
}
.t-opt:hover { transform: translateX(4px); border-color: #ffd166; color: #fff; }
.t-opt.main { border-color: #11b5a4; color: #ffd166; }
.t-opt .key {
  float: right; margin-left: 18px; color: #14161c; background: #8d97a3;
  padding: 0 8px; font-size: 0.8em; align-self: center;
}
.t-opt.main .key { background: #ffd166; }
.t-rules { font-size: clamp(10px, 1.6vw, 13px); font-weight: bold; letter-spacing: 1px; color: #8d97a3; text-shadow: 1px 1px 0 #000; max-width: 640px; }
.t-controls { font-size: clamp(10px, 1.6vw, 13px); letter-spacing: 1px; color: #6f7a86; text-shadow: 1px 1px 0 #000; }
.t-controls b { color: #b9c2cc; }
.t-career { font-size: 12px; font-weight: bold; letter-spacing: 2px; color: #ffb347; text-shadow: 2px 2px 0 #000c; }

#end { background: #101318cc; }
#end h2, #pause h2 {
  font-size: clamp(30px, 6vw, 62px); letter-spacing: 4px;
  text-shadow: 4px 4px 0 #0009; -webkit-text-stroke: 1px #14161c;
}
#end h2.win { color: #ffd166; }
#end h2.loss { color: #8d97a3; }
#endScore { font-size: clamp(18px, 3vw, 28px); font-weight: bold; color: #f4f1e8; letter-spacing: 2px; text-shadow: 2px 2px 0 #000; }
#endLine { font-size: clamp(12px, 1.8vw, 15px); font-weight: bold; color: #4fd8c9; letter-spacing: 1px; text-shadow: 1px 1px 0 #000; }
#endBox { border-collapse: collapse; margin-top: 4px; font-size: 12px; letter-spacing: 1px; }
#endBox th { color: #ffb347; padding: 3px 10px; border-bottom: 2px solid #2e3742; text-align: left; }
#endBox td { color: #b9c2cc; padding: 2px 10px; font-weight: bold; }
#endBox tr.sep th { padding-top: 10px; }

#pause { background: #101318dd; }
#pause h2 { color: #f4f1e8; }

/* ---------- touch controls ---------- */
#touchUI { position: absolute; inset: 0; pointer-events: none; }
#touchPad {
  position: absolute; left: 12px; bottom: 12px; width: 138px; height: 138px;
  border: 3px dashed #f4f1e844; border-radius: 50%;
  pointer-events: auto; touch-action: none;
}
#touchPad::after {
  content: 'MOVE'; position: absolute; inset: 0; display: grid; place-items: center;
  color: #f4f1e855; font-weight: bold; letter-spacing: 2px; font-size: 12px;
}
#touchBtns { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: flex-end; gap: 10px; pointer-events: auto; }
.tbtn {
  width: 62px; height: 62px; border-radius: 50%;
  border: 3px solid #f4f1e866; background: #14161c88;
  display: grid; place-items: center;
  color: #f4f1e8aa; font-weight: bold; font-size: 11px; letter-spacing: 1px;
  touch-action: none;
}
.tbtn.big { width: 84px; height: 84px; border-color: #ffd16688; color: #ffd166cc; }
.tbtn:active { background: #2e3742cc; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  #hud .tname { display: none; }
  #hud .tscore { font-size: 20px; }
  .t-opt { min-width: 260px; font-size: 14px; }
  #hint { font-size: 10px; max-width: 94vw; white-space: normal; text-align: center; }
  #title h1 { letter-spacing: 2px; }
  .t-controls { display: none; }
}
