/* ═══════════════════════════════════════════════════════════════════════
   GAME PAGE STYLES — play.html
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── GAME PAGE BODY ────────────────────────────────────────────────── */
body.game-page {
  background: #080d12;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ─── GAME HEADER ───────────────────────────────────────────────────── */
.game-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0,0,0,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  z-index: 50;
}
.game-back {
  color: rgba(255,255,255,0.6); font-size: 0.85rem; font-weight: 600;
  transition: color 0.2s; padding: 6px 12px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
}
.game-back:hover { color: #fff; background: rgba(255,255,255,0.05); }
.game-logo { font-size: 1.2rem; font-weight: 900; }
.difficulty-badge {
  background: rgba(0,212,106,0.15); color: #00D46A;
  padding: 4px 12px; border-radius: 50px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  border: 1px solid rgba(0,212,106,0.3);
}

/* ─── TOP AD ────────────────────────────────────────────────────────── */
.ad-top-game {
  text-align: center; padding: 8px;
  background: #0a0f14;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  min-height: 106px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── GAME MAIN LAYOUT ──────────────────────────────────────────────── */
.game-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  gap: 16px;
  position: relative;
}

/* ─── TEAM SELECT SCREEN ────────────────────────────────────────────── */
.overlay-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #080d12 0%, #0d1821 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; overflow-y: auto;
  padding: 20px;
}
.select-container {
  width: 100%; max-width: 1100px;
}
.select-title {
  text-align: center; font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900; margin-bottom: 32px;
  background: linear-gradient(135deg, #00D46A, #FFD700);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.select-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 24px; align-items: start;
}
.select-col h3 {
  text-align: center; font-size: 0.9rem; font-weight: 700;
  color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 16px;
}

/* Team selector grid */
.team-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 520px; overflow-y: auto;
  padding-right: 4px;
}
.team-selector-grid::-webkit-scrollbar { width: 4px; }
.team-selector-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

.team-pick-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 6px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px; cursor: pointer; transition: all 0.18s;
  color: #fff;
}
.team-pick-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
.team-pick-btn.selected {
  background: color-mix(in srgb, var(--team-color, #00D46A) 15%, transparent);
  border-color: var(--team-color, #00D46A);
  box-shadow: 0 0 16px color-mix(in srgb, var(--team-color, #00D46A) 30%, transparent);
}
.pick-flag { font-size: 1.6rem; }
.pick-name { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px; opacity: 0.8; }

/* VS column */
.select-vs {
  display: flex; flex-direction: column; align-items: center;
  gap: 24px; padding-top: 32px;
  min-width: 160px;
}
.vs-badge {
  font-size: 2.5rem; font-weight: 900; letter-spacing: 4px;
  color: rgba(255,255,255,0.15);
}
.difficulty-select { text-align: center; }
.difficulty-select p {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.4); margin-bottom: 10px;
}
.diff-btns { display: flex; flex-direction: column; gap: 6px; }
.diff-btn {
  padding: 8px 28px; border-radius: 50px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: all 0.18s;
}
.diff-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.diff-btn.active {
  background: rgba(0,212,106,0.2); border-color: #00D46A;
  color: #00D46A;
}
.btn-kickoff {
  width: 100%; padding: 16px 12px;
  background: linear-gradient(135deg, #00D46A, #00A851);
  border: none; border-radius: 50px; cursor: pointer;
  font-size: 1rem; font-weight: 900; color: #000;
  letter-spacing: 1px;
  box-shadow: 0 0 30px rgba(0,212,106,0.4);
  transition: all 0.2s;
}
.btn-kickoff:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(0,212,106,0.6);
}

/* ─── GAME AREA ─────────────────────────────────────────────────────── */
.game-area {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 960px;
}
#game-container {
  position: relative; width: 100%;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 60px rgba(0,212,106,0.1), 0 30px 80px rgba(0,0,0,0.6);
  background: #111;
}
#gameCanvas {
  display: block; width: 100%;
  cursor: default;
}

/* ─── CONTROLS HINT ─────────────────────────────────────────────────── */
.controls-hint {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  justify-content: center;
  padding: 10px 16px; margin-top: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; width: 100%;
  font-size: 0.8rem; color: rgba(255,255,255,0.4);
}
.btn-menu {
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); padding: 5px 16px;
  border-radius: 8px; cursor: pointer; font-size: 0.8rem;
  transition: all 0.2s;
}
.btn-menu:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ─── MOBILE CONTROLS ────────────────────────────────────────────────── */
.mobile-controls {
  position: absolute; inset: 0;
  pointer-events: none;
  display: none; /* shown on touch devices by JS */
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px 20px;
}
.joystick-zone {
  pointer-events: all;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.joystick-base {
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.joystick-thumb {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,212,106,0.7);
  border: 2px solid #00D46A;
  pointer-events: none;
  transition: transform 0.05s;
}
.joystick-label { font-size: 0.65rem; color: rgba(255,255,255,0.4); font-weight: 700; letter-spacing: 1px; }
.action-btns {
  pointer-events: all;
  display: flex; flex-direction: column; gap: 12px;
  align-items: flex-end;
}
.action-btn {
  width: 66px; height: 66px; border-radius: 50%;
  border: none; cursor: pointer;
  font-size: 1.2rem; font-weight: 700;
  color: #fff; line-height: 1.2; text-align: center;
  transition: transform 0.1s, opacity 0.1s;
  -webkit-user-select: none;
}
.action-btn:active { transform: scale(0.9); opacity: 0.85; }
.shoot-btn  { background: rgba(0,212,106,0.7); border: 2px solid #00D46A; }
.sprint-btn { background: rgba(255,215,0,0.5);  border: 2px solid #FFD700; font-size: 0.7rem; }

/* ─── SIDEBAR AD ─────────────────────────────────────────────────────── */
.ad-sidebar {
  display: none; /* shown on wider screens */
  min-width: 160px;
}
@media (min-width: 1100px) { .ad-sidebar { display: block; } }

/* ─── BOTTOM AD ─────────────────────────────────────────────────────── */
.ad-bottom-game {
  text-align: center; padding: 12px;
  background: #0a0f14;
  border-top: 1px solid rgba(255,255,255,0.05);
  min-height: 110px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .select-row {
    grid-template-columns: 1fr;
  }
  .select-vs { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 0; }
  .vs-badge { font-size: 1.8rem; }
  .team-selector-grid { grid-template-columns: repeat(4, 1fr); max-height: 220px; }
  .controls-hint { display: none; }
  .mobile-controls { display: flex !important; }
  .ad-top-game { min-height: 60px; }
  .ad-top-game ins { width: 320px !important; height: 50px !important; }
}
