html { height: auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
body { overflow-y: auto; height: auto; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 20px 16px 60px; }
.hidden { display: none; }

#joinScreen { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 360px; margin-top: 10vh; }
#joinScreen h1 { font-size: 1.4rem; text-align: center; }
#playerName { width: 100%; font-size: 1.1rem; padding: 12px; }
.join-buttons { display: flex; gap: 14px; width: 100%; }
.join-btn { flex: 1; padding: 22px 0; font-size: 1.2rem; font-weight: 800; border-radius: 12px; }

#gameScreen { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
#teamHeader { text-align: center; }
#myTeamName { font-size: 1.3rem; font-weight: 800; }
#myTeamPoints { font-size: 2.4rem; font-weight: 900; }

#buzzBtn {
  width: 220px; height: 220px; border-radius: 50%;
  background: var(--accent); color: #1a1a1a; font-size: 1.6rem; font-weight: 900;
  border: 6px solid #fff3; box-shadow: 0 0 30px rgba(255,210,63,.6);
}
#buzzBtn:active { transform: scale(.95); }
#buzzBtn:disabled { background: #444; color: #999; box-shadow: none; }

#buzzStatus { font-size: 1.1rem; color: var(--text-dim); min-height: 1.4em; }

#infoPanel { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.info-cat { padding: 10px 14px; border-radius: 8px; background: var(--panel-light); border: 1px solid var(--border); font-weight: 600; }
.info-cat.off { opacity: .4; }
.info-cat.won-red { background: var(--red-dark); border-color: var(--red); color: #fff; }
.info-cat.won-blue { background: var(--blue-dark); border-color: var(--blue); color: #fff; }
.info-question { padding: 14px; border-radius: 10px; background: var(--panel); border: 2px solid var(--accent); }
.info-question .q-text { font-weight: 800; margin-bottom: 8px; }
.info-answer { padding: 8px; border-radius: 6px; background: var(--panel-light); margin-bottom: 6px; }
.info-answer.removed { opacity: .2; text-decoration: line-through; }
.lifeline-status { display: flex; gap: 10px; font-size: .9rem; }
.lifeline-status span { padding: 6px 10px; border-radius: 6px; background: var(--panel-light); }
.lifeline-status span.used { opacity: .4; text-decoration: line-through; }

#pingBadge {
  position: fixed; top: 8px; right: 8px; z-index: 70;
  background: rgba(13,16,24,.85); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 8px; font-size: .75rem; color: var(--text-dim); font-variant-numeric: tabular-nums;
}

#minigameControls {
  position: fixed; inset: 0; z-index: 65; background: #0b3d0b;
  touch-action: none;
}
#minigameControls.hidden { display: none; }

.mg-ctrl-view { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.mg-ctrl-view.hidden { display: none; }

#mgHaxballControls { flex-direction: row; justify-content: space-between; gap: 10px; padding: 10px 14px; position: relative; }
#mgShakeControls, #mgBalanceControls, #mgLastClickControls { flex-direction: column; gap: 18px; padding: 20px; }

#mgScoreLine {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  font-size: 1.4rem; font-weight: 900; color: #fff; z-index: 2;
}
#mgFieldWrap {
  flex: 1; height: 100%; min-width: 0;
  display: flex; align-items: center; justify-content: center;
}
#mgCanvas { max-width: 100%; max-height: 100%; border-radius: 8px; }
#joystickBase {
  width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.08); border: 3px solid rgba(255,255,255,.3);
  position: relative; touch-action: none;
}
#joystickKnob {
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent);
  position: absolute; top: 41px; left: 41px; box-shadow: 0 0 20px rgba(255,210,63,.6);
  transition: transform .05s linear;
}
#kickBtn {
  width: 100px; height: 100px; border-radius: 50%; border: 6px solid #fff3; flex-shrink: 0;
  background: var(--red); color: #fff; font-size: 1rem; font-weight: 900;
  box-shadow: 0 0 30px rgba(255,45,61,.6);
}
#kickBtn:active { transform: scale(.95); }

/* ===== Wstrząśnij butelką ===== */
#mgShakeMyTimer { font-size: 2.4rem; font-weight: 900; color: var(--accent); }
.mg-bottle-big {
  width: 90px; height: 240px; border-radius: 14px 14px 6px 6px;
  background: rgba(255,255,255,.08); border: 3px solid rgba(255,255,255,.3);
  position: relative; overflow: hidden;
}
.mg-bottle-big-fill {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--accent), #b8860b); transition: height .1s linear;
}
#mgShakeHint { font-size: 1.3rem; font-weight: 800; letter-spacing: 1px; }
#mgMotionPermBtn { padding: 14px 22px; font-size: 1.1rem; font-weight: 800; border-radius: 10px; }

/* ===== Balansująca kulka ===== */
#mgBalanceMyStatus { font-size: 1.6rem; font-weight: 800; text-align: center; }
#mgTiltPermBtn { padding: 14px 22px; font-size: 1.1rem; font-weight: 800; border-radius: 10px; }

/* ===== Przeciąganie liny ===== */
#mgRopeControls { flex-direction: column; gap: 22px; padding: 20px; }
#mgRopeStatus { font-size: 1.8rem; font-weight: 900; text-align: center; letter-spacing: 1px; }
#mgRopePullBtn {
  width: 210px; height: 210px; border-radius: 50%;
  border: 6px solid rgba(255,255,255,0.25);
  font-size: 2rem; font-weight: 900; color: #fff; background: #555;
  transition: transform 0.05s, filter 0.05s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
#mgRopePullBtn.team-red  { background: linear-gradient(160deg, #e0212e, #7a0e18); box-shadow: 0 0 35px rgba(255,45,61,0.7); }
#mgRopePullBtn.team-blue { background: linear-gradient(160deg, #1a7ae0, #0c357a); box-shadow: 0 0 35px rgba(45,140,255,0.7); }
#mgRopePullBtn:active { transform: scale(0.91); filter: brightness(1.2); }
#mgRopePullBtn:disabled { background: #2a2a2a; box-shadow: none; color: #555; transform: none; }
#mgRopeMyPulls { font-size: 1.1rem; font-weight: 700; color: var(--text-dim); text-align: center; }

/* ===== Nie klikaj ===== */
#mgLcBtn {
  width: 220px; height: 220px; border-radius: 50%; border: 6px solid #fff3;
  font-size: 1.5rem; font-weight: 900; color: #fff; background: #555;
  transition: background .15s, transform .1s;
}
#mgLcBtn.go { background: var(--green); box-shadow: 0 0 30px rgba(63,221,120,.6); }
#mgLcBtn.trap { background: var(--red); box-shadow: 0 0 30px rgba(255,45,61,.6); }
#mgLcBtn.locked { background: #2a2a2a; color: #888; }
#mgLcBtn.eliminated { background: #1a1a1a; color: #555; }
#mgLcBtn:active { transform: scale(.95); }
#mgLcMyStatus { font-size: 1.2rem; font-weight: 700; color: var(--text-dim); }

/* Telefon trzymany w portrecie podczas mini-gry -> wymuś wygląd poziomy (obrót CSS, bez konieczności fizycznego obracania) */
@media (orientation: portrait) {
  #minigameControls:not(.hidden) {
    top: 0; left: 100%; right: auto; bottom: auto;
    width: 100vh; height: 100vw;
    transform-origin: 0 0;
    transform: rotate(90deg);
  }
}

.now-playing-banner {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(13,16,24,.95); border: 2px solid var(--accent); border-radius: 12px;
  padding: 12px 20px; font-size: 1.1rem; font-weight: 800; color: var(--accent);
  box-shadow: 0 0 20px rgba(255,210,63,.4); max-width: 90vw; text-align: center; z-index: 60;
}
.now-playing-banner.hidden { display: none; }
