/* ═══════════════════════════════════════════════════════
   TheGamerCave — Main Stylesheet
   Dark gaming theme with purple accent
════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────── */
:root {
  --bg:             #0a0a0d;
  --surface:        #111116;
  --surface-raised: #18181f;
  --border:         #1f1f2e;
  --border-light:   #2a2a3d;

  --primary:        #7c3aed;
  --primary-hover:  #6d28d9;
  --primary-dim:    rgba(124, 58, 237, 0.15);

  --text:           #f0f0f5;
  --text-secondary: #8b8ba7;
  --text-muted:     #5a5a72;

  --success:        #22c55e;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #3b82f6;

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --shadow:         0 4px 24px rgba(0,0,0,.4);
  --shadow-sm:      0 2px 8px rgba(0,0,0,.3);

  --transition:     0.18s ease;
  --font-sans:      'Inter', system-ui, sans-serif;
  --font-display:   'Space Grotesk', 'Inter', sans-serif;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-main { flex: 1; }

/* ── Typography ───────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 80ms;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover { background: var(--surface-raised); color: var(--text); border-color: var(--border-light); }

.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-success { background: var(--success); color: #fff; border: none; }
.btn-success:hover { background: #16a34a; color: #fff; }

.btn-sm { padding: .375rem .875rem; font-size: .8rem; }
.btn-lg { padding: .875rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-text { background: none; border: none; color: var(--text-secondary); font-size: .8rem; padding: 0; cursor: pointer; }
.btn-text:hover { color: var(--text); }
.btn-text--danger:hover { color: var(--danger); }

/* ── Forms ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.1rem;
}

label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .625rem .875rem;
  font-size: .95rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

textarea { resize: vertical; min-height: 80px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8ba7' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .875rem center;
  padding-right: 2.5rem;
}

.form-hint { font-size: .78rem; color: var(--text-muted); }

.input-password { position: relative; }
.input-password input { padding-right: 2.75rem; }
.toggle-password {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-secondary);
  display: flex; align-items: center; padding: 0;
}
.toggle-password:hover { color: var(--text); }

/* ── Alerts ───────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.alert p { margin: .15rem 0; }
.alert-error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25); color: #86efac; }
.alert-info    { background: rgba(59,130,246,.1);  border: 1px solid rgba(59,130,246,.25); color: #93c5fd; }

/* ── Header ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,13,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  flex-shrink: 0;
  text-decoration: none;
}
.logo:hover { color: var(--text); }
.logo svg { flex-shrink: 0; }

.header-search { flex: 1; max-width: 340px; }

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}
.search-form input {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  padding: .45rem 2.5rem .45rem 1rem;
  font-size: .875rem;
  width: 100%;
  outline: none;
}
.search-form input:focus { border-color: var(--primary); }
.search-btn {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  padding: 0;
}
.search-btn:hover { color: var(--text); }

.header-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.nav-link {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: .375rem .625rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-raised); }

.nav-user { display: flex; align-items: center; gap: .5rem; position: relative; }

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.nav-avatar-link { display: flex; }
.nav-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: #fff;
}

.nav-notif {
  position: relative;
  background: none; border: none;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  transition: background var(--transition);
}
.nav-notif:hover { background: var(--surface-raised); color: var(--text); }

/* Notification bell badge */
.notif-badge {
  position: absolute;
  top: -4px; right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* Notification dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .9rem;
}
.notif-dropdown-list {
  max-height: 360px;
  overflow-y: auto;
}
.notif-dropdown-item {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-dim, rgba(255,255,255,.06));
  font-size: .84rem;
  line-height: 1.45;
}
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dropdown-item--unread { background: rgba(124,58,237,.08); }
.notif-dropdown-item p { margin: 0 0 .25rem; color: var(--text); }
.notif-dropdown-item .notif-time { font-size: .75rem; color: var(--text-muted); }
.notif-dropdown-item .notif-actions { display: flex; gap: .5rem; margin-top: .4rem; }
.notif-dropdown-empty { padding: 1.25rem 1rem; text-align: center; color: var(--text-muted); font-size: .85rem; margin: 0; }
.notif-dropdown-footer {
  padding: .6rem .75rem;
  border-top: 1px solid var(--border);
}
.badge-count {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.notif-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-muted); font-size: .875rem; }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex; align-items: center; gap: .4rem;
  background: none; border: none; color: var(--text-secondary);
  font-size: .875rem; font-weight: 500;
  padding: .375rem .625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.nav-dropdown-toggle:hover { background: var(--surface-raised); color: var(--text); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 180px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: block;
  padding: .625rem 1rem;
  font-size: .875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover { background: var(--surface); color: var(--text); }
.dropdown-item--danger:hover { color: var(--danger); }
.dropdown-item--admin { color: var(--warning); }
.dropdown-item--staff { color: var(--info); }
.dropdown-divider { height: 1px; background: var(--border); margin: .25rem 0; }

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  padding: .25rem;
  cursor: pointer;
  margin-left: auto;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.mobile-menu { display: none; border-top: 1px solid var(--border); }
.mobile-nav { padding: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.mobile-nav a { padding: .75rem 1rem; color: var(--text-secondary); border-radius: var(--radius-sm); font-weight: 500; text-decoration: none; }
.mobile-nav a:hover { background: var(--surface-raised); color: var(--text); }
.mobile-menu.open { display: block; }

/* ── Announcement bar ─────────────────────────────── */
.announcement-bar {
  background: linear-gradient(90deg, #5b21b6 0%, #7c3aed 40%, #a855f7 70%, #7c3aed 100%);
  background-size: 200% auto;
  animation: announcement-shimmer 4s linear infinite;
  padding: .5rem 0;
  position: relative;
  z-index: 90;
}
.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 0 1rem;
}
.announcement-icon { font-size: 1rem; }
@keyframes announcement-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── Notification friend actions ───────────────────── */
.notif-friend-actions {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}
.notif-friend-actions .btn { font-size: .75rem; padding: .25rem .625rem; }

/* ── Admin: featured remove button ────────────────── */
.game-card-wrap { position: relative; }
.featured-remove-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  z-index: 10;
  background: rgba(0,0,0,.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card-wrap:hover .featured-remove-btn { opacity: 1; }

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 4rem;
}
.footer-inner {
  padding: 2.5rem 1.25rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}
.footer-brand { flex-shrink: 0; }
.footer-tagline { color: var(--text-muted); font-size: .85rem; margin-top: .5rem; }
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; margin-bottom: .25rem; }
.footer-col a { font-size: .875rem; color: var(--text-secondary); text-decoration: none; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1rem 0; }
.footer-bottom .container { font-size: .8rem; color: var(--text-muted); }
.footer-bottom a { color: var(--text-secondary); }

/* ── Auth pages ───────────────────────────────────── */
.auth-page .site-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem 1rem;
}
.auth-container { width: 100%; max-width: 440px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.auth-title { text-align: center; font-size: 1.75rem; margin-bottom: .5rem; }
.auth-subtitle { text-align: center; color: var(--text-secondary); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; }
.auth-switch { text-align: center; color: var(--text-secondary); font-size: .875rem; margin-top: 1.25rem; }

/* ── Hero ─────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(124,58,237,.2) 0%, transparent 60%),
              radial-gradient(ellipse at 10% 100%, rgba(79,70,229,.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  position: relative;
}
.hero-text { max-width: 540px; }
.hero-badge {
  display: inline-block;
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 100px;
  padding: .3rem .875rem;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-family: var(--font-display);
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 30%, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 2rem; line-height: 1.65; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 2rem;
  text-align: center;
  min-width: 140px;
}
.stat-number { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── Sections ─────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section--alt { background: var(--surface); }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.section-title { font-size: 1.5rem; }
.section-link { font-size: .875rem; color: var(--primary); font-weight: 500; }

/* ── Game Cards ───────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}
.games-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: var(--shadow);
  color: var(--text);
}

.game-card-img {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-raised);
}
.game-card-img--empty { background-image: none; background-color: var(--surface-raised); }
.game-card--featured .game-card-img { height: 180px; }

.game-card-body { padding: .875rem; flex: 1; }
.game-card-title { font-size: .95rem; font-weight: 600; margin-bottom: .5rem; line-height: 1.35; }
.game-card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.game-card-mini { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.game-card-mini-link { text-decoration: none; color: var(--text); }

.rating-badge {
  background: rgba(245,158,11,.15);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 100px;
  padding: .15rem .5rem;
  font-size: .75rem;
  font-weight: 600;
}
.rating-badge--lg { font-size: .9rem; padding: .3rem .75rem; }
.game-year { font-size: .78rem; color: var(--text-muted); }
.game-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.tag {
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .15rem .6rem;
  font-size: .72rem;
  font-weight: 500;
}

/* Scrollable games strip */
.games-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .75rem;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.game-card-sm {
  flex-shrink: 0;
  width: 150px;
  scroll-snap-align: start;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition);
}
.game-card-sm:hover { transform: translateY(-2px); color: var(--text); }
.game-card-sm-img {
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-raised);
}
.game-card-sm-body { padding: .5rem .6rem; }
.game-card-sm-title { font-size: .78rem; font-weight: 600; display: block; line-height: 1.3; margin-bottom: .25rem; }
.rating-xs { font-size: .7rem; color: var(--warning); }

/* ── Forum preview ────────────────────────────────── */
.forum-preview { display: flex; flex-direction: column; gap: 1rem; }
.forum-preview-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.forum-preview-avatar img,
.forum-preview-avatar .avatar-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-placeholder {
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .9rem;
}
.forum-preview-content { flex: 1; min-width: 0; }
.forum-preview-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.forum-username { font-weight: 600; font-size: .875rem; text-decoration: none; color: var(--text); }
.forum-username:hover { color: var(--primary); }
.forum-username.role-admin { color: var(--warning); }
.forum-username.role-staff { color: var(--info); }
.forum-time { color: var(--text-muted); font-size: .78rem; }
.forum-preview-text { font-size: .875rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── CTA ──────────────────────────────────────────── */
.cta-section { padding: 4rem 0; }
.cta-box {
  background: linear-gradient(135deg, var(--primary-dim), rgba(79,70,229,.1));
  border: 1px solid rgba(124,58,237,.3);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2.5rem;
  text-align: center;
}
.cta-box h2 { font-size: 2rem; margin-bottom: .75rem; }
.cta-box p  { color: var(--text-secondary); margin-bottom: 1.75rem; font-size: 1.05rem; }

/* ── Profile ──────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  padding: 2rem 1.25rem;
  align-items: start;
}

.profile-sidebar { position: sticky; top: 76px; }

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.profile-avatar-wrap { margin-bottom: 1rem; }
.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-light);
  margin: 0 auto;
}
.profile-avatar-placeholder {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff;
  margin: 0 auto;
}
.profile-username { font-size: 1.2rem; margin-bottom: .2rem; }
.profile-handle { font-size: .8rem; color: var(--text-muted); }
.profile-bio { font-size: .85rem; color: var(--text-secondary); margin-top: .75rem; line-height: 1.55; }
.profile-badges { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.badge-icon { width: 28px; height: 28px; object-fit: contain; }
.banned-badge {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  border-radius: 100px;
  padding: .25rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  margin: .5rem auto 0;
  display: inline-block;
}
.profile-stats-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem .5rem;
  margin-top: 1rem;
  font-size: .78rem;
  color: var(--text-secondary);
  text-align: center;
}
/* 5-stat variant */
.profile-stats-mini--5 {
  grid-template-columns: repeat(6, 1fr);
}
.profile-stats-mini--5 > div:nth-child(1),
.profile-stats-mini--5 > div:nth-child(2) { grid-column: span 3; }
.profile-stats-mini--5 > div:nth-child(3),
.profile-stats-mini--5 > div:nth-child(4),
.profile-stats-mini--5 > div:nth-child(5) { grid-column: span 2; }
/* 6-stat variant (with platinas) — 3 × 2 grid */
.profile-stats-mini--6 { grid-template-columns: repeat(3, 1fr); }
.profile-stats-mini strong { display: block; font-size: 1rem; color: var(--text); font-family: var(--font-display); }

.profile-nav { margin-top: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.profile-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem .875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.profile-nav-item:hover, .profile-nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
}

.profile-main { min-width: 0; }
.tab-title { font-size: 1.4rem; margin-bottom: 1.5rem; }
.tab-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.tab-title-row .tab-title { margin-bottom: 0; }

/* Inner tabs */
.tabs-inner { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: none;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn.active, .tab-btn:hover {
  background: var(--primary-dim);
  border-color: rgba(124,58,237,.4);
  color: var(--primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Settings */
.settings-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.settings-card h3 { font-size: 1.05rem; margin-bottom: 1.25rem; }
.settings-card h4 { font-size: .9rem; font-weight: 600; color: var(--text-secondary); }

.avatar-upload-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.settings-avatar-preview {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-raised);
}
.settings-avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #fff;
}
.avatar-upload-wrap small { font-size: .78rem; color: var(--text-muted); }

/* ── Overview ─────────────────────────────────────── */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.overview-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.overview-section h3 { font-size: 1rem; margin-bottom: 1rem; }
.games-list-mini { display: flex; flex-direction: column; gap: .5rem; }
.game-list-item {
  display: flex; align-items: center; gap: .75rem;
  font-size: .85rem; color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.game-list-item:hover { color: var(--text); }
.game-list-item img { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; }
.game-thumb-placeholder { width: 36px; height: 36px; background: var(--surface-raised); border-radius: var(--radius-sm); }

/* ── Reviews ──────────────────────────────────────── */
.reviews-list { display: flex; flex-direction: column; gap: 1rem; }
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.review-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; flex-wrap: wrap; gap: .5rem; }
.review-game-link { font-weight: 600; font-size: .9rem; color: var(--text); display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.review-game-link:hover { color: var(--primary); }
.review-game-thumb { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; }
.review-rating { display: flex; gap: 2px; }
.star-on { color: var(--warning); }
.star-off { color: var(--border-light); }
.review-content { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: .5rem; }
.review-date { font-size: .78rem; color: var(--text-muted); }
.review-mini { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.review-mini:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.review-mini-game { font-size: .875rem; font-weight: 600; color: var(--text); }
.review-user { display: flex; align-items: center; gap: .625rem; }
.review-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
}
.review-avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
}
.review-username { font-weight: 600; font-size: .875rem; color: var(--text); text-decoration: none; }
.review-username:hover { color: var(--primary); }
.review-form-wrap {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.review-form-wrap h3 { font-size: 1rem; margin-bottom: 1rem; }
.review-form textarea { margin-bottom: .875rem; }

.star-rating-input { display: flex; gap: .25rem; margin-bottom: .875rem; }
.star-btn {
  font-size: 1.75rem;
  background: none; border: none;
  color: var(--border-light);
  cursor: pointer;
  transition: color var(--transition), transform 80ms;
  padding: 0 .1rem;
}
.star-btn.active { color: var(--warning); }
.star-btn:hover { transform: scale(1.15); }

/* ── Friends ──────────────────────────────────────── */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}
.friend-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .8rem;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}
.friend-card:hover { border-color: var(--border-light); transform: translateY(-2px); color: var(--text); }
.friend-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.friend-avatar-placeholder {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff;
}
.friend-username { font-weight: 600; font-size: .8rem; }
.friend-requests { margin-bottom: 1.5rem; }
.friend-requests h3 { font-size: 1rem; margin-bottom: .75rem; }
.friend-request-item { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .5rem; }
.friend-name { font-weight: 600; font-size: .9rem; color: var(--text); text-decoration: none; }
.friend-request-actions { display: flex; gap: .5rem; }

/* ── Notifications ────────────────────────────────── */
.notifications-list { display: flex; flex-direction: column; gap: .5rem; }
.notif-item {
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
}
.notif-item--unread { border-color: rgba(124,58,237,.3); background: var(--primary-dim); }
.notif-time { font-size: .78rem; color: var(--text-muted); display: block; margin-top: .25rem; }

/* ── Game hero ────────────────────────────────────── */
.game-hero {
  position: relative;
  padding: 3rem 0;
  background: var(--surface);
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
}
.game-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,10,13,.95) 40%, rgba(10,10,13,.6));
}
.game-hero-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  position: relative;
}
.game-cover img {
  width: 180px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.game-cover-placeholder {
  width: 180px; height: 240px;
  background: var(--surface-raised);
  border-radius: var(--radius);
}
.game-hero-info { flex: 1; }
.game-title { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: .875rem; }
.game-meta-row { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; margin-bottom: .75rem; }
.meta-pill {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 100px;
  padding: .25rem .75rem;
  font-size: .8rem;
  color: var(--text-secondary);
}
.game-platforms { color: var(--text-muted); font-size: .8rem; margin-bottom: 1rem; }
.game-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.list-status { font-size: .875rem; font-weight: 600; color: var(--text-secondary); }
.list-status-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.game-login-hint { font-size: .875rem; color: var(--text-muted); }

.game-body { padding: 2.5rem 0; }
.game-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; align-items: start; }
.game-section { margin-bottom: 2.5rem; }
.game-section h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.game-description { color: var(--text-secondary); line-height: 1.7; font-size: .95rem; }
.game-sidebar { position: sticky; top: 76px; }
.game-info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.game-info-card h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin-bottom: .5rem; }
.game-info-card p { font-size: .875rem; color: var(--text-secondary); }
.game-tags-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.metacritic-score {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: 1rem;
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.3);
  color: var(--success);
}

.screenshots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.screenshot-thumb {
  aspect-ratio: 16/9;
  display: block;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: opacity var(--transition);
}
.screenshot-thumb:hover { opacity: .85; }

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .1rem .5rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: .5rem;
}

/* ── Games / Browse ───────────────────────────────── */
.page-header { padding: 2rem 0 1.5rem; display: flex; align-items: baseline; gap: 1rem; }
.page-header h1 { font-size: 2rem; }
.result-count { font-size: .875rem; color: var(--text-muted); }

.games-layout { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; padding-bottom: 3rem; align-items: start; }

.filters-sidebar { position: sticky; top: 76px; }
.filter-group { margin-bottom: 1.5rem; }
.filter-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--text-muted); margin-bottom: .5rem; }
.filter-group select { width: 100%; }

.genre-list { display: flex; flex-direction: column; gap: .25rem; }
.genre-tag {
  display: block;
  padding: .375rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.genre-tag:hover, .genre-tag.active {
  background: var(--primary-dim);
  color: var(--primary);
}

.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.page-btn {
  padding: .5rem .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .875rem;
  text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.page-info { padding: .5rem; color: var(--text-muted); font-size: .875rem; }

/* ── Forum ────────────────────────────────────────── */
.forum-container { padding: 2rem 1.25rem; max-width: 900px; }
.forum-header { margin-bottom: 1.5rem; }
.forum-header h1 { font-size: 2rem; margin-bottom: .25rem; }
.forum-desc { color: var(--text-muted); font-size: .875rem; }

.forum-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.forum-messages {
  height: 520px;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  scroll-behavior: smooth;
}

.forum-msg { display: flex; gap: .875rem; align-items: flex-start; }
.forum-msg--deleted { opacity: .5; }
.forum-msg-avatar img, .forum-msg-avatar .avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.forum-msg-body { flex: 1; min-width: 0; }
.forum-msg-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; flex-wrap: wrap; }
.role-tag {
  font-size: .65rem;
  font-weight: 700;
  border-radius: 4px;
  padding: .1rem .35rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.role-tag--admin { background: rgba(245,158,11,.15); color: var(--warning); }
.role-tag--staff { background: rgba(59,130,246,.15); color: var(--info); }
.forum-msg-time { font-size: .73rem; color: var(--text-muted); }
.forum-msg-text { font-size: .9rem; line-height: 1.55; color: var(--text); word-break: break-word; }
.deleted-notice { font-size: .8rem; color: var(--text-muted); font-style: italic; }
.forum-empty { text-align: center; padding: 3rem; color: var(--text-muted); }

.forum-input-wrap { border-top: 1px solid var(--border); padding: 1rem 1.25rem; }
.forum-form {
  display: flex;
  gap: .75rem;
  align-items: center;
}
.forum-my-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.forum-input-inner { flex: 1; display: flex; gap: .625rem; }
.forum-input-inner input { flex: 1; }
.forum-rules { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; }
.forum-login-prompt { border-top: 1px solid var(--border); padding: 1.25rem; text-align: center; }

/* ── Search ───────────────────────────────────────── */
.search-layout { padding-bottom: 3rem; }
.search-form-full { margin-bottom: 2rem; }
.search-form-adv { display: flex; flex-direction: column; gap: 1rem; }
.search-input-wrap { display: flex; gap: .75rem; }
.search-input-lg {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .875rem 1.25rem;
  font-size: 1rem;
  outline: none;
}
.search-input-lg:focus { border-color: var(--primary); }
.search-type-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.type-tab {
  padding: .5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}
.type-tab:hover, .type-tab.active {
  background: var(--primary-dim);
  border-color: rgba(124,58,237,.4);
  color: var(--primary);
}

.search-suggestions h3 { font-size: 1rem; margin-bottom: .875rem; color: var(--text-secondary); }
.suggestion-tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.suggestion-tag {
  padding: .4rem .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}
.suggestion-tag:hover { background: var(--primary-dim); border-color: rgba(124,58,237,.4); color: var(--primary); }

.search-results { margin-bottom: 2.5rem; }
.results-title { font-size: 1.25rem; margin-bottom: 1.25rem; }

.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.user-card {
  display: flex;
  gap: .875rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
}
.user-card:hover { border-color: var(--border-light); transform: translateY(-2px); color: var(--text); }
.user-card-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.user-card-avatar-placeholder {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-card-info strong { display: block; font-size: .95rem; margin-bottom: .1rem; }
.user-handle { font-size: .78rem; color: var(--text-muted); display: block; }
.user-card-info p { font-size: .8rem; color: var(--text-secondary); margin-top: .25rem; }

/* ── Admin / Staff ────────────────────────────────── */
.admin-container { padding: 2rem 1.25rem; }
.admin-header { margin-bottom: 2rem; display: flex; flex-direction: column; gap: .875rem; }
.admin-header h1 { font-size: 1.75rem; }
.admin-nav { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-nav-link {
  padding: .4rem .875rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}
.admin-nav-link:hover, .admin-nav-link.active {
  background: var(--primary-dim);
  border-color: rgba(124,58,237,.4);
  color: var(--primary);
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card-lg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon { font-size: 1.75rem; }
.stat-number-lg { display: block; font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); }
.stat-label-lg { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

.admin-section h2 { font-size: 1.2rem; margin-bottom: 1rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  background: var(--surface-raised);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-weight: 600;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-raised); }
.row-banned td { opacity: .6; }

.role-badge {
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.role-badge--user  { background: rgba(139,139,167,.15); color: var(--text-secondary); }
.role-badge--staff { background: rgba(59,130,246,.15); color: var(--info); }
.role-badge--admin { background: rgba(245,158,11,.15); color: var(--warning); }

.badge-success { background: rgba(34,197,94,.15); color: var(--success); border-radius: 4px; padding: .15rem .45rem; font-size: .75rem; font-weight: 600; }
.badge-danger  { background: rgba(239,68,68,.15); color: var(--danger); border-radius: 4px; padding: .15rem .45rem; font-size: .75rem; font-weight: 600; }

.admin-layout { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: start; }
.admin-main { min-width: 0; }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.admin-card h3 { font-size: 1rem; margin-bottom: 1.25rem; }
.admin-card h4 { font-size: .85rem; color: var(--text-secondary); margin-bottom: .5rem; }

.admin-search-form { display: flex; gap: .5rem; margin-bottom: .875rem; }
.admin-search-form input { max-width: 280px; }

/* Staff */
.staff-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; align-items: start; }
.staff-filters { margin-bottom: 1.25rem; }
.forum-mod-list { display: flex; flex-direction: column; gap: .75rem; }
.forum-mod-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.forum-mod-item--deleted { border-color: rgba(239,68,68,.3); opacity: .7; }
.forum-mod-meta { display: flex; align-items: center; gap: .625rem; margin-bottom: .375rem; }
.forum-mod-text { font-size: .875rem; color: var(--text-secondary); margin-bottom: .75rem; }
.forum-mod-actions { display: flex; gap: .5rem; }
.reported-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.reported-list li { display: flex; align-items: center; justify-content: space-between; font-size: .875rem; }

/* Badges admin */
.badges-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.badge-admin-card {
  display: flex;
  gap: .875rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.badge-admin-icon { width: 40px; height: 40px; object-fit: contain; }
.badge-admin-info { flex: 1; }
.badge-admin-info strong { display: block; font-size: .9rem; }
.badge-icon-file { font-size: .75rem; color: var(--text-muted); display: block; }
.badge-admin-info p { font-size: .8rem; color: var(--text-secondary); margin-top: .2rem; }
.badge-count-info { font-size: .75rem; color: var(--text-muted); }

/* ── Misc ─────────────────────────────────────────── */
.empty-state { color: var(--text-muted); font-size: .9rem; padding: 1rem 0; }
.empty-state a { color: var(--primary); }
.empty-state-box {
  padding: 3rem 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-state-box p { color: var(--text-muted); margin-bottom: 1rem; }

/* User page */
.friend-action .btn { text-align: center; }

/* Misc role colors on forum */
.role-admin { color: var(--warning) !important; }
.role-staff  { color: var(--info) !important; }

/* ── Announcement bar ─────────────────────────────── */
.announcement-bar {
  background: linear-gradient(90deg, #5b21b6, #7c3aed, #9333ea);
  background-size: 200% 100%;
  animation: shimmer-bar 4s linear infinite;
  padding: .55rem 0;
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
}
@keyframes shimmer-bar { 0%{background-position:0 0} 100%{background-position:200% 0} }
.announcement-inner { display: flex; align-items: center; gap: .5rem; }
.announcement-icon { font-size: 1rem; flex-shrink: 0; }

/* ── Achievements ─────────────────────────────────── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.achievement-card {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem;
  transition: border-color var(--transition);
}
.achievement-card:hover { border-color: var(--border-light); }
.achievement-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--surface);
}
.achievement-img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--surface);
}
.achievement-info { flex: 1; min-width: 0; }
.achievement-name { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .2rem; }
.achievement-desc { display: block; font-size: .78rem; color: var(--text-secondary); margin-bottom: .3rem; line-height: 1.4; }
.achievement-percent { font-size: .75rem; color: var(--text-muted); }
.achievements-more { font-size: .85rem; color: var(--text-muted); margin-top: .75rem; }

/* ── Platform chips & checkboxes ──────────────────── */
.profile-platforms { display: flex; flex-wrap: wrap; gap: .375rem; margin: .75rem 0; }
.platform-chip {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 20px;
  padding: .25rem .7rem;
  font-size: .78rem;
  font-weight: 600;
}
.platform-category {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 1rem 0 .5rem;
}
.platform-category:first-of-type { margin-top: 0; }
.platforms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.platform-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .875rem;
  transition: border-color var(--transition), background var(--transition);
}
.platform-checkbox:hover { border-color: var(--primary); }
.platform-checkbox input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }
.platform-checkbox:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-dim);
}

/* ── Challenges page ──────────────────────────────── */
.challenges-page { max-width: 820px; margin: 0 auto; }
.challenges-header { margin-bottom: 1.5rem; }
.challenges-header h1 { font-size: 1.75rem; }
.challenges-header p { color: var(--text-secondary); margin-top: .25rem; }

.challenges-list { display: flex; flex-direction: column; gap: 1rem; }

.challenge-card {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.challenge-card:hover { border-color: var(--border-light); }

.challenge-game-thumb {
  width: 90px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-raised);
}

.challenge-body { flex: 1; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .625rem; }

.challenge-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.challenge-meta { flex: 1; }
.challenge-game-title { display: block; font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: .2rem; }
.challenge-game-title:hover { color: var(--primary); }
.challenge-type { font-size: .82rem; color: var(--text-secondary); }

.challenge-status {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.challenge-status--pending   { background: rgba(245,158,11,.15); color: var(--warning); }
.challenge-status--accepted  { background: rgba(59,130,246,.15); color: var(--info); }
.challenge-status--completed { background: rgba(34,197,94,.15);  color: var(--success); }
.challenge-status--rejected  { background: rgba(239,68,68,.15);  color: var(--danger); }

.challenge-from {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .83rem;
  color: var(--text-secondary);
}
.challenge-from a { color: var(--text); font-weight: 600; }
.challenge-from a:hover { color: var(--primary); }

.challenge-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.challenge-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-dim);
  color: var(--primary);
  font-size: .7rem;
  font-weight: 700;
}
.challenge-date { margin-left: auto; font-size: .78rem; color: var(--text-muted); }

.challenge-message {
  font-size: .85rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: .5rem .75rem;
  border-left: 2px solid var(--border-light);
  margin: 0;
}

.challenge-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Create challenge form */
.challenge-create-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 560px;
}
.challenge-create-wrap h2 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.challenge-form .form-hint { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* Notification friend actions */
.notif-friend-actions { display: flex; gap: .5rem; }

/* Featured game card wrap */
.game-card-wrap { position: relative; }
.featured-remove-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: rgba(0,0,0,.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card-wrap:hover .featured-remove-btn { opacity: 1; }

/* Tab title row */
.tab-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.tab-title-row .tab-title { margin-bottom: 0; }

/* List status hint */
.list-status-hint { font-size: .78rem; color: var(--text-muted); display: block; margin-top: .25rem; }

/* btn-success */
.btn-success { background: rgba(34,197,94,.15); color: var(--success); border: 1px solid rgba(34,197,94,.3); }
.btn-success:hover { background: rgba(34,197,94,.25); color: var(--success); }

/* ── Feed ─────────────────────────────────────────── */
.feed-list { display: flex; flex-direction: column; gap: .75rem; }
.feed-item {
  display: flex;
  gap: .875rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feed-avatar { flex-shrink: 0; }
.feed-avatar img, .feed-avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.feed-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dim); color: var(--primary);
  font-weight: 700; font-size: .85rem;
}
.feed-body { flex: 1; min-width: 0; }
.feed-content {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .875rem; flex-wrap: wrap;
}
.feed-icon { font-size: 1.1rem; flex-shrink: 0; }
.feed-text { flex: 1; line-height: 1.5; }
.feed-user { font-weight: 700; color: var(--text); }
.feed-user:hover { color: var(--primary); }
.feed-stars { color: var(--warning); letter-spacing: .05em; }
.feed-cover { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.feed-time { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.feed-pagination { display: flex; justify-content: space-between; margin-top: 1.5rem; }

/* ── Chat ─────────────────────────────────────────── */
.chat-page .site-main { display: flex; flex-direction: column; }
.chat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: calc(100vh - 60px);
  overflow: hidden;
}
.chat-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: .75rem 0;
}
.chat-sidebar-section { padding: .25rem 0; }
.chat-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: .5rem .875rem .25rem;
}
.chat-sidebar-divider { height: 1px; background: var(--border); margin: .5rem 0; }
.chat-channel-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .875rem;
  font-size: .875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.chat-channel-item:hover { background: var(--surface-raised); color: var(--text); }
.chat-channel-item.active { background: var(--primary-dim); color: var(--primary); }
.chat-item-icon { font-size: 1rem; font-weight: 700; color: var(--text-muted); width: 20px; text-align: center; }
.chat-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-avatar { width: 24px; height: 24px; flex-shrink: 0; }
.chat-item-avatar img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.chat-item-avatar-ph {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-dim); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700;
}
.chat-game-thumb { width: 24px; height: 18px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.chat-unread-dot {
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 10px; padding: .1rem .35rem;
  min-width: 18px; text-align: center;
}
.chat-empty-hint { font-size: .78rem; color: var(--text-muted); padding: .25rem .875rem; }
.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
.chat-header h2 { font-size: 1rem; font-weight: 600; }

/* ── Likes & Comments ─────────────────────────────── */
.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .625rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.review-actions { display: flex; align-items: center; gap: .75rem; }
.like-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 1px solid var(--border);
  border-radius: 20px; padding: .2rem .65rem;
  font-size: .8rem; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
}
.like-btn:hover, .like-btn.liked { border-color: rgba(239,68,68,.5); color: #ef4444; }
.like-count-static { font-size: .8rem; color: var(--text-muted); }
.toggle-comments {
  font-size: .8rem; color: var(--text-secondary); background: none; border: none; cursor: pointer; padding: 0;
}
.toggle-comments:hover { color: var(--primary); }
.review-comments {
  margin-top: .75rem;
  border-top: 1px solid var(--border);
  padding-top: .75rem;
}
.comments-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.comment-item {
  display: flex; gap: .5rem; font-size: .83rem;
}
.comment-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar-ph {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-dim); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-weight: 600; color: var(--text); margin-right: .35rem; }
.comment-text { color: var(--text-secondary); }
.comment-time { font-size: .75rem; color: var(--text-muted); margin-left: .35rem; }
.comment-delete { font-size: .75rem; color: var(--danger); background: none; border: none; cursor: pointer; margin-left: .25rem; }
.comment-form { display: flex; gap: .5rem; align-items: center; }
.comment-input { flex: 1; }
.loading-hint { font-size: .82rem; color: var(--text-muted); }

/* ── Leaderboard ──────────────────────────────────── */
.leaderboard-list { display: flex; flex-direction: column; gap: .5rem; }
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lb-rank {
  width: 28px; text-align: center;
  font-weight: 700; font-size: .9rem; color: var(--text-muted);
  flex-shrink: 0;
}
.lb-rank--top { color: var(--warning); font-size: 1rem; }
.lb-avatar { width: 36px; height: 36px; flex-shrink: 0; overflow: hidden; border-radius: 50%; }
.lb-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.lb-avatar-ph {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-dim); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.lb-name { flex: 1; font-weight: 600; font-size: .9rem; color: var(--text); }
.lb-name:hover { color: var(--primary); }
.lb-score { font-size: .9rem; font-weight: 700; color: var(--text); text-align: right; }
.lb-score small { font-weight: 400; color: var(--text-muted); }

/* ── PSN Integration ──────────────────────────────── */
.psn-connected-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0,68,170,.12);
  border: 1px solid rgba(0,68,170,.3);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.psn-connected-icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: #003087;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.psn-connected-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .875rem;
}
.psn-status-ok  { color: #4ade80; font-size: .75rem; }
.psn-stats-line { font-size: .78rem; color: var(--text-secondary); }
.psn-platinum-count { color: #f5c842; font-weight: 700; }
.psn-last-sync  { font-size: .72rem; color: var(--text-muted); }
.psn-section-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .625rem;
}
.psn-games-list {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.psn-game-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  background: var(--surface-raised);
  border-radius: var(--radius);
}
.psn-game-cover {
  width: 36px; height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.psn-game-cover--ph {
  background: #003087;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 800;
}
.psn-game-details { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.psn-game-name {
  font-size: .85rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.psn-platinum-badge { font-size: .85rem; }
.psn-game-trophies  { font-size: .72rem; color: var(--text-muted); }

/* ── Steam Integration ────────────────────────────── */
.steam-connected-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(23,107,135,.12);
  border: 1px solid rgba(23,107,135,.3);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.steam-avatar {
  width: 48px; height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
}
.steam-connected-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .875rem;
}
.steam-status--ok { color: #4ade80; font-size: .78rem; }
.steam-warning    { color: var(--warning); font-size: .78rem; }
.steam-recent-grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.steam-recent-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  background: var(--surface-raised);
  border-radius: var(--radius);
}
.steam-game-icon {
  width: 32px; height: 32px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}
.steam-game-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.steam-game-name { font-size: .875rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steam-game-time { font-size: .75rem; color: var(--text-muted); }

/* ── Events ───────────────────────────────────────── */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.event-card:hover { border-color: var(--border-light); }
.event-image { height: 120px; background-size: cover; background-position: center; }
.event-body { padding: 1rem; }
.event-title { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.event-desc { font-size: .85rem; color: var(--text-secondary); margin-bottom: .5rem; }
.event-dates { font-size: .78rem; color: var(--primary); font-weight: 600; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .header-search { display: none; }
  .header-nav .nav-link:not(:last-of-type) { display: none; }
  .mobile-menu-toggle { display: flex; }

  .hero-content { flex-direction: column; }
  .hero-stats { flex-direction: row; }
  .stat-card { min-width: unset; flex: 1; padding: 1rem; }

  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar { position: static; }

  .games-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; display: flex; gap: 1rem; flex-wrap: wrap; }
  .filter-group { margin-bottom: 0; min-width: 150px; }
  .genre-list { flex-direction: row; flex-wrap: wrap; gap: .25rem; }

  .overview-grid { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .game-hero-content { flex-direction: column; gap: 1.25rem; }
  .game-cover img { width: 140px; }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .staff-layout { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 1.5rem; }
}

@media (max-width: 600px) {
  .header-nav { gap: .25rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-actions { flex-direction: column; }
  .hero-stats { gap: .5rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .game-card-img { height: 100px; }
  .game-card--featured .game-card-img { height: 120px; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .cta-box { padding: 2rem 1.25rem; }
  .cta-box h2 { font-size: 1.5rem; }
  .profile-layout { padding: 1.5rem 0; }
  .forum-messages { height: 380px; }
}

/* ── Achievement Toggle ───────────────────────────── */
.achievement-card { position: relative; }
.achievement-card.achieved {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 99,102,241), .07);
}
.achievement-card.achieved .achievement-img { opacity: 1; }
.achievement-card:not(.achieved) .achievement-img { opacity: .55; filter: grayscale(.4); }
.ach-toggle-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.achievement-card.achieved .ach-toggle-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.ach-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }
.achievement-card.achieved .ach-toggle-btn:hover { background: var(--primary-dark, var(--primary)); }
.ach-progress-label {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: .75rem;
}

/* ── Profile stats 6-item grid ────────────────────── */
.profile-stats-mini--6 {
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem .75rem;
}
.profile-stats-mini--6 > div { grid-column: span 1; }

/* =========================================
   Global Mobile Hardening & Resilience
========================================= */
html {
  /* Prevent font scaling on landscape orientation changes */
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  /* Cleaner tap interactions */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  /* Prevent long URLs or unbroken strings from breaking mobile layouts */
  overflow-wrap: break-word;
}

/* Prevent Flex/Grid blowout on all major container types */
.site-main, .container, .profile-main, .admin-main, .chat-main,
.forum-msg-body, .feed-body, .review-card, .game-hero-info, .filter-group {
  min-width: 0;
}

/* Ensure mobile touch targets meet the 48px minimum standard */
@media (max-width: 900px) {
  .btn, .nav-dropdown-toggle, .tab-btn {
    min-height: 48px;
  }
}

/* =========================================
   TABLET & SMALL DESKTOP (Max 900px)
========================================= */
@media (max-width: 900px) {
  .container { padding: 0 1rem; }

  /* Header & Nav */
  .header-inner { gap: .75rem; }
  .header-nav { gap: .35rem; }
  .header-nav > .nav-link,
  .header-nav > .btn { display: none; }
  .mobile-menu-toggle { margin-left: .25rem; }
  .nav-user { margin-left: auto; }
  .nav-dropdown-toggle { padding: .375rem; }
  .nav-dropdown-toggle span { display: none; }
  .notif-dropdown { right: -.5rem; width: min(92vw, 320px); }
  .dropdown-menu { max-width: 92vw; }

  .announcement-bar { display: block; }
  .announcement-inner {
    justify-content: flex-start;
    text-align: left;
    line-height: 1.45;
  }
  .announcement-inner span:last-child { min-width: 0; }

  /* Universal Column Stack for Forms & Headers */
  .section-header, .page-header, .tab-title-row, .challenge-top,
  .search-input-wrap, .admin-search-form, .comment-form,
  .steam-connected-box, .psn-connected-box, .friend-request-item,
  .reported-list li, .leaderboard-item, .challenge-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }

  /* Universal Full-Width Button overrides */
  .game-actions form, .game-actions .btn,
  .search-input-wrap .btn, .admin-search-form .btn, .comment-form .btn,
  .friend-request-actions, .notif-friend-actions, .challenge-actions,
  .friend-request-actions .btn, .notif-friend-actions .btn, .challenge-actions .btn {
    width: 100%;
    justify-content: center;
    flex: 1;
  }

  .section { padding: 2.5rem 0; }

  /* Hero Section */
  .hero { padding: 3rem 0 2.5rem; }
  .hero-content { align-items: stretch; gap: 1.5rem; }
  .hero-text { max-width: none; }
  .hero-title { font-size: 2.25rem; }
  .hero-desc { font-size: 1rem; margin-bottom: 1.5rem; }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    width: 100%;
  }
  .stat-card { padding: .875rem .5rem; }
  .stat-number { font-size: 1.35rem; }
  .stat-label { font-size: .7rem; }

  /* Sidebar Filters */
  .filters-sidebar {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
  }
  .filter-group { margin-bottom: 1rem; }
  .filter-group:last-child { margin-bottom: 0; }
  .genre-list {
    max-height: 170px;
    overflow-y: auto;
    padding-right: .25rem;
  }

  /* Profile Layout */
  .profile-layout { padding: 1.25rem 1rem; gap: 1rem; align-items: start; }
  .profile-sidebar {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }
  .profile-card, .settings-card, .overview-section, .review-card,
  .review-form-wrap, .admin-card, .challenge-create-wrap {
    padding: 1rem;
  }
  .profile-badges,
  .profile-platforms { justify-content: center; }
  .profile-badges .badge-icon { flex: 0 0 28px; }

  /* Horizontal Scrolling Navs */
  .tabs-inner {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    /* Smooth scrolling on iOS */
    -webkit-overflow-scrolling: touch;
  }
  .profile-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
  }
  .profile-nav-item {
    flex: 1 1 auto;
    gap: .75rem;
    min-width: 0;
    white-space: normal;
  }
  .tab-btn { flex: 0 0 auto; }

  .profile-stats-mini, .profile-stats-mini--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-stats-mini--5 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .profile-stats-mini--6 > div { grid-column: span 1; }

  /* Game Hero */
  .game-hero { padding: 1.75rem 0; }
  .game-hero-overlay { background: rgba(10,10,13,.86); }
  .game-hero-content { align-items: center; text-align: center; }
  .game-cover img { width: 130px; }
  .game-cover-placeholder { width: 130px; height: 174px; }
  .game-meta-row, .game-actions, .game-tags-list { justify-content: center; }
  .game-body { padding: 1.75rem 0; }
  .game-sidebar { position: static; }

  /* Forum & Admin */
  .forum-container, .admin-container { padding: 1.25rem 1rem; }
  .forum-wrap { border-radius: var(--radius); }
  .forum-messages {
    height: calc(100dvh - 280px);
    min-height: 320px;
    padding: 1rem;
    overflow-y: auto;
  }
  .forum-form { align-items: stretch; }
  .forum-input-inner { flex-direction: column; }
  .forum-input-inner .btn { justify-content: center; }

  .admin-search-form input { max-width: none; }
  .admin-main { overflow-x: auto; }
  .admin-table { min-width: 640px; }

  /* Chat */
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100dvh - 60px);
  }
  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 230px;
    overflow-y: auto;
  }
  .chat-main { min-height: calc(100dvh - 290px); }
  .chat-header {
    align-items: flex-start;
    flex-direction: column;
    padding: .875rem 1rem;
  }

  /* Challenges & Feeds */
  .challenge-game-thumb { width: 100%; height: 120px; }
  .challenge-date { margin-left: 0; }

  .feed-item, .forum-preview-item { gap: .75rem; padding: .875rem; }
  .feed-content { display: block; }
  .feed-cover { margin-top: .5rem; }

  .footer-inner {
    padding: 2rem 1rem;
    /* Safe Area Insets for iPhones */
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  .footer-brand {
    width: 100%;
    padding-top: .75rem;
  }
  .footer-brand .logo span { display: inline; }
  .footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 1rem;
    width: 100%;
    padding-bottom: .75rem;
  }
  .footer-col { min-width: 0; }
  .footer-col a { overflow-wrap: normal; }
}

/* =========================================
   MOBILE PHONES (Max 640px)
========================================= */
@media (max-width: 640px) {
  .container { padding: 0 .875rem; }
  .btn { max-width: 100%; justify-content: center; }

  .announcement-inner {
    align-items: flex-start;
    padding-top: .125rem;
    padding-bottom: .125rem;
    text-align: left;
  }

  .mobile-nav {
    padding: .75rem .875rem 1rem;
    /* Notch support for bottom navigation */
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .auth-page .site-main { padding: 1rem .875rem; }
  .auth-card { padding: 1.5rem 1rem; border-radius: var(--radius); }

  /* Hero & Typography Overrides */
  .hero { padding: 2.25rem 0 2rem; }
  .hero-title { font-size: 1.9rem; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { grid-template-columns: 1fr; }

  .section-header { margin-bottom: 1.25rem; }
  .section-title, .page-header h1, .forum-header h1,
  .admin-header h1, .challenges-header h1 {
    font-size: 1.5rem;
  }

  /* Universal 1-Column Grids */
  .games-grid, .games-grid--featured, .users-grid, .badges-admin-grid,
  .achievements-grid, .events-grid, .stats-grid, .friends-grid,
  .platforms-grid, .screenshots-grid {
    grid-template-columns: 1fr;
  }

  .game-card-img, .game-card--featured .game-card-img { height: 150px; }
  .games-scroll { gap: .75rem; }
  .game-card-sm { width: 135px; }

  /* Profile & Lists */
  .profile-layout { padding: 1rem .875rem; }
  .profile-sidebar {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }
  .profile-stats-mini, .profile-stats-mini--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .profile-stats-mini--5 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .overview-grid { gap: 1rem; }
  .review-game-link, .review-user, .game-list-item { align-items: flex-start; }
  .review-footer, .feed-pagination { align-items: stretch; flex-direction: column; }

  .page-header { padding: 1.25rem 0 1rem; }
  .filters-sidebar { padding: .875rem; }

  .game-title { font-size: 1.5rem; }
  .game-cover img { width: 112px; }
  .game-cover-placeholder { width: 112px; height: 150px; }

  /* Forum & Admin tweaks */
  .forum-container, .admin-container { padding: 1rem .875rem; }
  .forum-messages {
    height: calc(100dvh - 250px);
    min-height: 300px;
    padding: .875rem;
  }
  .forum-input-wrap { padding: .875rem; }
  .forum-my-avatar { display: none; }
  .forum-msg { gap: .625rem; }
  .forum-msg-avatar img, .forum-msg-avatar .avatar-placeholder {
    width: 30px; height: 30px;
  }
  .forum-empty { padding: 2rem 1rem; }

  .stat-card-lg, .badge-admin-card, .psn-game-item, .steam-recent-item {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .lb-score { text-align: left; }
  .admin-table { min-width: 560px; }

  .chat-sidebar { max-height: 190px; }
  .chat-channel-item { padding: .5rem .875rem; }
  .chat-main { min-height: calc(100dvh - 250px); }

  .cta-section { padding: 2.5rem 0; }
  .cta-box { padding: 1.75rem 1rem; border-radius: var(--radius); }
  .cta-box h2 { font-size: 1.35rem; }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
    width: 100%;
    padding-bottom: .75rem;
  }
  .footer-brand {
    padding-top: .75rem;
    width: 100%;
  }
  .footer-inner {
    padding-left: .875rem;
    padding-right: .875rem;
  }
  .footer-brand .logo {
    display: inline-flex;
    width: auto;
  }
  .footer-brand .logo span { display: inline; }
  .footer-tagline { margin-top: .5rem; }
  .footer-col { min-width: 0; }
  .footer-col a { overflow-wrap: normal; }
}

/* =========================================
   SMALL MOBILE PHONES (Max 420px)
========================================= */
@media (max-width: 420px) {
  .logo span { display: none; }
  .footer-brand .logo span { display: inline; }
  .nav-notif { width: 34px; height: 34px; }
  .notif-dropdown { right: -2.75rem; width: calc(100vw - 1rem); }
  .dropdown-menu { right: -.25rem; }

  .hero-title { font-size: 1.7rem; }
  .game-card-img, .game-card--featured .game-card-img { height: 130px; }
  .game-card-body { padding: .75rem; }

  .profile-avatar, .profile-avatar-placeholder { width: 72px; height: 72px; }
  .profile-avatar-placeholder { font-size: 1.5rem; }
  .tab-title { font-size: 1.2rem; }

  .review-actions, .challenge-actions,
  .friend-request-actions, .notif-friend-actions {
    flex-direction: column;
  }
  .star-btn { font-size: 1.5rem; }
}