* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: #f3f6ff;

  background-color: #0f1117;
  background-image: linear-gradient(180deg, #161922 0%, #0f1117 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(17, 20, 28, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 1.3rem;
  font-weight: 800;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-links a {
  opacity: 0.85;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a.active {
  color: #ffffff;
  font-weight: 700;
}

.header-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.hero,
.panel,
.stat-card,
.profile-card,
.leaderboard,
.events,
.cat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.hero {
  padding: 32px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1.5fr 1fr;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 2.25rem;
}

.hero p {
  color: #ccd4ea;
  line-height: 1.6;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  background: #5865f2;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
}

.btn.secondary {
  background: rgba(255,255,255,0.08);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.panel {
  padding: 22px;
}

input,
select {
  width: 100%;
  background: #1e2430;
  color: white;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #bec8e3;
}

.small {
  font-size: 0.9rem;
  color: #bec8e3;
}

.cat-card {
  text-align: center;
  padding: 22px;
}

.cat-emoji {
  font-size: 4rem;
  margin: 10px 0 18px;
}

.status-grid {
  display: grid;
  gap: 14px;
}

.progress-wrap {
  display: grid;
  gap: 6px;
  text-align: left;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #d9e2fb;
}

.progress {
  width: 100%;
  height: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7a5cff, #52c7ff);
  transition: width 0.35s ease;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.info-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  color: #c9d3f0;
}

.info-pill {
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 8px 12px;
}

.muted {
  color: #9ba7ca;
}

.success {
  color: #76f0a7;
}

.error {
  color: #ff7b8d;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #242b39;
}

.footer-note {
  margin-top: 18px;
  color: #97a3c9;
  font-size: 0.95rem;
}

a.disabled {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

.narrow-panel {
  max-width: 760px;
  margin: 0 auto 20px;
}

@media (max-width: 900px) {
  .hero,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}