/* === CSS Variables === */
:root {
  --bg-primary: #070b0f;
  --bg-secondary: #0d1219;
  --bg-card: #131a22;
  --bg-card-hover: #18202b;
  --bg-input: #0f161f;
  --border: #1e2a36;
  --border-light: #263340;
  --text-primary: #e8ecf1;
  --text-secondary: #8899aa;
  --text-muted: #556677;
  --accent: #f0652f;
  --accent-hover: #ff7b4a;
  --accent-glow: rgba(240, 101, 47, 0.15);
  --green: #00c853;
  --green-bg: rgba(0, 200, 83, 0.1);
  --red: #ff3d3d;
  --red-bg: rgba(255, 61, 61, 0.1);
  --warfare: #f0652f;
  --operations: #00bcd4;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--accent);
}

/* === Navbar === */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 12, 18, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(240,101,47,0.08);
}

.nav-inner {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 1280px; margin: 0 auto; padding: 0.75rem 1.5rem;
}

.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 1.25rem; color: var(--text-primary);
}
.logo:hover { color: var(--text-primary); }
.logo-icon { font-size: 1.4rem; }
.logo-icon-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.logo-accent { color: var(--accent); }

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

.nav-link {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-link:hover { color: var(--text-primary); border-bottom-color: var(--accent); }

.nav-search { flex: 1; max-width: 160px; margin-left: 0.5rem; }
.nav-search input {
  width: 100%; padding: 0.5rem 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-primary);
  font-size: 0.85rem; outline: none;
  transition: border-color var(--transition);
}
.nav-search input:focus { border-color: var(--accent); }
.nav-search input::placeholder { color: var(--text-muted); }

.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto; display: none; z-index: 200;
}
.search-dropdown.active { display: block; }
.search-item {
  display: block; padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.search-item:hover { background: var(--bg-card-hover); }
.search-item-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.search-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.nav-auth { display: flex; align-items: center; gap: 0.75rem; }

.user-menu { display: flex; align-items: center; gap: 0.75rem; }

/* Support / Tip button next to avatar */
.btn-support {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-support:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}
.btn-support svg {
  stroke: #fff;
}

.user-dropdown { position: relative; z-index: 500; margin-left: auto; }
.user-trigger {
  display: flex; align-items: center; gap: 0.5rem;
  background: none; border: none; color: var(--text-primary);
  font-size: 0.85rem; cursor: pointer; padding: 0.25rem;
  font-family: inherit;
}
.user-trigger-name { flex-shrink: 1; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border-light);
}

.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  min-width: 180px; padding: 0.5rem; display: none; z-index: 200;
}
.user-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 0.6rem 0.75rem; font-size: 0.85rem;
  color: var(--text-secondary); border-radius: var(--radius-xs);
  transition: all var(--transition);
}
.dropdown-menu a:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 0.25rem 0; }

/* Notification badge */
.avatar-badge-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; line-height: 16px;
  background: #e74c3c; color: #fff; font-size: 0.6rem; font-weight: 700;
  border-radius: 8px; text-align: center; padding: 0 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.notif-badge-inline {
  position: static; display: inline-flex; align-items: center; justify-content: center;
  margin-left: 0.5rem; vertical-align: middle;
}
.notif-link {
  display: flex !important; align-items: center;
  justify-content: space-between;
}

/* Notifications page */
.notif-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1.1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: all 0.3s ease;
}
.notif-row:hover { background: var(--bg-card-hover); border-color: var(--accent); transform: translateX(2px); }
.notif-unread { border-left: 3px solid var(--accent); background: rgba(240,101,47,0.05); }
.notif-icon { flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
.notif-up-svg { color: var(--accent); background: rgba(240,101,47,0.12); border-radius: 50%; padding: 4px; width: 28px; height: 28px; }
.notif-comment-svg { color: var(--operations); background: rgba(0,188,212,0.12); border-radius: 50%; padding: 4px; width: 28px; height: 28px; }
.notif-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.notif-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }
.notif-text strong { color: var(--text-primary); }
.notif-time { font-size: 0.72rem; color: var(--text-muted); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; font-size: 0.9rem; font-weight: 600;
  border: none; border-radius: var(--radius-xs); cursor: pointer;
  font-family: inherit; text-decoration: none;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-card-hover); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); background: var(--bg-input); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { border-color: var(--red); background: rgba(255,61,61,0.2); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.7rem; }

.btn-google {
  background: #fff; color: #222; font-weight: 600; gap: 0.75rem;
  padding: 0.75rem 2rem; font-size: 0.95rem;
  border: 2px solid #e0e0e0; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.btn-google:hover { background: #f5f5f5; color: #222; transform: translateY(-1px); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === Main Content === */
.main-content {
  max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem;
  min-height: calc(100vh - 140px);
}

/* === Hero === */
.hero {
  text-align: center; padding: 4rem 0 3rem;
  margin-bottom: 2rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(240,101,47,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0,188,212,0.04) 0%, transparent 50%),
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(240,101,47,0.015) 40px, rgba(240,101,47,0.015) 41px);
  pointer-events: none;
}
.hero-content { }
.hero-title { font-size: 3rem; font-weight: 800; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.hero-sub { color: var(--text-secondary); font-size: 1.15rem; max-width: 560px; margin: 0 auto 2rem; }

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

.hero-stats { display: flex; gap: 2.5rem; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* === Filters === */
.filters { margin-bottom: 2rem; }
.filter-bar { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filter-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.filter-chip {
  padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 500;
  border-radius: 20px; background: var(--bg-secondary);
  color: var(--text-secondary); border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer; text-decoration: none; font-family: inherit; display: inline-block;
}
.filter-chip:hover { color: var(--text-primary); border-color: var(--border-light); }
.filter-chip.active { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }
.filter-chip.mode-badge { cursor: default; pointer-events: none; }
.filter-chip.mode-badge:hover { color: var(--text-secondary); border-color: var(--border); }

/* === Gun Grid === */
.guns-section { margin-bottom: 3rem; scroll-margin-top: 80px; }
.gun-category { margin-bottom: 3rem; }

.category-title {
  font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.05em; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.gun-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.3s ease; display: block; position: relative;
}
.gun-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-glow);
}

.gun-card-visual {
  padding: 0; background: var(--bg-secondary);
  height: 160px; overflow: hidden; position: relative;
}
.gun-card-visual::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(7,11,15,0.6) 100%);
  pointer-events: none;
}
.gun-card-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: transform 0.4s ease;
}
.gun-card:hover .gun-card-img { transform: scale(1.08); }

.gun-build-count {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
  padding: 0.25rem 0.6rem; font-size: 0.65rem; font-weight: 700;
  background: rgba(0,0,0,0.7); color: var(--accent);
  border-radius: 100px; backdrop-filter: blur(8px);
  letter-spacing: 0.03em;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.gun-card:hover .gun-build-count,
.gun-card:active .gun-build-count { opacity: 1; transform: translateY(0); }

.gun-silhouette { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.gun-silhouette .gun-emoji { font-size: 2.5rem; }

.gun-card-info { padding: 0.9rem 1rem; }
.gun-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.gun-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.gun-type-badge {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  padding: 0.15rem 0.5rem; border-radius: 4px;
  background: var(--bg-secondary); color: var(--text-secondary);
  letter-spacing: 0.04em;
}
.gun-caliber {
  font-size: 0.7rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.gun-modes { display: flex; gap: 0.35rem; }
.mode-tag {
  font-size: 0.85rem; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; padding: 0 2px;
}
.mode-tag.warfare { background: rgba(240,101,47,0.12); }
.mode-tag.operations { background: rgba(0,188,212,0.12); }

/* === Gun Hero (Gun Page) === */
.gun-hero {
  margin-bottom: 2.5rem; padding: 2.5rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.gun-hero-main { display: flex; gap: 2.5rem; margin-top: 1.5rem; align-items: center; }
.gun-hero-visual {
  flex-shrink: 0; width: 240px; height: 160px;
  background: var(--bg-secondary); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.gun-hero-img {
  width: 100%; height: 100%; object-fit: contain;
}
.gun-emoji { font-size: 4rem; }
.gun-hero-info h1 { font-size: 2.25rem; margin-bottom: 0.75rem; }
.gun-hero-meta { display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }
.gun-hero-desc { color: var(--text-secondary); max-width: 560px; }
.gun-hero-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; align-items: center; }
.or-divider { color: var(--text-muted); font-size: 0.85rem; }

/* === Back Link === */
.back-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
}
.back-link:hover { color: var(--text-primary); }

/* === Build List === */
.builds-section { margin-top: 2rem; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.section-header h2 { font-size: 1.25rem; }

.sort-tabs { display: flex; gap: 0.25rem; }
.tab {
  padding: 0.4rem 1rem; font-size: 0.8rem; font-weight: 600;
  border-radius: var(--radius-xs); color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer; border: none; background: none; font-family: inherit; text-decoration: none;
}
.tab:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.tab.active { background: var(--accent); color: #fff; }
.tab.active:hover { background: var(--accent-hover); color: #fff; }

.build-list { display: flex; flex-direction: column; gap: 0.75rem; }

.build-card {
  display: block; padding: 1.25rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all 0.3s ease;
}
.build-card:hover {
  border-color: var(--border-light); background: var(--bg-card-hover);
  transform: translateX(3px); box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.build-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem;
}
.build-author { display: flex; align-items: center; gap: 0.5rem; }
.author-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-light);
}
.author-name {
  font-size: 0.8rem; color: var(--text-secondary); font-weight: 500;
}
.build-date { font-size: 0.75rem; color: var(--text-muted); }

.build-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.build-desc {
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem;
  line-height: 1.5;
}

.build-card-footer { display: flex; align-items: center; justify-content: space-between; }
.build-votes { display: flex; gap: 0.75rem; }
.vote-count {
  font-size: 0.8rem; display: flex; align-items: center; gap: 0.25rem;
}
.vote-count.up { color: var(--green); }
.vote-count.down { color: var(--red); }
.build-score {
  font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.build-score.positive { background: var(--green-bg); color: var(--green); }
.build-score.negative { background: var(--red-bg); color: var(--red); }

.build-gun { font-size: 0.8rem; color: var(--accent); font-weight: 600; }

/* === Build Detail === */
.build-detail { max-width: 860px; margin: 0 auto; }

.build-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 1.5rem 0; flex-wrap: wrap; gap: 1rem;
}
.build-detail-author { display: flex; align-items: center; gap: 1rem; }
.author-avatar-lg {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--border-light);
}
.author-name-lg { font-size: 1rem; font-weight: 600; color: var(--text-primary); display: block; }
.build-meta { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 2px; }
.build-owner-actions { display: flex; gap: 0.5rem; }

.build-detail-title { font-size: 2rem; margin-bottom: 1rem; }
.build-detail-desc {
  color: var(--text-secondary); margin-bottom: 2rem;
  line-height: 1.7; white-space: pre-wrap;
}

/* Vote Box */
.vote-box {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 2rem;
}
.vote-score { font-size: 2rem; font-weight: 800; min-width: 60px; text-align: center; }
.vote-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.vote-buttons { display: flex; gap: 0.5rem; }
.vote-btn {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; transition: all var(--transition);
}
.vote-btn:hover:not(:disabled) { border-color: var(--border-light); color: var(--text-primary); }
.vote-btn.up.active { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.vote-btn.down.active { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.vote-counts { display: flex; gap: 1rem; font-size: 0.8rem; }
.vc-up { color: var(--green); }
.vc-down { color: var(--red); }

/* === Build Sections === */
.build-section {
  margin-bottom: 2rem; padding: 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.build-section h3 { font-size: 1.1rem; margin-bottom: 1rem; }

.attachment-list { display: flex; flex-direction: column; gap: 0.5rem; }
.attachment-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary); border-radius: var(--radius-xs);
}
.att-slot {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  color: var(--accent); min-width: 80px;
}
.att-name { font-size: 0.9rem; }

.tuning-info { display: flex; flex-direction: column; gap: 0.35rem; }
.tuning-row { display: flex; align-items: center; gap: 1rem; }
.tuning-key { font-size: 0.8rem; color: var(--text-secondary); min-width: 100px; }
.tuning-val { font-size: 0.85rem; font-weight: 600; color: var(--accent); }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.75rem; }
.build-image { border-radius: var(--radius-sm); overflow: hidden; }
.build-image img {
  width: 100%; height: 200px; object-fit: cover;
  cursor: pointer; transition: transform var(--transition);
}
.build-image img:hover { transform: scale(1.03); }
.build-image img.zoomed {
  position: fixed; inset: 0; z-index: 999;
  width: 90vw; height: 90vh; object-fit: contain;
  margin: auto; background: rgba(0,0,0,0.9);
  border-radius: var(--radius);
}

/* === Comments === */
.comment-form { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }
.comment-form textarea {
  flex: 1; padding: 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-primary);
  font-family: inherit; font-size: 0.85rem; resize: vertical;
  outline: none; transition: border-color var(--transition);
}
.comment-form textarea:focus { border-color: var(--accent); }

.comments-list { display: flex; flex-direction: column; gap: 1rem; }
.comment { display: flex; gap: 0.75rem; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-light); flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.comment-author { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.comment-date { font-size: 0.7rem; color: var(--text-muted); }
.comment-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

/* === Upload Form === */
.upload-page { max-width: 800px; margin: 0 auto; }
.upload-page h1 { font-size: 1.75rem; margin: 1rem 0 2rem; }

.build-form { display: flex; flex-direction: column; gap: 1.5rem; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
}
.form-group input[type="text"],
.form-group textarea {
  padding: 0.75rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text-primary); font-family: inherit; font-size: 0.9rem;
  outline: none; transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }

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

.attachment-row {
  display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center;
}
.att-slot-input { flex: 0 0 130px; }
.att-name-input { flex: 1; }
.attachment-row input {
  padding: 0.5rem 0.6rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text-primary); font-size: 0.85rem; font-family: inherit;
}

.tuning-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.tuning-row input {
  padding: 0.5rem 0.6rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text-primary); font-size: 0.85rem; font-family: inherit;
}
.tuning-key-input { flex: 0 0 160px; }
.tuning-val-input { flex: 1; }

.file-upload-area {
  position: relative; overflow: hidden;
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1.25rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition); }
.file-upload-area:hover { border-color: var(--border-light); }
.file-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.upload-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.file-upload-label { color: var(--text-muted); font-size: 0.85rem; }

.file-preview { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.preview-thumb {
  width: 80px; height: 60px; object-fit: cover; border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

.current-images { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.current-image-item { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.current-image-item .thumb {
  width: 100px; height: 70px; object-fit: cover; border-radius: var(--radius-xs);
}
.current-image-item label { font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }

.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* === Login === */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3rem; text-align: center;
  max-width: 440px; width: 100%;
}
.login-icon { font-size: 3rem; margin-bottom: 1rem; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.login-sub { color: var(--text-muted); margin-bottom: 2rem; }
.login-footer { font-size: 0.75rem; color: var(--text-muted); margin-top: 2rem; }

.auth-notice { text-align: left; }
.auth-setup { margin-top: 1rem; text-align: left; }
.auth-setup h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.auth-setup ol { padding-left: 1.25rem; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.8; }
.auth-setup code { font-size: 0.75rem; }

/* === Settings === */
.settings-page { max-width: 640px; margin: 0 auto; }
.settings-page h1 { font-size: 1.75rem; margin: 1rem 0 2rem; }

.settings-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem;
}
.settings-card h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; border-top: 1px solid var(--border); gap: 1rem;
  flex-wrap: wrap;
}
.setting-info h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.setting-info p { font-size: 0.85rem; color: var(--text-secondary); }

.inline-form { display: flex; gap: 0.5rem; align-items: center; }
.input-sm { padding: 0.5rem 0.75rem; max-width: 180px; }
.input-sm {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-primary);
  font-size: 0.85rem; font-family: inherit;
}

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-xs); margin-bottom: 1rem; font-size: 0.85rem; font-weight: 500; }
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(255,61,61,0.2); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(0,200,83,0.2); }

/* === Profile === */
.profile-page { max-width: 800px; margin: 0 auto; }
.profile-header {
  text-align: center; padding: 2.5rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 2rem;
}
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  border: 3px solid var(--accent); margin-bottom: 1rem;
}
.profile-header h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.profile-stats { display: flex; gap: 2.5rem; justify-content: center; margin-bottom: 1.5rem; }
.profile-stat { text-align: center; }
.ps-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.ps-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.profile-builds { margin-bottom: 2rem; }
.profile-builds h2 { font-size: 1.25rem; margin-bottom: 1rem; }

/* === Error Pages === */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--accent); opacity: 0.3; line-height: 1; margin-bottom: 1rem; }
.error-page h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.error-page p { color: var(--text-muted); margin-bottom: 2rem; }

/* === Empty State === */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* === Footer === */
.footer {
  border-top: 1px solid var(--border); padding: 2rem 1.5rem;
  text-align: center;
}
.footer-inner p { color: var(--text-muted); font-size: 0.8rem; }
.footer-small { margin-top: 0.25rem; font-size: 0.7rem !important; color: var(--text-muted) !important; opacity: 0.6; }

/* === Mobile Optimization === */
@media (max-width: 768px) {
  /* Navbar */
  .nav-inner { flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0.75rem; }
  .nav-auth { order: 1; flex: 1; min-width: 0; flex-direction: row; align-items: center; gap: 0.5rem; }
  .nav-links { order: 3; width: 100%; flex-direction: row; justify-content: center; gap: 0.5rem; }
  .user-dropdown { order: 1; flex-shrink: 0; }
  .nav-link { font-size: 0.75rem; padding: 0.2rem 0.4rem; white-space: nowrap; flex-shrink: 0; }
  .nav-search { max-width: 130px; margin-left: 0; }
  .logo { font-size: 1rem; }
  .logo-icon { font-size: 1.1rem; }
  .btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }

  /* Hero */
  .hero { padding: 2rem 0 1.5rem; }
  .hero-title { font-size: 1.75rem; }
  .hero-sub { font-size: 0.9rem; padding: 0 0.5rem; }
  .hero-stats { gap: 1.5rem; }
  .stat-num { font-size: 1.5rem; }

  /* Main content */
  .main-content { padding: 1rem 0.75rem; }

  /* Gun grid */
  .gun-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
  .gun-card-visual { height: 110px; }
  .gun-card-info { padding: 0.6rem; }
  .gun-name { font-size: 0.82rem; }
  .gun-meta { gap: 0.25rem; flex-wrap: wrap; }
  .gun-type-badge { font-size: 0.65rem; }
  .gun-caliber { font-size: 0.65rem; }
  .gun-build-count { font-size: 0.6rem; top: 0.4rem; right: 0.4rem; }

  /* Filters */
  .filter-bar { flex-direction: column; gap: 0.5rem; }
  .filter-group { gap: 0.3rem; }
  .filter-chip { padding: 0.25rem 0.55rem; font-size: 0.7rem; }

  /* Gun hero */
  .gun-hero { padding: 1.25rem; }
  .gun-hero-main { flex-direction: column; gap: 1rem; }
  .gun-hero-visual { width: 100%; height: 150px; }
  .gun-hero-info h1 { font-size: 1.4rem; }
  .gun-hero-desc { font-size: 0.85rem; }

  /* Feed / build cards */
  .feed-section { max-width: 100%; }
  .feed-card { padding: 0.85rem; margin-bottom: 0.5rem; }
  .feed-card-actions { gap: 1.25rem; }
  .feed-action { font-size: 0.75rem; }
  .feed-code-block { max-height: 80px; }
  .feed-desc { font-size: 0.82rem; }

  /* Build detail */
  .tweet-detail { max-width: 100%; }
  .tweet-main-card { padding: 0.85rem; }
  .tweet-header { gap: 0.5rem; }
  .tweet-avatar { width: 36px; height: 36px; }
  .tweet-username { font-size: 0.85rem; }
  .tweet-body-text { font-size: 0.88rem; }
  .tweet-code-block { padding: 0.6rem; max-height: 150px; }
  .tweet-code-block code { font-size: 0.7rem; }
  .tweet-actions { justify-content: space-around; }
  .tweet-act-btn { padding: 0.3rem 0.6rem; }

  /* Forms */
  .upload-page, .settings-page, .login-card { max-width: 100%; padding: 0 0.25rem; }
  .build-form { gap: 1rem; }
  .form-group input[type="text"], .form-group textarea { font-size: 16px !important; /* prevent iOS zoom */ }
  .attachment-row { flex-direction: column; }
  .att-slot-input { flex: 0 0 auto; width: 100%; }

  /* Mode selector */
  .mode-selector { gap: 0.5rem; }
  .mode-card { padding: 0.6rem; }

  /* Comments */
  .comment-form { gap: 0.5rem; }
  .comment-form textarea { font-size: 0.82rem; }
  .comment-item { padding: 0.65rem 0; }

  /* Login */
  .login-card { padding: 1.5rem 1rem; margin: 0 0.5rem; }
  .login-card h1 { font-size: 1.25rem; }

  /* Settings */
  .settings-card { padding: 1rem; }
  .setting-row { flex-direction: column; align-items: flex-start; }
  .inline-form { flex-direction: column; width: 100%; }
  .input-sm { max-width: 100%; width: 100%; }

  /* Footer */
  .footer { padding: 1rem 0.75rem; }

  /* Error */
  .error-code { font-size: 4rem; }
}

@media (max-width: 480px) {
  /* Tighter mobile */
  .hero-title { font-size: 1.35rem; letter-spacing: -0.01em; }
  .hero-sub { font-size: 0.8rem; }
  .hero-stats { gap: 1rem; }

  /* 2-column gun grid on small phones */
  .gun-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .gun-card-visual { height: 95px; }
  .gun-name { font-size: 0.75rem; }
  .gun-card-info { padding: 0.5rem; }
  .mode-tag { font-size: 0.75rem; min-width: 24px; height: 24px; }

  /* Gun hero smaller */
  .gun-hero { padding: 1rem; }
  .gun-hero-visual { height: 120px; }
  .gun-hero-info h1 { font-size: 1.2rem; }

  /* Feed actions tighter */
  .feed-card { padding: 0.7rem; margin-bottom: 0.5rem; }
  .feed-card-actions { gap: 1rem; }
  .feed-action span { display: none; }
  .feed-mode-tag { font-size: 0.6rem; padding: 0.1rem 0.4rem; }

  /* Navbar minimal */
  .nav-links { gap: 0.3rem; }
  .nav-link { font-size: 0.72rem; padding: 0.2rem 0.4rem; }
  .user-trigger-name { display: none; }

  /* Form elements full-width */
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; text-align: center; justify-content: center; }

  /* Share/reply buttons full-width */
  .tweet-actions { gap: 0; }
  .tweet-act-btn { flex: 1; justify-content: center; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .build-count { margin-left: 0; }
  .vote-box { flex-direction: column; align-items: flex-start; }
}

/* === Twitter-Style Feed === */
.feed-section { max-width: 640px; margin: 0 auto; }
.feed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.feed-header h2 { font-size: 1.15rem; font-weight: 700; }
.build-count { font-size: 0.85rem; color: var(--text-muted); margin-left: 1rem; }

.feed-list { display: flex; flex-direction: column; }

.feed-card {
  padding: 1.1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  position: relative; margin-bottom: 0.75rem;
  cursor: pointer;
}
.feed-card:hover {
  background: var(--bg-card-hover); border-color: var(--border-light);
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.feed-card-link { position: absolute; inset: 0; z-index: 1; }

.feed-card-header { display: flex; align-items: flex-start; gap: 0.75rem; position: relative; z-index: 3; margin-bottom: 0.5rem; }
.feed-avatar-link { flex-shrink: 0; }
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border-light); }
.feed-user-info { display: flex; align-items: baseline; gap: 0.35rem; flex-wrap: wrap; }
.feed-username { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.feed-username:hover { text-decoration: underline; }
.feed-timestamp { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

.feed-card-body { position: relative; z-index: 2; }
.feed-code-block {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 0.75rem; margin-bottom: 0.5rem;
  overflow-x: auto; max-height: 120px;
}
.feed-code-block pre { margin: 0; }
.feed-code-block { position: relative; }
.feed-code-block .copy-btn {
  position: absolute; top: 0.35rem; right: 0.35rem;
  display: flex; align-items: center; gap: 0.25rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.5rem; border-radius: var(--radius-xs);
  cursor: pointer; transition: all var(--transition); z-index: 3;
  font-family: inherit;
}
.feed-code-block .copy-btn:hover { color: var(--text-primary); border-color: var(--border-light); }
.feed-code-block .copy-btn.copied { color: var(--green); border-color: var(--green); }
.feed-code-block code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--accent);
  background: none; padding: 0; white-space: pre-wrap; word-break: break-all;
}
.feed-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; }

.feed-card-actions {
  display: flex; align-items: center; gap: 1.5rem; margin-top: 0.75rem;
  position: relative; z-index: 3;
}
.feed-card-tags {
  position: absolute; bottom: 0.75rem; right: 1rem;
  display: flex; gap: 0.35rem; z-index: 4;
}
.feed-action {
  display: flex; align-items: center; gap: 0.35rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.8rem; cursor: pointer; padding: 8px; font-family: inherit;
  transition: color var(--transition); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.feed-action:hover { color: var(--text-primary); }
.feed-action.up.active { color: var(--green); }
.feed-action.down.active { color: var(--red); }
.feed-action:disabled { opacity: 0.4; cursor: default; }
.feed-action span { font-size: 0.8rem; }

/* === Twitter-Style Build Detail === */
.tweet-detail { max-width: 640px; margin: 0 auto; }

.tweet-main-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin: 1.5rem 0;
}

.tweet-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.tweet-avatar-link { flex-shrink: 0; }
.tweet-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--border-light); }
.tweet-user-info { display: flex; align-items: baseline; gap: 0.3rem; flex-wrap: wrap; flex: 1; }
.tweet-username { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }
.tweet-username:hover { text-decoration: underline; }
.tweet-handle { font-size: 0.8rem; color: var(--text-muted); }
.tweet-dot { font-size: 0.8rem; color: var(--text-muted); }
.tweet-date { font-size: 0.8rem; color: var(--text-muted); }
.tweet-owner-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

.tweet-meta-row { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }

.tweet-code-block {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 0.85rem; margin-bottom: 0.75rem;
  overflow-x: auto; max-height: 200px; overflow-y: auto;
}
.tweet-code-block pre { margin: 0; }
.tweet-code-block code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: var(--accent); background: none; padding: 0;
  white-space: pre-wrap; word-break: break-all;
}

.tweet-body-text { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.65; white-space: pre-wrap; margin-bottom: 0.75rem; }

.tweet-images { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.tweet-image-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.tweet-image-wrap img { width: 100%; max-height: 400px; object-fit: contain; background: var(--bg-secondary); cursor: pointer; }
.tweet-image-wrap img:hover { opacity: 0.9; }
.tweet-image-wrap img.zoomed {
  position: fixed; inset: 2rem; z-index: 999;
  width: calc(100vw - 4rem); height: calc(100vh - 4rem);
  object-fit: contain; background: rgba(0,0,0,0.95);
  border-radius: var(--radius);
}

.tweet-actions {
  display: flex; align-items: center; gap: 0;
  border-top: 1px solid var(--border); padding-top: 0.75rem;
}
.tweet-act-btn {
  display: flex; align-items: center; gap: 0.35rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.85rem; cursor: pointer; padding: 0.35rem 1rem; font-family: inherit;
  transition: all var(--transition); border-radius: 20px;
}
.tweet-act-btn:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-card-hover); }
.tweet-act-btn.up.active { color: var(--green); }
.tweet-act-btn.down.active { color: var(--red); }
.tweet-act-btn:disabled { opacity: 0.4; cursor: default; }
.tweet-act-btn span { font-size: 0.8rem; margin-left: 0.1rem; }

/* === Comments Section (Twitter-style) === */
.comments-section { margin-top: 1.5rem; }
.comments-section h3 { font-size: 1.05rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

.comment-form { display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: flex-start; }
.comment-form-avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-light); flex-shrink: 0; }
.comment-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.comment-input-wrap textarea {
  width: 100%; padding: 0.65rem 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-primary);
  font-family: inherit; font-size: 0.85rem; resize: vertical; outline: none;
}
.comment-input-wrap textarea:focus { border-color: var(--accent); }
.comment-input-wrap .btn { align-self: flex-end; }

.comment-item { display: flex; gap: 0.65rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-light); flex-shrink: 0; }
.comment-content { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.15rem; }
.comment-author { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.comment-author:hover { text-decoration: underline; }
.comment-date { font-size: 0.7rem; color: var(--text-muted); }
.comment-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; white-space: pre-wrap; }

/* === Feed Card Responsive === */
@media (max-width: 480px) {
  .feed-card-actions { gap: 1rem; }
  .tweet-actions { justify-content: space-around; }
  .tweet-act-btn { padding: 0.35rem 0.5rem; }
}

/* === Modern Code Input === */
.code-input-wrap { position: relative; }
.code-textarea {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.02em;
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xs) !important;
  color: var(--accent) !important;
  resize: vertical;
  min-height: 60px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.code-textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(240,101,47,0.1) !important;
  outline: none;
}
.code-char-count {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* === Code Block Header (Build Detail) === */
.tweet-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.tweet-code-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}
.tweet-code-copy {
  font-size: 0.7rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.tweet-code-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Feed Image Preview === */
.feed-image-wrap {
  margin-top: 0.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 300px;
}
.feed-image {
  width: 100%;
  object-fit: cover;
  display: block;
}

/* === Mode Selector === */
.mode-selector { display: flex; gap: 0.75rem; }
.mode-option { cursor: pointer; flex: 1; }
.mode-option input { display: none; }
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  transition: all var(--transition);
}
.mode-option input:checked + .mode-card {
  border-color: var(--accent);
  background: rgba(240,101,47,0.08);
}
.mode-option:hover .mode-card { border-color: var(--border-light); }
.mode-option input:checked + .mode-card:hover { border-color: var(--accent); }
.mode-emoji { font-size: 1.3rem; }
.mode-name { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.mode-option input:checked + .mode-card .mode-name { color: var(--accent); }

/* === Feed Mode Tag === */
.feed-mode-tag {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  letter-spacing: 0.03em;
}
.feed-mode-tag.warfare { background: rgba(240,101,47,0.12); color: var(--warfare); }
.feed-mode-tag.operations { background: rgba(0,188,212,0.12); color: var(--operations); }
.feed-mode-tag.region.global { background: rgba(59,130,246,0.12); color: #60a5fa; }
.feed-mode-tag.region.garena { background: rgba(168,85,247,0.12); color: #c084fc; }

/* === Reddit-Style Voting === */
.reddit-vote {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  min-width: 40px;
}
.rv-arrow {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: flex;
}
.rv-arrow:hover:not(:disabled) { background: var(--bg-card-hover); }
.rv-arrow.up.active, .rv-arrow.up:hover:not(:disabled) { color: #ff4500; }
.rv-arrow.down.active, .rv-arrow.down:hover:not(:disabled) { color: #7193ff; }
.rv-arrow:disabled { opacity: 0.3; cursor: default; }
.rv-score {
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-secondary);
  line-height: 1; min-width: 20px; text-align: center;
}
.rv-score.upvoted { color: #ff4500; }
.rv-score.downvoted { color: #7193ff; }

/* === Gun Picker Modal === */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
  background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-popup {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 380px;
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-search {
  margin: 0.5rem 0.75rem; padding: 0.5rem 0.75rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-primary);
  font-size: 0.85rem; font-family: inherit; outline: none;
}
.modal-search:focus { border-color: var(--accent); }
.modal-gun-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.75rem;
}
.modal-type-group { margin-bottom: 0.5rem; }
.modal-type-label {
  display: block; font-size: 0.65rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.1em; padding: 0.5rem 0.75rem 0.25rem;
}
.modal-gun-item {
  display: block; padding: 0.5rem 0.75rem;
  font-size: 0.85rem; color: var(--text-secondary);
  border-radius: var(--radius-xs); transition: all var(--transition);
}
.modal-gun-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* === Feed Gun Badge === */
.feed-gun-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  color: var(--accent); background: rgba(59,130,246,0.12);
  padding: 0.15rem 0.5rem; border-radius: var(--radius-xs);
  margin-bottom: 0.5rem; position: relative; z-index: 3;
}
.feed-gun-badge:hover { background: rgba(59,130,246,0.25); }

/* === Leaderboard === */
.leaderboard-list {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.leader-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: all 0.3s ease;
}
.leader-row:hover {
  background: var(--bg-card-hover); border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.leader-rank {
  font-size: 1.1rem; font-weight: 800; min-width: 36px; text-align: center;
  color: var(--text-muted);
}
.leader-rank.gold { font-size: 1.5rem; color: #ffd700; filter: drop-shadow(0 0 8px rgba(255,215,0,0.3)); }
.leader-rank.silver { font-size: 1.3rem; color: #c0c0c0; filter: drop-shadow(0 0 6px rgba(192,192,192,0.3)); }
.leader-rank.bronze { font-size: 1.2rem; color: #cd7f32; filter: drop-shadow(0 0 6px rgba(205,127,50,0.3)); }
.leader-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border-light);
}
.leader-row:nth-child(1) .leader-avatar { border-color: #ffd70040; }
.leader-row:nth-child(2) .leader-avatar { border-color: #c0c0c040; }
.leader-row:nth-child(3) .leader-avatar { border-color: #cd7f3240; }
.leader-info { flex: 1; display: flex; flex-direction: column; }
.leader-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.leader-detail { font-size: 0.75rem; color: var(--text-muted); }
.leader-score {
  font-weight: 700; font-size: 1rem;
  color: #ff4500; min-width: 80px; text-align: right;
}

/* === Trending Guns === */
.trending-section { margin-bottom: 2.5rem; }
.trending-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.trending-header h2 { font-size: 1.25rem; }
.trending-badge {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--accent-glow); color: var(--accent);
  padding: 0.2rem 0.6rem; border-radius: 100px;
}
.section-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.trending-scroll {
  display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  touch-action: pan-x; overscroll-behavior-x: contain;
}
.trending-scroll::-webkit-scrollbar { height: 6px; }
.trending-scroll::-webkit-scrollbar-track { background: transparent; }
.trending-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }
.trending-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.trending-card {
  flex: 0 0 260px; scroll-snap-align: start;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: all var(--transition); cursor: pointer; text-decoration: none;
}
.trending-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.trending-gold { border-color: #b8860b33; background: linear-gradient(135deg, var(--bg-card) 0%, rgba(184,134,11,0.08) 100%); }
.trending-silver { border-color: #8899aa33; background: linear-gradient(135deg, var(--bg-card) 0%, rgba(136,153,170,0.08) 100%); }
.trending-bronze { border-color: #cd7f3233; background: linear-gradient(135deg, var(--bg-card) 0%, rgba(205,127,50,0.08) 100%); }
.trending-rank-badge {
  font-size: 1.1rem; font-weight: 800; min-width: 28px; text-align: center;
  color: var(--text-muted);
}
.trending-gold .trending-rank-badge, .trending-silver .trending-rank-badge, .trending-bronze .trending-rank-badge { font-size: 1.3rem; color: var(--text-primary); }
.trending-gun-img {
  width: 52px; height: 35px; border-radius: 6px; object-fit: cover;
  background: var(--bg-secondary); flex-shrink: 0;
}
.trending-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.trending-name { font-weight: 700; font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-type { font-size: 0.65rem; color: var(--text-muted); }
.trending-bar-wrap {
  height: 3px; background: var(--bg-input); border-radius: 100px;
  margin: 0.25rem 0; overflow: hidden;
}
.trending-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), #ff4500);
  border-radius: 100px; transition: width 0.6s ease;
}
.trending-stats {
  display: flex; gap: 0.75rem; font-size: 0.65rem; color: var(--text-muted);
}
.trending-stats span { white-space: nowrap; }

/* Trending skeleton loading */
.trending-skeleton {
  flex: 0 0 260px; height: 80px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}
.trending-empty { color: var(--text-muted); font-size: 0.85rem; padding: 1rem 0; }

@media (max-width: 480px) {
  .trending-card { flex: 0 0 240px; padding: 0.7rem 0.85rem; gap: 0.6rem; }
  .trending-skeleton { flex: 0 0 240px; }
  .trending-gun-img { width: 44px; height: 30px; }
  .trending-name { font-size: 0.8rem; }
  .trending-rank-badge { font-size: 1rem; }
  .trending-scroll { scrollbar-width: none; }
  .trending-scroll::-webkit-scrollbar { display: none; }
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes votePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* Publish status indicator */
#publishStatus { animation: fadeIn 0.3s ease; }
.publish-dots span {
  display: inline-block; animation: dotPulse 1.4s infinite; font-size: 1.2rem;
}
.publish-dots span:nth-child(2) { animation-delay: 0.2s; }
.publish-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Page entrance */
.main-content { animation: fadeIn 0.35s ease-out; }

/* Feed card stagger */
.build-card, .feed-card { animation: fadeInUp 0.4s ease-out backwards; }
.build-card:nth-child(1), .feed-card:nth-child(1) { animation-delay: 0.05s; }
.build-card:nth-child(2), .feed-card:nth-child(2) { animation-delay: 0.10s; }
.build-card:nth-child(3), .feed-card:nth-child(3) { animation-delay: 0.15s; }
.build-card:nth-child(4), .feed-card:nth-child(4) { animation-delay: 0.20s; }
.build-card:nth-child(5), .feed-card:nth-child(5) { animation-delay: 0.25s; }
.build-card:nth-child(6), .feed-card:nth-child(6) { animation-delay: 0.30s; }

/* Vote button pulse on click */
.vote-btn:active { animation: votePulse 0.3s ease; }
.vote-btn.upvote.voted { color: #ff4500 !important; }
.vote-btn.downvote.voted { color: #7193ff !important; }

/* Button press effect */
.btn:active { transform: scale(0.96); }
.btn, .vote-btn, .nav-link, .gun-card, .feed-card { transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease, box-shadow 0.2s ease; }

/* Gun card hover lift */
.gun-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* Navbar dropdown animation */
.dropdown-menu { animation: slideDown 0.2s ease; }

/* Modal animation */
.modal.active { animation: scaleIn 0.25s ease; }

/* === Delete Confirmation Modal === */
.confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.confirm-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.confirm-dialog {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  max-width: 380px; width: 90%; text-align: center;
  animation: scaleIn 0.25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.confirm-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.confirm-dialog h3 { font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.confirm-dialog p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: center; }
.btn-cancel {
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border); padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-cancel:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-delete {
  background: var(--red); color: #fff;
  border: none; padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-delete:hover { background: #ff5555; transform: scale(1.02); }

/* === Material Ripple (::after — reliably clipped by parent) === */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-cancel, .btn-delete,
.gun-card, .feed-card, .filter-chip, .tab, .rv-arrow, .copy-btn,
.nav-guns-btn, .user-trigger, .feed-action, .nav-icon,
.logo, .nav-link, .leader-row, .trending-card, .notif-row {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  contain: paint;
}
.ripple-target::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  left: var(--rx, 50%);
  top: var(--ry, 50%);
  width: var(--rs, 0px);
  height: var(--rs, 0px);
  transform: translate(-50%, -50%) scale(0);
  will-change: transform, opacity;
}
.ripple-target.rippling::after {
  animation: ripplePulse 0.45s ease-out forwards;
}
@keyframes ripplePulse {
  to { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

/* === Offline Overlay === */
.offline-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100000; background: var(--bg-primary, #0a0e17);
  align-items: center; justify-content: center;
}
.offline-overlay.visible { display: flex; }
.offline-card { text-align: center; padding: 2rem 1.5rem; max-width: 340px; width: 90%; }
.offline-card .offline-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.8; }
.offline-card h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.offline-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.75rem; line-height: 1.5; }
.offline-card .btn { margin-bottom: 0.75rem; }
.offline-status { font-size: 0.78rem; color: var(--text-muted); min-height: 1.2em; }

/* === SVG Icons === */
.feed-mode-tag svg,
.feed-card-tags svg,
.nav-link svg,
.mode-tag svg,
.trending-stats svg,
.vote-count svg,
.trending-header svg,
.feed-header svg,
.leader-score svg,
.mode-emoji svg,
.filter-chip svg {
  vertical-align: -2px;
  flex-shrink: 0;
}
.gun-emoji svg { display: block; }
.mode-tag svg { vertical-align: -3px; }
.leader-rank.gold svg { color: #f0c040; }
.leader-rank.silver svg { color: #8899aa; }
.leader-rank.bronze svg { color: #cd7f32; }
.trending-card.trending-gold .trending-rank-badge svg { color: #f0c040; }
.trending-card.trending-silver .trending-rank-badge svg { color: #8899aa; }
.trending-card.trending-bronze .trending-rank-badge svg { color: #cd7f32; }
.offline-icon svg { width: 56px; height: 56px; }
.login-icon svg { width: 40px; height: 40px; }

/* ── Admin Suspend/Delete Modal ─────────────────────────────── */
.admin-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.admin-modal {
  background: var(--card); border-radius: 16px; padding: 24px;
  max-width: 380px; width: 90%;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.admin-modal h3 {
  margin: 0 0 4px; font-size: 18px; color: var(--text);
}
.admin-modal-desc {
  color: var(--text-muted); font-size: 13px; margin: 0 0 16px;
}
.admin-opt {
  width: 100%; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; margin-bottom: 10px;
  border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text);
  cursor: pointer; text-align: left; font-size: 14px;
  transition: all 0.15s ease;
}
.admin-opt:hover { border-color: var(--accent); }
.admin-opt:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-opt-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.admin-opt-text strong { display: block; margin-bottom: 2px; }
.admin-opt-text small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.admin-opt.danger:hover { border-color: #e74c3c; background: rgba(231,76,60,0.08); }
.admin-opt.restrict:hover { border-color: #f0a040; background: rgba(240,160,64,0.08); }
.admin-opt.cancel {
  justify-content: center; border-color: transparent;
  color: var(--text-muted); font-weight: 600; font-size: 13px;
}
.admin-opt.cancel:hover { color: var(--text); background: var(--border); }

/* ── Ripple Effect (reusable) ────────────────────────────────── */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.6s, background-size 0.6s;
  pointer-events: none;
}
.ripple:active::after {
  background-size: 0% 0%;
  opacity: 1;
  transition: 0s;
}

/* ── Support Page ───────────────────────────────────────────── */
.support-page { max-width: 680px; margin: 0 auto; padding: 2rem 1rem; }

.support-hero { text-align: center; margin-bottom: 2rem; }
.support-hero-icon { margin-bottom: 0.75rem; color: #f0652f; }
.support-hero-icon svg { width: 40px; height: 40px; stroke: #f0652f; }
.support-hero h1 { font-size: 1.75rem; font-weight: 800; margin: 0 0 0.5rem; color: var(--text-primary); }
.support-hero-text { color: var(--text-muted); font-size: 0.9rem; max-width: 480px; margin: 0 auto; line-height: 1.6; }

.support-info-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem; margin-bottom: 1.5rem;
}
.support-info-box h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.75rem; color: var(--text-primary); }
.support-info-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.8rem; }
.support-info-row:last-child { margin-bottom: 0; }
.support-info-row svg { flex-shrink: 0; color: #f0652f; }

.support-stats {
  display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;
  margin-bottom: 1.5rem; padding: 1.25rem 1rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
}
.support-stat { text-align: center; min-width: 90px; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.support-section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 0 0 0.75rem; }

/* Tier cards — iOS-style horizontal list */
.support-tiers { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.support-tier {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 1rem; cursor: pointer;
  transition: all 0.2s; position: relative;
}
.support-tier:hover { border-color: #f0652f55; }
.support-tier.selected {
  border-color: #f0652f;
  background: rgba(240,101,47,0.04);
}
.support-tier .tier-icon-circle {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-input);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.support-tier .tier-icon-circle svg { color: var(--text-muted); }
.support-tier.selected .tier-icon-circle { background: rgba(240,101,47,0.12); }
.support-tier.selected .tier-icon-circle svg { color: #f0652f; }
.support-tier .tier-info { flex: 1; min-width: 0; }
.support-tier .tier-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.support-tier .tier-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.tier-popular {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  background: #22c55e22; color: #22c55e;
  padding: 1px 8px; border-radius: 20px; margin-left: 6px;
  vertical-align: middle;
}
.support-tier .tier-price {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.3rem 0.6rem; border-radius: 10px; flex-shrink: 0;
}
.tier-price-amt { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.support-tier.selected .tier-price-amt { color: #f0652f; }
.tier-price-per { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }
.support-tier.selected .tier-price-per { color: rgba(240,101,47,0.6); }
.tier-check {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(240,101,47,0.12); border: 1.5px solid #f0652f;
  display: none; align-items: center; justify-content: center;
}
.support-tier.selected .tier-check { display: flex; }
.tier-check svg { width: 12px; height: 12px; stroke: #f0652f; }

/* Active subscription tier */
.support-tier.current {
  border-color: #22c55e;
  background: rgba(34,197,94,0.04);
}
.support-tier.current .tier-check {
  display: flex;
  background: rgba(34,197,94,0.15);
  border-color: #22c55e;
}
.support-tier.current .tier-check svg { stroke: #22c55e; }
.support-tier.current .tier-price-amt { color: #22c55e; }
.support-tier.current .tier-icon-circle { background: rgba(34,197,94,0.12); }
.support-tier.current .tier-icon-circle svg { color: #22c55e; }
.support-tier.current .tier-name { color: #22c55e; }

.tier-current-check {
  display: inline-flex; align-items: center;
  margin-left: 6px; vertical-align: middle;
}
.tier-current-check svg { stroke: #22c55e; width: 14px; height: 14px; }

/* Greyed-out tiers (not current sub) */
.support-tier.greyed {
  opacity: 0.45;
}

/* Subscribe button */
.support-sub-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; background: #f0652f; color: #fff;
  border: none; border-radius: 14px; padding: 1rem;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all 0.2s; margin-bottom: 0.75rem;
}
.support-sub-btn:hover { background: #e05520; }
.support-sub-btn svg { stroke: #fff; }
.support-sub-btn:disabled { opacity: 0.7; cursor: wait; }
.support-sub-btn.subscribed { background: #22c55e; pointer-events: none; }

/* Spinner for loading states */
.spinner {
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Restore button */
.support-restore-btn {
  display: block; width: 100%;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.8rem; font-weight: 600; padding: 0.5rem; cursor: pointer;
  text-align: center; margin-bottom: 1.5rem;
}
.support-restore-btn:hover { color: var(--text-primary); }

.support-manage-btn {
  display: flex;
  align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 0.75rem; margin-top: 0.5rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.support-manage-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }

/* Support modal */
.support-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.support-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; max-width: 380px; width: 90%;
  text-align: center; animation: scaleIn 0.25s ease;
}
.support-modal-icon { margin-bottom: 1rem; }
.support-modal-icon svg { stroke: #f0652f; }
.support-modal h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--text-primary); }
.support-modal p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin: 0 0 1rem; }
.support-modal-sub { font-size: 0.8rem; padding: 0.75rem; background: var(--bg-input); border-radius: 8px; margin-bottom: 1.25rem; }

/* Store buttons in modal */
.support-modal-stores { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 0.5rem; }
.support-store-btn {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.1rem; border-radius: 10px;
  font-size: 0.8rem; font-weight: 700; text-decoration: none;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); transition: all 0.2s;
}
.support-store-btn:hover { border-color: var(--text-muted); }

/* Recent supporters */
.support-recent { margin-top: 1rem; }
.support-recent h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-primary); }
.support-recent-list { display: flex; flex-direction: column; gap: 0.5rem; }
.support-recent-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.85rem;
}
.recent-name { font-weight: 600; color: var(--text-primary); }
.recent-tier { color: #22c55e; font-size: 0.75rem; }

@media (max-width: 768px) {
  .support-tier { padding: 0.85rem; }
  .support-tier .tier-name { font-size: 0.9rem; }
  .support-stats { gap: 1rem; }
}

/* Maintenance banner (admin-only, visible when maintenance mode is ON) */
.maintenance-banner {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 9999;
}
.maintenance-banner span {
  opacity: 0.9;
  font-weight: 400;
  margin-left: 0.5rem;
}