/* ==========================================================================
   Aquatic Athlete Challenge – Game Section Styles (Cinematic Theme)
   ========================================================================== */

/* 1. Game Section */
.game-section {
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

/* 2. Game Container */
.game-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 217, 255, 0.05);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* 3. Pool Area */
.pool-area {
  height: 220px;
  background: linear-gradient(180deg, #0b5a8a 0%, #073d5f 60%, #052d47 100%);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

[data-theme="light"] .pool-area {
  background: linear-gradient(180deg, #1a8ecf 0%, #0d6f9a 60%, #0a5a7e 100%);
}

.pool-area canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 4. Game HUD */
.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--card-border);
}

.hud-item {
  background: var(--card-bg-solid);
  padding: 0.9rem;
  text-align: center;
}

.hud-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.hud-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.hud-value.score-val {
  color: var(--secondary);
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

.hud-value.timer-val {
  color: #ffab40;
}

/* 5. Underwater Bar */
.uw-bar-wrap {
  background: rgba(0, 217, 255, 0.03);
  border-bottom: 1px solid var(--card-border);
  padding: 0.75rem 1rem;
}

.uw-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.uw-bar-track {
  height: 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .uw-bar-track {
  background: rgba(0, 0, 0, 0.06);
}

.uw-bar-fill {
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #43a047, #66bb6a);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(67, 160, 71, 0.3);
}

.uw-bar-fill.warning {
  background: linear-gradient(90deg, #fdd835, #ffb300);
  box-shadow: 0 0 8px rgba(253, 216, 53, 0.3);
}

.uw-bar-fill.danger {
  background: linear-gradient(90deg, #ff7043, #ef5350);
  box-shadow: 0 0 8px rgba(239, 83, 80, 0.3);
}

.uw-bar-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.uw-bar-mark span {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 6. Game Event */
.game-event {
  padding: 0.65rem 1rem;
  margin: 0.5rem 1rem;
  border-left: 3px solid var(--secondary);
  border-radius: 0 8px 8px 0;
  background: rgba(0, 217, 255, 0.04);
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.3s ease;
}

.game-event.event-info {
  border-left-color: #42a5f5;
  background: rgba(66, 165, 245, 0.06);
}

.game-event.event-warn {
  border-left-color: #ffb300;
  background: rgba(255, 179, 0, 0.06);
}

.game-event.event-danger {
  border-left-color: #ef5350;
  background: rgba(239, 83, 80, 0.06);
}

.game-event.event-gold {
  border-left-color: #fdd835;
  background: rgba(253, 216, 53, 0.06);
}

/* 7. Game Controls */
.game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  gap: 0.75rem;
}

.ctrl-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

/* 8. Game Buttons */
.game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease, opacity 0.2s ease,
              background-color 0.2s ease;
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.game-btn:active {
  transform: translateY(0);
}

.game-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.game-btn.primary {
  background: linear-gradient(135deg, var(--secondary), #00b8d4);
  border: none;
  box-shadow: 0 4px 16px rgba(0, 217, 255, 0.25);
}

.game-btn.primary:hover {
  box-shadow: 0 6px 24px rgba(0, 217, 255, 0.4);
}

.game-btn.surface {
  background: linear-gradient(135deg, #ec407a, #f06292);
  border: none;
  animation: pulse-surface 2s ease-in-out infinite;
  box-shadow: 0 4px 16px rgba(236, 64, 122, 0.25);
}

.game-btn.surface:hover {
  box-shadow: 0 6px 24px rgba(236, 64, 122, 0.4);
}

.game-btn.speed {
  background: linear-gradient(135deg, #d32f2f, #e53935);
  border: none;
}

.game-btn.control {
  background: linear-gradient(135deg, #ef6c00, #f57c00);
  border: none;
}

.game-btn.cautious {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  border: none;
}

.game-btn.reset {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--card-border);
}

.game-btn.reset:hover {
  background: rgba(0, 217, 255, 0.06);
  color: var(--text);
  border-color: rgba(0, 217, 255, 0.2);
}

/* 9. Pulse Animation */
@keyframes pulse-surface {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 64, 122, 0.3); }
  50% { box-shadow: 0 0 0 10px rgba(236, 64, 122, 0); }
}

/* 10. Stroke Info */
.stroke-info {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.7;
  margin-top: 0.15rem;
}

/* 11. Difficulty Select */
.difficulty-select {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0.75rem 0;
}

.diff-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--card-bg-solid);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.diff-btn:first-child { border-radius: 10px 0 0 10px; }
.diff-btn:last-child { border-radius: 0 10px 10px 0; }
.diff-btn + .diff-btn { border-left: none; }

.diff-btn:hover {
  background: rgba(0, 217, 255, 0.06);
  color: var(--text);
}

.diff-btn.active {
  background: linear-gradient(135deg, var(--secondary), #00b8d4);
  color: #fff;
  border-color: var(--secondary);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
}

/* 12. Game Info Panel */
.game-info-panel { padding: 1rem; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.info-box {
  background: rgba(0, 217, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.info-box h4 {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.info-box li {
  padding: 0.15rem 0;
  padding-left: 0.75rem;
  position: relative;
}

.info-box li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--secondary);
  transform: translateY(-50%);
}

/* 13. Game Overlay */
.overlay-card {
  background: var(--card-bg-solid);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 217, 255, 0.1);
  border: 1px solid var(--card-border);
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.overlay-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.overlay-stats {
  margin: 1.25rem 0;
  text-align: left;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-row span:last-child {
  font-weight: 700;
  color: var(--text);
}

.overlay-badges {
  margin: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.fact {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(0, 217, 255, 0.04);
  border-radius: 8px;
  border-left: 3px solid var(--secondary);
  text-align: left;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  margin: 0.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary), #00b8d4);
  box-shadow: 0 4px 16px rgba(0, 217, 255, 0.25);
}

.btn-secondary {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid var(--card-border);
  color: var(--secondary);
}

/* 14. Achievement Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(0, 217, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
}

.badge.gold {
  background: rgba(253, 216, 53, 0.1);
  color: #fdd835;
  border-color: rgba(253, 216, 53, 0.25);
}

.badge.blue {
  background: rgba(66, 165, 245, 0.1);
  color: #42a5f5;
  border-color: rgba(66, 165, 245, 0.25);
}

/* 15. Best Score Bar */
.best-score-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.6rem 1rem;
  background: rgba(0, 217, 255, 0.03);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--card-border);
}

.best-score-bar strong {
  color: var(--secondary);
  font-weight: 700;
}

/* 16. Keyboard Hint */
.kb-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.4rem 1rem;
  opacity: 0.7;
}

.kb-hint kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  font-family: inherit;
  background: rgba(0, 217, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  color: var(--text);
  margin: 0 0.1rem;
  line-height: 1.4;
}
