/* ============================================
   VALORANT LINEUPS - Main Stylesheet
   Design: Dark tactical UI with red/white accents
   Font: Rajdhani (display), Inter (body)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --val-red: #FF4655;
  --val-red-dark: #c8001e;
  --val-red-glow: rgba(255, 70, 85, 0.3);
  --val-white: #ECE8E1;
  --val-off-white: #C4C2BC;
  --val-dark: #0F1923;
  --val-dark-mid: #1A242D;
  --val-dark-panel: #111C25;
  --val-dark-card: #162029;
  --val-border: rgba(255, 70, 85, 0.2);
  --val-border-subtle: rgba(255, 255, 255, 0.06);
  --val-accent: #FF9600;
  --val-cyan: #00C6FF;
  --radius-sm: 2px;
  --radius-md: 4px;
  --transition: 0.15s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--val-dark);
  color: var(--val-white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--val-dark); }
::-webkit-scrollbar-thumb { background: var(--val-red-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--val-red); }

/* ── Typography ── */
.font-display { font-family: 'Rajdhani', sans-serif; }

h1, h2, h3 { font-family: 'Rajdhani', sans-serif; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── Loading Screen ── */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--val-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out { opacity: 0; visibility: hidden; }

.loading-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 3rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--val-white);
}

.loading-logo span { color: var(--val-red); }

.loading-bar-container {
  width: 280px; height: 2px;
  background: rgba(255,255,255,0.1);
  margin-top: 32px; position: relative; overflow: hidden;
}

.loading-bar {
  height: 100%; background: var(--val-red);
  width: 0%; animation: loadBar 1.8s ease forwards;
  box-shadow: 0 0 12px var(--val-red);
}

@keyframes loadBar {
  0% { width: 0%; }
  60% { width: 80%; }
  100% { width: 100%; }
}

/* ── Nav Header ── */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 60px;
  background: rgba(15,25,35,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--val-border);
  display: flex; align-items: center; padding: 0 24px;
  gap: 24px;
}

.nav-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--val-white); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}

.nav-logo .dot { color: var(--val-red); }

.nav-sep {
  width: 1px; height: 24px;
  background: var(--val-border-subtle);
}

.nav-map-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--val-off-white);
}

.nav-map-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--val-red);
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ── Buttons ── */
.btn {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  border: none; cursor: pointer;
  padding: 10px 20px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
}

.btn-primary {
  background: var(--val-red);
  color: #fff;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.btn-primary:hover {
  background: #ff5f6d;
  box-shadow: 0 0 20px var(--val-red-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--val-white);
  border: 1px solid var(--val-border);
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}

.btn-secondary:hover {
  border-color: var(--val-red);
  color: var(--val-red);
  background: var(--val-red-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--val-off-white);
  padding: 6px 12px;
}

.btn-ghost:hover { color: var(--val-white); background: rgba(255,255,255,0.05); }

.btn-danger {
  background: rgba(255,70,85,0.15);
  color: var(--val-red);
  border: 1px solid var(--val-red-dark);
}

.btn-danger:hover { background: var(--val-red); color: #fff; }

/* ── VIEW: Map Select ── */
#view-maps {
  min-height: 100vh; padding-top: 60px;
}

.maps-hero {
  padding: 80px 60px 40px;
  position: relative;
}

.maps-hero-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--val-red); margin-bottom: 12px;
}

.maps-hero-title {
  font-size: 4rem; font-weight: 700;
  line-height: 0.9; letter-spacing: 0.05em;
  text-transform: uppercase;
}

.maps-hero-title span { color: var(--val-red); }

.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px;
  padding: 40px 60px 60px;
}

.map-card {
  position: relative; height: 220px;
  overflow: hidden; cursor: pointer;
  transition: transform 0.3s ease;
  border: 1px solid transparent;
}

.map-card::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(15,25,35,0.9) 0%, rgba(15,25,35,0.1) 60%);
  transition: opacity 0.3s ease;
}

.map-card:hover::before { opacity: 0.6; }
.map-card:hover { transform: scale(1.01); border-color: var(--val-red); }

.map-card-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease; filter: brightness(0.7);
}

.map-card:hover .map-card-img { transform: scale(1.06); filter: brightness(0.85); }

.map-card-info {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 20px 24px;
}

.map-card-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  line-height: 1;
}

.map-card-coords {
  font-size: 0.7rem; letter-spacing: 0.2em;
  color: var(--val-off-white); margin-top: 4px;
  text-transform: uppercase;
}

.map-card-arrow {
  position: absolute; top: 50%; right: 20px;
  transform: translateY(-50%) translateX(10px);
  opacity: 0; transition: all 0.3s ease;
  color: var(--val-red); font-size: 1.5rem; z-index: 2;
}

.map-card:hover .map-card-arrow { opacity: 1; transform: translateY(-50%) translateX(0); }

.map-card-count {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  background: var(--val-red); color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
}

/* ── VIEW: Lineup Editor ── */
#view-lineup {
  display: none; padding-top: 60px;
  min-height: 100vh;
}

#view-lineup.active { display: flex; }

.lineup-layout {
  display: flex; width: 100%;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 200px; min-width: 200px; max-width: 200px;
  background: var(--val-dark-panel);
  border-right: 1px solid var(--val-border-subtle);
  display: flex; flex-direction: column;
  overflow: hidden;
  height: 100%;
  position: relative;
}

.sidebar-header {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--val-border-subtle);
}

.sidebar-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--val-red); margin-bottom: 8px;
}

/* Sort tabs */
.sort-tabs {
  display: flex; gap: 2px;
  background: rgba(0,0,0,0.3);
  padding: 3px; border-radius: 3px;
}

.sort-tab {
  flex: 1; padding: 5px 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: transparent; border: none;
  color: var(--val-off-white); cursor: pointer;
  transition: all var(--transition);
  border-radius: 2px;
}

.sort-tab.active {
  background: var(--val-red);
  color: #fff;
  box-shadow: 0 0 8px var(--val-red-glow);
}

.sort-tab:not(.active):hover { color: var(--val-white); background: rgba(255,255,255,0.05); }

/* Tags filter */
.tags-filter {
  padding: 6px 8px;
  border-bottom: 1px solid var(--val-border-subtle);
  display: flex; flex-wrap: wrap; gap: 3px;
}

.tag-pill {
  padding: 3px 7px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--val-border);
  color: var(--val-off-white); cursor: pointer;
  background: transparent;
  transition: all var(--transition);
  border-radius: 2px;
}

.tag-pill:hover { border-color: var(--val-red); color: var(--val-white); }
.tag-pill.active { background: var(--val-red); border-color: var(--val-red); color: #fff; }

/* Sidebar list items */
.sidebar-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 4px 0;
}

.sidebar-section-label {
  padding: 10px 8px 3px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  display: flex; align-items: center; gap: 6px;
}
.sidebar-section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: rgba(255,255,255,0.06);
}

.agent-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px; cursor: pointer;
  transition: background var(--transition);
  border-left: 2px solid transparent;
}

.agent-item:hover { background: rgba(255,255,255,0.04); }
.agent-item.active { background: rgba(255,70,85,0.08); border-left-color: var(--val-red); }

.agent-item-icon {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--val-dark-mid);
  border: 1px solid var(--val-border-subtle);
}

.agent-item-info { flex: 1; min-width: 0; }

.agent-item-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1;
}

.agent-item-role {
  font-size: 0.6rem; letter-spacing: 0.1em;
  color: var(--val-off-white); margin-top: 2px;
  text-transform: uppercase;
}

.agent-item-count {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  color: var(--val-red);
}

/* Abilities sub-list */
.abilities-list {
  padding: 1px 0 1px 34px;
  display: none;
  border-bottom: 1px solid var(--val-border-subtle);
}

.abilities-list.open { display: block; }

.ability-item {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 0; cursor: pointer;
  transition: all var(--transition);
  border-radius: 2px;
}

.ability-item:hover { background: rgba(255,255,255,0.04); }
.ability-item.active { background: rgba(255,70,85,0.08); }

.ability-item-icon {
  width: 22px; height: 22px;
  object-fit: contain; flex-shrink: 0;
  filter: brightness(0.8);
}

.ability-item.active .ability-item-icon { filter: brightness(1.2) drop-shadow(0 0 4px var(--val-red)); }

.ability-slot {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--val-dark);
  padding: 1px 5px;
  color: var(--val-off-white);
  border-radius: 2px;
}

.ability-name {
  font-size: 0.78rem; letter-spacing: 0.05em;
  text-transform: uppercase; font-weight: 500;
  font-family: 'Rajdhani', sans-serif;
}

/* Location item */
.location-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer;
  transition: background var(--transition);
  border-left: 2px solid transparent;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}

.location-item:hover { background: rgba(255,255,255,0.04); }
.location-item.active { background: rgba(255,70,85,0.08); border-left-color: var(--val-red); }

.location-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--val-red); flex-shrink: 0;
}

/* ── Main content (minimap area) ── */
.main-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  height: 100%;
}

/* Map header banner */
.map-banner {
  height: 130px; position: relative; overflow: hidden;
  flex-shrink: 0;
}

.map-banner-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  filter: brightness(0.4);
}

.map-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,25,35,0.95) 0%, rgba(15,25,35,0.3) 100%);
}

.map-banner-info {
  position: absolute; left: 24px; bottom: 16px;
}

.map-banner-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.6rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  line-height: 1;
}

.map-banner-meta {
  font-size: 0.75rem; letter-spacing: 0.2em;
  color: var(--val-off-white); text-transform: uppercase;
  margin-top: 6px;
}

.map-banner-meta span { color: var(--val-red); }

.map-banner-actions {
  position: absolute; right: 24px; bottom: 16px;
  display: flex; gap: 10px; align-items: center;
}

/* Minimap container */
.minimap-area {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; background: var(--val-dark); overflow: hidden;
  position: relative;
}

.minimap-wrapper {
  position: relative;
  /* Fill the available minimap-area, stay square */
  width: min(100%, calc(100vh - 210px));
  height: min(calc(100vh - 210px), 100%);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--val-border);
  box-shadow: 0 0 40px rgba(0,0,0,0.5), 0 0 1px var(--val-red-glow);
  flex-shrink: 0;
}

.minimap-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0.85) saturate(0.9);
}

/* Lineup dots on minimap */
.lineup-dot {
  position: absolute; z-index: 10;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.lineup-dot-inner {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--val-red);
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 8px var(--val-red-glow), 0 0 0 0 var(--val-red);
  transition: all 0.2s ease;
  position: relative;
}

.lineup-dot:hover .lineup-dot-inner,
.lineup-dot.active .lineup-dot-inner {
  width: 20px; height: 20px;
  box-shadow: 0 0 16px var(--val-red), 0 0 0 4px var(--val-red-glow);
  background: #ff6b78;
}

.lineup-dot-pulse {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--val-red);
  opacity: 0;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Agent mini-icon on dot */
.lineup-dot-agent {
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  object-fit: cover; display: none;
}

.lineup-dot:hover .lineup-dot-agent { display: block; }

/* ── Lineup Tooltip/Popup ── */
.lineup-popup {
  position: fixed; z-index: 200;
  background: var(--val-dark-card);
  border: 1px solid var(--val-border);
  border-top: 2px solid var(--val-red);
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0; transition: opacity 0.15s ease;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.lineup-popup.visible { opacity: 1; pointer-events: all; }

.popup-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--val-border-subtle);
  display: flex; align-items: center; gap: 10px;
}

.popup-agent-icon {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--val-border);
  background: var(--val-dark-mid);
}

.popup-info { flex: 1; }

.popup-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1;
}

.popup-meta {
  font-size: 0.68rem; color: var(--val-off-white);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-top: 3px;
}

.popup-meta .red { color: var(--val-red); }

.popup-ability {
  display: flex; align-items: center; gap: 6px;
  background: var(--val-dark); padding: 4px 8px;
  border-radius: 2px; border: 1px solid var(--val-border-subtle);
}

.popup-ability img { width: 20px; height: 20px; object-fit: contain; }
.popup-ability span { font-size: 0.72rem; font-family: 'Rajdhani', sans-serif; font-weight: 600; letter-spacing: 0.08em; }

.popup-images {
  display: flex; gap: 2px;
  max-height: 160px;
  overflow-x: auto;
}

.popup-images img {
  height: 150px; min-width: 200px;
  object-fit: cover; flex-shrink: 0;
}

.popup-body { padding: 14px 16px; }

.popup-desc {
  font-size: 0.8rem; line-height: 1.6;
  color: var(--val-off-white); margin-bottom: 12px;
}

.popup-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }

.popup-tag {
  padding: 2px 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; border-radius: 2px;
  background: rgba(255,70,85,0.15); color: var(--val-red);
  border: 1px solid var(--val-red-dark);
}

.popup-actions {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--val-border-subtle);
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--val-dark-card);
  border: 1px solid var(--val-border);
  border-top: 2px solid var(--val-red);
  width: 680px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.9);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  transform: translateY(20px); transition: transform 0.25s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--val-border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
}

.modal-close {
  background: none; border: none;
  color: var(--val-off-white); cursor: pointer; font-size: 1.2rem;
  padding: 4px 8px; transition: color var(--transition);
}

.modal-close:hover { color: var(--val-red); }

.modal-body { padding: 24px; }

/* ── Form elements ── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block; margin-bottom: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--val-off-white);
}

.form-label .required { color: var(--val-red); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--val-dark);
  border: 1px solid var(--val-border);
  color: var(--val-white);
  padding: 10px 14px;
  font-family: 'Inter', sans-serif; font-size: 0.875rem;
  transition: border-color var(--transition);
  outline: none;
  border-radius: var(--radius-sm);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--val-red);
  box-shadow: 0 0 0 2px var(--val-red-glow);
}

.form-select option { background: var(--val-dark-mid); }

.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Agent/Ability selectors */
.agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px; max-height: 200px; overflow-y: auto;
  padding: 4px;
}

.agent-select-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; cursor: pointer;
  border: 1px solid var(--val-border-subtle);
  border-radius: 2px; background: var(--val-dark);
  transition: all var(--transition);
}

.agent-select-card:hover { border-color: var(--val-border); background: rgba(255,255,255,0.04); }
.agent-select-card.selected { border-color: var(--val-red); background: rgba(255,70,85,0.1); }

.agent-select-card img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}

.agent-select-card span {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  text-align: center; line-height: 1.2;
  color: var(--val-off-white);
}

.agent-select-card.selected span { color: var(--val-red); }

/* Ability selector */
.ability-select-grid {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.ability-select-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--val-border-subtle);
  background: var(--val-dark);
  color: var(--val-off-white);
  transition: all var(--transition); border-radius: 2px;
}

.ability-select-btn:hover { border-color: var(--val-border); }
.ability-select-btn.selected { border-color: var(--val-red); background: rgba(255,70,85,0.1); color: var(--val-white); }

.ability-select-btn img { width: 24px; height: 24px; object-fit: contain; }

.ability-select-btn .slot-badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 2px;
}

.ability-select-btn span:last-child {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}

/* Minimap placement picker */
.minimap-picker {
  position: relative; display: block; width: 100%; cursor: crosshair;
  border: 1px solid var(--val-border); background: var(--val-dark);
}

.minimap-picker img { display: block; width: 100%; height: auto; }

.placement-dot {
  position: absolute; width: 14px; height: 14px;
  background: var(--val-red); border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 10px var(--val-red-glow);
  display: none;
}

/* Tags input */
.tags-input-container {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  background: var(--val-dark); border: 1px solid var(--val-border);
  min-height: 44px; cursor: text;
  transition: border-color var(--transition);
}

.tags-input-container:focus-within { border-color: var(--val-red); }

.tag-badge {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: rgba(255,70,85,0.15); border: 1px solid var(--val-red-dark);
  color: var(--val-red);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 2px;
}

.tag-badge button {
  background: none; border: none; cursor: pointer;
  color: inherit; font-size: 0.9rem; line-height: 1; padding: 0 2px;
}

.tags-input-container input {
  flex: 1; min-width: 80px;
  background: none; border: none; outline: none;
  font-family: 'Inter', sans-serif; font-size: 0.875rem;
  color: var(--val-white);
}

/* Suggested tags */
.suggested-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.suggested-tag {
  padding: 3px 10px; cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--val-border); color: var(--val-off-white);
  border-radius: 2px; background: none;
  transition: all var(--transition);
}

.suggested-tag:hover { border-color: var(--val-red); color: var(--val-red); }

/* Image upload */
.image-upload-area {
  border: 1px dashed var(--val-border);
  padding: 20px; text-align: center; cursor: pointer;
  transition: all var(--transition); border-radius: 2px;
  background: var(--val-dark);
}

.image-upload-area:hover { border-color: var(--val-red); background: rgba(255,70,85,0.05); }

.image-upload-area p {
  font-size: 0.8rem; color: var(--val-off-white); margin-top: 8px;
}

.image-upload-area .upload-icon { font-size: 2rem; opacity: 0.4; }

.image-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.image-preview-item {
  position: relative; width: 80px; height: 60px;
  border: 1px solid var(--val-border); overflow: hidden;
}

.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.image-preview-remove {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: var(--val-red); color: #fff;
  border: none; cursor: pointer; font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}

/* Modal footer */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--val-border-subtle);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Notifications ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 500;
  background: var(--val-dark-card);
  border: 1px solid var(--val-border);
  border-left: 3px solid var(--val-red);
  padding: 14px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translateX(120%); transition: transform 0.3s ease;
  max-width: 320px;
}

.toast.show { transform: translateX(0); }
.toast.success { border-left-color: #00C48C; }
.toast.error { border-left-color: var(--val-red); }

/* ── Utility ── */
.hidden { display: none !important; }
.red { color: var(--val-red); }
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--val-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Animated entry ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.4s ease forwards; }

.map-card { animation: fadeInUp 0.4s ease both; }
.map-card:nth-child(1) { animation-delay: 0.05s; }
.map-card:nth-child(2) { animation-delay: 0.1s; }
.map-card:nth-child(3) { animation-delay: 0.15s; }
.map-card:nth-child(4) { animation-delay: 0.2s; }
.map-card:nth-child(5) { animation-delay: 0.25s; }
.map-card:nth-child(6) { animation-delay: 0.3s; }
.map-card:nth-child(7) { animation-delay: 0.35s; }
.map-card:nth-child(8) { animation-delay: 0.4s; }

/* ── Back button ── */
.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--val-off-white);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  transition: color var(--transition);
  padding: 0;
}

.back-btn:hover { color: var(--val-red); }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: rgba(255,255,255,0.3);
  gap: 12px;
}

.empty-state-icon { font-size: 3rem; opacity: 0.3; }

.empty-state-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
}

.empty-state-text { font-size: 0.8rem; max-width: 200px; line-height: 1.5; }

/* ── Role color badges ── */
.role-duelist { color: #FF6B6B; }
.role-controller { color: #6BCBFF; }
.role-initiator { color: #FFD96B; }
.role-sentinel { color: #6BFFB8; }

/* Responsive */
@media (max-width: 768px) {
  .maps-grid { grid-template-columns: 1fr 1fr; padding: 20px; }
  .maps-hero { padding: 40px 20px 20px; }
  .maps-hero-title { font-size: 2.5rem; }
  .sidebar { width: 180px; min-width: 180px; }
  .map-banner-name { font-size: 2.5rem; }
}

/* ══════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  cursor: zoom-out;
}

#lightbox.open { opacity: 1; visibility: visible; }

#lightbox-img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain;
  border: 1px solid var(--val-border);
  box-shadow: 0 0 80px rgba(0,0,0,0.9);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
  cursor: default;
}

#lightbox.open #lightbox-img { transform: scale(1); }

#lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,70,85,0.15); border: 1px solid var(--val-red);
  color: var(--val-white); font-size: 1.2rem; cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
#lightbox-close:hover { background: var(--val-red); }

#lightbox-nav-prev, #lightbox-nav-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(15,25,35,0.8); border: 1px solid var(--val-border);
  color: var(--val-white); font-size: 1.4rem; cursor: pointer;
  width: 44px; height: 60px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
#lightbox-nav-prev { left: 20px; }
#lightbox-nav-next { right: 20px; }
#lightbox-nav-prev:hover, #lightbox-nav-next:hover { background: var(--val-red); border-color: var(--val-red); }

#lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-family: 'Rajdhani', sans-serif; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.2em; color: rgba(255,255,255,0.4); text-transform: uppercase;
}

/* ── Clickable images in detail modal ── */
.detail-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 4px; margin-bottom: 16px; }
.detail-img-thumb {
  width: 100%; height: 140px; object-fit: cover;
  cursor: zoom-in; transition: filter 0.15s ease, transform 0.15s ease;
  border: 1px solid transparent;
}
.detail-img-thumb:hover { filter: brightness(1.1); transform: scale(1.01); border-color: var(--val-red); }

/* ══════════════════════════════════════════
   EXPORT / IMPORT MODAL
══════════════════════════════════════════ */
.export-import-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.export-card {
  background: var(--val-dark);
  border: 1px solid var(--val-border-subtle);
  padding: 20px 18px;
}

.export-card-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--val-white); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}

.export-card-title .icon { color: var(--val-red); font-size: 1rem; }

.export-card p {
  font-size: 0.78rem; color: var(--val-off-white);
  line-height: 1.5; margin-bottom: 14px;
}

.import-drop-zone {
  border: 1px dashed var(--val-border);
  padding: 20px; text-align: center; cursor: pointer;
  transition: all 0.15s ease; margin-bottom: 12px;
  background: var(--val-dark);
}
.import-drop-zone:hover, .import-drop-zone.drag-over {
  border-color: var(--val-red); background: rgba(255,70,85,0.04);
}
.import-drop-zone .drop-icon { font-size: 1.6rem; opacity: 0.35; }
.import-drop-zone p { font-size: 0.75rem; color: var(--val-off-white); margin-top: 6px; margin-bottom: 0; }
.import-drop-zone .file-name { color: var(--val-red); font-weight: 600; margin-top: 4px; }

.import-mode-row { display: flex; gap: 8px; margin-bottom: 12px; }
.import-mode-btn {
  flex: 1; padding: 6px 10px; cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--val-border-subtle);
  color: var(--val-off-white); transition: all 0.15s ease;
}
.import-mode-btn.active { background: rgba(255,70,85,0.1); border-color: var(--val-red); color: var(--val-red); }
.import-mode-btn:hover:not(.active) { border-color: var(--val-border); color: var(--val-white); }

.export-progress {
  display: none; margin-top: 10px;
  font-family: 'Rajdhani', sans-serif; font-size: 0.78rem;
  color: var(--val-off-white); letter-spacing: 0.05em;
  align-items: center; gap: 8px;
}
.export-progress.show { display: flex; }
