/* ============================================================
   ChatsFun · estilos
   ============================================================ */
:root {
  --purple-900: #3b0f8a;
  --purple-800: #4c1d95;
  --purple-700: #6d28d9;
  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;
  --purple-300: #c4b5fd;
  --purple-200: #ddd6fe;
  --purple-100: #ede9fe;
  --purple-50: #f6f3ff;
  --bg: #f1edfb;
  --card: #ffffff;
  --text: #1f1a33;
  --muted: #6b6785;
  --line: #ece8f6;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(76, 29, 149, .08);
  --shadow-lg: 0 20px 50px rgba(40, 10, 90, .25);
  --topbar-h: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 600; }
.small { font-size: 12.5px; }
.center { text-align: center; }

.icon { width: 20px; height: 20px; flex: none; display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- Cabecera ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 28px;
  background: linear-gradient(90deg, #5b21b6 0%, #6d28d9 50%, #7c3aed 100%);
  color: #fff;
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: var(--purple-700);
}
.brand-logo .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.brand-logo.big { width: 72px; height: 72px; }
.brand-logo.big .icon { width: 40px; height: 40px; }
.brand-name { font-size: 30px; font-weight: 900; letter-spacing: -.5px; }
.brand-img {
  display: block; height: 58px; width: auto; padding: 6px 20px 6px 13px;
  background: #fff; border-radius: 999px; box-shadow: 0 2px 10px rgba(40, 10, 90, .18);
}
.login-logo { display: block; height: 60px; width: auto; margin: 0 auto 6px; padding: 8px 20px 8px 14px; background: #fff; border-radius: 999px; box-shadow: 0 4px 16px rgba(40, 10, 90, .25); }

.mainnav {
  display: flex; gap: 4px; align-items: center;
  background: #fff; border-radius: 999px; padding: 5px;
  margin-left: auto; margin-right: auto;
}
.nav-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px;
  color: var(--text); font-weight: 800; font-size: 16px;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: var(--purple-50); }
.nav-btn.active { background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); color: #fff; box-shadow: 0 4px 12px rgba(109, 40, 217, .35); }

.top-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; flex: none;
  box-shadow: 0 2px 8px rgba(76, 29, 149, .08);
  transition: transform .12s, background .15s;
}
.round-btn:hover { background: var(--purple-50); }
.round-btn:active { transform: scale(.94); }
.round-btn.sm { width: 40px; height: 40px; }
.round-btn.sm .icon { width: 18px; height: 18px; }
.badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.me-btn { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; padding: 4px; border-radius: 999px; }
.me-btn:hover { background: rgba(255, 255, 255, .1); }
.me-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Desplegables ---------- */
.dropdown-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 230px; background: #fff; color: var(--text);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 50;
}
.dropdown.up { top: auto; bottom: calc(100% + 10px); left: 0; right: auto; }
.dropdown-title { font-weight: 900; padding: 8px 10px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px; font-weight: 700; text-align: left;
}
.dropdown-item:hover { background: var(--purple-50); }
.dropdown-item.danger { color: var(--red); }
.notif-list { max-height: 360px; overflow: auto; width: 300px; }
.notif { padding: 10px 12px; border-radius: 10px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.notif:hover { background: var(--purple-50); cursor: pointer; }
.notif small { display: block; color: var(--muted); }
.emoji-menu { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; min-width: 0; }
.emoji-menu button { font-size: 21px; height: 34px; border-radius: 8px; }
.emoji-menu button:hover { background: var(--purple-50); }

/* ---------- Layout ---------- */
.app { height: calc(100% - var(--topbar-h)); padding: 14px; }
.view { display: none; height: 100%; }
.view.active { display: block; }
.view-chats.active {
  display: grid; gap: 14px;
  grid-template-columns: 320px minmax(0, 1fr) clamp(470px, 34vw, 660px);
  grid-template-rows: minmax(0, 1fr);
}
.view-dm.active { display: grid; gap: 14px; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.view:not(.view-chats):not(.view-dm) { overflow: auto; padding: 8px 10px 40px; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.ico-purple { color: var(--purple-600); }
.ico-purple .icon { width: 24px; height: 24px; }
.link { color: var(--purple-700); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.link .icon { width: 17px; height: 17px; }
.close-drawer { display: none; }

.col-left, .col-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.rooms-card { flex: 1 1 60%; min-height: 0; display: flex; flex-direction: column; }
.users-card { flex: 1 1 40%; min-height: 0; display: flex; flex-direction: column; }
.col-right { overflow: auto; }

/* Segmented */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--purple-50); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.seg-btn { padding: 8px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.seg-btn.active { background: #fff; color: var(--purple-700); box-shadow: 0 2px 6px rgba(76, 29, 149, .1); }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--purple-50); border-radius: 12px; padding: 0 12px; color: var(--muted);
  margin-bottom: 10px;
}
.searchbox input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 100%; font-weight: 600; }
.searchbox .icon { width: 17px; height: 17px; }

.room-list, .user-list { overflow: auto; min-height: 0; flex: 1; margin: 0 -6px; padding: 0 6px; }
.room-group { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 900; padding: 12px 10px 4px; }
.room-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; border-radius: 14px; font-weight: 700; font-size: 16px; text-align: left;
  transition: background .12s;
}
.room-item:hover { background: var(--purple-50); }
.room-item .r-icon { font-size: 22px; width: 28px; text-align: center; }
.room-item .r-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .r-count { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 14px; }
.room-item .r-count .icon { width: 15px; height: 15px; }
.room-item.active { background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); color: #fff; box-shadow: 0 4px 14px rgba(109, 40, 217, .35); }
.room-item.active .r-count { color: #fff; }

.user-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row .u-name { flex: 1; font-weight: 800; font-size: 16px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .u-name small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.user-row .u-dm { color: var(--muted); padding: 6px; border-radius: 10px; }
.user-row .u-dm:hover { background: var(--purple-50); color: var(--purple-700); }

/* ---------- Avatares ---------- */
.avatar {
  --s: 44px;
  width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: calc(var(--s) * .4);
  background-size: cover; background-position: center;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.online::after {
  content: ''; position: absolute; right: 0; bottom: 0;
  width: 28%; height: 28%; min-width: 10px; min-height: 10px;
  border-radius: 50%; background: var(--green); border: 2px solid #fff;
}
.avatar-wrap { display: inline-flex; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.room-badge {
  width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--purple-100), var(--purple-200));
  font-size: 30px; display: flex; align-items: center; justify-content: center;
}
.chat-title { flex: 1; min-width: 0; }
.chat-title h1 { font-size: 26px; font-weight: 900; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title p { color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tools { display: flex; gap: 10px; }
.mobile-only { display: none !important; }

.messages {
  flex: 1; overflow-y: auto; padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.msg { display: flex; gap: 12px; align-items: flex-start; max-width: 82%; animation: pop .18s ease-out; }
.msg .avatar { cursor: pointer; }
.msg-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.msg-meta { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.msg-meta b { color: var(--text); font-size: 16px; font-weight: 900; cursor: pointer; }
.bubble {
  background: #f3f1fa; padding: 10px 16px; border-radius: 6px 18px 18px 18px;
  font-weight: 600; font-size: 15.5px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .03);
}
.bubble a { color: var(--purple-700); text-decoration: underline; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .msg-meta { flex-direction: row-reverse; }
.msg.mine .bubble { background: linear-gradient(135deg, #e4dbff, #d8ccff); border-radius: 18px 6px 18px 18px; }
.msg.cont { margin-top: -8px; }
.msg.cont .msg-meta { display: none; }
.msg.cont > .avatar { visibility: hidden; height: 0; }
.msg-img { max-width: min(340px, 100%); max-height: 320px; border-radius: 14px; cursor: zoom-in; display: block; box-shadow: var(--shadow); }
.read-mark { color: var(--purple-600); }
.read-mark .icon { width: 16px; height: 16px; }
.empty-state { margin: auto; text-align: center; color: var(--muted); font-size: 46px; max-width: 360px; }
.empty-state p { font-size: 15px; font-weight: 700; margin-top: 8px; }
.day-sep { align-self: center; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--purple-50); padding: 4px 12px; border-radius: 999px; }

/* Tarjetas dentro del chat */
.chat-card {
  display: flex; gap: 14px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px;
  box-shadow: var(--shadow); max-width: 560px;
}
.chat-card .cc-img { width: 150px; height: 92px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 42px; }
.chat-card .cc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.chat-card .cc-info b { font-size: 16px; font-weight: 900; }
.chat-card .cc-line { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.chat-card .cc-line .icon { width: 16px; height: 16px; color: #f97316; }
.chat-card .btn { align-self: center; }

.typing { display: flex; align-items: center; gap: 10px; padding: 0 22px 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.dots { display: inline-flex; gap: 4px; background: var(--purple-50); padding: 8px 12px; border-radius: 999px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--purple-600); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }

.composer { border-top: 1px solid var(--line); padding: 14px 18px; }
.composer-row { display: flex; align-items: center; gap: 10px; }
.composer .round-btn { box-shadow: none; border: 1px solid var(--line); }
.msg-input {
  flex: 1; min-width: 0; border: 1px solid var(--line); outline: 0;
  border-radius: 999px; padding: 13px 20px; font-weight: 600; background: #fff;
}
.msg-input:focus { border-color: var(--purple-300); box-shadow: 0 0 0 4px var(--purple-50); }
.send-btn {
  width: 66px; height: 46px; border-radius: 999px; flex: none;
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(109, 40, 217, .35);
}
.send-btn:disabled, .msg-input:disabled { opacity: .5; cursor: not-allowed; }
.send-btn .icon { width: 22px; height: 22px; fill: #fff; }
.preview { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.preview img { height: 70px; border-radius: 10px; }
.preview button { color: var(--red); font-weight: 800; }

/* ---------- Eventos ---------- */
.event-list { display: flex; flex-direction: column; }
.event-row { display: flex; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event-row:last-child { border-bottom: 0; }
.ev-img { width: 120px; height: 80px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 38px; box-shadow: inset 0 0 30px rgba(0, 0, 0, .25); }
.ev-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-info b { font-size: 16.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-line { display: flex; gap: 7px; align-items: center; font-weight: 600; font-size: 14px; color: #3b3651; }
.ev-line .icon { width: 16px; height: 16px; }
.ev-line .i-cal { color: var(--red); }
.ev-line .i-pin { color: #f97316; }
.ev-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 14px; align-self: stretch; }
.price { background: var(--purple-100); color: var(--purple-700); font-weight: 900; font-size: 14px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.heart-btn { color: var(--text); }
.heart-btn.on { color: #e11d48; }
.heart-btn.on .icon { fill: #e11d48; }

.events-grid, .plans-grid, .people-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.event-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.event-card .ev-img { width: 100%; height: 140px; border-radius: 0; font-size: 60px; }
.event-card .ev-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event-card .ev-body b { font-size: 17px; font-weight: 900; }
.event-card .ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.tag { display: inline-flex; gap: 4px; font-size: 12px; font-weight: 800; background: var(--purple-50); color: var(--purple-700); padding: 3px 9px; border-radius: 999px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- Juegos ---------- */
.games-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.game-card {
  background: #fff; border-radius: 14px; overflow: hidden; text-align: left;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(76, 29, 149, .18); }
.game-card[hidden], .col-right [hidden] { display: none !important; }
.game-card .g-top { height: 74px; display: flex; align-items: center; justify-content: center; font-size: 42px; }
.game-card .g-body { padding: 10px 12px 12px; }
.game-card .g-body b { display: block; font-weight: 900; font-size: 16px; }
.game-card .g-body span { font-size: 13.5px; font-weight: 600; color: #3b3651; }
.game-card .g-soon { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 900; color: var(--purple-700); background: var(--purple-100); border-radius: 999px; padding: 2px 8px; }
.games-grid.big { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.games-grid.big .g-top { height: 140px; font-size: 72px; }
.games-grid.big .g-body { padding: 16px; }
.games-grid.big .g-body b { font-size: 20px; }
.games-grid.big .g-actions { display: flex; gap: 8px; padding: 0 16px 16px; }

/* ---------- Vistas ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 6px 4px 18px; }
.view-head h1 { font-size: 30px; font-weight: 900; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .searchbox { margin: 0; background: #fff; box-shadow: var(--shadow); min-width: 220px; }
select {
  border: 0; background: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 700;
  box-shadow: var(--shadow); outline: 0; max-width: 100%;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-weight: 800; white-space: nowrap;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); color: #fff; box-shadow: 0 4px 12px rgba(109, 40, 217, .3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.soft { background: var(--purple-100); color: var(--purple-800); }
.btn.soft:hover { background: var(--purple-200); }
.btn.ghost { border: 1px solid var(--line); background: #fff; }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px; font-size: 17px; }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.users-card .btn { margin-top: 10px; }

.plan-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.plan-card h3 { font-size: 18px; font-weight: 900; }
.plan-card p { font-weight: 600; color: #3b3651; white-space: pre-wrap; overflow-wrap: anywhere; }
.plan-who { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.stack { display: flex; }
.stack .avatar { margin-left: -8px; border: 2px solid #fff; }
.stack .avatar:first-child { margin-left: 0; }
.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }

.person-card { background: #fff; border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.person-card b { font-size: 18px; font-weight: 900; }
.person-card p { color: var(--muted); font-weight: 600; font-size: 14px; min-height: 20px; overflow-wrap: anywhere; }
.person-card .p-actions { display: flex; gap: 8px; margin-top: 6px; }

.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); font-weight: 700; font-size: 16px; }
.empty .big-emoji { font-size: 54px; display: block; margin-bottom: 8px; }

/* ---------- Mensajes privados ---------- */
.dm-list-card { display: flex; flex-direction: column; min-height: 0; }
.dm-list { overflow: auto; flex: 1; margin: 0 -8px; }
.dm-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border-radius: 14px; text-align: left; }
.dm-item:hover { background: var(--purple-50); }
.dm-item.active { background: var(--purple-100); }
.dm-item .dm-info { flex: 1; min-width: 0; }
.dm-item .dm-info b { display: block; font-weight: 900; }
.dm-item .dm-info span { display: block; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item .dm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.dm-item .unread { background: var(--purple-600); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; }
#dmChat .chat-head .avatar-wrap:empty { display: none; }

/* ---------- Modales ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 10, 70, .55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: calc(100% - 20px); overflow: auto;
  padding: 26px; position: relative; animation: pop .2s ease-out;
}
.modal h2 { font-size: 22px; font-weight: 900; margin-bottom: 14px; }
.modal-close { position: absolute; top: 14px; right: 14px; box-shadow: none; background: var(--purple-50); z-index: 2; }
.login-modal { max-width: 460px; padding: 0; overflow: auto; }
.login-hero { background: linear-gradient(135deg, #5b21b6, #8b5cf6); color: #fff; text-align: center; padding: 28px 24px 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-hero h1 { font-size: 26px; font-weight: 900; }
.login-hero p { opacity: .9; font-weight: 600; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-weight: 600;
  outline: 0; background: #fff; box-shadow: none; resize: vertical;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--purple-300); box-shadow: 0 0 0 4px var(--purple-50); }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.form label.check input { width: 18px; height: 18px; accent-color: var(--purple-600); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: #b91c1c; background: #fee2e2; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.avatar-picker { align-items: center; cursor: pointer; }
.avatar-preview {
  width: 92px; height: 92px; border-radius: 50%; background: var(--purple-50); color: var(--purple-600);
  display: flex; align-items: center; justify-content: center; border: 2px dashed var(--purple-300); overflow: hidden;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview .icon { width: 30px; height: 30px; }

/* Perfil tipo Instagram */
.profile-modal { max-width: 760px; }
.profile-top { display: flex; gap: 30px; align-items: center; padding: 6px 6px 20px; border-bottom: 1px solid var(--line); }
.profile-top .avatar { --s: 130px; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--purple-300); }
.profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.profile-info h2 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-stats { display: flex; gap: 22px; font-weight: 600; }
.profile-stats b { font-weight: 900; font-size: 17px; }
.profile-bio { font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-dot { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #dcfce7; color: #15803d; }
.status-dot.off { background: #f1f5f9; color: #64748b; }
.profile-tabs { display: flex; justify-content: center; gap: 6px; padding: 12px 0; font-weight: 900; color: var(--muted); text-transform: uppercase; font-size: 13px; letter-spacing: 1px; }
.profile-tabs .icon { width: 16px; height: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 6px; cursor: pointer; background: var(--purple-50); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.photo-tile:hover img { transform: scale(1.05); }
.photo-tile .ph-over { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 900; opacity: 0; transition: opacity .15s; }
.photo-tile:hover .ph-over { opacity: 1; }
.photo-tile .ph-over .icon { fill: #fff; }
.upload-tile { aspect-ratio: 1; border-radius: 6px; border: 2px dashed var(--purple-300); color: var(--purple-700); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 800; background: var(--purple-50); }
.upload-tile .icon { width: 30px; height: 30px; }
.edit-box { background: var(--purple-50); border-radius: 14px; padding: 14px; margin-top: 10px; }

.photo-modal { max-width: 900px; padding: 0; overflow: hidden; display: flex; }
.photo-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; width: 100%; max-height: calc(100vh - 60px); }
.photo-view .pv-img { background: #000; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.photo-view .pv-img img { max-width: 100%; max-height: calc(100vh - 60px); object-fit: contain; }
.photo-view .pv-side { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pv-head { display: flex; align-items: center; gap: 10px; font-weight: 900; padding-right: 40px; }
.pv-caption { flex: 1; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-actions { display: flex; align-items: center; gap: 12px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; }
.pv-actions .heart-btn .icon { width: 26px; height: 26px; }
.photo-only img { max-width: 100%; max-height: calc(100vh - 60px); display: block; margin: auto; }

.picker-content { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-align: left; width: 100%; font-weight: 700; }
.picker-item:hover { background: var(--purple-50); }
.picker-item .pi-emoji { width: 52px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.picker-item small { display: block; color: var(--muted); font-weight: 600; }
.picker-section { font-size: 12px; font-weight: 900; text-transform: uppercase; color: var(--muted); margin: 8px 4px 0; letter-spacing: .6px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: #1f1a33; color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 700;
  box-shadow: var(--shadow-lg); max-width: 340px; animation: slidein .25s ease-out; cursor: pointer;
  display: flex; gap: 10px; align-items: center;
}
.toast.error { background: #b91c1c; }

.bottomnav { display: none; }
.drawer-backdrop { display: none; }

@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ============ Responsive ============ */
@media (max-width: 1500px) {
  .view-chats.active { grid-template-columns: 290px minmax(0, 1fr) clamp(400px, 33vw, 480px); }
  .nav-btn { padding: 10px 14px; font-size: 15px; }
  .ev-img { width: 96px; height: 70px; }
}

@media (max-width: 1200px) {
  .view-chats.active { grid-template-columns: 290px minmax(0, 1fr); }
  .col-right {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 92vw); z-index: 80;
    background: var(--bg); padding: 14px; transform: translateX(105%); transition: transform .25s;
  }
  .col-right.open { transform: none; box-shadow: var(--shadow-lg); }
  #openSide { display: inline-flex !important; }
  .col-right .close-drawer { display: inline-flex; }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(30, 10, 70, .4); z-index: 70; }
  .brand-name { display: none; }
}

@media (max-width: 900px) {
  :root { --topbar-h: 62px; }
  body { font-size: 14.5px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-name { display: inline; font-size: 22px; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-img { height: 50px; padding: 5px 15px 5px 10px; }
  .mainnav { display: none; }
  .top-actions { margin-left: auto; gap: 8px; }
  .round-btn { width: 40px; height: 40px; }
  .me-name, .chev { display: none; }
  #btnMessages { display: none; }
  .app { padding: 8px; height: calc(100% - var(--topbar-h) - 64px); }

  .view-chats.active { grid-template-columns: minmax(0, 1fr); }
  .col-left {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 88vw); z-index: 80;
    background: var(--bg); padding: 12px; transform: translateX(-105%); transition: transform .25s;
  }
  .col-left.open { transform: none; box-shadow: var(--shadow-lg); }
  .col-left .close-drawer { display: inline-flex; }
  #openRooms { display: inline-flex !important; }

  .view-dm.active { grid-template-columns: minmax(0, 1fr); }
  .view-dm.has-chat .dm-list-card { display: none; }
  .view-dm:not(.has-chat) #dmChat { display: none; }
  #dmBack { display: inline-flex !important; }

  .chat-head { padding: 10px 12px; gap: 10px; }
  .room-badge { width: 44px; height: 44px; font-size: 22px; }
  .chat-title h1 { font-size: 19px; }
  .chat-title p { font-size: 13px; }
  .chat-tools { gap: 6px; }
  .chat-tools .round-btn.sm { width: 36px; height: 36px; }
  .messages { padding: 14px 12px; }
  .msg { max-width: 94%; }
  .chat-card { flex-wrap: wrap; }
  .chat-card .cc-img { width: 100%; height: 100px; }
  .composer { padding: 10px; }
  .composer-row { gap: 6px; }
  .composer [data-action=image] { display: none; }
  .send-btn { width: 50px; }

  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 40;
    background: #fff; box-shadow: 0 -4px 20px rgba(76, 29, 149, .1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 800; color: var(--muted); position: relative; }
  .bottomnav button.active { color: var(--purple-700); }
  .bottomnav .badge { top: 4px; right: calc(50% - 22px); }

  .profile-top { flex-direction: column; text-align: center; gap: 14px; }
  .profile-top .avatar { --s: 100px; }
  .profile-info { align-items: center; }
  .profile-stats, .profile-actions { justify-content: center; }
  .photo-view { grid-template-columns: 1fr; overflow: auto; }
  .photo-modal { overflow: auto; }
  .view-head h1 { font-size: 24px; }
  .filters, .filters > * { width: 100%; }
  .games-grid.small { grid-template-columns: repeat(3, 1fr); }
  .notif-list { width: min(300px, 80vw); }
  .toasts { left: 12px; right: 12px; }
  .toast { max-width: none; }
}

/* ---------- Modo invitado ---------- */
body.is-guest .user-only { display: none !important; }
body:not(.is-guest) .guest-only { display: none !important; }
.btn.white { background: #fff; color: var(--purple-700); box-shadow: 0 2px 8px rgba(76, 29, 149, .15); padding: 11px 18px; }
.btn.white:hover { background: var(--purple-50); }
.guest-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--line); padding: 14px 18px;
  background: linear-gradient(90deg, var(--purple-50), #fff);
}
.guest-cta-text { font-weight: 600; color: #3b3651; }
.guest-cta-text b { color: var(--purple-700); }
@media (max-width: 900px) {
  .guest-cta { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; padding: 10px; }
  .guest-cta-text { font-size: 13px; }
  #btnRegister { padding: 9px 12px; font-size: 14px; }
  #btnRegister .icon { display: none; }
}

/* ---------- Datos extra del perfil ---------- */
.profile-sub { font-weight: 800; color: var(--purple-700); }
.profile-personality { font-weight: 600; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.tag.hobby { background: #ecfdf5; color: #047857; }
@media (max-width: 900px) { .profile-info .tags { justify-content: center; } }

/* ---------- Registro / inicio de sesión ---------- */
.auth-body { padding: 20px 26px 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-body .seg { margin-bottom: 0; }
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; padding: 12px; font-size: 16px; }
.btn.google:hover { background: #f8f9fa; }
.g-logo { width: 20px; height: 20px; flex: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Juegos (catálogo de El Tapete) ---------- */
.games-cat { grid-column: 1 / -1; font-size: 20px; font-weight: 900; margin: 14px 4px 0; }
.games-cat:first-child { margin-top: 0; }
.games-grid.big .g-top { height: 110px; font-size: 56px; }
.games-grid.big .g-body { display: flex; flex-direction: column; gap: 4px; }
.games-grid.big .g-players { color: var(--purple-700); font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.games-grid.big .g-actions { flex-wrap: wrap; margin-top: auto; }
.games-grid.big .game-card { display: flex; flex-direction: column; }
.mesa-card.cerrada { opacity: .6; }
.mesa-card .btn:disabled { opacity: .6; cursor: default; }
.mesa-card .cc-img { width: 84px; height: 84px; font-size: 38px; }

/* ---------- Pestañas de salas abiertas ---------- */
.room-tabs { position: relative; display: flex; align-items: flex-end; gap: 4px; padding: 10px 12px 0; background: var(--purple-50);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; flex: none; }
.room-tab { display: flex; align-items: center; flex: none; max-width: 190px; border-radius: 12px 12px 0 0;
  background: rgba(124, 58, 237, .07); border: 1px solid transparent; border-bottom: none; }
.room-tab:hover { background: rgba(124, 58, 237, .13); }
.room-tab.active { background: var(--card); border-color: var(--line); box-shadow: 0 -2px 8px rgba(76, 29, 149, .06); }
.room-tab-btn { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 8px 6px 9px 12px; border: 0;
  background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.room-tab.active .room-tab-btn { color: var(--purple-700); }
.rt-icon { flex: none; }
.rt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-count { flex: none; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--purple-100); color: var(--purple-700); }
.room-tab-close { flex: none; width: 22px; height: 22px; margin-right: 6px; border: 0; border-radius: 50%; background: none;
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.room-tab-close:hover { background: var(--purple-100); color: var(--purple-800); }
.room-tab-add { flex: none; width: 32px; height: 32px; margin: 0 0 4px 2px; border: 1px dashed var(--purple-300); border-radius: 10px;
  background: none; color: var(--purple-700); font-size: 18px; font-weight: 700; cursor: pointer; }
.room-tab-add:hover { background: var(--purple-100); }
.room-tab-btn:focus-visible, .room-tab-close:focus-visible, .room-tab-add:focus-visible { outline: 2px solid var(--purple-600); outline-offset: -2px; }
@media (max-width: 900px) {
  .room-tabs { padding: 8px 8px 0; }
  .room-tab { max-width: 150px; }
}

/* ---------- Eventos de VeDePlan ---------- */
.ev-ext { align-self: flex-start; margin-top: 4px; text-decoration: none; }

/* ---------- Miniaturas de las provincias ---------- */
.room-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.r-icon:has(.room-img) { width: 30px; height: 30px; flex: none; display: grid; place-items: center; font-size: 0; }
.rt-icon:has(.room-img) { width: 18px; height: 18px; display: inline-grid; }
.room-badge.has-img { padding: 0; overflow: hidden; background: var(--purple-100); }
.pi-emoji:has(.room-img) { padding: 0; overflow: hidden; }
.room-img.tag-img { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }

/* ---------- Ficha de un juego (desde el lateral del chat) ---------- */
.game-info { display: grid; gap: 10px; }
.game-info .g-top { height: 140px; border-radius: 16px; display: grid; place-items: center; font-size: 72px; }
.game-info .g-players { font-size: 13px; font-weight: 700; color: var(--purple-700); }
.game-info p { margin: 0; color: var(--muted); }
.game-info .g-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn { justify-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--purple-700); cursor: pointer; }
.link-btn svg { width: 16px; height: 16px; }

/* ---------- Añadir eventos ---------- */
.add-event-side { margin-top: 10px; width: 100%; justify-content: center; }
.add-event { display: grid; gap: 12px; }
.add-event label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--text); }
.add-event input, .add-event select, .add-event textarea { font: inherit; font-weight: 500; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--purple-50); color: var(--text); width: 100%; box-sizing: border-box; }
.add-event textarea { resize: vertical; }
.add-event input:focus, .add-event select:focus, .add-event textarea:focus { outline: 2px solid var(--purple-500); outline-offset: 0; }
.ae-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .ae-row { grid-template-columns: 1fr; } }
.ae-img { height: 130px; border: 2px dashed var(--purple-300); border-radius: 16px; display: grid !important; place-items: center; cursor: pointer;
  background: var(--purple-50) center/cover no-repeat; color: var(--purple-700); }
.ae-img.has-img { border-style: solid; }
.ae-img.has-img .ae-img-txt { background: rgba(255, 255, 255, .85); padding: 6px 10px; border-radius: 999px; }
.ae-img-txt { display: inline-flex; align-items: center; gap: 6px; }
.ae-img-txt svg { width: 18px; height: 18px; }
.ae-interests { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ae-interests legend { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ae-interests .chip { display: inline-flex; font-weight: 600; cursor: pointer; }
.ae-interests .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ae-interests .chip span { padding: 6px 10px; border-radius: 999px; background: var(--purple-50); border: 1px solid var(--line); font-size: 12.5px; }
.ae-interests .chip input:checked + span { background: var(--purple-600); border-color: var(--purple-600); color: #fff; }
.ae-interests .chip input:focus-visible + span { outline: 2px solid var(--purple-500); outline-offset: 2px; }
.ae-error { margin: 0; min-height: 1em; color: var(--red); font-size: 13px; font-weight: 600; }
.ev-desc { margin: 4px 0; color: var(--muted); font-size: 14px; white-space: pre-line; }
.ev-by { font-size: 13px; }
.btn.danger { color: var(--red); }

/* ---------- Seguidores y privacidad del perfil ---------- */
.stat-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.stat-btn:hover:not([disabled]) b { color: var(--purple-700); text-decoration: underline; }
.stat-btn[disabled] { cursor: default; }
.tag.follows-you { margin-top: 6px; background: var(--purple-100); color: var(--purple-800); }
.privacy-opts { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.privacy-opts legend { font-weight: 800; padding: 0 6px; }
.privacy-opt { display: flex !important; flex-direction: row !important; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.privacy-opt input { margin-top: 4px; accent-color: var(--purple-700); width: auto !important; }
.privacy-opt small { display: block; color: var(--muted); font-weight: 500; }
.privacy-now { margin: 6px 0 0; }
.follow-requests, .follow-list { background: var(--purple-50); border-radius: 14px; padding: 12px 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.req-row { display: flex; align-items: center; gap: 10px; }
.req-row .link-btn { font-weight: 700; }
.req-btns { margin-left: auto; display: flex; gap: 6px; }
.locked-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 20px; border: 2px dashed var(--line); border-radius: 16px; margin-top: 10px; }
.locked-box .big-emoji { font-size: 40px; }
.mesa-card .mesa-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* Tarjetas de juego como enlaces (SEO) */
a.game-card { color: inherit; text-decoration: none; }
.game-card .g-name { color: inherit; text-decoration: none; }
.game-card .g-name:hover { color: var(--purple-700); text-decoration: underline; }

/* ---------- Denuncias ---------- */
.msg-body { position: relative; }
.msg-flag { position: absolute; right: -32px; bottom: 6px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted, #8b8aa3); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.msg-flag svg { width: 14px; height: 14px; }
.msg:hover .msg-flag, .msg-flag:focus-visible { opacity: .75; }
.msg-flag:hover { opacity: 1; color: #dc2626; background: #fee2e2; }
@media (hover: none) { .msg-flag { opacity: .45; } }
.report-user { color: #b91c1c; }
.report-user svg { width: 15px; height: 15px; }
.report-modal { max-width: 460px; }
.report-target { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--purple-50, #f5f3ff); font-size: 14px; overflow-wrap: anywhere; }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border: 0; padding: 0; margin: 0; }
@media (max-width: 480px) { .report-reasons { grid-template-columns: 1fr; } }
.report-reasons legend { font-weight: 800; font-size: 14px; margin-bottom: 6px; grid-column: 1 / -1; }
.form .report-reason { flex-direction: row; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line, #e7e5f4); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.form .report-reason input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: #7c3aed; }
.report-reason:has(input:checked) { border-color: #7c3aed; background: #f5f3ff; }
.report-help { font-size: 12.5px; color: var(--muted, #8b8aa3); margin: 0; }

/* ---------- Añadir evento: código del correo ---------- */
.ae-codigo { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 6px 4px 4px; }
.ae-codigo-ico { font-size: 40px; }
.ae-codigo p { margin: 0; }
.ae-codigo input { width: min(260px, 100%); font: 800 28px/1 ui-monospace, monospace; letter-spacing: 10px; text-align: center; padding: 12px 8px;
  border: 2px solid var(--line, #e7e5f4); border-radius: 14px; outline: none; }
.ae-codigo input:focus { border-color: #7c3aed; }
.ae-codigo .btn.primary { width: min(260px, 100%); }

/* Enlaces legales (columna izquierda) */
.legal-links { font-size: 12px; line-height: 1.6; text-align: center; color: var(--muted); padding: 0 6px; flex: none; }
.legal-links a { color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.legal-links a:hover { color: var(--purple-700); text-decoration: underline; }
.form .check a { color: var(--purple-700); font-weight: 800; }

/* ---------- Borrar la cuenta (en Editar perfil) ---------- */
.borrar-cuenta { border-top: 1px solid var(--line, #e5e7eb); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.link-btn.danger-link { color: var(--red, #b91c1c); font-size: 13px; }
.borrar-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid #fca5a5; border-radius: 12px; background: rgba(254, 226, 226, .35); }
.borrar-box p { margin: 0; }
