/* =====================================================
   Soccer PK Game - Styles
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: radial-gradient(ellipse at center, #0d1b2a 0%, #050d14 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  color: #fff;
  overflow-x: hidden;
  padding: 10px;
}

/* ── Header ── */
.game-header {
  text-align: center;
  margin-bottom: 8px;
  animation: fadeIn 0.8s ease;
}

.game-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(255, 200, 0, 0.5));
}

.game-subtitle {
  font-size: 0.85rem;
  color: rgba(200, 220, 255, 0.7);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Canvas Container ── */
.canvas-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(255, 215, 0, 0.3),
    0 0 40px rgba(0, 80, 200, 0.4),
    0 20px 60px rgba(0, 0, 0, 0.6);
}

#gameCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  background: #0a1628;
}

/* ── Aim Instruction ── */
#aimInstruction {
  display: none;
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  color: #ffd700;
  white-space: nowrap;
  pointer-events: none;
  animation: pulse 1s ease-in-out infinite;
  text-align: center;
  z-index: 10;
}

/* ── Result Text ── */
#resultText {
  display: none;
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 8px;
  text-align: center;
  pointer-events: none;
  animation: resultPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  text-shadow: 0 0 30px currentColor, 0 4px 20px rgba(0,0,0,0.8);
  z-index: 20;
}

/* ── Start Screen ── */
#startScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,20,60,0.95) 0%, rgba(0,5,20,0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 12px;
  animation: fadeIn 0.5s ease;
}

.start-logo {
  font-size: 5rem;
  margin-bottom: 10px;
  animation: bounce 2s ease-in-out infinite;
}

.start-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.start-subtitle {
  font-size: 0.9rem;
  color: rgba(180, 200, 255, 0.7);
  letter-spacing: 4px;
  margin-bottom: 30px;
}

.start-instructions {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 16px 24px;
  margin-bottom: 28px;
  max-width: 420px;
  text-align: left;
  font-size: 13px;
  color: rgba(200, 220, 255, 0.85);
  line-height: 1.8;
}

.start-instructions h3 {
  color: #ffd700;
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.start-instructions li {
  list-style: none;
  padding-left: 4px;
}

.start-instructions li::before {
  content: '▶ ';
  color: #ffd700;
  font-size: 10px;
}

.btn-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #111;
  border: none;
  border-radius: 30px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(255, 180, 0, 0.4);
  text-transform: uppercase;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 30px rgba(255, 180, 0, 0.6);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: #ffd700;
  border: 2px solid #ffd700;
  border-radius: 30px;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.btn-secondary:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

/* ── Game Over Screen ── */
#gameOverScreen {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,10,40,0.96) 0%, rgba(0,0,10,0.98) 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 12px;
  animation: fadeIn 0.6s ease;
}

.gameover-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffd700;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

#finalScore {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 10px 0;
}

#finalMsg {
  font-size: 1.3rem;
  color: rgba(200,220,255,0.9);
  margin-bottom: 20px;
}

#resultIcons {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

#resultIcons span {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  animation: fadeIn 0.3s ease forwards;
}

.res-goal { border-color: rgba(255,215,0,0.6) !important; background: rgba(255,215,0,0.1) !important; }
.res-save { border-color: rgba(79,195,247,0.6) !important; background: rgba(79,195,247,0.1) !important; }
.res-miss { border-color: rgba(255,107,53,0.5) !important; background: rgba(255,107,53,0.08) !important; }

/* ── Controls hint ── */
.controls-hint {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(150, 180, 255, 0.6);
  flex-wrap: wrap;
  justify-content: center;
}

.controls-hint span {
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: monospace;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes resultPop {
  0% { transform: translateX(-50%) scale(0.3) rotate(-5deg); opacity: 0; }
  60% { transform: translateX(-50%) scale(1.15) rotate(2deg); opacity: 1; }
  80% { transform: translateX(-50%) scale(0.95) rotate(-1deg); }
  100% { transform: translateX(-50%) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.03); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ── Responsive ── */
@media (max-width: 820px) {
  body { padding: 6px; }
  .game-title { font-size: 1.4rem; }
  .game-subtitle { font-size: 0.75rem; }
  #resultText { font-size: 2.5rem; }
  .start-title { font-size: 1.6rem; }
}
