/* modals.css - Modals, Dialogs, Leaderboards, Matchmaking and Menus */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  padding: 16px;
}

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

.modal-card {
  background: rgba(19, 26, 43, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  color: #f8fafc;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.15);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.modal-title {
  font-size: 1.28rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fef3c7, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.15s;
}

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

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  color: #f8fafc;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.avatar-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 12px 2px;
}

.avatar-option {
  font-size: 1.8rem;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.avatar-option.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  transform: scale(1.1);
}

/* Leaderboard Specifics */
.leaderboard-tabs {
  display: flex;
  gap: 6px;
  background: rgba(11, 15, 25, 0.7);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.lb-tab {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.lb-tab.active {
  background: #f59e0b;
  color: #0f172a;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 4px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  transition: background 0.15s;
}

.leaderboard-row.user-row {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
}

.lb-rank {
  width: 28px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #94a3b8;
}

.lb-rank.gold { color: #facc15; }
.lb-rank.silver { color: #cbd5e1; }
.lb-rank.bronze { color: #d97706; }

.lb-avatar {
  font-size: 1.3rem;
  margin-right: 10px;
}

.lb-info {
  flex: 1;
  overflow: hidden;
}

.lb-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-tag {
  font-size: 0.72rem;
  color: #94a3b8;
}

.lb-score {
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: #38bdf8;
}

.lb-wins {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Matchmaking Radar Animation */
.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.radar-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.radar-sweep {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(56, 189, 248, 0.45) 0deg, transparent 90deg, transparent 360deg);
  animation: radarSpin 1.8s linear infinite;
}

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-icon {
  font-size: 2.2rem;
  z-index: 2;
}

.radar-status {
  margin-top: 20px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
}

.radar-timer {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.3);
  transition: transform 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-secondary {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 10px;
}

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

/* Game Over Modal Elements */
.gameover-banner {
  text-align: center;
  padding: 10px 0;
}

.gameover-result {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.gameover-reason {
  color: #94a3b8;
  font-size: 0.92rem;
}

.gameover-score-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
}

.series-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Promotion Modal */
.promotion-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.promo-piece-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.promo-piece-btn:hover {
  border-color: #f59e0b;
  transform: scale(1.08);
}

.promo-piece-btn svg {
  width: 48px;
  height: 48px;
}

/* Themes & Gotiya Selector */
.theme-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.theme-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(245, 158, 11, 0.5);
}

.theme-card.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.theme-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-preview-swatch {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.theme-title-text {
  font-weight: 700;
  font-size: 0.92rem;
  color: #f8fafc;
}

.theme-sub-text {
  font-size: 0.74rem;
  color: #94a3b8;
}

/* Difficulty Selector */
.diff-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.diff-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.diff-card.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.diff-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diff-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 3px;
}

/* Simulated Ad Player Modal */
.ad-player-box {
  background: #020617;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 16px 0;
}

.ad-sponsor-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-video-mock {
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}

.ad-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
}

.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.2s linear;
}

.ad-countdown-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f59e0b;
}

/* Store Bundles */
.store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

.store-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px 14px;
  transition: all 0.15s;
}

.store-item-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: #f59e0b;
}

.store-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-item-icon {
  font-size: 1.8rem;
}

.store-buy-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.store-free-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #f8fafc;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

/* Rematch Notice & Human-like Delay Indicators */
.rematch-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: left;
  animation: fadeInNotice 0.3s ease-out;
}

.rematch-notice.accepted {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.rematch-notice.proactive {
  background: rgba(56, 189, 248, 0.15);
  border: 1px dashed rgba(56, 189, 248, 0.5);
}

.rematch-spinner-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.rematch-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(245, 158, 11, 0.25);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spinRematch 0.85s linear infinite;
}

.rematch-notice.accepted .rematch-spinner {
  border: 3px solid rgba(16, 185, 129, 0.25);
  border-top-color: #10b981;
}

.rematch-notice.proactive .rematch-spinner {
  border: 3px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
}

@keyframes spinRematch {
  to { transform: rotate(360deg); }
}

@keyframes fadeInNotice {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.rematch-text-wrap {
  flex: 1;
  min-width: 0;
}

.rematch-status-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 2px;
}

.rematch-notice.accepted .rematch-status-title {
  color: #34d399;
}

.rematch-notice.proactive .rematch-status-title {
  color: #7dd3fc;
}

.rematch-status-sub {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.btn-primary.waiting-rematch {
  background: linear-gradient(135deg, #334155, #1e293b) !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.9;
}

.btn-primary.accepted-rematch {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35) !important;
}

.btn-primary.pulse-glow {
  animation: pulseGlowBtn 1.5s infinite;
}

@keyframes pulseGlowBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}

/* Settings & Options Drawer Buttons */
.settings-toggle-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.settings-toggle-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #86efac;
}

.settings-action-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.settings-action-btn:hover, .settings-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Glossy Mode Selection Buttons (Screenshot 4 style) */
.mode-glossy-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.mode-glossy-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.mode-glossy-btn:active {
  transform: translateY(1px);
}

.mode-btn-green {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mode-btn-blue {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mode-btn-cyan {
  background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mode-btn-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-btn-label {
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.skill-tier-card.selected {
  border-color: var(--accent-gold) !important;
  background: rgba(245, 158, 11, 0.18) !important;
}



