/* ==========================================================================
   ONE SHOT - MODAL, SUMMARY & VICTORY STYLES
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 12, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.92) translateY(20px);
  transition: all var(--transition-smooth);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Stats Cards Grid */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Puzzle Progress Rows */
.puzzle-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.puzzle-breakdown-row {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.breakdown-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.tier-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
}
.tier-pill.easy { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.tier-pill.medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.tier-pill.hard { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.breakdown-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Interactive Graph Action Section */
.graph-cta-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.graph-cta-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.graph-btn-group {
  display: flex;
  gap: 8px;
}

.graph-trigger-btn {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: var(--border-radius-md);
  padding: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.graph-trigger-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
}

/* Action Buttons */
.modal-actions {
  display: flex;
  gap: 10px;
}

.primary-btn {
  flex: 1;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: all var(--transition-fast);
}

.primary-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.secondary-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--border-radius-md);
  padding: 12px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.secondary-btn:hover {
  background: var(--bg-elevated);
  color: #fff;
}

.danger-btn {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
  border-radius: var(--border-radius-md);
  padding: 12px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.danger-btn:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.modal-card-sm {
  max-width: 380px !important;
}

/* ==========================================================================
   TUTORIAL / HOW TO PLAY VISUAL STYLES
   ========================================================================== */
.tutorial-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tutorial-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tutorial-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-tile-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 6px 0;
}

.mini-tile {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 17px;
  border-radius: 6px;
  user-select: none;
}

.mini-tile.green {
  background: #064e3b;
  border: 2px solid #10b981;
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.mini-tile.yellow {
  background: #451a03;
  border: 2px solid #f59e0b;
  color: #fcd34d;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.mini-tile.grey {
  background: #18181b;
  border: 2px solid #3f3f46;
  color: #71717a;
}

.mini-tile.input {
  background: rgba(30, 27, 75, 0.85);
  border: 2px solid #6366f1;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.tutorial-legend-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.legend-dot.green { background: #10b981; box-shadow: 0 0 6px #10b981; }
.legend-dot.yellow { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.legend-dot.grey { background: #71717a; }

.tutorial-progression-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin: 4px 0;
}

.prog-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.prog-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prog-pill.unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.prog-pill.locked {
  background: rgba(63, 63, 70, 0.35);
  color: #a1a1aa;
  border: 1px solid rgba(63, 63, 70, 0.6);
}

.prog-arrow {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

/* Confetti Canvas Container */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

/* ==========================================================================
   ARCHIVE CALENDAR MODAL STYLES (SQORDY DESIGN ALIGNMENT)
   ========================================================================== */
.calendar-popup-container {
  max-width: 440px;
}

.cal-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 10px;
  margin-bottom: 16px;
  text-align: center;
}

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

.cal-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.cal-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.cal-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 12px;
}

.cal-nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.cal-nav-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.cal-month-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.cal-day {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  padding: 0;
}

.cal-day.empty {
  visibility: hidden;
  pointer-events: none;
}

.cal-day:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  transform: scale(1.06);
}

.cal-day.won {
  background: #10b981 !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.cal-day.lost {
  background: #ef4444 !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.cal-day.in-progress {
  background: rgba(245, 158, 11, 0.2) !important;
  border: 1.5px solid #f59e0b !important;
  color: #fcd34d !important;
}

.cal-day.today {
  outline: 2px solid #f59e0b !important;
  outline-offset: 1px;
}

.cal-day.selected {
  box-shadow: 0 0 0 2px #6366f1 !important;
}

.cal-day-num {
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.cal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.cal-dot-won { background: #1b9e3e; }
.cal-dot-lost { background: #c9302c; }
.cal-dot-avail { background: #2b2b2b; border: 1px solid #383838; }
.cal-dot-today { background: #242424; border: 2px solid #EAAB3D; }

/* ==========================================================================
   DATA MANAGEMENT & BACKUP STYLES (GDPR COMPLIANCE)
   ========================================================================== */
.data-management-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 14px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.data-management-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.data-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-data-action {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-data-action:hover {
  background: var(--bg-elevated);
  border-color: #6366f1;
  transform: translateY(-1px);
}

.btn-data-danger {
  background: rgba(201, 48, 44, 0.15);
  border: 1px solid rgba(201, 48, 44, 0.4);
  color: #fca5a5;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-data-danger:hover {
  background: rgba(201, 48, 44, 0.3);
  border-color: #c9302c;
  color: #ffffff;
}
