/* ============================================================
   GRIT — Global Styles
   global.css  (full redesign)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { text-decoration: none; color: inherit; }
button, input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ── Design tokens ──────────────────────────────────────── */
:root {
  /* Palette */
  --purple:      #7c7cff;
  --purple-dim:  rgba(124,124,255,0.14);
  --purple-glow: rgba(124,124,255,0.35);
  --violet:      #c77dff;
  --violet-dim:  rgba(199,125,255,0.12);
  --blue:        #4c9fff;
  --teal:        #5dcaa5;
  --red:         #ff5c5c;

  /* Backgrounds */
  --bg-page:    #05060f;
  --bg-base:    #080b16;
  --bg-surface: rgba(12,15,26,0.94);
  --bg-card:    rgba(14,17,30,0.88);
  --bg-input:   rgba(10,12,22,0.9);

  /* Borders */
  --border:     rgba(255,255,255,0.07);
  --border-md:  rgba(255,255,255,0.12);
  --border-lit: rgba(124,124,255,0.28);

  /* Text */
  --text:       #e6e8f0;
  --text-muted: #6b7194;
  --text-hint:  #3d4260;

  /* Tiers */
  --bronze:   #cd7f32;
  --silver:   #c0c0c0;
  --gold:     #f4c430;
  --platinum: #78d9d9;
  --master:   #c77dff;

  /* Misc */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --navbar-h:   64px;
  --transition: 0.18s ease;
}

/* ── Body ────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-page);
  background-image: url("../assets/background.png");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Darkening veil over background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5,6,15,0.55) 0%,
    rgba(5,6,15,0.70) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Everything sits above the veil */
body > * { position: relative; z-index: 1; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,124,255,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,124,255,0.45); }

/* ── Typography helpers ──────────────────────────────────── */
.heading { font-family: 'Rajdhani', sans-serif; }
h1,h2,h3,h4 { font-family: 'Rajdhani', sans-serif; font-weight: 700; color: var(--text); line-height: 1.2; }

/* ── Utility: game-tag pill ─────────────────────────────── */
.game-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(199,125,255,0.12);
  color: var(--violet);
  border: 1px solid rgba(199,125,255,0.22);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Page fade-in ────────────────────────────────────────── */
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
main, .profile-page, .explore-page,
.settings-page, .saved-page, .achievements-page,
.guide-page, .build-page {
  animation: fadeInPage 0.4s ease forwards;
}

/* ── Primary button (shared) ─────────────────────────────── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--purple), #5a5aff);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--purple-glow);
  opacity: 0.92;
}
.primary-btn:active { transform: scale(0.97); }
.primary-btn.danger {
  background: linear-gradient(135deg, #ff5c5c, #e03a3a);
}
.primary-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Verified badge ───────────────────────────────────────── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  background: linear-gradient(135deg, #7c7cff, #5a5aff);
  border-radius: 50%;
  font-size: 9px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(124,124,255,0.5);
  vertical-align: middle;
  margin-left: 4px;
}
.verified-badge::after { content: "✓"; }

/* ── Reactions ────────────────────────────────────────────── */
.reaction-wrap {
  position: relative;
  display: inline-flex;
}

.reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(8,10,20,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  transform: translateX(-50%) translateY(6px) scale(0.92);
  white-space: nowrap;
  z-index: 100;
}
.reaction-picker.open {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.reaction-opt {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  padding: 4px 6px; border-radius: 8px;
  transition: transform 0.15s, background 0.15s;
  line-height: 1;
}
.reaction-opt:hover {
  transform: scale(1.35) translateY(-3px);
  background: rgba(255,255,255,0.08);
}

/* Reaction summary in sidebar */
.sidebar-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
}
.reaction-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Reaction counts on explore cards */
.card-reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.card-reaction-pill {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 3px;
}
