/* =========================================================
   GameCouch Design System — dark, blue accent, app-ready
   ========================================================= */

:root {
  --bg: #0b0d12;
  --bg-elevated: #10131a;
  --surface: #141822;
  --surface-2: #1a2030;
  --surface-3: #222a3c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --text-muted: #9aa3b8;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --accent-hover: #3b7af0;
  --danger: #ff5c7a;
  --danger-soft: rgba(255, 92, 122, 0.12);
  --star: #f5c518;
  --success: #3dd68c;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 64px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-x: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(79, 140, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(124, 92, 255, 0.08), transparent 50%),
    var(--bg) !important;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  padding-top: calc(var(--nav-h) + var(--safe-top));
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

/* Tailwind preflight recovery for our components */
button.nav-btn,
button.action-btn,
button.btn-submit,
button.quick-star,
button.comment-action-btn,
button.nav-burger,
button.follow-tab,
button.expand-btn,
button.spoiler-reveal {
  font-family: inherit;
}

img.game-cover,
img.navbar-logo,
.shelf-game img,
.activity-cover,
.yir-cover {
  max-width: none;
}

.game-cover {
  width: 120px;
  max-width: 120px;
}

/* Prevent flex children from collapsing weirdly under preflight */
.game-card > * {
  min-width: 0;
}

.game-actions {
  min-width: 2.75rem;
}



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

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1, h2, h3 {
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* ===== Layout ===== */
.page-wrapper {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 800;
}

.page-header p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

/* ===== Forms ===== */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.form-card h1 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control,
.form-select,
input.form-control,
textarea.form-control {
  width: 100%;
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.7rem 0.85rem !important;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
textarea.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

.form-control::placeholder {
  color: #6b7388 !important;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.input-group {
  display: flex;
}

.input-group-text {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-muted) !important;
  padding: 0.7rem 0.75rem;
}

/* ===== Buttons / nav chips ===== */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
  text-decoration: none;
}

.nav-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: white;
}

.nav-btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b6cff);
  border-color: transparent;
  color: white;
}

.nav-btn-primary:hover {
  filter: brightness(1.08);
  color: white;
}

/* ===== Site nav ===== */
.site-nav,
.navbar-custom {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: rgba(11, 13, 18, 0.82) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}

.site-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--nav-h);
  width: min(1100px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding-left: var(--safe-x);
  padding-right: var(--safe-x);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text) !important;
}

.navbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-text {
  white-space: nowrap;
}

.brand-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-mobile-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-burger {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated, var(--surface));
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.nav-drawer-inner {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem 1rem;
  gap: 0.2rem;
  width: min(1100px, 100%);
  margin: 0 auto;
}

.nav-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.95rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.nav-drawer-link:hover,
.nav-drawer-link:active {
  background: var(--surface-2);
  color: var(--accent);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: calc(var(--nav-h) + var(--safe-top));
  background: rgba(0, 0, 0, 0.5);
  z-index: 1030;
}

body.nav-open { overflow: hidden; }

.notif-nav { position: relative; }
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

@media (max-width: 1023px) {
  .nav-desktop { display: none !important; }
  .nav-mobile-tools { display: flex !important; }
  .nav-drawer:not([hidden]) { display: block; }
  .nav-backdrop:not([hidden]) { display: block; }
  .nav-mobile-log { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
}

@media (min-width: 1024px) {
  .nav-desktop { display: flex !important; }
  .nav-mobile-tools { display: none !important; }
  .nav-drawer, .nav-backdrop { display: none !important; }
}

/* Bootstrap dropdown override */
.dropdown-menu {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow);
  padding: 0.35rem !important;
}
.dropdown-item {
  color: var(--text) !important;
  border-radius: 8px;
  font-weight: 500;
}
.dropdown-item:hover {
  background: var(--accent-soft) !important;
  color: white !important;
}

/* ===== Review cards ===== */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-card {
  display: flex;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.game-cover,
.game-cover-placeholder {
  width: 120px;
  height: 160px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.game-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.75rem;
}

.game-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stars {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  color: var(--star);
  font-size: 1rem;
}
.star.empty { color: #3a4154; }

.game-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.game-notes {
  margin: 0;
  color: #c5cbe0;
  font-size: 0.95rem;
}

.game-notes.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0;
  cursor: pointer;
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.liked {
  color: var(--danger);
  border-color: rgba(255, 92, 122, 0.4);
  background: var(--danger-soft);
}

.like-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .game-card {
    /* keep side-by-side cover + content; later grid rules refine sizes */
    align-items: start;
  }
}

/* Comments */
.comments-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.comments-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.comment {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.comment-author { font-weight: 700; }
.comment-date { color: var(--text-muted); }
.comment-body { margin: 0; font-size: 0.9rem; }

.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.comment-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.comment-action-btn.danger { color: var(--danger); }

.add-comment-form textarea {
  margin-bottom: 0.35rem;
}

.login-to-comment {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Profile ===== */
.profile-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 !important;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  z-index: 3;
  background: linear-gradient(90deg, var(--profile-accent, var(--accent)), var(--accent-2));
  pointer-events: none;
}

.profile-banner-wrap {
  display: block !important;
  width: 100% !important;
  flex: 0 0 auto;
  height: 200px;
  max-height: 200px;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
}

.profile-banner-img {
  width: 100% !important;
  height: 200px !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center;
  display: block !important;
}

.profile-banner-fallback {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, rgba(79,140,255,0.4), rgba(124,92,255,0.25), var(--surface));
}

.profile-header-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  width: 100%;
  padding: 0 1.5rem 1.5rem;
  box-sizing: border-box;
  position: relative;
}

.profile-header .profile-avatar {
  margin-top: -56px;
  z-index: 2;
  flex: 0 0 auto;
}

.profile-header .profile-avatar img,
.profile-header .avatar-placeholder {
  width: 96px !important;
  height: 96px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  background: var(--surface-2);
}

.profile-header .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.profile-header .profile-info {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
  padding-top: 0.35rem;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.profile-username {
  color: var(--text-muted);
  margin: 0.15rem 0 0.5rem;
}

.profile-title {
  color: var(--profile-accent, var(--accent));
  font-weight: 600;
  margin: -0.15rem 0 0.5rem;
  font-size: 0.9rem;
}

.profile-bio {
  color: #c8cfdf;
  margin: 0.5rem 0;
}

.profile-joined {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0;
}

.profile-stat {
  text-align: center;
  color: inherit;
}

.stat-value {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.profile-pronouns {
  color: var(--text-muted);
  font-weight: 500;
}

.profile-meta-line {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.profile-style-compact .profile-banner-wrap,
.profile-style-compact .profile-banner-img,
.profile-style-compact .profile-banner-fallback {
  height: 120px;
  max-height: 120px;
}

.profile-style-vivid {
  border-color: color-mix(in srgb, var(--profile-accent, var(--accent)) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--profile-accent, var(--accent)) 20%, transparent),
              0 16px 48px rgba(0,0,0,0.35);
}

.you-badge,
.level-badge {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.level-badge {
  color: var(--profile-accent, var(--accent));
  border-color: rgba(79, 140, 255, 0.35);
  background: var(--accent-soft);
}

@media (max-width: 700px) {
  .profile-banner-wrap,
  .profile-banner-img,
  .profile-banner-fallback {
    height: 140px !important;
    max-height: 140px;
  }
  .profile-header .profile-avatar {
    margin-top: -44px;
  }
  .profile-header .profile-avatar img,
  .profile-header .avatar-placeholder {
    width: 80px !important;
    height: 80px !important;
  }
  .profile-header-inner {
    padding: 0 1rem 1.25rem;
  }
}

.favorite-game-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem 0.2rem 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  max-width: min(100%, 280px);
  text-decoration: none;
}
.favorite-game-chip img {
  width: 28px !important;
  height: 38px !important;
  max-width: 28px !important;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}
.favorite-game-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.favorite-game-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* Cropper needs explicit height in dark UI */
.crop-stage {
  min-height: 240px;
}
.cropper-container {
  max-height: 360px !important;
}

@media (min-width: 1024px) {
  .nav-desktop .nav-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
  }
}

/* ===== Profile stats (template uses .stat / .stat-num) ===== */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.85rem 0;
  width: 100%;
  max-width: none;
}

.profile-stats .stat,
.profile-stats .stat-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.25rem;
  min-width: 0;
}

.profile-stats .stat-num {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-stats .stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 0.15rem;
}

.profile-stats .stat-link:hover .stat-num {
  color: var(--accent);
}

/* ===== XP block ===== */
.xp-block {
  margin: 0.9rem 0 0.5rem;
  width: 100%;
  max-width: none;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.xp-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  gap: 0.75rem;
}

.xp-bar {
  height: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--profile-accent, var(--accent)), var(--accent-2));
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.xp-total {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.xp-capped {
  color: #ff8a8a;
  font-weight: 700;
}

.xp-next-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  align-items: center;
}

.xp-reward-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.72rem;
}

/* ===== Favorite game chip (refined) ===== */
.favorite-game-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
  max-width: min(100%, 300px);
  text-decoration: none;
  vertical-align: middle;
}

.favorite-game-chip img {
  width: 32px !important;
  height: 42px !important;
  max-width: 32px !important;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.favorite-game-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.favorite-game-chip-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.favorite-game-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.favorite-game-chip:hover {
  border-color: var(--accent);
}

.favorite-game-chip:hover .favorite-game-chip-title {
  color: var(--accent);
}

/* ===== Achievements ===== */
.achievements-section {
  margin: 1.5rem 0;
}

.achievements-section h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.achievements-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 0.85rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.achievement-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  opacity: 0.4;
  align-items: flex-start;
}

.achievement-card.unlocked {
  opacity: 1;
  border-color: rgba(79, 140, 255, 0.35);
  background: linear-gradient(135deg, rgba(79,140,255,0.08), rgba(124,92,255,0.05));
}

.achievement-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.achievement-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.achievement-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.achievement-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}


/* ===== Profile primary links (Diary / Year Review) ===== */
.profile-primary-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  width: 100%;
  margin: 0.85rem 0 0.5rem;
}

.profile-primary-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(79, 140, 255, 0.35);
  background: linear-gradient(135deg, rgba(79,140,255,0.14), rgba(124,92,255,0.08));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.profile-primary-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(79,140,255,0.22), rgba(124,92,255,0.12));
}

.profile-primary-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.profile-primary-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-actions {
  width: 100%;
}

@media (max-width: 520px) {
  .profile-primary-links {
    grid-template-columns: 1fr;
  }
  .profile-stats {
    max-width: none;
  }
}

/* ===== Profile two-column body ===== */
.profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1.25rem 1.5rem;
  width: 100%;
  align-items: start;
}

.profile-main {
  min-width: 0;
}

.profile-aside {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.favorite-showcase {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.favorite-showcase:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.favorite-showcase-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 280px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.favorite-showcase-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-muted);
  aspect-ratio: 3 / 4;
  max-height: 280px;
}

.favorite-showcase-meta {
  padding: 0.75rem 0.85rem 0.9rem;
}

.favorite-showcase-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.favorite-showcase-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.profile-achievements {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem;
}

.profile-achievements-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.55rem;
  gap: 0.5rem;
}

.profile-achievements-title {
  font-weight: 800;
  font-size: 0.85rem;
}

.profile-achievements-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-achievements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
}

.profile-ach-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  opacity: 0.35;
  min-width: 0;
}

.profile-ach-item.unlocked {
  opacity: 1;
  border-color: rgba(79, 140, 255, 0.3);
  background: rgba(79, 140, 255, 0.08);
}

.profile-ach-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  line-height: 1;
}

.profile-ach-name {
  font-size: 0.7rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .profile-body {
    grid-template-columns: 1fr;
  }
  .favorite-showcase-cover,
  .favorite-showcase-fallback {
    max-height: 220px;
    aspect-ratio: 16 / 10;
  }
  .profile-achievements-grid {
    max-height: none;
  }
}

/* ===== Profile lists in header ===== */
.profile-lists-panel {
  margin-top: 1rem;
  width: 100%;
}

.profile-lists-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.profile-lists-title {
  font-weight: 800;
  font-size: 0.85rem;
}

.profile-lists-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-lists-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.profile-list-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
  min-width: 0;
}

.profile-list-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.profile-list-covers {
  display: flex;
  height: 56px;
  background: var(--surface-2);
}

.profile-list-covers img {
  flex: 1;
  width: 0;
  height: 56px;
  object-fit: cover;
}

.profile-list-covers-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.profile-list-meta {
  padding: 0.5rem 0.6rem 0.55rem;
}

.profile-list-name {
  font-weight: 700;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-list-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

@media (max-width: 520px) {
  .profile-lists-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== Profile owner toolbar ===== */
.profile-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.15rem;
  width: 100%;
}

.profile-owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.profile-action-btn {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.8rem !important;
}

.profile-visitor-actions {
  margin: 0.75rem 0 0.25rem;
}

@media (max-width: 600px) {
  .profile-topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-owner-actions {
    margin-left: 0;
  }
}


/* Banner owner actions */
.profile-banner-wrap {
  position: relative;
}

.profile-banner-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  z-index: 2;
  justify-content: flex-end;
  max-width: calc(100% - 1.5rem);
}

.banner-action {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: rgba(11, 13, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.banner-action:hover {
  background: rgba(11, 13, 18, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

.banner-action-primary {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.95), rgba(124, 92, 255, 0.9));
  border-color: transparent;
}

.banner-action-primary:hover {
  filter: brightness(1.08);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.95), rgba(124, 92, 255, 0.9));
}

/* Social pills */
.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 0.55rem;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.social-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.social-pill-text {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-pill:hover {
  transform: translateY(-1px);
}

.social-twitch .social-pill-icon {
  background: #9146ff;
  color: #fff;
}
.social-twitch:hover {
  border-color: #9146ff;
  background: rgba(145, 70, 255, 0.12);
}

.social-youtube .social-pill-icon {
  background: #ff0000;
  color: #fff;
}
.social-youtube:hover {
  border-color: #ff0000;
  background: rgba(255, 0, 0, 0.1);
}

.social-x .social-pill-icon {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}
.social-x:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 700px) {
  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .profile-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* Status shelves below profile header */
.status-shelves-section {
  margin: 1.25rem 0 0.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.shelf-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .status-shelves-section {
    grid-template-columns: 1fr;
  }
}

.shelf-title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.shelf-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.shelf-row {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.shelf-card {
  flex: 0 0 auto;
  width: 72px;
  text-decoration: none;
  color: inherit;
}

.shelf-card img,
.shelf-card-placeholder {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}

.shelf-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
}

.shelf-card-title {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-card:hover .shelf-card-title {
  color: var(--accent);
}


/* Profile mid stats — fill space beside identity / above XP less stacked */
.profile-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  column-gap: 1rem;
  row-gap: 0.35rem;
  align-items: start;
}

/* Identity stays left */
.profile-name-row,
.profile-username,
.profile-meta-line,
.profile-bio,
.profile-title,
.profile-socials {
  grid-column: 1;
}

/* Stats sit top-right of main */
.profile-mid {
  grid-column: 2;
  grid-row: 1 / span 5;
  align-self: start;
  margin-top: 0.15rem;
}

/* Full width under identity + stats */
.xp-block,
.profile-joined,
.profile-primary-links,
.profile-visitor-actions,
.profile-lists-panel {
  grid-column: 1 / -1;
}

.profile-stats-mid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: 1fr;
  gap: 0.4rem !important;
  max-width: none !important;
  margin: 0 !important;
  align-content: start;
}

.profile-stats-mid .stat,
.profile-stats-mid .stat-link,
.profile-stats-mid .stat-btn {
  padding: 0.5rem 0.3rem !important;
  min-height: 4.1rem;
  height: 100%;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.profile-stats-mid .stat-num {
  font-size: 1rem !important;
  line-height: 1.15;
}

.profile-stats-mid .stat-label {
  font-size: 0.58rem !important;
  line-height: 1.15;
  margin-top: 0.2rem;
  max-width: 100%;
  padding: 0 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 700px) {
  .profile-main {
    grid-template-columns: 1fr;
  }
  .profile-mid {
    grid-column: 1;
    grid-row: auto;
  }
  .profile-stats-mid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}


/* Clickable profile stats */
.profile-stats-mid .stat-btn {
  cursor: pointer;
  border-color: rgba(79, 140, 255, 0.35);
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.12), rgba(79, 140, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, 0.08);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.profile-stats-mid .stat-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.22), rgba(79, 140, 255, 0.08));
  transform: translateY(-1px);
  color: inherit;
}

.profile-stats-mid .stat-btn:hover .stat-num {
  color: var(--accent);
}

.profile-stats-mid .stat-btn .stat-label {
  color: #a8b3cc;
}

.profile-stats-mid .stat:not(.stat-btn) {
  opacity: 0.95;
}


/* Align lists bottom with achievements bottom */
.profile-body {
  align-items: stretch !important;
}

.profile-main {
  height: 100%;
  align-content: start;
}

.profile-aside {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.profile-lists-panel {
  margin-top: auto !important;
  padding-top: 0.75rem;
}

.profile-achievements {
  margin-top: auto !important;
}

.profile-location {
  color: var(--text-muted);
  font-weight: 500;
}

.profile-username {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}


/* ===== Equal-height columns: lists align with achievements ===== */
.profile-body {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
  gap: 1.25rem 1.5rem !important;
  align-items: stretch !important;
  width: 100%;
}

.profile-main {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100%;
  height: 100%;
  grid-template-columns: none !important;
}

.profile-main-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  column-gap: 1rem;
  row-gap: 0.35rem;
  align-items: start;
}

.profile-main-top > .profile-name-row,
.profile-main-top > .profile-username,
.profile-main-top > .profile-bio,
.profile-main-top > .profile-title,
.profile-main-top > .profile-socials {
  grid-column: 1;
}

.profile-main-top > .profile-mid {
  grid-column: 2;
  grid-row: 1 / span 6;
  align-self: start;
}

.profile-main-top > .xp-block,
.profile-main-top > .profile-joined,
.profile-main-top > .profile-primary-links,
.profile-main-top > .profile-visitor-actions {
  grid-column: 1 / -1;
}

.profile-main > .profile-lists-panel {
  margin-top: auto !important;
  padding-top: 1rem;
  grid-column: auto !important;
}

.profile-aside {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100%;
  height: 100%;
  gap: 0.85rem;
}

.profile-aside > .favorite-showcase {
  flex: 0 0 auto;
}

.profile-aside > .profile-achievements {
  margin-top: auto !important;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .profile-body {
    grid-template-columns: 1fr !important;
  }
  .profile-main-top {
    grid-template-columns: 1fr;
  }
  .profile-main-top > .profile-mid {
    grid-column: 1;
    grid-row: auto;
  }
  .profile-main > .profile-lists-panel,
  .profile-aside > .profile-achievements {
    margin-top: 0.85rem !important;
  }
}


/* Restore horizontal width while keeping bottom alignment */
.profile-header-inner {
  width: 100%;
}

.profile-info {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
}

.profile-body {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 280px !important;
  gap: 1rem 1.15rem !important;
  width: 100% !important;
  align-items: stretch !important;
}

.profile-main {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100%;
  height: 100%;
}

.profile-main-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 270px !important;
  column-gap: 0.85rem !important;
  row-gap: 0.35rem !important;
  width: 100% !important;
}

.profile-main-top > .xp-block,
.profile-main-top > .profile-joined,
.profile-main-top > .profile-primary-links,
.profile-main-top > .profile-visitor-actions {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
}

.profile-primary-links {
  width: 100% !important;
}

.profile-lists-panel {
  width: 100% !important;
  margin-top: auto !important;
}

.profile-aside {
  width: 280px !important;
  max-width: 280px !important;
}

.favorite-showcase-cover,
.favorite-showcase-fallback {
  max-height: 300px !important;
}

.profile-stats-mid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  width: 100% !important;
}

@media (max-width: 900px) {
  .profile-body {
    grid-template-columns: 1fr !important;
  }
  .profile-aside {
    width: 100% !important;
    max-width: none !important;
  }
  .profile-main-top {
    grid-template-columns: 1fr !important;
  }
}


/* Equal vertical rhythm: top / XP / diary / lists */
.profile-main {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 0.85rem !important;
  min-height: 100% !important;
  height: 100% !important;
}

.profile-main-top {
  flex: 0 0 auto;
}

.profile-main > .xp-block,
.profile-main > .profile-joined,
.profile-main > .profile-primary-links,
.profile-main > .profile-visitor-actions {
  flex: 0 0 auto;
  width: 100% !important;
  max-width: none !important;
  grid-column: auto !important;
}

.profile-main > .profile-joined {
  margin: 0 !important;
}

.profile-main > .profile-lists-panel {
  flex: 0 0 auto;
  margin-top: 0 !important;
  padding-top: 0 !important;
  width: 100% !important;
}

/* Group joined with diary visually: small gap handled by parent */
.profile-main > .profile-joined + .profile-primary-links {
  margin-top: -0.35rem;
}


/* Shelf previews — consistent cover width (matches 5+ layout) */
.shelf-preview {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  gap: 0;
}

/* Same width as in the 5+ case: 4 covers share (100% - 44px) */
.shelf-preview-item {
  flex: 0 0 calc((100% - 44px) / 4);
  width: calc((100% - 44px) / 4);
  max-width: calc((100% - 44px) / 4);
  height: 78px;
  display: block;
  min-width: 0;
  position: relative;
}

.shelf-preview-item img,
.shelf-preview-fallback {
  width: 100%;
  height: 78px;
  object-fit: cover;
  display: block;
}

.shelf-preview-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-2);
}

.shelf-preview-more {
  flex: 0 0 44px;
  width: 44px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  margin-left: auto;
}

.shelf-preview-item + .shelf-preview-item {
  border-left: 1px solid rgba(0,0,0,0.25);
}

/* Hide old scrolling shelf row if present */
.shelf-row {
  overflow: hidden;
}



/* ===== Full-width Twitch live embed ===== */
.twitch-embed-section {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(145, 70, 255, 0.35);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.twitch-embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, rgba(145, 70, 255, 0.14), rgba(79, 140, 255, 0.06));
  border-bottom: 1px solid var(--border);
}

.twitch-embed-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 220px;
}

.twitch-embed-text {
  min-width: 0;
}

.twitch-embed-title {
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twitch-embed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.twitch-channel {
  color: #c4a6ff;
  font-weight: 700;
}

.twitch-game {
  color: var(--text);
  font-weight: 600;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #e91916;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 0 3px rgba(233, 25, 22, 0.2);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.twitch-open-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #9146ff;
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  transition: filter 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.twitch-open-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  color: #fff !important;
}

.twitch-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0e0e10;
}

.twitch-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.twitch-offline {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
  font-size: 0.9rem;
}

.twitch-offline-label {
  font-weight: 800;
  color: #c4a6ff;
}

.twitch-offline a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 700px) {
  .twitch-embed-title {
    white-space: normal;
  }
}


/* List cards (fallback styles if missing) */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.list-card {
  display: block;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.list-card:hover { border-color: var(--accent); }
.list-card-title { font-weight: 700; margin-bottom: 0.25rem; }
.list-card-meta { font-size: 0.8rem; color: var(--text-muted); }
.list-card-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; }


/* Dismissible live notice (below stream) */
.live-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(90deg, rgba(233, 25, 22, 0.18), rgba(145, 70, 255, 0.12));
  border-top: 1px solid rgba(233, 25, 22, 0.35);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}
.live-notice-text {
  flex: 1 1 auto;
}
.live-notice-close {
  flex: 0 0 auto;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.live-notice-close:hover {
  background: rgba(233, 25, 22, 0.85);
  border-color: #fff;
}


/* ===== Redesigned review cards ===== */
.game-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 1rem 1.1rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover {
  border-color: rgba(79, 140, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.game-cover-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.game-cover,
.game-cover-placeholder {
  width: 110px;
  height: 148px;
  object-fit: cover;
  display: block;
}

.game-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-muted);
}

.game-content {
  min-width: 0;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.meta-chip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.stars {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-bottom: 0.25rem;
}

.stars .star {
  color: #f5c542;
  font-size: 1rem;
  line-height: 1;
}

.stars .star.empty {
  color: rgba(255, 255, 255, 0.18);
}

.rating-num {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.game-title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

.game-title a:hover {
  color: var(--accent);
}

.game-notes {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.game-notes-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.game-notes.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.25rem 0 0;
  cursor: pointer;
}

.game-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.liked {
  color: #ff6b8a;
  border-color: rgba(255, 107, 138, 0.45);
  background: rgba(255, 107, 138, 0.1);
}

.action-btn.delete:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.5);
}

.like-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Comments redesign */
.comments-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.comment-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text);
}

.comment {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.comment-author a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.add-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.comment-input,
.add-comment-form textarea.form-control {
  width: 100%;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  padding: 0.7rem 0.85rem !important;
  resize: vertical;
  min-height: 64px;
  font-size: 0.9rem;
}

.comment-input:focus,
.add-comment-form textarea.form-control:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Spoiler toggle pill */
.spoiler-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.spoiler-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.spoiler-toggle-ui {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.spoiler-toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.spoiler-toggle input:checked + .spoiler-toggle-ui {
  background: rgba(245, 158, 11, 0.35);
  border-color: #f59e0b;
}

.spoiler-toggle input:checked + .spoiler-toggle-ui::after {
  transform: translateX(18px);
  background: #f59e0b;
}

.spoiler-toggle input:checked ~ .spoiler-toggle-label {
  color: #fbbf24;
}

.comment-submit {
  padding: 0.45rem 1rem !important;
  font-size: 0.85rem !important;
  border-radius: 999px !important;
}

/* Spoiler blocks in reviews */
.spoiler-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.spoiler-badge {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spoiler-reveal {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.spoiler-reveal:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
}

.spoiler-content.is-hidden {
  display: none;
}

@media (max-width: 700px) {
  .game-card {
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .game-cover,
  .game-cover-placeholder {
    width: 84px;
    height: 112px;
  }
  .game-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 0.15rem;
  }
}


/* Review card polish v2 */
.game-card {
  grid-template-columns: 140px minmax(0, 1fr) !important;
  gap: 1.1rem 1.25rem !important;
}

.game-cover-link {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.game-cover,
.game-cover-placeholder {
  width: 140px !important;
  height: 188px !important;
}

.review-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.review-title-row .game-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.review-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.review-inline-actions .like-count {
  min-width: 1rem;
  text-align: center;
}

/* True half-star fill */
.stars .star {
  position: relative;
  display: inline-block;
  font-size: 1.15rem !important;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
}

.stars .star.full {
  color: #f5c542 !important;
}

.stars .star.half {
  color: rgba(255, 255, 255, 0.18) !important;
  background: linear-gradient(90deg, #f5c542 0 50%, rgba(255, 255, 255, 0.18) 50% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stars .star.empty {
  color: rgba(255, 255, 255, 0.18) !important;
}

.meta-chip.meta-by a {
  margin-left: 0.15rem;
}

.review-owner-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.15rem;
  margin-top: -0.15rem;
}

.owner-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.owner-link-btn:hover {
  color: var(--accent);
}

.owner-link-btn.danger:hover {
  color: #ff6b6b;
}

@media (max-width: 700px) {
  .game-card {
    grid-template-columns: 100px minmax(0, 1fr) !important;
  }
  .game-cover,
  .game-cover-placeholder {
    width: 100px !important;
    height: 134px !important;
  }
}


.review-side-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.review-owner-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.review-owner-links form {
  display: inline;
  margin: 0;
}


.game-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.game-meta-row .game-meta {
  margin-bottom: 0;
  flex: 1 1 auto;
}

.game-meta-row .review-owner-links {
  flex-shrink: 0;
  margin-left: auto;
}


.game-cover-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.cover-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
}

.cover-actions form {
  margin: 0;
}

.review-like-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  margin-left: auto;
}

.review-like-stack .like-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

.game-meta-row {
  align-items: flex-start;
}


.reviews-sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.reviews-sort-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.sort-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.sort-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-chip.active {
  background: rgba(79, 140, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.pagination-info {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}


/* ===== Force identical review cards everywhere ===== */
.game-list .game-card,
article.game-card {
  display: grid !important;
  grid-template-columns: 140px minmax(0, 1fr) !important;
  gap: 1.1rem 1.25rem !important;
  align-items: start !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 1rem 1.1rem !important;
  margin-bottom: 0.9rem !important;
}

.game-cover-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.cover-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.65rem !important;
  justify-content: center !important;
  width: 100%;
}

.cover-actions form {
  display: inline-flex !important;
  margin: 0 !important;
}

.game-cover,
.game-cover-placeholder {
  width: 140px !important;
  height: 188px !important;
  object-fit: cover !important;
  border-radius: 12px;
}

.game-meta-row {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  flex-wrap: wrap !important;
  margin-bottom: 0.45rem !important;
}

.review-like-stack {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.15rem !important;
  margin-left: auto !important;
}

.comment-form-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  flex-wrap: wrap !important;
}

.spoiler-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.spoiler-toggle input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

/* Hide legacy checkbox label style if any leftover markup */
label.spoiler-check {
  display: none !important;
}

@media (max-width: 700px) {
  .game-list .game-card,
  article.game-card {
    grid-template-columns: 100px minmax(0, 1fr) !important;
  }
  .game-cover,
  .game-cover-placeholder {
    width: 100px !important;
    height: 134px !important;
  }
}


/* Diary stars match review card stars */
.diary-stars {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-top: 0.2rem;
}

.diary-stars .star {
  position: relative;
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
}

.diary-stars .star.full {
  color: #f5c542 !important;
}

.diary-stars .star.half {
  color: rgba(255, 255, 255, 0.18) !important;
  background: linear-gradient(90deg, #f5c542 0 50%, rgba(255, 255, 255, 0.18) 50% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.diary-stars .star.empty {
  color: rgba(255, 255, 255, 0.18) !important;
}

.diary-rating-num {
  margin-left: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}


/* ===== Diary list layout ===== */
.diary-month {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.diary-month-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.diary-entry {
  display: grid;
  grid-template-columns: 36px 56px minmax(0, 1fr);
  gap: 0.75rem 0.85rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.diary-day {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
  text-align: center;
  align-self: center;
}

.diary-cover-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 56px;
  height: 75px;
  flex-shrink: 0;
}

.diary-cover,
.diary-cover-placeholder {
  width: 56px !important;
  height: 75px !important;
  object-fit: cover !important;
  display: block;
}

.diary-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-2);
}

.diary-body {
  min-width: 0;
}

.diary-game-title {
  display: inline-block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.15rem;
}

.diary-game-title:hover {
  color: var(--accent);
}

.diary-notes {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.diary-stars {
  display: flex !important;
  align-items: center;
  gap: 0.08rem;
  margin-top: 0.15rem;
}

.diary-stars .star {
  font-size: 0.95rem !important;
}

.diary-rating-num {
  margin-left: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

@media (max-width: 500px) {
  .diary-entry {
    grid-template-columns: 28px 48px minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.65rem 0.7rem;
  }
  .diary-cover-link,
  .diary-cover,
  .diary-cover-placeholder {
    width: 48px !important;
    height: 64px !important;
  }
}

.yir-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.yir-stat {
  text-align: center;
}


/* ===== Year in Review (restored) ===== */
.yir-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.35rem;
  margin-bottom: 1.5rem;
}

.yir-hero-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.yir-avatar,
.yir-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.yir-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
}

.yir-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.yir-hero h1 {
  margin: 0.15rem 0;
  font-size: 1.55rem;
  font-weight: 800;
}

.yir-user {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.yir-stats {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.65rem !important;
  margin-top: 1.25rem !important;
  width: 100% !important;
}

.yir-stat {
  min-width: 100px;
  padding: 0.75rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center !important;
}

.yir-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.yir-stat-label {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.yir-section {
  margin-bottom: 1.75rem;
}

.yir-section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.yir-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
  min-height: 140px;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.yir-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 140px;
}

.yir-bar-track {
  flex: 1;
  width: 100%;
  max-width: 28px;
  display: flex;
  align-items: flex-end;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.yir-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2, #7c5cff));
  border-radius: 6px 6px 0 0;
  min-height: 0;
}

.yir-bar-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.yir-bar-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  min-height: 0.9rem;
}

.yir-top-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.yir-top-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.yir-top-item:hover {
  border-color: var(--accent);
}

.yir-rank {
  width: 1.5rem;
  text-align: center;
  font-weight: 800;
  color: var(--text-muted);
}

.yir-cover,
.yir-cover-fallback {
  width: 44px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.yir-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
}

.yir-top-title {
  font-weight: 700;
}

.yir-top-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.yir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.65rem;
}

.yir-grid-item {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 2 / 3;
  background: var(--surface-2);
}

.yir-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yir-grid-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-muted);
}

.yir-grid-rating {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  color: #f5c542;
  font-size: 0.72rem;
  font-weight: 800;
}

@media (max-width: 700px) {
  .yir-bars {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: auto;
  }
  .yir-bar-col {
    height: 110px;
  }
}


/* ===== Followers / Following list ===== */
.follow-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.follow-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.follow-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.follow-tab.active {
  background: rgba(79, 140, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 720px;
}

.user-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.user-list-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.user-list-avatar,
.user-list-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-2);
}

.user-list-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.user-list-name {
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.2;
}

.user-list-handle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.user-list-bio {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.user-list-item form {
  margin: 0;
  flex-shrink: 0;
}

.user-list-item .nav-btn {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .user-list-item {
    flex-wrap: wrap;
  }
  .user-list-item form {
    width: 100%;
  }
  .user-list-item .nav-btn {
    width: 100%;
  }
}


/* Center followers / following page content */
.page-wrapper:has(.follow-tabs) {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-wrapper:has(.follow-tabs) .page-header,
.page-wrapper:has(.follow-tabs) .follow-tabs,
.page-wrapper:has(.follow-tabs) .user-list,
.page-wrapper:has(.follow-tabs) .empty-state {
  width: 100%;
  max-width: 720px;
}

.page-wrapper:has(.follow-tabs) .page-header {
  text-align: left;
}

.page-wrapper:has(.follow-tabs) .follow-tabs {
  justify-content: flex-start;
}


/* ===== List detail page ===== */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.list-owner {
  margin: 0 0 0.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.list-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.list-description {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

.list-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.list-owner-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.page-wrapper:has(.list-items),
.page-wrapper:has(.list-header) {
  /* keep content readable width */
}

.page-wrapper:has(.list-header) > .form-card,
.page-wrapper:has(.list-header) > .list-items,
.page-wrapper:has(.list-header) > .empty-state {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.list-rank {
  width: 1.75rem;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.list-item-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.list-item-cover,
.list-item-cover-placeholder {
  width: 52px !important;
  height: 70px !important;
  object-fit: cover !important;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
  display: block;
}

.list-item-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
}

.list-item-title {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.25;
}

.list-item-notes {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.list-move-btn {
  padding: 0.25rem 0.45rem !important;
  font-size: 0.75rem !important;
  min-width: 2rem;
}

.list-move-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* search results under add-game on list page */
#list-search-results.search-results,
.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.search-result-item img,
.search-result-placeholder {
  width: 40px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.search-result-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.search-result-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .list-item {
    flex-wrap: wrap;
  }
  .list-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}


/* List drag and drop */
.list-drag-handle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  border-radius: 6px;
}

.list-drag-handle:hover {
  color: var(--text);
  background: var(--surface-2);
}

.list-item.is-draggable {
  cursor: grab;
}

.list-item.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.list-item.is-draggable:active {
  cursor: grabbing;
}


.list-item.is-touch-dragging {
  opacity: 0.35;
}

.list-touch-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.95;
  margin: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--accent) !important;
  border-radius: 14px;
  background: var(--surface);
}

.list-drag-handle {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.list-item.is-draggable {
  -webkit-user-select: none;
  user-select: none;
}


/* ===== List page polish v2 ===== */
.page-wrapper:has(.list-header) {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.list-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 1rem !important;
  margin-bottom: 1.25rem !important;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  max-width: none !important;
  width: 100% !important;
}

.list-title {
  font-size: 1.75rem !important;
  letter-spacing: -0.02em;
}

.list-owner-actions {
  display: flex !important;
  gap: 0.5rem !important;
  flex-shrink: 0;
}

.page-wrapper:has(.list-header) > .form-card {
  max-width: none !important;
  width: 100% !important;
  margin-bottom: 1.25rem !important;
}

.list-items {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.55rem !important;
  width: 100% !important;
  max-width: none !important;
}

.list-item {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100% !important;
  padding: 0.65rem 0.85rem !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-sizing: border-box;
}

.list-drag-handle {
  flex: 0 0 auto !important;
  width: 28px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--text-muted) !important;
  cursor: grab;
  border: none !important;
  background: transparent !important;
  font-size: 1.1rem !important;
  line-height: 1 !important;
  border-radius: 8px;
}

.list-drag-handle:hover {
  color: var(--text) !important;
  background: var(--surface-2) !important;
}

.list-rank {
  flex: 0 0 1.75rem !important;
  width: 1.75rem !important;
  text-align: center !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  color: var(--accent) !important;
  line-height: 1 !important;
}

.list-item-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.85rem !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  text-decoration: none !important;
  color: inherit !important;
}

.list-item-cover,
.list-item-cover-placeholder {
  width: 48px !important;
  height: 64px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface-2) !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.list-item-cover-placeholder {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  color: var(--text-muted) !important;
}

.list-item-title {
  font-weight: 700 !important;
  font-size: 0.98rem !important;
  line-height: 1.3 !important;
}

.list-item-notes {
  margin-top: 0.15rem !important;
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
}

.list-item-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.35rem !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

.list-item-actions .nav-btn {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.8rem !important;
  white-space: nowrap;
}

.list-item.is-dragging {
  opacity: 0.55;
  border-color: var(--accent) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

@media (max-width: 560px) {
  .list-header {
    flex-direction: column;
  }
  .list-item {
    gap: 0.55rem !important;
    padding: 0.6rem 0.7rem !important;
  }
  .list-item-cover,
  .list-item-cover-placeholder {
    width: 42px !important;
    height: 56px !important;
  }
}


.shelf-block-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.shelf-block-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.page-wrapper-shelf {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}


a.shelf-block-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.shelf-preview-item {
  display: block;
  overflow: hidden;
}

.shelf-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ===== Game detail page ===== */
.game-page-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

.game-page-cover,
.game-page-cover-placeholder {
  width: 160px !important;
  height: 214px !important;
  object-fit: cover !important;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
  display: block;
}

.game-page-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
}

.game-page-info {
  min-width: 0;
  flex: 1 1 auto;
}

.game-page-title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.game-page-meta {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.community-score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 280px;
}

.community-score-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #f5c542;
  line-height: 1;
}

.community-score-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.community-score-sub {
  display: block;
  margin-top: 0.15rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.status-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-btn.active {
  background: rgba(79, 140, 255, 0.18);
  border-color: var(--accent);
  color: var(--accent);
}

.status-btn-clear {
  padding: 0.4rem 0.55rem;
}

/* Fans also liked */
.fans-also-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.fans-also-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.fans-also-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.fans-also-card img,
.fans-also-fallback {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.fans-also-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
}

.fans-also-meta {
  padding: 0.55rem 0.65rem 0.7rem;
}

.fans-also-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fans-also-sub {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 700px) {
  .game-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .game-page-cover,
  .game-page-cover-placeholder {
    width: 120px !important;
    height: 160px !important;
  }
  .fans-also-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fans-also-card:nth-child(n+5) {
    display: none;
  }
}


/* ===== Navbar redesign ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: rgba(11, 13, 18, 0.88) !important;
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.nav-desktop {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  gap: 1rem;
  min-width: 0;
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 650;
  border: none;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link-muted {
  color: rgba(160, 170, 190, 0.75);
  font-size: 0.8rem;
  font-weight: 600;
}

.nav-cta {
  padding: 0.4rem 0.85rem !important;
  border-radius: 999px !important;
  font-weight: 750 !important;
  font-size: 0.84rem !important;
}

.nav-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-icon-label {
  display: none;
  font-size: 0.78rem;
  font-weight: 650;
}

.nav-sort {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.nav-dropdown form {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-dropdown button {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-dropdown button:hover {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
}

.nav-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nav-profile-btn:hover {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.08);
}

.nav-profile-avatar,
.nav-profile-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.nav-profile-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

.nav-profile-label {
  font-size: 0.8rem;
  font-weight: 700;
  padding-right: 0.25rem;
}

.notif-nav .notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff4d6d;
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-mobile-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-cta-mobile {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.8rem !important;
  border-radius: 999px !important;
}

.nav-drawer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated, var(--surface));
}

.nav-drawer-inner {
  width: min(1100px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 0.75rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-drawer-link {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  color: var(--text) !important;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
}

.nav-drawer-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

.nav-drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.5rem;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex !important;
  }
  .nav-mobile-right {
    display: none !important;
  }
  .nav-burger {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .nav-desktop {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .nav-icon-label {
    display: inline;
  }
  .nav-sort .nav-icon-btn {
    width: auto;
    padding: 0 0.65rem;
  }
}


/* ===== Nav search ===== */
.nav-search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
  min-width: 160px;
  margin-right: 0.5rem;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.nav-search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
}

.nav-search-input::placeholder {
  color: var(--text-muted);
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 60;
}

.nav-search-wrap-mobile {
  max-width: none;
  margin: 0 0 0.75rem;
}

.nav-search-results-mobile {
  position: relative;
  top: 0.4rem;
  max-height: 280px;
}

.nav-search-group {
  padding: 0.4rem 0.55rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-search-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.nav-search-item:hover {
  background: rgba(79, 140, 255, 0.1);
}

.nav-search-thumb {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.nav-search-thumb-user {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.nav-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-search-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.nav-search-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-search-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-search-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-search-status {
  padding: 0.65rem 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

@media (min-width: 1024px) {
  .nav-desktop {
    gap: 0.75rem;
  }
}


/* Nav layout with search: brand | links | search | actions */
.site-nav-bar {
  gap: 0.75rem !important;
}

.nav-desktop {
  display: none;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 1 1 auto !important;
  gap: 0.75rem !important;
  min-width: 0 !important;
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
}

.nav-search-wrap {
  flex: 1 1 180px !important;
  max-width: 280px !important;
  min-width: 140px !important;
  margin-right: 0 !important;
  margin-left: 0.25rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

.nav-search-results {
  min-width: 300px;
  width: max(100%, 300px);
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex !important;
  }
}

@media (max-width: 1200px) {
  .nav-link {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
  .nav-search-wrap {
    max-width: 220px !important;
  }
  .nav-profile-label {
    display: none;
  }
  .nav-profile-btn {
    padding: 0.15rem;
  }
  .nav-link-muted {
    display: none;
  }
}


/* Feed / Explore page controls */
.feed-page-header {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

.feed-page-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.feed-mode-tabs {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  gap: 0.15rem;
}

.feed-mode-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.feed-mode-tab:hover {
  color: var(--text);
}

.feed-mode-tab.active {
  background: rgba(79, 140, 255, 0.18);
  color: var(--accent);
}

.page-sort {
  position: relative;
}

.page-sort-dropdown {
  right: 0;
  left: auto;
}


.page-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.page-sort-btn:hover,
.page-sort-btn[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
}

.page-sort-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 40;
}

.page-sort-dropdown form {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.page-sort-dropdown button {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.page-sort-dropdown button:hover {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
}


/* ===== Activity feed ===== */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 720px;
  margin: 0 auto;
}

.page-wrapper:has(.activity-list) .page-header,
.page-wrapper:has(.empty-state) .page-header {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.activity-avatar-link {
  flex-shrink: 0;
  text-decoration: none;
}

.activity-avatar,
.activity-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}

.activity-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 1rem;
}

.activity-body {
  min-width: 0;
  flex: 1 1 auto;
}

.activity-text {
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text);
}

.activity-actor {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  margin-right: 0.25rem;
}

.activity-actor:hover {
  color: var(--accent);
}

.activity-meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.activity-meta a {
  text-decoration: none;
  font-weight: 700;
}

.activity-meta a:hover {
  text-decoration: underline;
}

.activity-cover-link {
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: 44px;
  height: 58px;
  display: block;
  background: var(--surface-2);
}

.activity-cover {
  width: 44px !important;
  height: 58px !important;
  object-fit: cover !important;
  display: block;
}

@media (max-width: 560px) {
  .activity-item {
    gap: 0.65rem;
    padding: 0.75rem 0.8rem;
  }
  .activity-avatar,
  .activity-avatar-fallback {
    width: 38px;
    height: 38px;
  }
}


.nav-profile-menu {
  position: relative;
}

.nav-profile-btn {
  cursor: pointer;
  font: inherit;
}

.nav-profile-caret {
  margin-left: 0.1rem;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-profile-btn[aria-expanded="true"] .nav-profile-caret {
  transform: rotate(180deg);
}

.nav-profile-dropdown {
  right: 0;
  left: auto;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-profile-dropdown a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
}

.nav-profile-dropdown a:hover {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
}

.nav-profile-dropdown .nav-profile-logout {
  color: #ff8a8a;
}

.nav-profile-dropdown .nav-profile-logout:hover {
  background: rgba(255, 92, 92, 0.12);
  color: #ff8a8a;
}


.nav-profile-btn {
  padding: 0.15rem !important;
  gap: 0.25rem;
}

.nav-profile-btn .nav-profile-avatar,
.nav-profile-btn .nav-profile-fallback {
  width: 32px;
  height: 32px;
}

.nav-profile-label {
  display: none !important;
}


/* ===== Landing page ===== */
.landing {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 2.5rem;
}

.landing-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 850;
}

.landing-lead {
  margin: 1rem 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 34rem;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.landing-cta {
  padding: 0.65rem 1.2rem !important;
  font-size: 0.95rem !important;
  border-radius: 999px !important;
}

.landing-cta-secondary {
  padding: 0.65rem 1.1rem !important;
  border-radius: 999px !important;
}

.landing-hero-visual {
  min-height: 260px;
  position: relative;
}

.landing-card-stack {
  position: relative;
  height: 280px;
}

.landing-float-card {
  position: absolute;
  width: min(240px, 70%);
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.landing-float-card.c1 { top: 10px; left: 10%; transform: rotate(-4deg); }
.landing-float-card.c2 { top: 90px; right: 5%; transform: rotate(3deg); }
.landing-float-card.c3 { bottom: 10px; left: 18%; transform: rotate(1deg); }

.landing-float-stars { color: #f5c542; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.landing-float-title { font-weight: 800; font-size: 1rem; }
.landing-float-sub { margin-top: 0.2rem; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 2.5rem;
}

.landing-feature {
  padding: 1.1rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.landing-feature-icon { font-size: 1.4rem; margin-bottom: 0.45rem; }
.landing-feature h2 { margin: 0 0 0.4rem; font-size: 1rem; font-weight: 800; }
.landing-feature p { margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.45; }

.landing-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.landing-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.landing-recent-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

.landing-recent-card {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.landing-recent-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.landing-recent-card:hover img {
  filter: brightness(1.06);
}

.landing-recent-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.landing-recent-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-muted);
}

.landing-recent-rating {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  color: #f5c542;
  font-size: 0.72rem;
  font-weight: 800;
}

.landing-bottom-cta {
  margin-top: 2.5rem;
  text-align: center;
  padding: 2rem 1.25rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(79,140,255,0.12), rgba(11,13,18,0.2));
}

.landing-bottom-cta h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 850;
}

.landing-bottom-cta p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }
  .landing-hero-visual { display: none; }
  .landing-features {
    grid-template-columns: 1fr 1fr;
  }
  .landing-recent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .landing-recent-card:nth-child(n+7) {
    display: none;
  }
}

@media (max-width: 560px) {
  .landing-features {
    grid-template-columns: 1fr;
  }
}


/* ===== Leaderboards ===== */
.lb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  max-width: 1220px;
  margin: 0 auto;
}

.page-wrapper:has(.lb-grid) .page-header {
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.page-wrapper:has(.lb-grid) .page-header h1 {
  letter-spacing: -0.02em;
}

.lb-card {
  background:
    linear-gradient(180deg, rgba(79, 140, 255, 0.06), transparent 42%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.05rem 1rem 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
}

.lb-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79, 140, 255, 0.55), transparent);
  opacity: 0.9;
}

.lb-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.lb-subtitle {
  margin: 0.25rem 0 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.lb-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.45rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.04);
}

.lb-row-gold:hover,
.lb-row-silver:hover,
.lb-row-bronze:hover {
  transform: translateX(1px);
}

.lb-rank {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.lb-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.lb-thumb,
.lb-thumb-placeholder {
  width: 40px !important;
  height: 54px !important;
  object-fit: cover !important;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
  display: block;
}

.lb-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
}

.lb-avatar,
.lb-avatar-placeholder {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.lb-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lb-name {
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.lb-meta {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.lb-score {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.95rem;
  color: #f5c542;
  min-width: 2.35rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(245, 197, 66, 0.25);
}

.lb-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lb-subtitle {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.65rem !important;
}

@media (max-width: 1100px) {
  .lb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .lb-grid {
    grid-template-columns: 1fr;
  }
  .lb-name {
    max-width: 12rem;
  }
}


/* Landing teaser panels: leaderboards + XP */
.landing-teasers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}

.landing-teaser {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.landing-teaser:hover,
.landing-teaser:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.landing-teaser-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-teaser h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 850;
}

.landing-teaser-copy p:not(.landing-teaser-kicker) {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.landing-teaser-link {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--accent);
  text-decoration: none;
}

.landing-teaser-boards {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(79, 140, 255, 0.18), transparent 55%),
    var(--surface);
}

.landing-teaser-xp {
  background:
    radial-gradient(ellipse at 100% 100%, rgba(245, 197, 66, 0.14), transparent 55%),
    var(--surface);
}

.lb-mock {
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.lb-mock-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.lb-mock-row {
  display: grid;
  grid-template-columns: 1.2rem 1fr 2rem;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.lb-mock-rank {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.lb-mock-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.lb-mock-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--w, 70%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7c9bff);
}

.lb-mock-score {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f5c542;
  text-align: right;
}

.xp-mock {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.xp-mock-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.xp-mock-level {
  font-size: 1.35rem;
  font-weight: 850;
  color: #f5c542;
}

.xp-mock-rank {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.xp-mock-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.xp-mock-bar-fill {
  height: 100%;
  width: 72%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5c542, #ff9f43);
}

.xp-mock-meta {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.xp-mock-badges {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 1.15rem;
}

@media (max-width: 900px) {
  .landing-teasers {
    grid-template-columns: 1fr;
  }
  .landing-teaser {
    grid-template-columns: 1fr;
  }
}


.page-sort-dropdown .sort-option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.page-sort-dropdown .sort-option:hover {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
}


/* ===== Light mode ===== */
html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e4e9f2;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-muted: #5b657a;
  --accent: #3b7af0;
  --accent-2: #6b5cff;
  --accent-soft: rgba(59, 122, 240, 0.12);
  --accent-hover: #2f6ae0;
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.1);
  --star: #d97706;
  --success: #059669;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 122, 240, 0.1), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(107, 92, 255, 0.06), transparent 50%),
    var(--bg) !important;
  color: var(--text);
}

html[data-theme="light"] .site-nav {
  background: rgba(244, 246, 251, 0.9) !important;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .nav-search {
  background: #fff;
}

html[data-theme="light"] .nav-dropdown,
html[data-theme="light"] .nav-search-results {
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .nav-profile-btn {
  background: #fff;
}

html[data-theme="light"] .brand-accent {
  background: linear-gradient(135deg, #3b7af0, #6b5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}

.nav-theme-toggle:hover {
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
}

.nav-theme-toggle-value {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.nav-theme-toggle-mobile {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}


/* Sun / moon theme switch */
.nav-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
}

.nav-theme-row .nav-theme-toggle-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
}

.nav-drawer-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--text);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.15rem;
  color: var(--text-muted);
}

.theme-switch-icon {
  display: inline-flex;
  opacity: 0.45;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.theme-switch.is-light .theme-switch-sun,
.theme-switch:not(.is-light) .theme-switch-moon {
  opacity: 1;
  color: var(--accent);
}

.theme-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
  /* default (dark): toward moon on the right */
  transform: translateX(18px);
}

.theme-switch.is-light .theme-switch-track {
  background: rgba(59, 122, 240, 0.2);
  border-color: rgba(59, 122, 240, 0.35);
}

.theme-switch.is-light .theme-switch-thumb {
  /* light: toward sun on the left */
  transform: translateX(0);
  background: #3b7af0;
}

.theme-switch:not(.is-light) .theme-switch-thumb {
  background: #c7d0e0;
}

html[data-theme="light"] .theme-switch:not(.is-light) .theme-switch-thumb {
  background: #64748b;
}


.danger-zone {
  border-color: rgba(255, 92, 122, 0.35) !important;
}

.danger-zone-title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--danger);
}

.danger-zone-text {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.btn-danger-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: none;
  background: var(--danger);
  color: #fff;
  font-weight: 750;
  font-size: 0.92rem;
  cursor: pointer;
}

.btn-danger-solid:hover {
  filter: brightness(1.05);
}


/* Settings page */
.settings-page {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.settings-header {
  margin-bottom: 1.25rem;
}

.settings-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 850;
}

.settings-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.settings-card {
  max-width: none !important;
  width: 100%;
  margin-bottom: 1rem !important;
}

.settings-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.settings-section-spaced {
  margin-top: 1.5rem !important;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.settings-page .form-label {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.settings-page .btn-submit {
  width: 100%;
  margin-top: 0.35rem;
}

.settings-page .avatar-upload-preview {
  margin-bottom: 0.85rem;
}


/* Circular avatar crop preview */
.crop-panel .cropper-view-box,
.crop-panel .cropper-face {
  border-radius: 50% !important;
}

.crop-panel .cropper-view-box {
  outline: 0 !important;
  box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.7);
}

.crop-panel .cropper-face {
  background-color: inherit !important;
}

.crop-panel .cropper-line,
.crop-panel .cropper-point {
  background-color: var(--accent);
}

.crop-panel .cropper-modal {
  background-color: rgba(0, 0, 0, 0.65);
}


/* Stronger circular crop visibility */
.crop-panel .cropper-view-box,
.crop-panel .cropper-face {
  border-radius: 50% !important;
}

.crop-panel .cropper-view-box {
  outline: 0 !important;
  box-shadow:
    0 0 0 3px #4f8cff,
    0 0 0 9999px rgba(0, 0, 0, 0.55) !important;
}

.crop-panel .cropper-modal {
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.55) !important;
}

.crop-panel .cropper-face {
  background-color: transparent !important;
  opacity: 1 !important;
}

.crop-panel .cropper-line {
  background-color: #4f8cff !important;
  opacity: 0.95 !important;
}

.crop-panel .cropper-point {
  width: 10px !important;
  height: 10px !important;
  opacity: 1 !important;
  background-color: #4f8cff !important;
  border-radius: 50%;
}

.crop-panel .cropper-point.point-e,
.crop-panel .cropper-point.point-w {
  margin-top: -5px !important;
}
.crop-panel .cropper-point.point-n,
.crop-panel .cropper-point.point-s {
  margin-left: -5px !important;
}


/* Centered nav search + no focus blue box */
.site-nav-bar {
  position: relative;
}

.nav-desktop {
  position: relative;
}

.nav-search-wrap {
  position: absolute !important;
  left: 50%;
  transform: translateX(-50%);
  flex: 0 0 auto !important;
  width: min(320px, 36vw) !important;
  max-width: 320px !important;
  min-width: 180px !important;
  margin: 0 !important;
  z-index: 5;
}

.nav-primary {
  margin-right: auto;
}

.nav-actions {
  margin-left: auto !important;
}

.nav-search {
  box-shadow: none !important;
}

.nav-search:focus-within {
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
  outline: none !important;
}

.nav-search-input,
.nav-search-input:focus,
.nav-search-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  ring: none;
}

/* kill browser / tailwind focus rings on search */
.nav-search-input:focus {
  outline: 0 !important;
}


/* True viewport-bar centering for search */
.site-nav-bar {
  position: relative !important;
}

.nav-desktop {
  position: static !important;
}

.nav-search-wrap {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(300px, 34vw) !important;
  max-width: 300px !important;
  z-index: 6;
}

.nav-search-results {
  transform: none;
}


.nav-actions .nav-cta {
  padding: 0.55rem 1.15rem !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  margin-right: 0.55rem;
}

.nav-cta-mobile {
  padding: 0.45rem 0.9rem !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
}


/* Nav actions spacing: center bell between Review and avatar */
.nav-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}

.nav-actions .nav-cta {
  margin-right: 0 !important;
}

.nav-actions .notif-nav {
  margin-left: 0.75rem;
  margin-right: 0.75rem;
  width: 40px;
  height: 40px;
}

.nav-actions .nav-profile-menu {
  margin-left: 0;
}

.nav-actions .nav-profile-btn {
  padding: 0 !important;
}

.nav-actions .nav-profile-btn .nav-profile-avatar,
.nav-actions .nav-profile-btn .nav-profile-fallback {
  width: 38px !important;
  height: 38px !important;
}


/* + Review matches avatar height, fully rounded pill */
.nav-actions .nav-cta.nav-btn-primary {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 1.15rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  border: none !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.nav-actions .nav-profile-btn .nav-profile-avatar,
.nav-actions .nav-profile-btn .nav-profile-fallback {
  width: 38px !important;
  height: 38px !important;
}


/* Add review page */
.add-review-page {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.add-review-card {
  max-width: none !important;
  width: 100%;
}

.add-review-page .form-label {
  font-weight: 700;
  font-size: 0.85rem;
}

.add-review-page .btn-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.add-review-page .selected-game {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.add-review-page .selected-game img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.add-review-page .selected-title {
  font-weight: 800;
  font-size: 0.98rem;
}

.add-review-page .selected-year {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.add-review-page .search-results {
  margin-top: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.add-review-page .search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.add-review-page .search-result-item:hover {
  background: rgba(79, 140, 255, 0.1);
}

.add-review-page .search-result-item img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}


/* Add review modal */
.gc-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.gc-modal[hidden] { display: none !important; }
.gc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.gc-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  padding: 1.25rem 1.35rem 1.35rem;
}
.gc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gc-modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 850;
}
.gc-modal-header p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.gc-modal-close {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
body.gc-modal-open { overflow: hidden; }
.gc-modal .selected-game {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.gc-modal .selected-game img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
}
.gc-modal .selected-title { font-weight: 800; }
.gc-modal .selected-year { color: var(--text-muted); font-size: 0.82rem; }
.gc-modal .search-results {
  margin-top: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.gc-modal .search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.gc-modal .search-result-item:hover { background: rgba(79, 140, 255, 0.1); }
.gc-modal .search-result-item img,
.gc-modal .search-result-placeholder {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
  flex-shrink: 0;
}
.gc-modal .btn-submit { width: 100%; }
.nav-actions .nav-cta, .nav-cta-mobile { cursor: pointer; }


/* Review modal enter / exit animation */
.gc-modal {
  opacity: 0;
}

.gc-modal.is-open {
  animation: gcModalFadeIn 0.2s ease forwards;
}

.gc-modal.is-open .gc-modal-dialog {
  animation: gcModalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gc-modal.is-closing {
  animation: gcModalFadeOut 0.18s ease forwards;
}

.gc-modal.is-closing .gc-modal-dialog {
  animation: gcModalSlideOut 0.18s ease forwards;
}

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

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

@keyframes gcModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gcModalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}


/* Spoiler toggle (matches theme switch style) */
.spoiler-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.spoiler-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.spoiler-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.spoiler-switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
  display: block;
}

.spoiler-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c7d0e0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}

.spoiler-switch input:checked + .spoiler-switch-track {
  background: rgba(79, 140, 255, 0.22);
  border-color: rgba(79, 140, 255, 0.45);
}

.spoiler-switch input:checked + .spoiler-switch-track .spoiler-switch-thumb {
  transform: translateX(20px);
  background: var(--accent);
}

.spoiler-switch input:focus-visible + .spoiler-switch-track {
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.25);
}


/* ===== Messages / DMs ===== */
.page-wrapper:has(.dm-layout) {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.dm-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 0;
  min-height: min(70vh, 640px);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}

.dm-sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.dm-sidebar-title {
  padding: 0.9rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.dm-empty {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dm-thread {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.dm-thread:hover {
  background: rgba(79, 140, 255, 0.08);
}

.dm-thread.active {
  background: rgba(79, 140, 255, 0.14);
}

.dm-avatar,
.dm-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.dm-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-muted);
}

.dm-thread-meta {
  min-width: 0;
  flex: 1;
}

.dm-thread-name {
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dm-thread-preview {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-main {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 640px);
  background: var(--surface);
}

.dm-placeholder {
  margin: auto;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.dm-placeholder h2 {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
}

.dm-placeholder p {
  margin: 0;
  font-size: 0.92rem;
}

.dm-chat-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dm-bubble {
  max-width: min(75%, 420px);
  align-self: flex-start;
  padding: 0.65rem 0.85rem;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.dm-bubble.mine {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: rgba(79, 140, 255, 0.18);
  border-color: rgba(79, 140, 255, 0.28);
}

.dm-bubble-text {
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-bubble-time {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dm-compose {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.dm-compose .form-control {
  flex: 1;
  resize: none;
  min-height: 44px;
}

.dm-compose .nav-btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 1.1rem;
}

@media (max-width: 800px) {
  .dm-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .dm-sidebar {
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .dm-main {
    min-height: 50vh;
  }
}


.meta-chip.meta-title {
  color: #f5c542;
  border-color: rgba(245, 197, 66, 0.35);
  background: rgba(245, 197, 66, 0.1);
  font-weight: 750;
}

.comment-user-title {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f5c542;
  opacity: 0.95;
}

.comment-item {
  position: relative;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comment-actions {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.comment-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.comment-icon-btn svg {
  width: 14px;
  height: 14px;
}

.comment-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.comment-icon-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.comment-item .comment-date {
  margin-right: 4.5rem;
}


/* Comment edit/delete under comment content, right-aligned */
.comment-item .comment-actions {
  position: static !important;
  top: auto !important;
  right: auto !important;
  justify-content: flex-end;
  margin-top: 0.35rem;
  gap: 0.4rem;
}

.comment-item .comment-date {
  margin-right: 0 !important;
}

.comment-item .comment-body {
  margin-bottom: 0.15rem;
}


/* Fix: comments use class "comment", not "comment-item" */
.comment {
  position: relative;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.comment .comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.comment .comment-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.comment .comment-actions {
  position: static !important;
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.comment .comment-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.comment .comment-icon-btn svg {
  width: 14px;
  height: 14px;
}

.comment .comment-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.comment .comment-icon-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.comment .comment-date {
  margin-right: 0 !important;
  flex-shrink: 0;
}


.edit-comment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.edit-comment-btns {
  display: flex;
  gap: 0.4rem;
}


.comment.is-editing .comment-actions {
  display: none !important;
}

.comment.is-editing > .comment-body,
.comment.is-editing > [data-spoiler] {
  display: none !important;
}


/* Comment body + actions on one row */
.comment-body-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
}

.comment-body-row .comment-body,
.comment-body-row .spoiler-block {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.comment-body-row .comment-actions {
  flex: 0 0 auto;
  margin-top: 0 !important;
  align-self: flex-end;
}

.spoiler-hide {
  /* same base look as reveal */
}


.spoiler-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.spoiler-reveal,
.spoiler-hide {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.spoiler-reveal:hover,
.spoiler-hide:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
}

.spoiler-hide {
  border-color: rgba(154, 163, 184, 0.35);
  background: rgba(154, 163, 184, 0.1);
  color: var(--text-muted);
}

.spoiler-hide:hover {
  border-color: rgba(154, 163, 184, 0.55);
  background: rgba(154, 163, 184, 0.16);
  color: var(--text);
}

.spoiler-block-sm .spoiler-content {
  margin: 0;
}


/* Nested comment threads */
.comment-thread-node {
  margin-bottom: 0.55rem;
}

.comment-replies {
  margin-top: 0.45rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.comment-thread-node.is-collapsed > .comment-replies {
  display: none;
}

.comment-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.comment-reply-btn,
.comment-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  padding: 0;
}

.comment-reply-btn:hover,
.comment-collapse-btn:hover {
  color: var(--accent);
}

.reply-comment-form {
  margin-top: 0.55rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}


/* Compact spoiler chip matching old SPOILERS badge size */
.spoiler-chip.spoiler-reveal,
.spoiler-chip.spoiler-hide {
  padding: 0.15rem 0.5rem !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.spoiler-chip.spoiler-reveal {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
}

.spoiler-chip.spoiler-hide {
  background: rgba(154, 163, 184, 0.12) !important;
  border: 1px solid rgba(154, 163, 184, 0.35) !important;
  color: var(--text-muted) !important;
}


/* Rank title colors — Grandmaster keeps the classic gold */
.meta-chip.meta-title.rank-newcomer,
.comment-user-title.rank-newcomer {
  color: #94a3b8 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  background: rgba(148, 163, 184, 0.12) !important;
}

.meta-chip.meta-title.rank-player,
.comment-user-title.rank-player {
  color: #7dd3fc !important;
  border-color: rgba(125, 211, 252, 0.4) !important;
  background: rgba(125, 211, 252, 0.12) !important;
}

.meta-chip.meta-title.rank-regular,
.comment-user-title.rank-regular {
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
  background: rgba(52, 211, 153, 0.12) !important;
}

.meta-chip.meta-title.rank-enthusiast,
.comment-user-title.rank-enthusiast {
  color: #60a5fa !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
  background: rgba(96, 165, 250, 0.14) !important;
}

.meta-chip.meta-title.rank-veteran,
.comment-user-title.rank-veteran {
  color: #a78bfa !important;
  border-color: rgba(167, 139, 250, 0.45) !important;
  background: rgba(167, 139, 250, 0.14) !important;
}

.meta-chip.meta-title.rank-critic,
.comment-user-title.rank-critic {
  color: #f472b6 !important;
  border-color: rgba(244, 114, 182, 0.45) !important;
  background: rgba(244, 114, 182, 0.14) !important;
}

.meta-chip.meta-title.rank-expert,
.comment-user-title.rank-expert {
  color: #fb7185 !important;
  border-color: rgba(251, 113, 133, 0.45) !important;
  background: rgba(251, 113, 133, 0.14) !important;
}

.meta-chip.meta-title.rank-legend,
.comment-user-title.rank-legend {
  color: #fb923c !important;
  border-color: rgba(251, 146, 60, 0.45) !important;
  background: rgba(251, 146, 60, 0.14) !important;
}

.meta-chip.meta-title.rank-grandmaster,
.comment-user-title.rank-grandmaster {
  color: #f5c542 !important;
  border-color: rgba(245, 197, 66, 0.45) !important;
  background: rgba(245, 197, 66, 0.14) !important;
}


.profile-title.rank-newcomer { color: #94a3b8 !important; }
.profile-title.rank-player { color: #7dd3fc !important; }
.profile-title.rank-regular { color: #34d399 !important; }
.profile-title.rank-enthusiast { color: #60a5fa !important; }
.profile-title.rank-veteran { color: #a78bfa !important; }
.profile-title.rank-critic { color: #f472b6 !important; }
.profile-title.rank-expert { color: #fb7185 !important; }
.profile-title.rank-legend { color: #fb923c !important; }
.profile-title.rank-grandmaster { color: #f5c542 !important; }


/* Equal-size Show/Hide Spoilers chips for seamless toggle */
.spoiler-chip.spoiler-reveal,
.spoiler-chip.spoiler-hide {
  min-width: 7.6rem;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

/* Comment rank titles as pills */
.comment-user-title {
  display: inline-flex !important;
  align-items: center;
  margin-left: 0.4rem !important;
  padding: 0.12rem 0.5rem !important;
  border-radius: 999px !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  line-height: 1.2;
  border: 1px solid transparent;
  vertical-align: middle;
}


.comment-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.comment-footer-actions .comment-actions {
  position: static !important;
  margin: 0 !important;
  display: inline-flex !important;
}

.comment-footer-actions .comment-icon-btn {
  width: 26px;
  height: 26px;
}


.comment-footer-actions {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.comment-footer-actions .comment-actions-end {
  margin-left: auto !important;
}


.action-btn.report-btn.reported,
.report-btn.reported {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(239, 68, 68, 0.12) !important;
}


.report-modal-dialog {
  width: min(420px, 100%);
}

.report-modal-text {
  margin: 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.report-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.report-confirm-btn {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}


/* Review-level spoiler toolbar above notes */
.game-notes-wrap .spoiler-block {
  gap: 0.5rem;
}

.game-notes-wrap .spoiler-toolbar {
  margin-bottom: 0.15rem;
}

.game-notes-wrap .spoiler-content.is-hidden {
  display: none;
}


.profile-name-row .meta-chip.meta-title {
  align-self: center;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
}

.game-meta .you-badge,
.comment-author .you-badge,
.you-badge-sm {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(79, 140, 255, 0.16);
  border: 1px solid rgba(79, 140, 255, 0.35);
  color: var(--accent);
  vertical-align: middle;
}


button.banner-action {
  font: inherit;
  cursor: pointer;
  appearance: none;
}


.profile-banner-actions .banner-action-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.profile-banner-actions .banner-action-form .banner-action {
  font: inherit;
}


/* ===== Admin / Moderation ===== */
.admin-page {
  max-width: 960px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 1.75rem;
}

.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: center;
}

.admin-stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.admin-stat-label {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
}

.admin-stat-alert {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.admin-stat-alert .admin-stat-value {
  color: #f87171;
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-section-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.admin-section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 750;
}

.admin-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(79, 140, 255, 0.15);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-empty {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.admin-card-body {
  min-width: 0;
  flex: 1;
}

.admin-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  font-weight: 700;
  color: var(--text);
}

.admin-card-title a {
  color: var(--accent);
  text-decoration: none;
}

.admin-card-title a:hover {
  text-decoration: underline;
}

.admin-card-reason {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.admin-card-meta {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-card-meta a {
  color: var(--accent);
  text-decoration: none;
}

.admin-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.admin-card-actions form {
  margin: 0;
}

.admin-muted {
  color: var(--text-muted);
  font-weight: 500;
}

.admin-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(79, 140, 255, 0.14);
  border: 1px solid rgba(79, 140, 255, 0.3);
  color: var(--accent);
}

.admin-pill-admin {
  background: rgba(245, 197, 66, 0.14);
  border-color: rgba(245, 197, 66, 0.35);
  color: #f5c542;
}

.admin-pill-banned {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.admin-btn-danger {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

.admin-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12) !important;
}

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

  .admin-card {
    flex-direction: column;
  }

  .admin-card-actions {
    flex-direction: row;
    width: 100%;
  }
}


.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.admin-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 750;
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.admin-tab.active {
  color: #fff;
  background: var(--accent);
}

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  font-size: 0.7rem;
  font-weight: 800;
}

.admin-tab-btn {
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.admin-tab-btn:hover,
.admin-tab-btn.active {
  border-color: rgba(79, 140, 255, 0.55);
  transform: translateY(-1px);
}

.admin-stat-alert-text {
  color: #f87171;
}

.admin-panel[hidden] {
  display: none !important;
}


.admin-filter-bar {
  margin: 0 0 0.85rem;
}

.admin-filter-input {
  width: 100%;
  max-width: 420px;
}

.admin-card[hidden] {
  display: none !important;
}


.admin-panel {
  display: none;
}
.admin-panel.is-active {
  display: block;
}


.admin-pagination {
  margin: 1.25rem 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.admin-tabs a.admin-tab {
  text-decoration: none;
}

.admin-stats a.admin-stat-card {
  text-decoration: none;
  color: inherit;
}


.lb-card .lb-list {
  margin-top: 0.2rem;
}

.lb-rank {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.lb-rank-gold {
  color: #1a1405 !important;
  background: linear-gradient(145deg, #ffe9a8, #f5c542 45%, #d4a017) !important;
  border-color: #f5c542 !important;
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.25), 0 4px 14px rgba(245, 197, 66, 0.35);
  font-weight: 900;
}

.lb-rank-silver {
  color: #1b1f27 !important;
  background: linear-gradient(145deg, #f3f5f8, #c5ccd8 50%, #9aa3b5) !important;
  border-color: #c0c7d4 !important;
  box-shadow: 0 0 0 2px rgba(192, 199, 212, 0.22), 0 4px 12px rgba(160, 170, 190, 0.28);
  font-weight: 900;
}

.lb-rank-bronze {
  color: #1a1008 !important;
  background: linear-gradient(145deg, #f0c49a, #cd7f32 48%, #a35c1d) !important;
  border-color: #cd7f32 !important;
  box-shadow: 0 0 0 2px rgba(205, 127, 50, 0.22), 0 4px 12px rgba(205, 127, 50, 0.28);
  font-weight: 900;
}

.lb-row-gold {
  background: linear-gradient(90deg, rgba(245, 197, 66, 0.12), transparent 70%);
  border: 1px solid rgba(245, 197, 66, 0.18);
}

.lb-row-silver {
  background: linear-gradient(90deg, rgba(192, 199, 212, 0.1), transparent 70%);
  border: 1px solid rgba(192, 199, 212, 0.14);
}

.lb-row-bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent 70%);
  border: 1px solid rgba(205, 127, 50, 0.16);
}

.lb-row-gold .lb-score,
.lb-row-silver .lb-score,
.lb-row-bronze .lb-score {
  font-size: 1.02rem;
}


.lb-expand-btn {
  margin-top: 0.75rem;
  width: 100%;
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(79, 140, 255, 0.08);
  color: var(--accent);
  font: inherit;
  font-weight: 750;
  font-size: 0.82rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lb-expand-btn:hover {
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.35);
}

.lb-row-extra[hidden] {
  display: none !important;
}


.lb-grid {
  align-items: stretch;
}

.lb-card {
  min-height: 100%;
}

.lb-card-top {
  flex-shrink: 0;
}

.lb-list {
  flex: 1 1 auto;
}

.lb-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.lb-filter-bar {
  margin: 0.55rem 0 0;
}

.lb-filter-input {
  width: 100%;
  font-size: 0.85rem;
}

.lb-row {
  min-height: 58px;
  box-sizing: border-box;
}

.lb-text {
  min-width: 0;
  flex: 1;
}

.lb-name {
  max-width: none !important;
}

.lb-expand-btn {
  margin-top: 0;
}

.lb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.lb-page-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 650;
}

.lb-page-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}


/* Leaderboard equal rows + modal */
.lb-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
}

.lb-row {
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 0 0.45rem !important;
  box-sizing: border-box;
}

.lb-main {
  min-height: 0;
}

.lb-thumb,
.lb-thumb-placeholder {
  width: 34px !important;
  height: 46px !important;
}

.lb-avatar,
.lb-avatar-placeholder {
  width: 34px !important;
  height: 34px !important;
}

.lb-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
}

.lb-card-top {
  min-height: 4.5rem;
}

.lb-subtitle {
  min-height: 2.2em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lb-modal-dialog {
  width: min(560px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
}

.lb-modal-dialog .gc-modal-body {
  overflow: auto;
  padding-top: 0.75rem;
}

.lb-modal-filter {
  margin-bottom: 0.75rem;
}

.lb-modal-list {
  margin-bottom: 0.75rem;
}

.lb-expand-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.lb-modal-dialog {
  width: min(480px, 100%) !important;
  max-height: none !important;
  overflow: visible !important;
}

.lb-modal-dialog .gc-modal-body {
  overflow: visible !important;
  max-height: none !important;
  padding-bottom: 0.25rem;
}

.lb-modal-list {
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 0.5rem;
}

.lb-modal-list .lb-row {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
}

.lb-modal-filter {
  margin-bottom: 0.55rem;
}

.lb-modal-dialog .gc-modal-header {
  padding-bottom: 0.35rem;
}

.lb-modal-dialog .gc-modal-header p {
  margin: 0.15rem 0 0;
}


.lb-modal-dialog {
  width: min(560px, calc(100vw - 2rem)) !important;
  max-height: none !important;
  overflow: visible !important;
}

.lb-modal-dialog .gc-modal-body {
  overflow: visible !important;
  max-height: none !important;
}

.lb-modal-list {
  max-height: none !important;
  overflow: visible !important;
}

.lb-modal-list .lb-row {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
}

.lb-modal-list .lb-thumb,
.lb-modal-list .lb-thumb-placeholder {
  width: 30px !important;
  height: 40px !important;
}

.lb-modal-list .lb-avatar,
.lb-modal-list .lb-avatar-placeholder {
  width: 30px !important;
  height: 30px !important;
}

.lb-modal-list .lb-name {
  font-size: 0.84rem;
}

.lb-modal-list .lb-meta {
  font-size: 0.72rem;
}

.lb-modal-list .lb-score {
  font-size: 0.9rem;
}

.lb-modal-list .lb-rank {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.75rem;
}


/* Emphasized primary nav destinations */
.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.72rem !important;
  border-radius: 999px;
  font-weight: 750 !important;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-link-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.nav-link-explore {
  color: #7eb6ff !important;
  background: rgba(79, 140, 255, 0.12);
  border-color: rgba(79, 140, 255, 0.28);
}

.nav-link-explore:hover {
  color: #fff !important;
  background: rgba(79, 140, 255, 0.22);
  border-color: rgba(79, 140, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
}

.nav-link-boards {
  color: #f5c542 !important;
  background: rgba(245, 197, 66, 0.12);
  border-color: rgba(245, 197, 66, 0.3);
}

.nav-link-boards:hover {
  color: #ffe9a8 !important;
  background: rgba(245, 197, 66, 0.2);
  border-color: rgba(245, 197, 66, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.12);
}

.nav-drawer-emphasis {
  font-weight: 750 !important;
  color: var(--text) !important;
}


/* Subtle distinction between primary destinations */
.nav-dest {
  font-weight: 650;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-dest-explore {
  color: #8bb8ff;
}

.nav-dest-explore:hover {
  color: #b6d2ff;
  border-bottom-color: rgba(139, 184, 255, 0.55);
}

.nav-dest-activity {
  color: #9ae6b4;
}

.nav-dest-activity:hover {
  color: #c6f6d5;
  border-bottom-color: rgba(154, 230, 180, 0.5);
}

.nav-dest-boards {
  color: #f0d078;
}

.nav-dest-boards:hover {
  color: #ffe9a8;
  border-bottom-color: rgba(240, 208, 120, 0.55);
}


/* Reverted: nav-dest no longer used */
.nav-dest,
.nav-dest-explore,
.nav-dest-activity,
.nav-dest-boards {
  color: inherit;
  font-weight: inherit;
  border-bottom: none;
}
.nav-dest:hover,
.nav-dest-explore:hover,
.nav-dest-activity:hover,
.nav-dest-boards:hover {
  color: inherit;
  border-bottom-color: transparent;
}


/* Subtle distinction between primary destinations */
.nav-dest {
  font-weight: 650 !important;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-dest-explore {
  color: #8bb8ff !important;
}
.nav-dest-explore:hover {
  color: #b6d2ff !important;
  border-bottom-color: rgba(139, 184, 255, 0.55) !important;
}

.nav-dest-activity {
  color: #9ae6b4 !important;
}
.nav-dest-activity:hover {
  color: #c6f6d5 !important;
  border-bottom-color: rgba(154, 230, 180, 0.5) !important;
}

.nav-dest-boards {
  color: #f0d078 !important;
}
.nav-dest-boards:hover {
  color: #ffe9a8 !important;
  border-bottom-color: rgba(240, 208, 120, 0.55) !important;
}


/* Profile visitor action buttons */
.profile-visitor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.profile-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 2.05rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 24, 0.55);
  color: #e8eefc;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.profile-action:hover {
  background: rgba(20, 28, 48, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.profile-action-primary {
  background: linear-gradient(135deg, #5b9bff, #4f8cff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.35);
}

.profile-action-primary:hover {
  background: linear-gradient(135deg, #6aa4ff, #5b95ff);
  color: #fff;
}

.profile-action-secondary {
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.35);
  color: #b6d2ff;
}

.profile-action-secondary:hover {
  background: rgba(79, 140, 255, 0.22);
  color: #fff;
}

.profile-action-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.profile-action-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.profile-action-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(232, 238, 252, 0.8);
}

.profile-action-ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.profile-action-muted {
  opacity: 0.7;
  cursor: default;
}

.profile-action.is-reported,
.profile-action:disabled {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

.profile-action-form {
  display: inline;
  margin: 0;
}


.profile-modal-danger-btn {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

.profile-modal-danger-btn:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}


/* ===== Settings overhaul ===== */
.settings-page {
  max-width: 1040px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.settings-sidebar {
  position: sticky;
  top: 5.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

.settings-sidebar-head h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.settings-sidebar-head p {
  margin: 0.25rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.settings-nav-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.settings-nav-item.active {
  background: rgba(79, 140, 255, 0.14);
  color: #b6d2ff;
}

.settings-nav-danger.active {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.settings-back-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-muted);
  text-decoration: none;
}

.settings-back-link:hover {
  color: var(--accent);
}

.settings-panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.4rem;
}

.settings-panel-header {
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.settings-panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.settings-panel-header p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.settings-subhead {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 750;
}

.settings-photo-block {
  padding: 0.85rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.settings-photo-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.settings-panel-danger {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06), var(--surface) 40%);
}

.settings-panel[hidden] {
  display: none !important;
}

@media (max-width: 800px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-sidebar {
    position: static;
  }
  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}


.settings-layout-top {
  display: block;
  max-width: 820px;
  margin: 0 auto;
}

.settings-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-tabs {
  margin-bottom: 1.1rem;
}

.settings-tab-danger.active {
  background: #ef4444 !important;
  color: #fff !important;
}


/* Keep all settings panels the same width */
.settings-layout-top,
.settings-layout-top .settings-main,
.settings-layout-top .settings-panel,
.settings-layout-top .settings-panel-card {
  width: 100%;
  max-width: 820px;
  box-sizing: border-box;
}

.settings-layout-top .settings-panel-card,
.settings-layout-top .settings-inner,
.settings-layout-top .form-card,
.settings-layout-top .settings-photo-block {
  max-width: 100%;
}

.settings-layout-top input,
.settings-layout-top textarea,
.settings-layout-top select,
.settings-layout-top .form-control {
  max-width: 100%;
  box-sizing: border-box;
}


.settings-page {
  max-width: 820px !important;
  margin-left: auto;
  margin-right: auto;
}

.settings-layout-top {
  max-width: 100% !important;
}

.settings-main {
  width: 100%;
  max-width: 100%;
}

.settings-panel.active,
.settings-panel {
  width: 100%;
  max-width: 100%;
}

.settings-panel-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


/* Settings Photos redesign */
.photos-preview-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 1.25rem;
}

.photos-preview-banner {
  height: 120px;
  background: linear-gradient(135deg, #1a2744, #2a3f6d 50%, #1e2b4a);
}

.photos-preview-banner img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.photos-preview-banner-empty {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.photos-preview-avatar-wrap {
  position: absolute;
  left: 1rem;
  top: 72px;
}

.photos-preview-avatar,
.photos-preview-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.photos-preview-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent);
}

.photos-preview-meta {
  padding: 2.6rem 1rem 1rem 1rem;
}

.photos-preview-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.photos-preview-handle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.photos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.photos-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
}

.photos-section-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.photos-section-head p {
  margin: 0.25rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.photos-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.photos-file-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.photos-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2rem;
  padding: 0 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(79, 140, 255, 0.35);
  background: rgba(79, 140, 255, 0.12);
  color: #b6d2ff;
  font-weight: 750;
  font-size: 0.86rem;
  width: fit-content;
}

.photos-file-label:hover .photos-file-btn {
  background: rgba(79, 140, 255, 0.2);
}

.photos-file-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.photos-submit {
  width: 100%;
}

.photos-remove-form {
  margin-top: 0.5rem;
}

.photos-remove-btn {
  width: 100%;
}

.photos-crop-panel {
  margin-top: 0.75rem;
}

.photos-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

@media (max-width: 700px) {
  .photos-grid {
    grid-template-columns: 1fr;
  }
}


.photos-help {
  margin: 0.45rem 0 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.photos-section .form-control {
  margin-bottom: 0.35rem;
}

.photos-banner-form .form-control {
  margin-bottom: 0.75rem;
}

.photos-crop-panel .btn-submit {
  width: auto;
}


.avatar-crop-dialog {
  width: min(520px, calc(100vw - 1.5rem)) !important;
}

.avatar-crop-stage {
  width: 100%;
  max-height: 360px;
  background: #0b1020;
  border-radius: 12px;
  overflow: hidden;
}

.avatar-crop-stage img {
  display: block;
  max-width: 100%;
}

.avatar-ready-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(79, 140, 255, 0.3);
  background: rgba(79, 140, 255, 0.08);
}

.avatar-ready-preview img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(79, 140, 255, 0.4);
}

.avatar-ready-preview span {
  font-size: 0.82rem;
  font-weight: 650;
  color: #b6d2ff;
}

.photos-section #avatar-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


#banner-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* Favorite game redesign */
.fav-game-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  padding: 0.85rem;
}

.fav-selected {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.fav-selected-art {
  flex-shrink: 0;
  width: 72px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.fav-selected-art img {
  width: 72px !important;
  height: 96px !important;
  object-fit: cover;
  display: block;
}

.fav-selected-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 1.2rem;
}

.fav-selected-body {
  min-width: 0;
  flex: 1;
}

.fav-selected-label {
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.fav-selected-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: 0.55rem;
}

.fav-clear-btn {
  padding: 0.3rem 0.75rem !important;
  font-size: 0.8rem !important;
}

.fav-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 0.75rem;
}

.fav-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.fav-search-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 0 !important;
}

.fav-search-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.fav-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  min-height: 1.1em;
}

.fav-results {
  margin-top: 0.5rem;
}

.fav-results .search-result-item,
.fav-results button {
  border-radius: 10px;
}


.favorite-showcase-empty {
  opacity: 0.85;
  border-style: dashed;
  cursor: default;
  text-decoration: none;
  color: inherit;
}

a.favorite-showcase-empty {
  cursor: pointer;
}

a.favorite-showcase-empty:hover {
  opacity: 1;
  border-color: rgba(79, 140, 255, 0.4);
}

.favorite-showcase-empty-title {
  color: var(--text-muted) !important;
  font-weight: 700 !important;
}

.favorite-showcase-hint {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}


.fav-search-box {
  width: 100%;
  box-sizing: border-box;
}

.fav-search-box:focus-within {
  border-color: rgba(79, 140, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

.fav-search-input,
.fav-search-input.form-control {
  width: 100% !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.fav-search-input:focus,
.fav-search-input.form-control:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}


.nav-notif-menu {
  position: relative;
}

.nav-notif-dropdown {
  right: 0;
  left: auto;
  width: min(360px, calc(100vw - 1.5rem));
  padding: 0;
  overflow: hidden;
}

.nav-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.nav-notif-head strong {
  font-size: 0.92rem;
}

.nav-notif-clear {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.nav-notif-clear:hover {
  text-decoration: underline;
}

.nav-notif-list {
  max-height: 360px;
  overflow: auto;
}

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

.nav-notif-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-notif-item:hover {
  background: rgba(255,255,255,0.04);
}

.nav-notif-item.unread {
  background: rgba(79, 140, 255, 0.08);
}

.nav-notif-menu.is-open .notif-nav {
  color: var(--accent);
}

.notif-nav .notif-badge:not([hidden]) {
  display: inline-flex;
}


.notif-badge[hidden],
.notif-nav .notif-badge[hidden] {
  display: none !important;
}


.auth-card h1 { margin-bottom: 0.25rem; }
.auth-sub { color: var(--text-muted); margin: 0 0 1.25rem; font-size: 0.92rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; color: var(--text-muted); font-size: 0.9rem; }
.auth-footer a { color: var(--accent); }
.auth-link { color: var(--accent); font-size: 0.86rem; font-weight: 650; text-decoration: none; }
.auth-row { display: flex; justify-content: flex-end; margin: -0.35rem 0 0.9rem; }
.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1rem 0; color: var(--text-muted); font-size: 0.8rem; font-weight: 700;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.auth-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%; height: 2.6rem; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text); font-weight: 750; text-decoration: none;
}
.auth-google-btn:hover { background: rgba(255,255,255,0.08); }
.auth-alert {
  border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem;
}
.auth-alert-error { background: rgba(255,92,92,0.15); border: 1px solid var(--danger); color: #ff8a8a; }
.auth-alert-info { background: rgba(79,140,255,0.15); border: 1px solid var(--accent); color: #8bb4ff; }


.auth-resend-box {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.auth-resend-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.auth-resend-form .form-control {
  flex: 1;
  min-width: 0;
}

.auth-resend-form .nav-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .auth-resend-form {
    flex-direction: column;
    align-items: stretch;
  }
}


/* Profile reviews: keep header left-aligned even when empty */
.profile-page .page-header#profile-reviews,
.page-wrapper.profile-page .page-header {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  text-align: left;
}

.profile-page .empty-state {
  text-align: left;
  padding: 1.5rem 1.25rem;
}

.profile-page .empty-state-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}


/* Mobile drawer search must not inherit desktop absolute centering */
.nav-drawer .nav-search-wrap,
.nav-search-wrap-mobile {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 0 0.85rem !important;
  flex: none !important;
  z-index: 1;
}

.nav-drawer .nav-search {
  width: 100%;
}

.nav-drawer .nav-search-results,
.nav-search-results-mobile {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: 0.45rem !important;
  width: 100% !important;
  transform: none !important;
  max-height: 240px;
}

.nav-drawer-inner {
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}


/* Light theme mobile drawer readability */
html[data-theme="light"] .nav-drawer {
  background: #ffffff !important;
  border-top-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .nav-drawer-link {
  color: #0f172a !important;
}

html[data-theme="light"] .nav-drawer-link:hover,
html[data-theme="light"] .nav-drawer-link:active {
  background: #eef1f7 !important;
  color: #3b7af0 !important;
}

html[data-theme="light"] .nav-drawer-theme {
  color: #0f172a !important;
}

html[data-theme="light"] .nav-drawer-divider {
  background: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .nav-backdrop {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .nav-burger span {
  background: #0f172a;
}

html[data-theme="light"] .nav-drawer .nav-search {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .nav-drawer .nav-search-input {
  color: #0f172a;
}


/* Polished mobile hamburger drawer */
.nav-drawer {
  border-top: 1px solid var(--border) !important;
  background: var(--bg-elevated, var(--surface)) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  max-height: min(78vh, 640px) !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-drawer-inner {
  padding: 0.9rem 0.85rem 1.15rem !important;
  gap: 0.35rem !important;
}

.nav-drawer-section {
  margin: 0.65rem 0.35rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-drawer-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.nav-drawer-link {
  display: flex !important;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.7rem 0.85rem !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  color: var(--text) !important;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.nav-drawer-link:hover,
.nav-drawer-link:active {
  background: rgba(79, 140, 255, 0.1) !important;
  color: var(--accent) !important;
}

.nav-drawer-link-cta {
  background: rgba(79, 140, 255, 0.12) !important;
  color: #b6d2ff !important;
}

html[data-theme="light"] .nav-drawer-link-cta {
  background: rgba(59, 122, 240, 0.12) !important;
  color: #2f6ae0 !important;
}

.nav-drawer-link-danger {
  color: #fca5a5 !important;
}

html[data-theme="light"] .nav-drawer-link-danger {
  color: #e11d48 !important;
}

.nav-drawer-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.15rem 0;
  padding: 0.65rem 0.85rem !important;
  border-radius: 10px !important;
  background: transparent;
}

.nav-drawer-theme-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-drawer-theme-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.nav-drawer-theme-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-search-drawer {
  padding: 0.55rem 0.85rem !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
}

.nav-drawer .nav-search-wrap-mobile {
  margin-bottom: 0.35rem !important;
}

html[data-theme="light"] .nav-drawer-group {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .nav-drawer {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}


/* Side panel hamburger (not full width) */
@media (max-width: 1023px) {
  .nav-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: 0 !important;
    width: min(320px, 86vw) !important;
    max-width: 320px !important;
    max-height: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1100 !important;
    border-top: none !important;
    border-left: 1px solid var(--border) !important;
    border-radius: 16px 0 0 16px;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35) !important;
    padding-top: env(safe-area-inset-top, 0px);
    transform: translateX(0);
    overflow-y: auto !important;
  }

  .nav-drawer[hidden] {
    display: none !important;
  }

  .nav-drawer:not([hidden]) {
    display: block !important;
  }

  .nav-backdrop:not([hidden]) {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    z-index: 1090 !important;
    background: rgba(0, 0, 0, 0.55) !important;
  }

  html[data-theme="light"] .nav-backdrop:not([hidden]) {
    background: rgba(15, 23, 42, 0.4) !important;
  }

  html[data-theme="light"] .nav-drawer {
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18) !important;
  }

  .nav-drawer-inner {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 1rem 0.85rem 1.25rem !important;
  }
}


/* Mobile drawer: content height, soft backdrop, slide-in */
@media (max-width: 1023px) {
  .nav-backdrop:not([hidden]) {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 1090 !important;
    background: rgba(0, 0, 0, 0.28) !important;
    opacity: 0;
    animation: navBackdropIn 0.2s ease forwards;
  }

  html[data-theme="light"] .nav-backdrop:not([hidden]) {
    background: rgba(15, 23, 42, 0.18) !important;
  }

  .nav-drawer {
    position: fixed !important;
    top: calc(var(--nav-h, 56px) + env(safe-area-inset-top, 0px) + 0.5rem) !important;
    right: 0.65rem !important;
    left: auto !important;
    bottom: auto !important;
    width: min(300px, calc(100vw - 1.3rem)) !important;
    max-width: 300px !important;
    height: auto !important;
    max-height: min(70vh, 560px) !important;
    border-radius: 16px !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35) !important;
    z-index: 1100 !important;
    overflow-y: auto !important;
    transform-origin: top right;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  .nav-drawer:not([hidden]) {
    display: block !important;
    animation: navDrawerIn 0.2s ease forwards;
  }

  .nav-drawer.is-closing {
    animation: navDrawerOut 0.16s ease forwards !important;
  }

  .nav-backdrop.is-closing {
    animation: navBackdropOut 0.16s ease forwards !important;
  }

  html[data-theme="light"] .nav-drawer {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14) !important;
  }
}

@keyframes navDrawerIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes navDrawerOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

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

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


/* Keep fixed nav + drawer above backdrop without changing layout */
.site-nav,
.navbar-custom {
  z-index: 1040;
}

body.nav-open .site-nav,
body.nav-open .navbar-custom {
  z-index: 1101 !important;
}

body.nav-open .nav-backdrop:not([hidden]) {
  z-index: 1100 !important;
}

body.nav-open .nav-drawer:not([hidden]) {
  z-index: 1102 !important;
  pointer-events: auto !important;
}


/* Light mode: brighter teaser mock panels */
html[data-theme="light"] .lb-mock,
html[data-theme="light"] .xp-mock {
  background: #f1f5fb;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .lb-mock-bar,
html[data-theme="light"] .xp-mock-bar-track {
  background: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .lb-mock-score {
  color: #d97706;
}

html[data-theme="light"] .xp-mock-level {
  color: #c2410c;
}

html[data-theme="light"] .landing-teaser-boards {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(59, 122, 240, 0.12), transparent 55%),
    #ffffff;
}

html[data-theme="light"] .landing-teaser-xp {
  background:
    radial-gradient(ellipse at 100% 100%, rgba(245, 158, 11, 0.12), transparent 55%),
    #ffffff;
}


/* Explore / Feed mobile polish */
@media (max-width: 700px) {
  .page-wrapper {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .feed-page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .feed-page-header h1 {
    font-size: 1.45rem !important;
    margin-bottom: 0.15rem;
  }

  .feed-page-header p {
    font-size: 0.88rem !important;
    line-height: 1.4;
  }

  .feed-page-controls {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .feed-mode-tabs {
    flex: 1 1 auto;
  }

  .feed-mode-tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 0.45rem 0.6rem;
  }

  .page-sort-btn {
    flex-shrink: 0;
  }

  .game-list {
    gap: 0.75rem !important;
  }

  .game-list .game-card,
  article.game-card {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: 0.7rem 0.75rem !important;
    padding: 0.8rem !important;
    border-radius: 14px !important;
    margin-bottom: 0 !important;
  }

  .game-cover-col {
    width: 78px !important;
  }

  .game-cover,
  .game-cover-placeholder {
    width: 78px !important;
    height: 104px !important;
    border-radius: 10px !important;
  }

  .game-cover-link {
    border-radius: 10px !important;
  }

  .cover-actions {
    gap: 0.25rem !important;
    margin-top: 0.35rem !important;
  }

  .cover-actions .action-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
  }

  .game-meta-row {
    gap: 0.4rem !important;
    align-items: flex-start !important;
  }

  .game-meta {
    gap: 0.3rem !important;
  }

  .meta-chip {
    font-size: 0.68rem !important;
    padding: 0.14rem 0.45rem !important;
  }

  .game-title {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }

  .stars {
    font-size: 0.92rem !important;
  }

  .rating-num {
    font-size: 0.8rem !important;
  }

  .game-notes,
  .game-notes-wrap {
    font-size: 0.88rem !important;
  }

  .review-like-stack {
    position: static !important;
    margin-left: auto;
  }

  .review-like-stack .action-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .comments-section {
    grid-column: 1 / -1;
  }
}


/* Mobile: use full card width for review content + tighter comment threads */
@media (max-width: 700px) {
  .game-list .game-card,
  article.game-card {
    grid-template-columns: 72px minmax(0, 1fr) !important;
    column-gap: 0.65rem !important;
    row-gap: 0.55rem !important;
  }

  .game-cover-col {
    grid-row: 1 / span 3;
  }

  .game-content {
    grid-column: 2 / -1 !important;
    min-width: 0 !important;
  }

  .comments-section,
  .add-comment-form,
  .login-to-comment {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .comments-section {
    margin-top: 0.55rem !important;
    padding-top: 0.7rem !important;
  }

  .comment {
    padding: 0.55rem 0.65rem !important;
    border-radius: 10px !important;
  }

  /* Much tighter nesting so threads don't eat half the screen */
  .comment-replies {
    margin-left: 0.35rem !important;
    padding-left: 0.45rem !important;
    border-left-width: 2px !important;
  }

  /* Cap extreme nesting visually */
  .comment-replies .comment-replies .comment-replies {
    margin-left: 0.15rem !important;
    padding-left: 0.35rem !important;
  }

  .comment-meta {
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
  }

  .comment-footer-actions {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .game-title {
    font-size: 0.98rem !important;
  }

  .meta-chip {
    max-width: 100%;
  }
}


/* Mobile review cards: full-width body under cover (no dead left column) */
@media (max-width: 700px) {
  .game-list .game-card,
  article.game-card {
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    gap: 0.55rem 0.7rem !important;
    align-items: start !important;
  }

  /* Let title/notes/comments participate in the card grid */
  .game-list .game-card > .game-content,
  article.game-card > .game-content {
    display: contents !important;
  }

  .game-list .game-card > .game-cover-col,
  article.game-card > .game-cover-col {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .game-list .game-card .game-meta-row,
  article.game-card .game-meta-row {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    width: 100%;
    min-width: 0;
  }

  .game-list .game-card .game-title,
  .game-list .game-card .stars,
  .game-list .game-card .game-notes-wrap,
  .game-list .game-card .game-notes-empty,
  .game-list .game-card .comments-section,
  .game-list .game-card .add-comment-form,
  .game-list .game-card .login-to-comment,
  article.game-card .game-title,
  article.game-card .stars,
  article.game-card .game-notes-wrap,
  article.game-card .game-notes-empty,
  article.game-card .comments-section,
  article.game-card .add-comment-form,
  article.game-card .login-to-comment {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .game-list .game-card .game-title,
  article.game-card .game-title {
    margin-top: 0.15rem !important;
  }

  .game-list .game-card .comments-section,
  article.game-card .comments-section {
    margin-top: 0.45rem !important;
  }

  .game-cover,
  .game-cover-placeholder {
    width: 76px !important;
    height: 102px !important;
  }

  .comment-replies {
    margin-left: 0.3rem !important;
    padding-left: 0.4rem !important;
  }
}


/* Mobile: like button top-right of review card */
@media (max-width: 700px) {
  .game-list .game-card,
  article.game-card {
    position: relative !important;
  }

  .game-list .game-card .review-like-stack,
  article.game-card .review-like-stack {
    position: absolute !important;
    top: 0.7rem !important;
    right: 0.7rem !important;
    margin: 0 !important;
    z-index: 2;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.55rem !important;
  }

  .game-list .game-card .game-meta-row,
  article.game-card .game-meta-row {
    padding-right: 3.1rem !important;
  }

  .game-list .game-card .review-like-stack .action-btn,
  article.game-card .review-like-stack .action-btn {
    width: 36px !important;
    height: 36px !important;
  }
}

/* Make "Log in" more obvious in comment prompt */
.login-to-comment {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-to-comment a {
  color: var(--accent) !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.login-to-comment a:hover {
  color: var(--accent-hover, #8bb4ff) !important;
}


.twitch-stream-title {
  margin: 0;
  padding: 0.65rem 1rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.twitch-game-stream {
  margin-top: 1.25rem;
}

@media (max-width: 700px) {
  .twitch-embed-section {
    border-radius: 14px !important;
    margin: 1rem 0 1.25rem !important;
  }

  .twitch-embed-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.65rem !important;
    padding: 0.75rem 0.85rem !important;
  }

  .twitch-embed-heading {
    align-items: center !important;
    gap: 0.55rem !important;
  }

  .twitch-embed-title {
    white-space: normal !important;
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
  }

  .twitch-stream-title {
    padding: 0.55rem 0.85rem 0.65rem !important;
    font-size: 0.84rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .twitch-open-btn {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.9rem !important;
  }

  .twitch-embed-wrap {
    aspect-ratio: 16 / 9;
    max-height: 42vh;
  }

  /* Profile top live banner */
  .twitch-top .twitch-embed-header {
    flex-direction: column;
  }

  .twitch-top .twitch-open-btn {
    width: 100%;
    justify-content: center;
  }
}

html[data-theme="light"] .twitch-embed-section {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .twitch-channel {
  color: #7c3aed;
}


/* Compact Twitch cards — kill extra vertical space */
.twitch-embed-section {
  display: flex;
  flex-direction: column;
}

.twitch-embed-header {
  align-items: center !important;
  gap: 0.65rem !important;
  padding: 0.65rem 0.85rem !important;
}

.twitch-embed-heading {
  align-items: center !important;
  gap: 0.55rem !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.twitch-embed-text {
  min-width: 0;
  flex: 1 1 auto;
}

.twitch-embed-title {
  margin: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.twitch-embed-meta {
  margin-top: 0.1rem !important;
}

.twitch-stream-title {
  padding: 0.5rem 0.85rem !important;
  margin: 0 !important;
}

.twitch-open-btn {
  width: auto !important;
  flex-shrink: 0;
}

.twitch-embed-wrap {
  aspect-ratio: 16 / 9 !important;
  max-height: none;
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .twitch-embed-header {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center !important;
    gap: 0.5rem 0.65rem !important;
    padding: 0.55rem 0.75rem !important;
  }

  .twitch-embed-heading {
    flex: 1 1 100% !important;
  }

  .twitch-open-btn {
    width: 100% !important;
    justify-content: center;
    padding: 0.5rem 0.85rem !important;
    order: 3;
  }

  .twitch-stream-title {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.82rem !important;
    -webkit-line-clamp: 2;
  }

  .twitch-embed-wrap {
    aspect-ratio: 16 / 9 !important;
    max-height: 36vh !important;
  }

  .twitch-embed-wrap iframe {
    max-height: 36vh;
  }
}


.game-notes-empty {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.9;
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}


@media (max-width: 700px) {
  .reviews-sort-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem !important;
    align-items: stretch;
  }

  .reviews-sort-label {
    grid-column: 1 / -1;
    margin: 0 0 0.1rem !important;
    font-size: 0.78rem;
  }

  .sort-chip {
    justify-content: center;
    text-align: center;
    padding: 0.45rem 0.55rem !important;
    font-size: 0.8rem !important;
  }

  /* Third chip spans full width so nothing looks orphaned */
  .reviews-sort-bar .sort-chip:last-of-type {
    grid-column: 1 / -1;
  }
}


@media (max-width: 700px) {
  .yir-hero {
    padding: 1rem 0.95rem 1.1rem !important;
  }

  .yir-hero-top {
    gap: 0.75rem !important;
  }

  .yir-avatar,
  .yir-avatar-fallback {
    width: 56px !important;
    height: 56px !important;
  }

  .yir-hero h1 {
    font-size: 1.25rem !important;
  }

  .yir-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.55rem !important;
    margin-top: 1rem !important;
  }

  .yir-stat {
    min-width: 0 !important;
    width: auto !important;
    padding: 0.7rem 0.55rem !important;
    border-radius: 12px !important;
  }

  .yir-stat-value {
    font-size: 1.25rem !important;
  }

  .yir-stat-label {
    font-size: 0.68rem !important;
    line-height: 1.2;
  }
}


@media (max-width: 700px) {
  .follow-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem !important;
    width: 100%;
    padding: 0.25rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 1rem !important;
  }

  /* When only 2 tabs (own profile following page without mutual), still look good */
  .follow-tabs:not(:has(.follow-tab:nth-child(3))) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .follow-tab {
    justify-content: center;
    text-align: center;
    padding: 0.55rem 0.35rem !important;
    border-radius: 10px !important;
    border: none !important;
    background: transparent !important;
    font-size: 0.78rem !important;
    line-height: 1.2;
    white-space: nowrap;
  }

  .follow-tab.active {
    background: rgba(79, 140, 255, 0.16) !important;
    color: var(--accent) !important;
    box-shadow: none;
  }

  html[data-theme="light"] .follow-tabs {
    background: #fff;
  }

  html[data-theme="light"] .follow-tab.active {
    background: rgba(59, 122, 240, 0.12) !important;
  }
}


@media (max-width: 700px) {
  .follow-tabs {
    gap: 0.2rem !important;
    padding: 0.2rem !important;
  }

  .follow-tab {
    min-width: 0 !important;
    padding: 0.55rem 0.25rem !important;
    font-size: 0.8rem !important;
    font-weight: 750 !important;
  }

  .follow-tab.active {
    padding: 0.55rem 0.25rem !important;
  }
}


@media (max-width: 1023px) {
  .nav-notif-menu-mobile {
    position: static;
  }

  .nav-notif-menu-mobile .nav-notif-dropdown {
    position: fixed !important;
    top: calc(var(--nav-h, 56px) + env(safe-area-inset-top, 0px) + 0.45rem) !important;
    left: 0.65rem !important;
    right: 0.65rem !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(70vh, 420px);
    border-radius: 14px !important;
    z-index: 1200 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }

  .nav-notif-menu-mobile .nav-notif-list {
    max-height: min(55vh, 320px);
  }

  .nav-notif-menu-mobile .nav-notif-head {
    padding: 0.7rem 0.85rem;
  }

  .nav-notif-menu-mobile .nav-notif-head strong {
    font-size: 0.95rem;
  }
}

html[data-theme="light"] .nav-notif-menu-mobile .nav-notif-dropdown {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}


.review-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.review-title-row .game-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.review-title-report {
  flex-shrink: 0;
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .game-list .game-card .review-title-row,
  article.game-card .review-title-row {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .review-title-report {
    margin-top: 0.05rem;
  }
}


@media (max-width: 700px) {
  .favorite-showcase {
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: stretch;
    border-radius: 14px !important;
  }

  .favorite-showcase-cover,
  .favorite-showcase-fallback {
    width: 88px !important;
    height: 118px !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: cover;
  }

  .favorite-showcase-fallback {
    font-size: 1.4rem !important;
  }

  .favorite-showcase-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem 0.85rem !important;
    min-width: 0;
  }

  .favorite-showcase-label {
    font-size: 0.68rem !important;
    margin-bottom: 0.25rem !important;
  }

  .favorite-showcase-title {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
  }

  .favorite-showcase-hint {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
  }

  .favorite-showcase-empty .favorite-showcase-cover,
  .favorite-showcase-empty .favorite-showcase-fallback {
    background: var(--surface-2);
  }
}


@media (max-width: 700px) {
  .admin-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.3rem !important;
    padding: 0.3rem !important;
    width: 100%;
  }

  .admin-tab {
    justify-content: center !important;
    text-align: center;
    padding: 0.6rem 0.4rem !important;
    font-size: 0.82rem !important;
    width: 100%;
    min-width: 0;
  }

  .admin-tab.active {
    box-shadow: 0 4px 12px rgba(79, 140, 255, 0.25);
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }
}


@media (max-width: 700px) {
  .settings-tabs.admin-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.3rem !important;
    padding: 0.3rem !important;
    width: 100%;
  }

  .settings-tabs .admin-tab {
    justify-content: center !important;
    text-align: center;
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.35rem !important;
    font-size: 0.8rem !important;
  }

  /* Danger Zone on its own full-width row */
  .settings-tabs .settings-tab-danger {
    grid-column: 1 / -1;
  }
}


/* Notification dropdown item polish */
.nav-notif-dropdown {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  overflow: hidden;
  padding: 0 !important;
}

.nav-notif-item,
a.nav-notif-item {
  display: flex !important;
  align-items: flex-start;
  gap: 0.7rem !important;
  padding: 0.75rem 0.9rem !important;
  text-decoration: none !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
  background: transparent;
}

.nav-notif-item:last-child {
  border-bottom: none !important;
}

.nav-notif-item:hover {
  background: rgba(79, 140, 255, 0.08) !important;
}

.nav-notif-item.unread {
  background: rgba(79, 140, 255, 0.1) !important;
}

.notif-avatar,
.notif-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.notif-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
}

.notif-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.notif-text {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text);
}

.notif-text strong {
  font-weight: 800;
  color: var(--text);
}

.notif-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-notif-head {
  background: var(--surface);
}

html[data-theme="light"] .nav-notif-item:hover {
  background: rgba(59, 122, 240, 0.08) !important;
}

html[data-theme="light"] .nav-notif-item.unread {
  background: rgba(59, 122, 240, 0.1) !important;
}

html[data-theme="light"] .nav-notif-dropdown {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12) !important;
}


.nav-notif-item {
  position: relative;
  align-items: stretch !important;
}

.nav-notif-link {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding-right: 0.35rem;
}

.nav-notif-dismiss {
  flex-shrink: 0;
  align-self: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-notif-dismiss:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}


.nav-notif-dismiss {
  position: relative;
  z-index: 2;
  pointer-events: auto !important;
}

.nav-notif-link {
  pointer-events: auto;
}


.review-page .review-page-list {
  max-width: 820px;
}

.review-page .share-box {
  max-width: 820px;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.review-page .share-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.review-page .share-row .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.page-back-link {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
}

.page-back-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.page-back-link a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .review-page .share-row {
    flex-direction: column;
    align-items: stretch;
  }
  .review-page .share-row .nav-btn {
    width: 100%;
    justify-content: center;
  }
}


.page-back-link a,
a.page-back-link {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

.review-like-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.review-like-stack .share-btn {
  order: 0;
}

.action-btn.share-btn.shared {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.12);
}

/* On mobile absolute stack, keep share above like */
@media (max-width: 700px) {
  .review-like-stack {
    gap: 0.3rem !important;
  }
}


.review-like-stack {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 0.35rem !important;
}

.review-like-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.review-like-stack .share-btn {
  margin-top: 0;
}


.review-like-stack {
  gap: 0.55rem !important;
}

.review-permalink-btn {
  text-decoration: none !important;
  color: var(--text-muted);
}

.review-permalink-btn:hover {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  background: rgba(79, 140, 255, 0.12) !important;
}

@media (max-width: 700px) {
  .review-like-stack {
    gap: 0.5rem !important;
  }
}


@media (max-width: 700px) {
  .review-like-stack {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.55rem !important;
  }

  .review-like-col {
    gap: 0.2rem;
  }
}


/* Space between open-review and like */
.review-like-stack {
  gap: 0.65rem !important;
}

.review-permalink-btn {
  margin-right: 0.15rem;
}

@media (max-width: 700px) {
  .review-like-stack {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.7rem !important;
  }

  .review-permalink-btn {
    margin-right: 0 !important;
    margin-bottom: 0.15rem !important;
  }
}

/* Hide open-review control when already on the review page */
.review-page .review-permalink-btn {
  display: none !important;
}
