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

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

body {
  background: #0b0d14;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ============================================
   COMPACT APP SHELL
   ============================================ */

.app-shell-compact {
  position: relative;
  max-width: 100%;
  padding: 12px 16px 40px;
  text-align: center;
}

/* ============================================
   ADMIN CORNER
   ============================================ */

.admin-corner {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  z-index: 100;
}

.admin-btn {
  background: rgba(99, 102, 241, 0.08);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.admin-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.admin-btn.admin-on {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.background-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  height: 90vw;
  max-width: 800px;
  max-height: 800px;
  object-fit: contain;
  opacity: 0.05;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}

.admin-sub-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.admin-sub-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.save-data-btn {
  background: #047857;
  color: #d1fae5;
  border-color: rgba(16, 185, 129, 0.45);
}

.save-data-btn:hover {
  background: #059669;
  color: #fff;
}

.save-status {
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

/* ============================================
   HEADER
   ============================================ */

.header-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
}

.brand-logo-compact {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
}

.title-compact {
  background: linear-gradient(135deg, #c084fc, #818cf8, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 24px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 3px;
}

/* ============================================
   STATS BAR
   ============================================ */

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
  flex-wrap: wrap;
  backdrop-filter: blur(12px);
}

.stat-item {
  padding: 4px 10px;
  min-width: 58px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item:last-child {
  border-right: none;
}

.stat-total {
  padding-left: 12px;
  border-left: 2px solid rgba(52, 211, 153, 0.3);
  border-right: none;
}

.stat-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  opacity: 0.9;
}

.stat-count {
  font-size: 16px;
  font-weight: 800;
  margin-top: 1px;
}

/* ============================================
   TABS NAV
   ============================================ */

.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.tab-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ============================================
   REGISTRATION ROW / MINI POPUP
   ============================================ */

.register-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reg-input {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  width: 160px;
  font-size: 12px;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.reg-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.reg-input::placeholder {
  color: #475569;
}

.reg-select {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
  backdrop-filter: blur(4px);
}

.reg-submit {
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.reg-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.mini-modal {
  background: linear-gradient(180deg, #161825, #0f1119);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  width: 90%;
  max-width: 300px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideUp 0.25s ease;
}

.mini-modal-title {
  color: #fff;
  font-size: 14px;
  margin-bottom: 15px;
  text-align: center;
  letter-spacing: 1px;
}

.mini-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-login-error {
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.save-slots-modal {
  max-width: 520px;
}

.save-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.save-slot-card {
  min-height: 118px;
  padding: 12px 10px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: rgba(15, 23, 42, 0.76);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  text-align: center;
  transition: all 0.18s ease;
}

.save-slot-card:hover {
  transform: translateY(-1px);
  border-color: rgba(52, 211, 153, 0.7);
  background: rgba(6, 78, 59, 0.42);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.save-slot-title {
  color: #86efac;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
}

.save-slot-date {
  min-height: 30px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.save-slot-action {
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ============================================
   MOVE BANNER
   ============================================ */

.move-banner-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 14px;
  font-size: 11px;
  backdrop-filter: blur(8px);
}

/* ============================================
   TEAM GRID – 10 COLUMNS
   ============================================ */

.team-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* Push Team 5 to col 2 to center row 2 */
.team-grid-compact > .team-col:nth-child(5) {
  grid-column: 2;
}

/* Push Team 7 to col 1 to start row 3 */
.team-grid-compact > .team-col:nth-child(7) {
  grid-column: 1;
}

.team-col {
  padding: 8px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.team-col:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.team-col-header {
  margin-bottom: 6px;
  text-align: center;
}

.team-col-header span {
  font-size: 10px;
  font-weight: 800;
  display: block;
  letter-spacing: 1px;
}

.group-select-compact {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9px;
  padding: 3px 4px;
  border-radius: 6px;
  margin-top: 3px;
}

/* ============================================
   COMPACT SLOT
   ============================================ */

.slot-compact {
  height: 38px;
  margin: 3px 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  cursor: grab;
  font-size: 10px;
  font-weight: 600;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.18s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
}

.slot-compact:active {
  cursor: grabbing;
}

.slot-compact:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
}




.slot-filled-compact {
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slot-pending-compact {
  border: 2px solid rgba(139, 92, 246, 0.8) !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3), inset 0 0 8px rgba(139, 92, 246, 0.1);
}

.slot-moving-compact {
  border: 2px dashed #67e8f9 !important;
  opacity: 0.6;
}

.slot-class-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 6px currentColor;
}

.slot-key {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 8px;
  opacity: 0.8;
}

.slot-name {
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.slot-empty-label {
  color: #4a5568;
  font-weight: 500;
  font-size: 10px;
}

/* ============================================
   RESERVE GRID
   ============================================ */

.section-title-compact {
  color: #67e8f9;
  font-size: 13px;
  margin: 20px 0 10px 0;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.reserve-grid-compact {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 20px;
}

/* ============================================
   TACTICAL MAP
   ============================================ */

.map-section-compact {
  margin-top: 20px;
}

.map-container-compact {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.map-bg-compact {
  display: block;
  width: 100%;
  opacity: 0.85;
}

.team-node-compact {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  color: #000;
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(255, 255, 255, 0.1);
  touch-action: none;
  transition: box-shadow 0.15s, transform 0.15s;
}

.team-node-compact:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.team-node-active-compact {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 0 0 5px rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%) scale(1.15);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.modal-compact {
  background: linear-gradient(180deg, #161825, #0f1119);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -8px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: slideUp 0.25s ease;
}

.modal-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-class {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal-name {
  font-size: 20px;
  font-weight: 800;
  margin-top: 2px;
}

.modal-info {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

/* ============================================
   SKILL SECTION
   ============================================ */

.skill-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.skill-section-label {
  font-size: 10px;
  color: #a78bfa;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.skill-library-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

.skill-lib-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.3);
}

.skill-lib-item:hover {
  transform: scale(1.12);
  border-color: #a78bfa;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.skill-lib-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

.skill-remove-btn {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid #0f1119;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}

.skill-remove-btn:hover {
  transform: scale(1.15);
}

.admin-skill-add {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.admin-skill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-skill-row .reg-input {
  flex: 1;
  min-width: 120px;
}

/* ============================================
   EQUIPPED SKILLS ROW
   ============================================ */

.equipped-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.equipped-slot {
  width: 84px;
  height: 84px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #374151;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.15s;
}

.equipped-slot:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.equipped-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  image-rendering: auto;
}

/* ============================================
   MODAL ACTIONS
   ============================================ */

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-action-btn {
  flex: 1;
  min-width: 80px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
}

.modal-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1100px) {
  .team-grid-compact {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .team-grid-compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .reserve-grid-compact {
    grid-template-columns: repeat(5, 1fr);
  }

  .stats-bar {
    gap: 2px;
    padding: 8px;
  }

  .stat-item {
    min-width: 42px;
    padding: 2px 6px;
  }

  .stat-name {
    font-size: 9px;
  }

  .stat-count {
    font-size: 13px;
  }

  .app-shell-compact {
    padding: 8px 10px 30px;
  }

  .save-slot-grid {
    grid-template-columns: 1fr;
  }
}
