@import url('https://fonts.googleapis.com/css2?family=Anton&family=Space+Grotesk:wght@400;500;700&family=Caveat:wght@600&family=Special+Elite&family=Permanent+Marker&display=swap');

:root {
  --ink: #171316;
  --paper: #ede6da;
  --paper-dim: #cfc6b6;
  --red: #b3261e;
  --red-bright: #e5482e;
  --gold: #c9a227;
  --line: rgba(237, 230, 218, 0.14);
  --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
}

a { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255,255,255,0.6) 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 0;
}

h1, h2, h3 {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
}

/* ---------- LOGIN / REGISTER PAGE ---------- */

.auth-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.brand h1 {
  font-size: 34px;
  color: var(--paper);
  line-height: 1;
}

.brand .dot {
  color: var(--red-bright);
}

.tagline {
  font-family: 'Caveat', cursive;
  color: var(--gold);
  font-size: 20px;
  margin-top: 2px;
  margin-bottom: 26px;
}

.tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}

.tab-btn {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: var(--paper-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.tab-btn.active {
  background: var(--red);
  color: var(--paper);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 12px;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
}

.field input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--red);
  color: var(--paper);
  margin-top: 6px;
}
.btn-primary:hover { filter: brightness(1.12); }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 16px;
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-oauth {
  background: #141013;
  color: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-oauth:hover { background: #201a1e; }

.btn-oauth svg { width: 18px; height: 18px; }

.msg {
  margin-top: 14px;
  font-size: 13px;
  min-height: 18px;
}
.msg.error { color: var(--red-bright); }
.msg.ok { color: #7fbf6a; }

.hidden { display: none !important; }

/* ---------- FEED PAGE ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(23,19,22,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.app-header .brand h1 { font-size: 22px; margin-bottom: 0; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tab-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e191c;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-weight: 700;
  font-size: 13px;
}
.tab-counter .num { color: var(--gold); font-family: 'Anton', sans-serif; font-size: 16px; }

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  color: var(--paper-dim);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--paper); border-color: var(--paper-dim); }

.container {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.composer {
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 30px;
}

.composer h2 {
  font-size: 16px;
  color: var(--paper-dim);
  margin-bottom: 12px;
}

.composer textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  font-family: 'Caveat', cursive;
  font-size: 22px;
  padding: 14px;
  line-height: 1.3;
}
.composer textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.composer-label {
  display: block;
  font-size: 11px;
  color: var(--paper-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 6px;
}

.char-counter {
  text-align: right;
  font-size: 11px;
  color: var(--paper-dim);
  margin-top: 4px;
}
.char-counter.limit-near { color: var(--gold); }
.char-counter.limit-reached { color: var(--red-bright); }

.post-description {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--paper-dim);
  line-height: 1.4;
}

.cost-note {
  font-size: 12px;
  color: var(--paper-dim);
}
.cost-note b { color: var(--gold); }

.feed-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper-dim);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.feed-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.post {
  position: relative;
  background: #1e191c;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.post .post-text {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  line-height: 1.25;
  color: var(--paper);
}

.post .post-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 0.5px;
}

.empty-state {
  text-align: center;
  color: var(--paper-dim);
  padding: 40px 10px;
  font-size: 14px;
}

/* ---------- MODAL ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
}

.modal {
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 360px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--paper-dim); margin: 0 0 16px; }

.qty-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.qty-btn {
  flex: 1;
  padding: 10px 0;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  cursor: pointer;
  font-weight: 700;
}
.qty-btn.selected {
  border-color: var(--gold);
  color: var(--gold);
}

.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn { flex: 1; }

.disclaimer {
  margin-top: 14px;
  font-size: 11px;
  color: var(--paper-dim);
  line-height: 1.4;
}

.buy-total {
  text-align: center;
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ================= HEADER (condiviso, generato da common.js) ================= */

.nav-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-decoration: none;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--paper); }
.nav-link.active { color: var(--paper); border-bottom-color: var(--red); }

.nav-row {
  display: flex;
  gap: 18px;
  margin-right: 6px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  font-family: 'Anton', sans-serif;
  color: var(--paper);
  font-size: 13px;
}

.avatar-lg {
  width: 92px;
  height: 92px;
  font-size: 34px;
  border-width: 2px;
}

.level-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.bell-wrap { position: relative; }

.btn-bell {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
  position: relative;
}
.btn-bell:hover { border-color: var(--paper-dim); }

.bell-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red-bright);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notif-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
  z-index: 30;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.4;
}
.notif-item:last-child { border-bottom: none; }
.notif-item b { color: var(--gold); }
.notif-item .notif-time { display: block; color: var(--paper-dim); font-size: 10.5px; margin-top: 2px; }
.notif-empty { padding: 20px; text-align: center; color: var(--paper-dim); font-size: 12px; }

/* ================= TABS FEED ================= */

.feed-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}
.feed-tab {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: 2px;
  color: var(--paper-dim);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.feed-tab.active { background: var(--red); color: var(--paper); }

/* ================= POST CARD ================= */

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-header .who { display: flex; flex-direction: column; }
.post-header .username {
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  color: var(--paper);
}
.post-header .level-tag {
  font-size: 10.5px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.act-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper-dim);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  cursor: pointer;
}
.act-btn:hover { color: var(--paper); border-color: var(--paper-dim); }
.act-btn.active-like { color: #7fbf6a; border-color: #7fbf6a; }
.act-btn.active-dislike { color: var(--red-bright); border-color: var(--red-bright); }
.act-btn.donate { color: var(--gold); border-color: var(--gold); margin-left: auto; }

.comments-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.comment-item {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.comment-item .bubble {
  background: #141013;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  flex: 1;
}
.comment-item .c-user { font-weight: 700; color: var(--gold); font-size: 11.5px; display: block; margin-bottom: 2px; }

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.comment-form input {
  flex: 1;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 9px 10px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}
.comment-form button {
  padding: 0 16px;
  background: var(--red);
  color: var(--paper);
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}

.streak-note {
  font-size: 11px;
  color: var(--gold);
  margin-top: 4px;
}

/* ================= XP BAR ================= */

.xp-bar-wrap { margin: 6px 0 2px; }
.xp-bar-track {
  height: 8px;
  border-radius: 5px;
  background: #141013;
  border: 1px solid var(--line);
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
}
.xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--paper-dim);
  margin-top: 4px;
}

/* ================= PROFILE PAGE ================= */

.profile-card {
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 26px;
}
.profile-top {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { font-size: 22px; margin-bottom: 4px; }
.profile-level {
  color: var(--gold);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.profile-bio {
  font-size: 13px;
  color: var(--paper-dim);
  margin: 8px 0;
}
.profile-stats {
  display: flex;
  gap: 22px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.profile-stats .stat { text-align: left; }
.profile-stats .stat .n { font-family: 'Anton', sans-serif; font-size: 18px; color: var(--paper); display: block; }
.profile-stats .stat .l { font-size: 10.5px; color: var(--paper-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.avatar-upload {
  position: relative;
  cursor: pointer;
}
.avatar-upload input { display: none; }
.avatar-upload .edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid #1e191c;
}

.bio-edit {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.bio-edit input {
  flex: 1;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 9px 10px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}

/* ================= LEADERBOARD ================= */

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
}
.lb-rank {
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  color: var(--paper-dim);
  width: 28px;
  text-align: center;
}
.lb-rank.top1 { color: var(--gold); }
.lb-rank.top2 { color: #cfc6b6; }
.lb-rank.top3 { color: #b3785e; }
.lb-info { flex: 1; min-width: 0; }
.lb-info .u { font-weight: 700; font-size: 14px; }
.lb-info .lv { font-size: 11px; color: var(--gold); text-transform: uppercase; }
.lb-xp { font-family: 'Anton', sans-serif; font-size: 15px; color: var(--paper); }

.lb-row .btn {
  display: inline-block;
  width: auto;
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 11px;
  white-space: nowrap;
}

/* ================= DONATE MODAL EXTRA ================= */

.donate-input {
  width: 100%;
  padding: 10px 12px;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  font-size: 16px;
  text-align: center;
  margin-bottom: 14px;
  font-family: 'Space Grotesk', sans-serif;
}

.follow-btn {
  padding: 8px 18px;
}
.follow-btn.following {
  background: transparent;
  border: 1px solid var(--paper-dim);
  color: var(--paper-dim);
}

/* ================= USERNAME EDITABILE ================= */

.username-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--paper-dim);
  cursor: pointer;
  font-size: 15px;
  padding: 2px 4px;
  line-height: 1;
}
.icon-btn:hover { color: var(--gold); }

.username-edit {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.username-edit input {
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 8px 10px;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
}

/* ================= LISTA FOLLOWER / SEGUITI ================= */

.stat-clickable {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}
.stat-clickable:hover .n { color: var(--gold); }

.user-list-body {
  max-height: 320px;
  overflow-y: auto;
  margin: 10px 0;
}
.user-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.user-list-item:last-child { border-bottom: none; }
.user-list-item .u { font-weight: 700; font-size: 13px; }
.user-list-item .lv { font-size: 11px; color: var(--gold); text-transform: uppercase; }

/* ================= TEMI COLORE ================= */
/* Il tema di default (rosso) è già definito in :root. Le altre varianti
   sovrascrivono solo i colori accento; sfondo/testo restano invariati. */

[data-theme="blue"] {
  --red: #2563eb;
  --red-bright: #3b82f6;
  --gold: #7fb2ff;
}
[data-theme="purple"] {
  --red: #7c3aed;
  --red-bright: #9d5bf0;
  --gold: #c9a8ff;
}
[data-theme="green"] {
  --red: #157a3d;
  --red-bright: #22a355;
  --gold: #8fe0ab;
}
[data-theme="gold"] {
  --red: #ad7c0a;
  --red-bright: #d99e12;
  --gold: #ffd75e;
}
[data-theme="mono"] {
  --red: #4b4b4b;
  --red-bright: #6e6e6e;
  --gold: #cfc6b6;
}

.theme-picker-wrap { margin-top: 16px; }
.theme-picker-label {
  font-size: 11px;
  color: var(--paper-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.theme-picker { display: flex; gap: 10px; }
.theme-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.theme-swatch.selected {
  border-color: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--paper-dim);
}

/* ================================================================
   RESPONSIVE — telefono, tablet, desktop
   Il layout base sopra è già "mobile-first" nei contenuti (colonna
   unica), qui sistemiamo header, navigazione, modali e card che sul
   desktop erano pensate per essere larghe.
   ================================================================ */

/* Evita lo scroll orizzontale indesiderato su schermi stretti */
html, body { overflow-x: hidden; }

/* ---------- BARRA DI NAVIGAZIONE MOBILE (fissa in basso) ---------- */
/* Nascosta su desktop/tablet: lì si usa il menu dentro l'header. */
.mobile-nav {
  display: none;
}

@media (max-width: 720px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: rgba(23, 19, 22, 0.97);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
  }
  .mobile-nav-link {
    flex: 1;
    text-align: center;
    padding: 12px 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--paper-dim);
    border-top: 2px solid transparent;
  }
  .mobile-nav-link.active {
    color: var(--paper);
    border-top-color: var(--red);
  }

  /* il menu testuale in cima si sposta in basso su mobile */
  .app-header .nav-row {
    display: none;
  }

  /* spazio per non far restare i contenuti sotto la barra fissa */
  .container {
    padding-bottom: 90px;
  }
}

/* ---------- HEADER: da riga unica a più righe se serve ---------- */
@media (max-width: 900px) {
  .app-header {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 12px 16px;
  }
  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .app-header .brand h1 { font-size: 18px; }
  .header-right { justify-content: center; gap: 8px; }
  .level-pill { font-size: 10px; padding: 5px 8px; }
  .tab-counter { padding: 6px 10px; font-size: 12px; }
  .btn-sm { padding: 7px 10px; font-size: 11px; }
  .btn-bell { width: 30px; height: 30px; font-size: 13px; }
}

/* ---------- CONTENUTO PRINCIPALE ---------- */
@media (max-width: 700px) {
  .container { padding: 18px 14px 90px; }
  .composer { padding: 14px; }
  .composer textarea { font-size: 19px; min-height: 80px; }
  .post { padding: 14px; }
  .post .post-text { font-size: 21px; }

  .post-actions {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .act-btn.donate { margin-left: 0; }

  .feed-tabs { width: 100%; }
  .feed-tab { flex: 1; text-align: center; }

  .comment-form input { font-size: 16px; } /* evita lo zoom automatico di iOS sugli input */
}

/* ---------- LOGIN / REGISTRAZIONE ---------- */
@media (max-width: 480px) {
  .auth-card { padding: 26px 20px; }
  .brand h1 { font-size: 28px; }
}

/* ---------- MODALI (acquisto punti, donazioni, lista utenti) ---------- */
@media (max-width: 480px) {
  .modal { padding: 20px; max-width: 92vw; max-height: 80vh; }
  .qty-row { flex-wrap: wrap; }
  .qty-btn { min-width: 60px; }
}

/* ---------- PROFILO ---------- */
@media (max-width: 600px) {
  .profile-card { padding: 18px; }
  .profile-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-info { width: 100%; }
  .username-row { justify-content: center; }
  .xp-labels { flex-direction: column; gap: 2px; text-align: center; }
  .profile-stats { justify-content: center; }
  .bio-edit, .username-edit { flex-direction: column; }
  .bio-edit input, .username-edit input { width: 100%; }
  .bio-edit button, .username-edit button { width: 100%; }
  .theme-picker { justify-content: center; }
}

/* ---------- CLASSIFICA ---------- */
@media (max-width: 520px) {
  .lb-row { flex-wrap: wrap; row-gap: 8px; }
  .lb-info { min-width: 100%; order: 3; }
  .lb-row .btn { order: 4; margin-left: auto; }
}

/* ---------- INPUT: dimensione minima 16px per evitare lo zoom automatico su iOS ---------- */
@media (max-width: 700px) {
  input, textarea, select { font-size: 16px; }
  .composer textarea { font-size: 19px; }
}

/* ================= BLOCCO VPN ================= */
#vpnBlockOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 8, 9, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.vpn-block-card {
  max-width: 440px;
  background: #1e191c;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
}
.vpn-block-card h1 {
  font-size: 24px;
  color: var(--red-bright);
  margin-bottom: 14px;
}
.vpn-block-card p {
  font-size: 14px;
  color: var(--paper-dim);
  line-height: 1.5;
  margin: 0 0 12px;
}
.vpn-block-card .btn {
  margin-top: 10px;
  width: auto;
  display: inline-block;
  padding: 10px 24px;
}

/* ================= PAGINA DI BENVENUTO ================= */
.welcome-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.welcome-card {
  width: 100%;
  max-width: 640px;
  background: #1e191c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  text-align: center;
}

.welcome-intro {
  color: var(--paper-dim);
  font-size: 14px;
  margin: 6px 0 26px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
  margin-bottom: 30px;
}

.welcome-item {
  background: #141013;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.welcome-item h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.welcome-item p {
  font-size: 13px;
  color: var(--paper-dim);
  line-height: 1.5;
  margin: 0;
}
.welcome-item b { color: var(--paper); }

.welcome-card .btn {
  width: auto;
  display: inline-block;
  padding: 13px 30px;
}

@media (max-width: 560px) {
  .welcome-card { padding: 28px 20px; }
  .welcome-grid { grid-template-columns: 1fr; }
}

/* ================= ANIMAZIONI DI INGRESSO ================= */
@keyframes pnFadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pnFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pnSlideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-header { animation: pnSlideDown 0.45s ease both; }
.auth-card, .welcome-card { animation: pnFadeInUp 0.5s ease both; }
.composer { animation: pnFadeInUp 0.5s ease .05s both; }
.feed-tabs { animation: pnFadeInUp 0.5s ease .1s both; }
.profile-card { animation: pnFadeInUp 0.5s ease both; }
.post, .lb-row, .comment-item, .user-list-item { animation: pnFadeInUp 0.4s ease both; }
.welcome-item { animation: pnFadeInUp 0.45s ease both; }
.welcome-item:nth-child(2) { animation-delay: .05s; }
.welcome-item:nth-child(3) { animation-delay: .1s; }
.welcome-item:nth-child(4) { animation-delay: .15s; }
.welcome-item:nth-child(5) { animation-delay: .2s; }
.welcome-item:nth-child(6) { animation-delay: .25s; }
.mobile-nav { animation: pnFadeIn 0.5s ease both; }

@media (prefers-reduced-motion: reduce) {
  .app-header, .auth-card, .welcome-card, .composer, .feed-tabs,
  .profile-card, .post, .lb-row, .comment-item, .user-list-item,
  .welcome-item, .mobile-nav {
    animation: none !important;
  }
}

/* ================= ACQUISTO PUNTI: SCAGLIONI CON BONUS ================= */
.tier-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.tier-card {
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 6px 8px;
  cursor: pointer;
  text-align: center;
  color: var(--paper);
}
.tier-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.tier-total {
  font-family: 'Anton', sans-serif;
  font-size: 17px;
  line-height: 1.1;
}
.tier-bonus {
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}
.tier-pay {
  font-size: 11px;
  color: var(--paper-dim);
  margin-top: 6px;
}

@media (max-width: 420px) {
  .tier-row { grid-template-columns: repeat(2, 1fr); }
}

/* ================= SCHERMATA CONFERMA PAGAMENTO ================= */
.buy-processing {
  text-align: center;
  padding: 24px 6px 6px;
}
.buy-processing-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border: 4px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #7fbf6a;
  animation: pnSpin 0.8s linear infinite;
}
.buy-processing-icon.success {
  border-color: #7fbf6a;
  animation: none;
}
.buy-processing-title {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  color: var(--paper);
  margin-bottom: 8px;
}
.buy-processing-sub {
  font-size: 13px;
  color: var(--paper-dim);
  line-height: 1.4;
}
@keyframes pnSpin {
  to { transform: rotate(360deg); }
}

/* ================= SELETTORE FONT / COLORE BESTEMMIA ================= */
.style-picker-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.style-picker-group { flex: 1; min-width: 220px; }
.style-picker-label {
  display: block;
  font-size: 11px;
  color: var(--paper-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.font-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.font-swatch {
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.font-swatch.selected { border-color: var(--gold); color: var(--gold); }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-swatch.selected {
  border-color: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--paper-dim);
}

/* ================= SEZIONE COMMENTI (completa) ================= */
.comment-item {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.comment-body { flex: 1; min-width: 0; }
.comment-item .bubble {
  background: #141013;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  word-break: break-word;
}
.comment-item .c-user { font-weight: 700; color: var(--gold); font-size: 11.5px; display: block; margin-bottom: 2px; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.comment-date {
  font-size: 10.5px;
  color: var(--paper-dim);
  cursor: default;
}
.c-act-btn {
  background: transparent;
  border: none;
  color: var(--paper-dim);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 2px;
}
.c-act-btn:hover { color: var(--paper); }
.c-act-btn.active-like { color: #7fbf6a; }
.c-act-btn.active-dislike { color: var(--red-bright); }
.c-act-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.reply-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.reply-form input {
  flex: 1;
  background: #141013;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 7px 9px;
  font-size: 12.5px;
  font-family: 'Space Grotesk', sans-serif;
}
.reply-form button {
  padding: 0 12px;
  background: var(--red);
  color: var(--paper);
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.comment-replies {
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.comment-reply { margin-bottom: 10px; }
.comment-reply .bubble { background: #1a1519; }