:root {
  --bg-0: #070b17;
  --bg-1: #0f1a32;
  --panel: rgba(14, 23, 45, 0.88);
  --line: rgba(105, 184, 255, 0.25);
  --accent: #3dc2ff;
  --accent-2: #00f5b4;
  --text: #e8f3ff;
  --muted: #9fb4d4;
  --danger: #ff6b6b;
  --gold: #ffcc4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(61, 194, 255, 0.25), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(0, 245, 180, 0.22), transparent 35%),
    linear-gradient(135deg, var(--bg-0), var(--bg-1));
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(115deg, transparent 48%, rgba(255, 255, 255, 0.04) 49%, transparent 50%);
  background-size: 280px 280px;
  opacity: 0.35;
}

.app-shell {
  width: min(1200px, 92vw);
  margin: 32px auto;
  position: relative;
  z-index: 2;
}

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.auth-panel {
  width: min(460px, 100%);
  margin: 6vh auto 0;
  padding: 26px;
}

.project-references {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.project-references h2 {
  margin: 0 0 8px;
  font-size: 1.06rem;
  color: var(--accent-2);
}

.project-references p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.references-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.references-list a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(61, 194, 255, 0.45);
}

.references-list a:hover {
  color: var(--accent-2);
  border-bottom-color: rgba(0, 245, 180, 0.5);
}

.auth-panel h1 {
  margin-top: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.tab-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(120deg, rgba(61, 194, 255, 0.35), rgba(0, 245, 180, 0.22));
}

.auth-form {
  display: none;
  gap: 8px;
}

.auth-form.active {
  display: grid;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
}

textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
}

.btn-primary,
.btn-secondary {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  color: #041625;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.dashboard {
  display: grid;
  gap: 18px;
}

.hidden {
  display: none !important;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
}

.subtitle {
  margin-top: 4px;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  padding: 16px;
}

.stat-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.value {
  margin: 8px 0 0;
  font-size: 2rem;
  font-weight: 700;
}

.exp-card {
  padding: 18px;
}

.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.exp-track {
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.exp-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(0, 245, 180, 0.35);
  transition: width 0.7s ease;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.mission-list,
.inventory-list,
.ranking-list {
  display: grid;
  gap: 10px;
}

.mission-item,
.inventory-item {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.mission-item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mission-item .meta,
.inventory-item .meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.pending {
  color: #d4f2ff;
}

.badge.completed {
  color: #89ffbc;
  border-color: rgba(137, 255, 188, 0.5);
}

.complete-btn,
.equip-btn {
  margin-top: 8px;
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(61, 194, 255, 0.15);
  cursor: pointer;
}

.complete-btn:disabled,
.equip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ranking-list {
  margin: 0;
  padding-left: 22px;
}

.ranking-list li {
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.admin-panel {
  padding: 18px;
}

.admin-form {
  display: grid;
  gap: 10px;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(340px, 90vw);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(61, 194, 255, 0.4);
  color: var(--text);
  padding: 13px 16px;
  border-radius: 12px;
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 40;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.levelup-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 7, 18, 0.76);
  display: grid;
  place-items: center;
  z-index: 30;
}

.levelup-content {
  width: min(500px, 92vw);
  padding: 28px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid rgba(61, 194, 255, 0.5);
  background: linear-gradient(135deg, rgba(11, 22, 44, 0.96), rgba(13, 36, 61, 0.96));
  animation: pulse 1.2s ease-in-out infinite alternate;
}

.levelup-content h2 {
  margin-top: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 2px;
  color: var(--gold);
}

@keyframes pulse {
  from { box-shadow: 0 0 12px rgba(255, 204, 77, 0.25); }
  to { box-shadow: 0 0 28px rgba(255, 204, 77, 0.6); }
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.6s ease forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 94vw;
    margin: 18px auto;
  }

  .project-references p,
  .references-list {
    font-size: 0.92rem;
  }

  .value {
    font-size: 1.55rem;
  }

  .top-bar {
    align-items: flex-start;
    gap: 12px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}
