/* ==========================================================================
   BUCKETS & BOMBS - UNIFIED GAME SHELL STYLESHEET
   Consistent arcade navigation, control bars, modals, scoreboard, and touch D-pads
   ========================================================================== */

:root {
  --shell-nav-h: 68px;
}

/* Base Game Body */
.game-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   TOP GAME NAVBAR
   ========================================================================== */
.game-top-bar {
  height: var(--shell-nav-h);
  background: rgba(14, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}

.game-top-container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.game-nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-game-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-game-back:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--gold-accent);
  color: var(--gold-accent);
  transform: translateX(-2px);
}

.game-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1.2px;
  color: #FFF;
}

.game-header-icon {
  font-size: 1.5rem;
}

.game-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-game-action {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 1px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #FFF;
}

.btn-game-action:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-action-restart {
  background: rgba(255, 107, 0, 0.15);
  border-color: rgba(255, 107, 0, 0.4);
  color: var(--hoop-orange);
}

.btn-action-restart:hover {
  background: var(--hoop-orange);
  color: #000;
  font-weight: 700;
}

.btn-action-help {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.35);
  color: var(--electric-blue);
}

.btn-action-help:hover {
  background: var(--electric-blue);
  color: #000;
}

/* ==========================================================================
   MAIN GAME STAGE WRAPPER
   ========================================================================== */
.game-stage-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Scoreboard Bar */
.game-scoreboard-bar {
  width: 100%;
  max-width: 860px;
  background: #0B0F17;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-pill-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-pill-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: #FFF;
  line-height: 1.1;
}

.stat-val-green { color: var(--turf-green); }
.stat-val-orange { color: var(--hoop-orange); }
.stat-val-gold { color: var(--gold-accent); }
.stat-val-blue { color: var(--electric-blue); }

/* Main Game Canvas or Board Unit */
.game-viewport-card {
  width: 100%;
  max-width: 860px;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Interactive Canvas Standard Container */
.canvas-aspect-container {
  width: 100%;
  position: relative;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  touch-action: none;
}

/* Status Commentary Banner */
.game-commentary-strip {
  width: 100%;
  background: #0A0E17;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.commentary-highlight {
  font-weight: 700;
  color: #FFF;
}

/* Controls Hint Bar */
.game-controls-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.key-badge {
  background: #1C273B;
  border: 1px solid #364966;
  border-bottom: 2px solid #364966;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold-accent);
}

/* ==========================================================================
   MOBILE TOUCH CONTROLS (VIRTUAL D-PAD & ACTION BUTTONS)
   ========================================================================== */
.mobile-touch-bar {
  display: none;
  width: 100%;
  max-width: 500px;
  margin: 1.25rem auto 0;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

@media (pointer: coarse), (max-width: 820px) {
  .mobile-touch-bar {
    display: flex;
  }
}

.virtual-dpad {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 4px;
  touch-action: manipulation;
}

.dpad-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  color: #FFF;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.dpad-btn:active, .dpad-btn.active {
  background: var(--gold-accent);
  color: #000;
  border-color: #FFF;
  transform: scale(0.92);
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

.virtual-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-v-action {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #FFF;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-v-a {
  background: var(--turf-green);
  color: #000;
  font-weight: 900;
}

.btn-v-b {
  background: var(--hoop-orange);
  color: #FFF;
  font-weight: 900;
}

.btn-v-action:active {
  transform: scale(0.9);
}

/* ==========================================================================
   MODALS: INSTRUCTIONS & GAME OVER / VICTORY
   ========================================================================== */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.88);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.game-modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.game-modal-card {
  background: #0E1522;
  border: 2px solid var(--gold-accent);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 215, 0, 0.2);
  text-align: center;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-icon-badge {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: bounceMini 1s infinite alternate;
}

@keyframes bounceMini {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 1.5px;
  color: #FFF;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-instructions-body {
  text-align: left;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-instructions-body h4 {
  font-family: var(--font-display);
  color: var(--gold-accent);
  font-size: 1.2rem;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.modal-instructions-body ul {
  padding-left: 1.25rem;
  margin-bottom: 0.8rem;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.modal-stat-box {
  display: flex;
  flex-direction: column;
}

.modal-stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.modal-stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-accent);
}

.modal-funny-comment {
  font-style: italic;
  color: #FFF;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  padding: 0.75rem;
  background: rgba(255, 215, 0, 0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold-accent);
}

.modal-action-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-modal-primary {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 1px;
  background: var(--gold-accent);
  color: #000;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 900;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-modal-primary:hover {
  background: #FFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-modal-secondary {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-modal-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

/* Confetti overlay for victories */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
}
