/* style.css - Keepy-ups V6 Premium Football Arcade Styles */
/* Palette: Black/White base, Teal #1ABC9C, Purple #6B00DB, Gold #F7B613 */
/* Headings: Poppins (with system sans fallback), Body: Montserrat (with Arial fallback) */

:root {
  --bg-color: #0b0e14;
  --panel-bg: rgba(18, 24, 38, 0.92);
  --panel-border: rgba(255, 255, 255, 0.12);
  --card-bg: rgba(255, 255, 255, 0.05);
  
  --text-main: #f5f7fa;
  --text-muted: #9aa5b8;
  
  --teal: #1ABC9C;
  --purple: #6B00DB;
  --gold: #F7B613;
  --red: #e74c3c;
  
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
  --font-body: 'Montserrat', Arial, sans-serif;
  
  --min-touch-target: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100vw;
  max-width: 540px;
  height: 100vh;
  max-height: 960px;
  background: radial-gradient(circle at 50% 30%, #162032 0%, #080c14 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Canvas fills container */
#pitch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
}

/* Top HUD */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.85) 0%, rgba(8, 12, 20, 0) 100%);
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-badge {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-badge.gold-accent {
  border-color: rgba(247, 182, 19, 0.4);
}

.hud-badge.teal-accent {
  border-color: rgba(26, 188, 156, 0.4);
}

.hud-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
}

.hud-value {
  font-size: 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.multiplier-pill {
  color: var(--gold);
  background: rgba(247, 182, 19, 0.15);
  border: 1px solid var(--gold);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  margin-left: 6px;
  display: inline-block;
}

/* HUD Controls */
.hud-btn {
  pointer-events: auto;
  min-width: var(--min-touch-target);
  min-height: var(--min-touch-target);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hud-btn:active {
  transform: scale(0.96);
}

/* Modals & Screens */
.screen-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.screen-layer.hidden {
  display: none !important;
}

/* Modal Cards */
.menu-card {
  width: 100%;
  max-width: 440px;
  background: rgba(25, 33, 48, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.title-tagline {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--teal);
  font-weight: 700;
}

h1.game-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-top: 4px;
}

h1.game-title span {
  color: var(--gold);
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Mode Selection Grid */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

/* Sections for Missions & Recent Runs */
.section-title {
  font-size: 11px;
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  margin-bottom: 6px;
}

.missions-section, .recent-section {
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
}

.missions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  text-align: left;
}

.mission-row.completed {
  border-color: rgba(247, 182, 19, 0.4);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
}

/* Countdown Overlay */
.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
}

.countdown-overlay.hidden {
  display: none;
}

.countdown-number {
  font-family: var(--font-heading);
  font-size: 72px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  animation: pulseCountdown 0.8s ease-in-out infinite;
}

@keyframes pulseCountdown {
  0% { transform: scale(0.6); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.0); opacity: 0.9; }
}

.mode-btn {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  min-height: var(--min-touch-target);
  transition: border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--teal);
}

.mode-btn.selected {
  border-color: var(--teal);
  background: rgba(26, 188, 156, 0.12);
}

.mode-header {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mode-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mode-best {
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 6px;
}

/* Primary Action Buttons */
.btn-primary {
  min-height: var(--min-touch-target);
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--teal) 0%, #149174 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 188, 156, 0.35);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

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

.btn-secondary {
  min-height: var(--min-touch-target);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row > * {
  flex: 1;
}

/* Ball Locker / Customisation */
.locker-section {
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.locker-title {
  font-size: 11px;
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.skins-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.skin-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  min-width: 72px;
  transition: border-color 0.15s ease;
}

.skin-item.active {
  border-color: var(--gold);
}

.skin-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.skin-preview {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.skin-name {
  font-size: 9px;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

/* Result Screen Specifics */
.result-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.stat-box-val {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.stat-box-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.copy-feedback {
  font-size: 12px;
  color: var(--teal);
  min-height: 18px;
  margin-top: 4px;
}

/* Instructions / Footer Bar */
.bottom-instructions {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-heading);
  pointer-events: none;
  z-index: 5;
}

/* Floating Kick Feedback Toast */
.strike-toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  z-index: 15;
  transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.4s ease;
}

/* Accessibility settings toggle bar */
.settings-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: var(--min-touch-target);
}

.switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

/* Reduced motion media query */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
