/* ==========================================================================
   Play Page / Match Setup Modal Styles (Dynamic Container-Relative Scaling)
   ========================================================================== */

/* ==========================================================================
   Section 1: Overlay & Backdrop Components
   Provides full-viewport dynamic container overlay coverage and backdrop settings.
   ========================================================================== */

.play-modal-overlay {
  /* Positioning */
  position: absolute;
  inset: 0;
  z-index: 100;

  /* Display / Flexbox */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Box Model - Container Query Width (cqw) relative padding */
  padding: 3.5cqw;
}

.play-modal-overlay.hidden,
.play-modal-overlay[hidden] {
  /* Display / Visibility override */
  display: none !important;

  /* Effects */
  opacity: 0;
  pointer-events: none;
}

.play-modal-backdrop {
  /* Positioning */
  position: absolute;
  inset: 0;

  /* Backgrounds & Borders */
  background-color: transparent;

  /* Effects - Disable default backdrop filter */
  backdrop-filter: none;
}

/* ==========================================================================
   Section 2: Card Container
   Central card structure with golden borders, deep background, and container scaling.
   ========================================================================== */

.match-setup-card {
  /* Positioning */
  position: relative;
  z-index: 101;

  /* Display / Flexbox */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4.2cqw; /* Dynamic vertical gap between modal elements */

  /* Box Model - Container Query relative dimensions */
  width: 85%;
  max-width: 85cqw;
  min-height: 55%;
  padding: 5.3cqw 4.4cqw 4.4cqw;

  /* Backgrounds & Borders */
  background-color: #160d08;
  border: 0.44cqw solid var(--border-gold, #c89d38);
  border-radius: 2.7cqw;

  /* Effects - Dual ambient box-shadow layering for depth and glow */
  box-shadow: 0 1.8cqw 5.3cqw rgba(0, 0, 0, 0.9), 0 0 2.7cqw rgba(200, 157, 56, 0.2);
}

/* ==========================================================================
   Section 3: Modal Close Controls
   Circular dismiss button placed at the top-right corner of the setup card.
   ========================================================================== */

/* Close Button - Scaled +10% */
.match-setup-card .setup-close-btn,
.match-setup-card .modal-close-btn {
  /* Positioning - Fixed to top-right corner of card */
  position: absolute;
  top: 2cqw;
  right: 2cqw;
  z-index: 102;

  /* Display / Flexbox */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Box Model - Dynamic circular dimensions */
  width: 5.72cqw;
  height: 5.72cqw;

  /* Typography */
  color: #ffffff;
  font-size: 3.52cqw;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;

  /* Backgrounds & Borders - Radial gradient overlay with gold border */
  background: radial-gradient(circle, #e74c3c 0%, #c0392b 100%);
  border: 0.39cqw solid #f3d078;
  border-radius: 50%;

  /* Effects & Transitions */
  box-shadow: 0 0.55cqw 1.32cqw rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, filter 0.15s ease;
}

/* State Transition: Close Button Hover */
.match-setup-card .setup-close-btn:hover,
.match-setup-card .modal-close-btn:hover {
  /* Effects - Scale expansion and brightness elevation */
  transform: scale(1.1);
  filter: brightness(1.15);
}

/* ==========================================================================
   Section 4: Typography & Headings
   Typography hierarchy for main title, section headings, and field labels.
   ========================================================================== */

/* Main Header */
.setup-title {
  /* Box Model */
  margin: 0;

  /* Typography - Cinzel serif styling with dynamic size */
  font-family: 'Cinzel', serif;
  font-size: 4.5cqw;
  font-weight: 700;
  color: var(--text-gold, #e2b755);
  text-align: center;
  letter-spacing: 0.08em;
}

/* Strategy Section Header */
.setup-section-label {
  /* Box Model */
  margin: 0 0 1.8cqw 0;

  /* Typography */
  font-family: 'Cinzel', serif;
  font-size: 2.84cqw;
  font-weight: 600;
  color: var(--border-gold-light, #f3d078);
  text-align: center;
  letter-spacing: 0.05em;
}

.section-label {
  /* Typography */
  font-family: 'Inter', sans-serif;
  font-size: 2.84cqw;
  font-weight: 800;
  color: var(--text-gold, #e2b755);
  letter-spacing: 0.05em;
}

.checkbox-label {
  /* Typography */
  font-family: 'Inter', sans-serif;
  font-size: 3cqw;
  font-weight: 800;
  color: var(--text-gold, #e2b755);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Section 5: Checkboxes & Custom Inputs
   Custom styled checkbox controls, checkmark pseudoelements, and checked states.
   ========================================================================== */

/* Checkbox Row */
.setup-row {
  /* Display / Flexbox */
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-checkbox-container {
  /* Display / Flexbox */
  display: inline-flex;
  align-items: center;
  gap: 2.1cqw;

  /* Typography / Interactive */
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-container input {
  /* Hide native HTML input element */
  display: none;
}

.checkmark {
  /* Positioning */
  position: relative;

  /* Box Model */
  width: 4cqw;
  height: 4cqw;

  /* Backgrounds & Borders */
  background-color: #0d0704;
  border: 0.44cqw solid var(--border-gold-light, #f3d078);
  border-radius: 0.9cqw;

  /* Transitions */
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* State Transition: Checked Checkmark Box */
.custom-checkbox-container input:checked ~ .checkmark {
  /* Background fill on active state */
  background-color: var(--border-gold, #c89d38);
}

/* Pseudo-element: Checked Checkmark Icon */
.custom-checkbox-container input:checked ~ .checkmark::after {
  /* Content & Positioning */
  content: '';
  position: absolute;
  top: 0.2cqw;
  left: 1.1cqw;

  /* Box Model */
  width: 0.9cqw;
  height: 2cqw;

  /* Borders - Construct checkmark shape via right and bottom borders */
  border: solid #120a06;
  border-width: 0 0.55cqw 0.55cqw 0;

  /* Effects - Rotate 45deg to render check mark */
  transform: rotate(45deg);
}

/* ==========================================================================
   Section 6: Strategy Toggles & Button Variants
   AI strategy selection wrappers, segmented toggles, and state variants.
   ========================================================================== */

/* AI Deck Strategy Section */
.setup-section {
  /* Display / Flexbox */
  display: flex;
  flex-direction: column;
  gap: 1.8cqw;

  /* Box Model */
  width: 100%;
}

/* Strategy Toggle Group */
.strategy-toggle-group {
  /* Display / Flexbox */
  display: flex;
  justify-content: space-between;
  gap: 1.8cqw;

  /* Box Model */
  width: 100%;
}

.strategy-btn {
  /* Display / Flexbox */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4cqw;

  /* Box Model */
  padding: 2.3cqw 1.8cqw;

  /* Typography */
  font-family: 'Inter', sans-serif;
  font-size: 2.84cqw;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;

  /* Backgrounds & Borders */
  border: 0.22cqw solid rgba(255, 255, 255, 0.15);
  border-radius: 1.3cqw;

  /* Transitions */
  transition: all 0.2s ease;
}

/* Active Green Toggle Button */
.strategy-btn.active-green {
  /* Typography */
  color: #ffffff;

  /* Backgrounds & Borders - Emerald linear gradient */
  background: linear-gradient(180deg, #10b981 0%, #047857 100%);
  border-color: #34d399;

  /* Effects - Green glow shadow layering */
  box-shadow: 0 0 2.7cqw rgba(16, 185, 129, 0.5);
}

/* Gold Toggle Button */
.strategy-btn.gold-btn {
  /* Typography */
  color: #1a0f0a;

  /* Backgrounds & Borders - Gold linear gradient */
  background: linear-gradient(180deg, #f3d078 0%, #c89d38 100%);
  border-color: #ffe6a3;

  /* Effects - Subtle elevation shadow */
  box-shadow: 0 0.44cqw 1.3cqw rgba(0, 0, 0, 0.4);
}

/* State Transition: Strategy Button Hover */
.strategy-btn:hover {
  /* Effects - Elevation and brightness boost */
  filter: brightness(1.1);
  transform: translateY(-0.22cqw);
}

.btn-strategy {
  /* Display / Flexbox */
  flex: 1;

  /* Box Model */
  padding: 2.1cqw 1.4cqw;

  /* Typography */
  font-family: 'Inter', sans-serif;
  font-size: 2.66cqw;
  font-weight: 700;
  color: #a88238;
  text-align: center;
  cursor: pointer;

  /* Backgrounds & Borders */
  background-color: #0f0805;
  border: 0.22cqw solid var(--border-gold, #c89d38);
  border-radius: 1.3cqw;

  /* Transitions */
  transition: all 0.2s ease;
}

/* State Transition: Strategy Button Hover */
.btn-strategy:hover {
  /* Typography & Background */
  color: #e2b755;
  background-color: #2c1a12;
}

/* State Transition: Active Strategy Selected */
.btn-strategy.active {
  /* Typography */
  color: #1a0f0a;

  /* Backgrounds & Borders */
  background-color: #c89d38;
  border-color: #f3d078;

  /* Effects - Ambient gold box-shadow glow */
  box-shadow: 0 0 1.8cqw rgba(200, 157, 56, 0.4);
}

/* ==========================================================================
   Section 7: Primary Action Buttons
   Main call-to-action buttons including Play Action and Start Battle controls.
   ========================================================================== */

/* Bottom Action PLAY Button */
.btn-play-action {
  /* Box Model */
  width: 100%;
  margin-top: 0.9cqw;
  padding: 3cqw;

  /* Typography */
  color: #ffffff;
  font-family: 'Cinzel', 'MedievalSharp', serif;
  font-size: 4.4cqw;
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;

  /* Backgrounds & Borders - Green action gradient */
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border: 0.33cqw solid #34d399;
  border-radius: 1.8cqw;

  /* Effects & Transitions - Action glow shadow */
  box-shadow: 0 0.9cqw 3.1cqw rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

/* State Transition: Play Button Hover */
.btn-play-action:hover {
  /* Effects - Increased shadow glow and upward translation */
  filter: brightness(1.15);
  transform: translateY(-0.22cqw);
  box-shadow: 0 1.3cqw 4cqw rgba(16, 185, 129, 0.6);
}

/* Action Area Container */
.setup-actions {
  /* Display / Flexbox */
  display: flex;
  justify-content: center;

  /* Box Model */
  width: 100%;
  margin-top: 0.9cqw;
}

/* START BATTLE Button */
.btn-start-battle {
  /* Box Model */
  width: 100%;
  padding: 2.7cqw 3.5cqw;

  /* Typography */
  color: #1a0f0a;
  font-family: 'Cinzel', serif;
  font-size: 3.5cqw;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;

  /* Backgrounds & Borders - Gold linear gradient */
  background: linear-gradient(180deg, #f3d078 0%, #c89d38 100%);
  border: 0.22cqw solid #f3d078;
  border-radius: 1.3cqw;

  /* Transitions */
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

/* State Transition: Start Battle Hover */
.btn-start-battle:hover {
  /* Effects */
  transform: translateY(-0.22cqw);
  box-shadow: 0 0.9cqw 2.7cqw rgba(243, 208, 120, 0.35);
}

/* State Transition: Start Battle Active Click */
.btn-start-battle:active {
  /* Effects - Reset translation on press */
  transform: translateY(0);
}