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

:root {
  --bg: #faf7f2;
  --bg2: #f3ede3;
  --bg3: #ebe2d3;
  --surface: #ffffff;
  --border: #ddd4c3;
  --border2: #c9bba8;
  --text: #2a2017;
  --text2: #6b5c45;
  --text3: #9e8c74;
  --accent: #d4450c;
  --accent2: #f07030;
  --accent-bg: #fef0e8;
  --green: #2d7a4f;
  --green-bg: #e8f5ee;
  --red: #c0392b;
  --red-bg: #fde8e6;
  --gold: #c87c00;
  --gold-bg: #fef3d0;
  --shadow: 0 2px 8px rgba(42,32,23,0.10);
  --shadow-md: 0 4px 16px rgba(42,32,23,0.13);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* ── APP SHELL ── */
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── TOPBAR ── */
.topbar {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.topbar-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}
.topbar-logo span { font-size: 1.2rem; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  max-width: 200px;
  overflow: hidden;
}
.topbar-user:hover { background: var(--bg3); }
.topbar-username {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-password {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── PAGE CONTENT ── */
.page { display: none; padding: 16px; max-width: 700px; margin: 0 auto; width: 100%; }
.page.active { display: block; }

/* ── CARDS & WIDGETS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: #bf3d0a; }

.btn-secondary { background: var(--bg2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg3); }

.btn-ghost { background: transparent; color: var(--text2); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg2); }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover:not(:disabled) { background: #a93226; }

.btn-success { background: var(--green); color: white; }
.btn-success:hover:not(:disabled) { background: #246040; }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 7px; border-radius: 50%; width: 34px; height: 34px; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent2);
  background: white;
}
textarea { min-height: 80px; resize: vertical; }
.input-hint { font-size: 0.78rem; color: var(--text3); margin-top: 4px; }

/* ── AUTH PAGE ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle { text-align: center; color: var(--text2); font-size: 0.9rem; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.auth-tab {
  flex: 1; padding: 8px; text-align: center; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: var(--text2);
  background: var(--bg2); border: none; font-family: var(--font-body);
  transition: all 0.15s;
}
.auth-tab.active { background: var(--accent); color: white; }

/* ── EVENT CARD ── */
.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  gap: 12px;
}
.event-item:hover { border-color: var(--accent2); background: var(--accent-bg); }
.event-item.past { opacity: 0.55; background: var(--bg2); }
.event-item.past:hover { opacity: 0.75; }

.event-info { flex: 1; min-width: 0; }
.event-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

.event-date-box {
  text-align: right;
  flex-shrink: 0;
}
.event-date-day { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.event-date-month { font-size: 0.7rem; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }

/* ── COLLAPSIBLE WIDGET ── */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.collapsible-header .chevron { transition: transform 0.2s; font-size: 0.9rem; color: var(--text3); }
.collapsible-header.open .chevron { transform: rotate(180deg); }
.collapsible-body { overflow: hidden; }
.collapsible-body.hidden { display: none; }

/* ── VOTING EMOJIS ── */
.vote-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  cursor: pointer;
  font-size: 1.3rem;
  transition: all 0.15s;
  flex: 1;
  min-width: 48px;
}
.vote-btn:hover { border-color: var(--accent2); background: var(--accent-bg); }
.vote-btn.selected { border-color: var(--green); background: var(--green-bg); box-shadow: 0 0 0 2px var(--green); }
.vote-btn .vote-label { font-size: 0.6rem; font-weight: 600; color: var(--text2); text-align: center; line-height: 1.2; }

/* ── SCORE BAR ── */
.score-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.score-track { flex: 1; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; background: var(--accent2); border-radius: 3px; transition: width 0.4s; }
.score-label { font-size: 0.78rem; font-weight: 600; color: var(--text2); min-width: 28px; text-align: right; }

/* ── PROPOSAL CARD ── */
.proposal-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.proposal-card.ghost-proposer { border-color: var(--red); background: var(--red-bg); }
.proposal-ghost-warning { font-size: 0.78rem; color: var(--red); font-weight: 600; margin-bottom: 6px; }

.proposal-name { font-weight: 600; font-size: 0.95rem; }
.proposal-detail { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }
.proposal-proposer { font-size: 0.75rem; color: var(--text3); }

/* ── RANKING ── */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
}
.rank-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text3);
  min-width: 24px;
  text-align: center;
}
.rank-num.first { color: var(--gold); }
.rank-num.second { color: var(--text2); }
.rank-num.third { color: #8b6914; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text2); background: var(--bg2); position: sticky; top: 0; }
tr:hover td { background: var(--bg2); }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-accent { background: var(--accent-bg); color: var(--accent); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gold { background: var(--gold-bg); color: var(--gold); }
.badge-gray { background: var(--bg3); color: var(--text2); }

/* ── ADDRESS SEARCH ── */
.address-results {
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.address-result-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.address-result-item:hover { background: var(--bg2); }
.address-result-item:last-child { border-bottom: none; }

/* ── MODAL ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42,32,23,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* ── ALERTS / TOAST ── */
.toast-wrap { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 300; width: calc(100% - 32px); max-width: 360px; pointer-events: none; }
.toast {
  background: var(--text);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.25s ease;
  pointer-events: all;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── MISC ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text3); font-size: 0.85rem; }
.text-small { font-size: 0.82rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-center { display: flex; align-items: center; justify-content: center; gap: 8px; }
.gap-8 { gap: 8px; }
.gap-4 { gap: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--text3); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  margin-top: 20px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.section-title:first-child { margin-top: 0; }

.event-code-badge {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--bg3);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
}

.locked-banner {
  background: var(--gold-bg);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 12px;
}

.danger-zone {
  border-top: 2px solid var(--border);
  padding-top: 20px;
  margin-top: 24px;
  text-align: center;
}

/* ── ADMIN PANEL ── */
.admin-tabs { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.admin-tab {
  flex: 1; padding: 10px; text-align: center; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; color: var(--text2);
  background: var(--bg2); border: none; font-family: var(--font-body);
  transition: all 0.15s;
}
.admin-tab.active { background: var(--accent); color: white; }

/* ── RESPONSIVE ── */
@media (min-width: 600px) {
  .topbar { padding: 0 24px; }
  .page { padding: 24px; }
  h1 { font-size: 2rem; }
  .vote-btn { min-width: 60px; }
}

@media (max-width: 400px) {
  .topbar-password { display: none; }
  .event-date-day { font-size: 1.3rem; }
}

/* spinner */
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EVENT HEADER COLLASSABILE ── */
.evt-header-collapsed {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}
.evt-header-collapsed:hover { opacity: 0.85; }

.evt-title-main {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evt-date-box {
  flex-shrink: 0;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  min-width: 52px;
  box-shadow: var(--shadow);
}
.evt-date-day   { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.evt-date-month { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; }
.evt-date-year  { font-size: 0.6rem; opacity: 0.8; margin-top: 1px; }

.evt-info-grid {
  display: grid;
  gap: 8px;
}
.evt-info-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.evt-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.evt-info-val {
  font-size: 0.9rem;
  color: var(--text);
}

.evt-edit-form {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 12px;
}

/* ── GAME PICKER CON FILTRI ── */
.game-picker-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 8px;
  overflow: hidden;
}
.game-picker-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.game-picker-filters input,
.game-picker-filters select {
  padding: 7px 10px;
  font-size: 0.82rem;
  min-width: 0;
}

/* ── VOTI SOLO EMOJI ── */
.vote-btn {
  font-size: 1.5rem;
  padding: 8px;
  min-width: 44px;
  flex: 1;
}
.vote-emoji {
  display: block;
  line-height: 1;
  pointer-events: none;
}

@media (min-width: 480px) {
  .evt-title-main { font-size: 1.4rem; }
  .evt-date-day   { font-size: 1.8rem; }
  .evt-date-box   { min-width: 60px; padding: 8px 12px; }
  .evt-info-grid  { grid-template-columns: 1fr 1fr; }
}


/* ── SEARCH EVENTS ── */
.opacity-60 { opacity: 0.6; }

/* ── GAME PICKER TABS ── */
.game-picker-tab {
  flex: 1;
  padding: 10px;
  background: var(--bg2);
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.game-picker-tab:hover { background: var(--bg3); }
.game-picker-tab.active { background: var(--surface); color: var(--accent); border-bottom: 2px solid var(--accent); }

/* ── VOTAZIONI ── */
.proposal-vote-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.proposal-vote-card.ghost-proposer { border-color: var(--red); background: var(--red-bg); }

.vote-missing-banner {
  background: var(--gold-bg);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 12px;
}
.vote-complete-banner {
  background: var(--green-bg);
  border: 1.5px solid var(--green);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.deadline-banner {
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 8px;
}

/* ── CLASSIFICA ── */
.ranking-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}
.ranking-tab {
  flex: 1;
  padding: 9px;
  background: var(--bg2);
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.ranking-tab.active { background: var(--accent); color: white; }

.ranking-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--surface);
}
.ranking-card.ranking-top {
  border-color: var(--accent2);
  background: var(--accent-bg);
}
.ranking-position {
  font-family: var(--font-display);
  font-size: 1.4rem;
  min-width: 36px;
  text-align: center;
}
.ranking-game-name {
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-display);
}

.ranking-user-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.ranking-user-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.ranking-user-pick { font-size: 0.95rem; margin-top: 4px; }

/* ── DETTAGLI GIOCO IN CLASSIFICA ── */
.btn-detail-toggle {
  font-size: 0.7rem;
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  font-family: var(--font-body);
}
.btn-detail-toggle:hover { color: var(--accent); }

.game-detail-box {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.85rem;
}
.game-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.game-detail-row:last-child { border-bottom: none; }
.game-detail-row span:first-child { color: var(--text3); font-size: 0.8rem; }

.vote-detail-item {
  display: inline-block;
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 6px;
  margin: 2px;
  font-size: 0.8rem;
}

.rank-position-sm {
  font-weight: 700;
  color: var(--text3);
  font-size: 0.85rem;
  min-width: 16px;
  display: inline-block;
}

/* ── STATO VOTAZIONE NELLA CARD EVENTO ── */
.event-item {
  flex-wrap: wrap;      /* permette alla barra di andare a capo */
  position: relative;
  overflow: hidden;
}

.evt-vote-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  text-align: right;
}

.evt-vote-status {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.evt-vote-status.open { color: var(--accent2); }
.evt-vote-status.done { color: var(--green); }

.evt-countdown {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 1px 5px;
  border-radius: 4px;
  text-align: right;
}

/* Barra colorata in fondo */
.evt-status-bar {
  width: 100%;
  height: 3px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  flex-basis: 100%;  /* va a capo nella flex row */
  margin-top: 4px;
}
.evt-status-bar.open { background: var(--accent2); }
.evt-status-bar.done { background: var(--green); }

@media (max-width: 380px) {
  .evt-vote-status { font-size: 0.7rem; }
  .evt-countdown   { font-size: 0.65rem; }
}

/* Stato "in attesa di proposte" */
.evt-vote-status.waiting { color: var(--text3); }
.evt-status-bar.waiting  { background: var(--border2); }


/* ── PROPOSTA DELL'UTENTE ── */
.proposal-vote-card.my-proposal {
  border-color: var(--green);
  background: var(--green-bg);
}
.my-proposal-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

/* ── SISTEMA VETO ── */
.veto-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.vote-btn.veto-btn {
  border-color: var(--red);
  color: var(--red);
}
.vote-btn.veto-btn.selected {
  background: var(--red-bg);
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red);
}
.vote-btn.veto-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border);
}

/* ── GAME PICKER FILTRI ── */
.gpf-bar {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.gpf-bar input {
  flex: 1;
  min-width: 0;
}
.gpf-filter-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.gpf-filter-btn:hover, .gpf-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.gpf-panel-inner {
  padding: 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gpf-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gpf-row-col { align-items: flex-start; }
.gpf-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  width: 80px;
  flex-shrink: 0;
}
.gpf-select {
  flex: 1;
  font-size: 0.82rem;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text1);
  font-family: var(--font-body);
}

/* ── APPROVAL VOTING ── */
.points-budget-bar {
  background: var(--bg2);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.points-bar-track {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
}
.points-bar-fill {
  background: var(--accent);
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s;
}

.vote-point-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.point-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.point-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.point-btn:hover:not(:disabled) { background: var(--accent); color: white; border-color: var(--accent); }
.point-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.point-display {
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 28px;
  text-align: center;
}
.point-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.point-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.point-fill {
  height: 100%;
  background: var(--accent2);
  border-radius: 99px;
  transition: width 0.3s;
}

/* ── BORDA DRAG & DROP ── */
.borda-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.borda-instructions {
  background: var(--accent-bg);
  border: 1px solid var(--accent2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 10px;
}
.borda-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.borda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.borda-item:active { cursor: grabbing; }
.borda-item.dragging {
  opacity: 0.5;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.borda-item.drag-over {
  border-color: var(--accent2);
  background: var(--accent-bg);
  box-shadow: 0 0 0 2px var(--accent2);
}
.borda-handle {
  font-size: 1.2rem;
  color: var(--text3);
  cursor: grab;
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: -2px;
}
.borda-rank {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text3);
  min-width: 28px;
  flex-shrink: 0;
}
.borda-item:nth-child(1) .borda-rank { color: #c9a227; }
.borda-item:nth-child(2) .borda-rank { color: #9e9e9e; }
.borda-item:nth-child(3) .borda-rank { color: #cd7f32; }
.borda-info {
  flex: 1;
  min-width: 0;
}
.borda-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.borda-meta {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 2px;
}
.borda-proposer {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 1px;
}
.borda-points {
  font-family: monospace;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
}
.borda-delete {
  opacity: 0;
  transition: opacity 0.15s;
}
.borda-item:hover .borda-delete { opacity: 1; }

/* ── FRECCE MOBILE BORDA ── */
.borda-arrows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.borda-arrow {
  width: 32px;
  height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  transition: all 0.1s;
}
.borda-arrow:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.borda-arrow:disabled { opacity: 0.25; cursor: not-allowed; }

/* ── NOTIF BUTTON ── */
.btn-notif {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}
.btn-notif:hover { background: var(--bg3); border-color: var(--border2); }
.btn-notif.active {
  background: var(--accent-bg);
  border-color: var(--accent);
}

/* ── SKELETON LOADER ── */
.skeleton-wrap { padding: 16px; }
.skeleton { background: var(--bg3); border-radius: var(--radius-sm); animation: shimmer 1.4s infinite; }
.skeleton-title { height: 28px; width: 70%; margin-bottom: 12px; }
.skeleton-line  { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-line.short { width: 50%; }
@keyframes shimmer { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── PHASE BANNER ── */
.phase-banner {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
  border-radius: 0;
}
.phase-proposals { background: var(--bg2); border-left-color: var(--text3); color: var(--text2); }
.phase-voting    { background: var(--green-bg); border-left-color: var(--green); color: var(--green); }
.phase-locked    { background: var(--gold-bg);  border-left-color: var(--gold);  color: var(--gold); }

/* ── UNSAVED BAR ── */
.borda-unsaved-bar {
  background: var(--gold-bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
}

/* ── SAVE STICKY ── */
.borda-save-sticky {
  position: sticky;
  bottom: 12px;
  margin-top: 12px;
  z-index: 10;
}
.borda-save-sticky .btn-primary {
  box-shadow: 0 4px 12px rgba(212,69,12,0.3);
}

/* ── VOTE BREAKDOWN ── */
.game-detail-votes {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}
.game-detail-votes-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.vote-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.8rem;
}
.vote-row-me { font-weight: 600; }
.vote-row-absent { opacity: 0.5; }
.vote-username { min-width: 80px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.vote-bar-wrap { flex: 1; height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.vote-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.vote-pts { min-width: 80px; text-align: right; color: var(--text2); white-space: nowrap; }
.vote-pts strong { color: var(--accent); }

/* ── QUOTA BAR ── */
.quota-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.quota-label { color: var(--text2); }
.quota-track { flex: 1; min-width: 48px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.quota-fill  { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.3s; }
.quota-count { font-weight: 600; color: var(--accent); }

/* ── CESTINO PROMINENTE (proposte e borda) ── */
.btn-trash-proposal {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--red-border, #f7c1c1);
  background: var(--red-bg, #fcebeb);
  color: var(--red, #a32d2d);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-trash-proposal:hover { background: var(--red-bg-hover, #f7c1c1); }

.btn-trash-borda {
  width: 34px; height: 34px;
  border-radius: 7px;
  border: 1px solid var(--red-border, #f7c1c1);
  background: var(--red-bg, #fcebeb);
  color: var(--red, #a32d2d);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-trash-borda:hover { background: var(--red-bg-hover, #f7c1c1); }

/* ── BORDA VIEW TOGGLE ── */
.borda-view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.borda-vtab {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.borda-vtab.active {
  background: var(--bg);
  border-color: var(--border2);
  color: var(--text);
  font-weight: 500;
}
.borda-item.borda-compact { padding: 6px 8px; }

/* ── BATCH MODAL ── */
.batch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.batch-row-num {
  font-size: 0.78rem;
  color: var(--text3);
  min-width: 16px;
  text-align: right;
}
.batch-input {
  flex: 1;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
}
.batch-input:focus { outline: none; border-color: var(--accent); }
.btn-batch-remove {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-batch-remove:hover { background: var(--red-bg, #fcebeb); color: var(--red, #a32d2d); border-color: var(--red-border, #f7c1c1); }

/* ── UNIFIED PICKER (upk) ── */
.upk-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.upk-loading { padding: 16px; text-align: center; color: var(--text3); font-size: 0.85rem; }
.upk-header  { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.upk-title   { font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }

.upk-search-row  { display: flex; gap: 6px; align-items: center; }
/* Previene RTL su tutti gli input di testo — fix globale */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;
}

.upk-search-wrap { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; direction: ltr; }
.upk-search-icon { font-size: 0.9rem; color: var(--text3); flex-shrink: 0; }
.upk-search-input { flex: 1; border: none; background: transparent; font-size: 0.88rem; color: var(--text); outline: none; direction: ltr; text-align: left; min-width: 0; }
.upk-search-input::placeholder { color: var(--text3); }
.upk-clear { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 1rem; padding: 0 2px; line-height: 1; }
.upk-filter-btn { font-size: 0.82rem; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg2); color: var(--text2); cursor: pointer; white-space: nowrap; }
.upk-filter-btn.active { border-color: var(--accent); color: var(--accent); }

.upk-filter-panel { padding: 8px 12px; background: var(--bg2); border-top: 1px solid var(--border); }
.upk-filter-row   { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.8rem; }
.upk-filter-row label { min-width: 72px; color: var(--text2); }
.upk-select  { flex: 1; font-size: 0.8rem; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.upk-reset-btn { font-size: 0.78rem; color: var(--text3); background: none; border: none; cursor: pointer; padding: 0; margin-top: 2px; }

.upk-sel-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--green-bg); border-bottom: 1px solid var(--green-border, #9FE1CB); font-size: 0.82rem; font-weight: 600; color: var(--green); }
.upk-propose-btn { font-size: 0.78rem; padding: 5px 12px; border-radius: var(--radius-sm); background: var(--accent); color: white; border: none; cursor: pointer; }

.upk-list  { max-height: 280px; overflow-y: auto; }
.upk-empty { padding: 16px; text-align: center; color: var(--text3); font-size: 0.82rem; }

.upk-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; user-select: none; }
.upk-item:last-child { border-bottom: none; }
.upk-item:hover { background: var(--bg2); }
.upk-item-checked { background: var(--green-bg) !important; }

.upk-cb { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--border2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: white; transition: all 0.1s; }
.upk-cb-on { background: var(--green); border-color: var(--green); }
@media (max-width: 639px) { .upk-cb { width: 24px; height: 24px; border-radius: 6px; } }

.upk-item-body { flex: 1; min-width: 0; }
.upk-item-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.upk-item-meta { font-size: 0.75rem; color: var(--text3); margin-top: 1px; }
.upk-owner { display: inline-block; font-size: 0.68rem; padding: 1px 5px; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; color: var(--text2); margin-right: 2px; }

.upk-add-custom { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; font-size: 0.82rem; font-weight: 500; color: var(--accent); background: var(--bg); transition: background 0.1s; }
.upk-add-custom:hover { background: var(--accent-bg); }
.upk-add-icon { font-size: 1.1rem; flex-shrink: 0; }

.upk-custom-form { padding: 12px; border-top: 1px solid var(--border); background: var(--bg2); }
.upk-custom-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.upk-cfield { flex: 1; }
.upk-cfield label { display: block; font-size: 0.75rem; color: var(--text2); margin-bottom: 3px; }
.upk-cfield-row { display: flex; gap: 8px; margin-bottom: 6px; }
.upk-cinput { width: 100%; font-size: 0.82rem; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.upk-cinput:focus { outline: none; border-color: var(--accent); }
.upk-cactions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
@media (max-width: 639px) { .upk-cfield-row { flex-wrap: wrap; } .upk-cfield { min-width: 80px; } }

/* ── DATE PAIR: affiancate su desktop, colonna su mobile ── */
.date-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .date-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ── SOCIAL ── */
.btn-topbar-icon {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg2);
  font-size: 1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.15s; flex-shrink: 0; padding: 0;
}
.btn-topbar-icon:hover { background: var(--bg3); }

.social-search-wrap { margin-bottom: 10px; }
.social-search-results { background: var(--bg2); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.social-friend-list { display: flex; flex-direction: column; gap: 4px; }
.social-user-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.social-user-row:hover { background: var(--bg2); }
.social-user-info { flex: 1; min-width: 0; }
.social-user-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.social-user-sub  { font-size: 0.75rem; color: var(--text3); }
.social-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.social-avatar-sm { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 0.65rem; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1.5px solid var(--bg); margin-left: -5px; }
.social-avatar-row { display: flex; align-items: center; margin-right: 6px; }
.social-group-card { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.social-group-icon { width: 36px; height: 36px; border-radius: 9px; background: #EEEDFE; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.social-group-name { font-size: 0.88rem; font-weight: 600; }
.social-group-meta { font-size: 0.75rem; color: var(--text3); }
.result-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.result-item:hover { background: var(--bg2); }

/* ── EMOJI PICKER ── */
.emoji-preview-btn {
  width: 52px; height: 52px; border-radius: 12px;
  background: #EEEDFE; border: 2px solid transparent;
  font-size: 28px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color 0.15s;
  line-height: 1;
}
.emoji-preview-btn:hover { border-color: #7F77DD; }

.emoji-picker-panel {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 10px;
}
.emoji-picker-inner { display: flex; flex-direction: column; }
.emoji-picker-top {
  background: var(--bg2);
  border-bottom: 0.5px solid var(--border);
}
.emoji-picker-search-wrap {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  border-bottom: 0.5px solid var(--border);
}
.emoji-cats {
  display: flex; overflow-x: auto; padding: 2px 4px;
}
.emoji-cat-btn {
  padding: 5px 8px; font-size: 18px; cursor: pointer;
  border: none; background: transparent;
  border-bottom: 2px solid transparent;
  opacity: 0.55; transition: opacity 0.1s;
  flex-shrink: 0;
}
.emoji-cat-btn:hover { opacity: 1; }
.emoji-cat-btn.on { border-bottom-color: #D85A30; opacity: 1; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px; padding: 6px;
  max-height: 150px; overflow-y: auto;
}
.emoji-cell {
  width: 34px; height: 34px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; border: none;
  background: transparent; transition: background 0.1s;
}
.emoji-cell:hover { background: var(--bg2); }
.emoji-cell-sel { background: #EEEDFE; outline: 2px solid #7F77DD; }
@media (max-width: 639px) {
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ── WIZARD CREA EVENTO ── */
.wz-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wz-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.wz-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.wz-main-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.wz-steps-bar {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.wz-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}
.wz-connector {
  height: 2px;
  background: var(--border);
  flex: 1;
  margin-top: 13px;
  align-self: flex-start;
}
.wz-connector-done { background: var(--accent); }
.wz-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  border: 2px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  flex-shrink: 0;
  z-index: 1;
}
.wz-dot-active { background: var(--accent); border-color: var(--accent); color: white; }
.wz-dot-done   { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.wz-step-label {
  font-size: 10px;
  color: var(--text3);
  text-align: center;
  white-space: nowrap;
}
.wz-step-active .wz-step-label { color: var(--accent); font-weight: 500; }
.wz-step-done .wz-step-label   { color: var(--green); }

.wz-body { padding: 20px; }
.wz-step-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.wz-step-sub {
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 16px;
}

.wz-vis-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.wz-vis-opt {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.wz-vis-opt:hover { background: var(--bg2); }
.wz-vis-sel { border-color: var(--accent); background: var(--accent-bg); }
.wz-vis-icon { font-size: 1.4rem; margin-bottom: 4px; }
.wz-vis-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.wz-vis-desc { font-size: 0.75rem; color: var(--text3); }

.wz-sum-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.wz-sum-row:last-child { border-bottom: none; }
.wz-sum-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.wz-sum-label { font-size: 0.75rem; color: var(--text3); }
.wz-sum-val   { font-size: 0.88rem; font-weight: 600; color: var(--text); }

.wz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
.wz-counter { font-size: 0.78rem; color: var(--text3); }

@media (max-width: 639px) {
  .wz-header { padding: 12px 14px 10px; }
  .wz-body   { padding: 14px; }
  .wz-footer { padding: 10px 14px; }
  .wz-dot    { width: 24px; height: 24px; font-size: 11px; }
  .wz-connector { margin-top: 11px; }
  .wz-step-label { font-size: 9px; }
  .wz-vis-opt { padding: 10px 8px; }
}

/* ── WIZARD STEPPER ── */
.wz-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 40px;
}
.wz-step-btn {
  width: 44px; height: 100%;
  border: none;
  background: var(--bg2);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
  border-right: 1px solid var(--border);
  border-radius: 0;
}
.wz-step-btn:last-child { border-right: none; border-left: 1px solid var(--border); }
.wz-step-btn:hover { background: var(--bg3); }
.wz-stepper-val { flex: 1; min-width: 0; }
.wz-stepper-val input {
  width: 100%; height: 40px;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  outline: none;
  padding: 0;
}
.wz-stepper-val input::placeholder { font-size: 0.75rem; font-weight: 400; color: var(--text3); }
/* Rimuove le freccine native del browser sul type=number */
.wz-stepper-val input::-webkit-outer-spin-button,
.wz-stepper-val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wz-stepper-val input[type=number] { -moz-appearance: textfield; }
@media (max-width: 639px) {
  .wz-step-btn { width: 38px; }
}
