/* ============ GoldenStream · estilos ============ */

:root {
  --bg: #0b0914;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --txt: #f4effc;
  --muted: #a79fc0;
  --gold: #ffd166;
  --gold2: #ff9f1c;
  --gold-soft: rgba(255, 209, 102, .14);
  --green: #4ade80;
  --red: #f87171;
  --r: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tabbar-h: 62px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(255, 209, 102, .09), transparent 60%),
    radial-gradient(900px 460px at -12% 108%, rgba(255, 122, 89, .07), transparent 60%),
    var(--bg);
  color: var(--txt);
  font: 15px/1.55 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .brand-txt, .big, .flame, .score, .rk-val { font-family: 'Sora', 'Inter', sans-serif; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
img { max-width: 100%; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 46px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
.inline { display: inline; }
.desktop-only { display: none; }
.empty-emoji { font-size: 44px; line-height: 1; margin-bottom: 8px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 9, 20, .78);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1100px; margin: 0 auto; padding: 9px 16px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--txt); flex: none; }
.brand:hover { text-decoration: none; }
.brand-ico {
  width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  box-shadow: 0 4px 18px rgba(255, 159, 28, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-txt {
  font-size: 18px; font-weight: 800; letter-spacing: .2px;
  background: linear-gradient(120deg, #ffe29a, var(--gold) 45%, var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: none; gap: 2px; }
.nav a {
  color: var(--muted); padding: 7px 12px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--txt); text-decoration: none; background: var(--surface-2); }
.nav a.on { color: var(--gold); background: var(--gold-soft); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

/* ---------- barra de pestañas (móvil) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 8px env(safe-area-inset-bottom, 0px);
  background: rgba(13, 10, 23, .92);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-top: 1px solid var(--line);
}
.tabbar-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  padding: 6px 2px; border-radius: 12px; position: relative;
  transition: color .15s;
}
.tabbar-item:hover { text-decoration: none; color: var(--txt); }
.tabbar-item.on { color: var(--gold); }
.ti-ico { font-size: 20px; line-height: 1; filter: grayscale(.15); }
.tabbar-item .badge-n { position: absolute; top: 0; right: calc(50% - 26px); }
.tabbar-add {
  width: 54px; height: 54px; margin: 0 auto; border: 0; cursor: pointer;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  box-shadow: 0 6px 22px rgba(255, 159, 28, .5), inset 0 1px 0 rgba(255, 255, 255, .4);
  display: grid; place-items: center;
  transform: translateY(-16px);
  transition: transform .15s, filter .15s;
}
.tabbar-add span { font-size: 24px; }
.tabbar-add:active { transform: translateY(-12px) scale(.94); filter: brightness(1.1); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; border-radius: 12px;
  padding: 10px 18px; font-weight: 700; font-size: 14px; text-decoration: none;
  line-height: 1.2; min-height: 42px;
  transition: transform .07s ease, filter .15s ease, box-shadow .15s ease;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn:focus-visible, .inp:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #261a02;
  box-shadow: 0 5px 18px rgba(255, 159, 28, .32), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-ghost { background: var(--surface-2); color: var(--txt); border: 1px solid var(--line-strong); }
.btn-sm { padding: 7px 13px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 14px 28px; font-size: 16px; min-height: 52px; }
.btn-block { width: 100%; }

/* ---------- inputs ---------- */
.inp {
  width: 100%; background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line-strong); color: var(--txt);
  border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 16px;
  margin: 6px 0; transition: border-color .15s, box-shadow .15s, background .15s;
}
.inp::placeholder { color: #6f6787; }
.inp:focus { outline: none; border-color: rgba(255, 209, 102, .6); background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 3px rgba(255, 209, 102, .12); }
textarea.inp { resize: vertical; }
select.inp { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a79fc0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
label { display: block; margin: 12px 0 2px; font-weight: 600; font-size: 13px; color: var(--muted); }
label input { display: block; }
label.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; color: var(--muted); margin-top: 13px; font-size: 13.5px; line-height: 1.4; }
label.check input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; flex: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .inp { flex: 1; min-width: 150px; }

/* ---------- layout ---------- */
.main { padding-top: 18px; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 40px; padding: 22px 0; border-top: 1px solid var(--line); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 17px; margin-bottom: 14px;
  animation: fadeUp .3s ease both;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
.empty { text-align: center; color: var(--muted); padding: 44px 18px; }
.empty p { margin: 4px 0; }
.banner { border-color: rgba(255, 209, 102, .35); background: rgba(255, 209, 102, .07); border-radius: var(--r); }

/* ---------- avatares ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 18px;
  background: linear-gradient(135deg, rgba(255, 209, 102, .28), rgba(255, 159, 28, .14));
  border: 1.5px solid rgba(255, 209, 102, .35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.avatar.big { width: 76px; height: 76px; font-size: 40px; border-width: 2px; }

/* ---------- chip usuario ---------- */
.chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--txt); min-width: 0;
  transition: border-color .15s, background .15s;
}
.chip:hover { text-decoration: none; border-color: rgba(255, 209, 102, .5); background: var(--surface-2); }
.chip .avatar { width: 30px; height: 30px; font-size: 15px; }
.chip-info { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; max-width: 130px; }
.chip-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-info i { font-size: 11px; color: var(--muted); font-style: normal; white-space: nowrap; }
.chipg {
  background: var(--gold-soft); color: var(--gold); font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 99px; margin-left: 6px; white-space: nowrap;
}
.chipg:hover { text-decoration: none; }
.badge-n {
  background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #261a02;
  font-weight: 800; font-size: 11px; padding: 1px 7px; border-radius: 99px;
  font-style: normal;
}

/* ---------- feed ---------- */
.feed { display: flex; justify-content: center; }
.feed-main { width: 100%; max-width: 700px; }
.composer { background: linear-gradient(160deg, rgba(255, 209, 102, .06), var(--surface) 45%); }
.composer-row { display: flex; gap: 12px; }
.composer-fields { flex: 1; min-width: 0; }
.composer-foot { display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.composer-foot .inp { flex: 1; }
.sortbar { display: flex; gap: 8px; margin: 16px 2px; }
.sort {
  color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 7px 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line);
  transition: all .15s;
}
.sort:hover { text-decoration: none; color: var(--txt); border-color: var(--line-strong); }
.sort.on { color: var(--gold); background: var(--gold-soft); border-color: rgba(255, 209, 102, .4); }

/* ---------- posts ---------- */
.post { padding: 15px 17px; }
.post:hover { border-color: var(--line-strong); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.post-meta { font-size: 13.5px; line-height: 1.4; min-width: 0; }
.userlink { color: var(--txt); font-weight: 700; }
.userlink:hover { color: var(--gold); text-decoration: none; }
.post-title { margin: 3px 0 7px; font-size: 17.5px; line-height: 1.3; }
.post-body { color: #ddd6ec; white-space: pre-wrap; overflow-wrap: break-word; }
.post-foot { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.votes {
  display: flex; align-items: center; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 6px;
}
.vote {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 5px 8px; border-radius: 8px;
  transition: color .12s, background .12s, transform .12s;
  touch-action: manipulation;
}
.vote:hover { color: var(--txt); background: rgba(255, 255, 255, .08); }
.vote.up.on { color: var(--gold); transform: translateY(-1px); }
.vote.dn.on { color: var(--red); transform: translateY(1px); }
.score { font-weight: 800; min-width: 26px; text-align: center; font-size: 14px; }
.btn-com {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 7px 12px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s;
}
.btn-com:hover { color: var(--txt); background: var(--surface-2); }
.comments { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 11px; }
.comment { display: flex; gap: 10px; padding: 9px 4px; }
.comment .avatar { width: 30px; height: 30px; font-size: 15px; }
.comment-body { min-width: 0; }
.comment-meta { font-size: 12.5px; }
.comment-text { color: #ddd6ec; font-size: 14px; overflow-wrap: break-word; }
.com-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.com-form .inp { margin: 0; flex: 1; }
.com-form .btn { flex: none; }

/* ---------- mi día ---------- */
.dash-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; }
.hero { background: linear-gradient(165deg, rgba(255, 209, 102, .09), var(--surface) 55%); border-color: rgba(255, 209, 102, .22); }
.hero-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.flame { font-size: 32px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.flame span { font-size: 15px; color: var(--txt); }
.hero-today { display: flex; gap: 24px; margin-left: auto; }
.big { font-size: 27px; font-weight: 800; line-height: 1.05; }
.big small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.big.alt { color: var(--gold); }
.barzone { margin-top: 15px; }
.bar { height: 10px; background: rgba(255, 255, 255, .07); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #2fbf72); border-radius: 99px; transition: width .5s ease; }
.bar.gold i { background: linear-gradient(90deg, var(--gold), var(--gold2)); }
.barzone span { font-size: 12.5px; color: var(--muted); }
.hero-actions { display: flex; gap: 10px; margin-top: 17px; flex-wrap: wrap; }
.badges h3 { margin-bottom: 12px; }
.badge-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.badge {
  text-align: center; padding: 9px 7px; min-width: 78px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 209, 102, .08), rgba(255, 255, 255, .03));
  transition: transform .12s, border-color .12s;
}
.badge:hover { transform: translateY(-2px); border-color: rgba(255, 209, 102, .4); }
.badge span { font-size: 23px; display: block; line-height: 1.15; }
.badge small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.logs h3 { margin-bottom: 6px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- retos ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.cards.lb { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.chal { display: flex; flex-direction: column; gap: 11px; }
.chal:hover { border-color: var(--line-strong); }
.chal.done { border-color: rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .06); }
.chal-head { display: flex; gap: 12px; align-items: flex-start; }
.chal-head h3 { margin: 0 0 3px; font-size: 15px; }
.chal-head p { margin: 0; font-size: 12.5px; line-height: 1.45; }
.chal-emoji {
  font-size: 30px; line-height: 1.2; width: 52px; height: 52px; flex: none;
  display: grid; place-items: center; border-radius: 14px;
  background: var(--gold-soft); border: 1px solid rgba(255, 209, 102, .25);
}
.chal-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--gold); font-weight: 700; margin-top: auto; }

/* ---------- ranking ---------- */
.rk { width: 48px; font-size: 17px; }
.rk-val { text-align: right; font-weight: 800; color: var(--gold); }
.lb .card h3 { font-size: 15.5px; }

/* ---------- grupos ---------- */
.grp-head { display: flex; gap: 13px; }
.grp-head h3 { margin: 0 0 3px; }
.grp-head p { margin: 0; font-size: 13px; line-height: 1.45; }
.grp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.ghead { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.ghead h2 { margin: 0 0 4px; font-size: 20px; }
.members h3 { margin-bottom: 10px; }
.member-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.member {
  display: flex; align-items: center; gap: 7px; color: var(--txt); font-size: 13px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 11px 4px 4px; border-radius: 99px;
  transition: border-color .12s, transform .12s;
}
.member:hover { text-decoration: none; border-color: rgba(255, 209, 102, .5); transform: translateY(-1px); }
.member .avatar { width: 26px; height: 26px; font-size: 13px; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 310px 1fr; gap: 14px; align-items: start; }
.chat-list h3 { margin-bottom: 8px; }
.newchat { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; align-items: center; margin-bottom: 10px; }
.newchat .inp { margin: 0; }
.conv {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px;
  border-radius: 12px; color: var(--txt);
  transition: background .12s;
}
.conv:hover { background: var(--surface-2); text-decoration: none; }
.conv.on { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(255, 209, 102, .35); }
.conv-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.conv-info b { font-size: 14px; }
.conv-info i { font-size: 12px; color: var(--muted); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { display: flex; flex-direction: column; height: 560px; padding: 0; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  font-size: 15px;
}
.chat-back { display: none; font-size: 19px; color: var(--txt); padding: 2px 6px; border-radius: 8px; }
.chat-back:hover { text-decoration: none; background: var(--surface-2); }
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 14px 14px; display: flex; flex-direction: column; gap: 7px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.chat-msgs::-webkit-scrollbar { width: 6px; }
.chat-msgs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }
.msg {
  max-width: 78%; align-self: flex-start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px; padding: 9px 13px; font-size: 14.5px;
  overflow-wrap: break-word; animation: fadeUp .2s ease both;
}
.msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(255, 209, 102, .22), rgba(255, 159, 28, .12));
  border-color: rgba(255, 209, 102, .35);
  border-radius: 16px 16px 5px 16px;
}
.msg .t { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.chat-send { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); align-items: center; background: rgba(255, 255, 255, .02); }
.chat-send .inp { margin: 0; flex: 1; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 6px; }

/* ---------- perfil ---------- */
.profile { background: linear-gradient(170deg, rgba(255, 209, 102, .07), var(--surface) 55%); }
.p-head { display: flex; gap: 17px; align-items: center; flex-wrap: wrap; }
.p-info { flex: 1; min-width: 210px; }
.p-info h2 { margin: 0 0 4px; font-size: 22px; }
.p-stats { display: flex; gap: 11px; flex-wrap: wrap; }
.p-stats div {
  text-align: center; min-width: 62px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 9px 12px;
}
.p-stats b { display: block; font-size: 18px; color: var(--gold); }
.p-stats span { font-size: 11px; color: var(--muted); }
.admin { font-size: 15px; vertical-align: 2px; }
.mini-post { padding: 9px 2px; border-bottom: 1px solid var(--line); }
.mini-post:last-child { border-bottom: 0; }
.mini-post a { color: var(--txt); font-weight: 600; }
.mini-post a:hover { color: var(--gold); }

/* ---------- auth / gate ---------- */
.auth-wrap { display: flex; flex-direction: column; align-items: center; padding-top: 26px; gap: 16px; }
.auth-hero { text-align: center; }
.auth-hero h1 {
  margin: 4px 0 0; font-size: 30px;
  background: linear-gradient(120deg, #ffe29a, var(--gold) 45%, var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card { width: 100%; max-width: 410px; padding: 22px; }
.tabs { display: flex; gap: 6px; margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tab {
  flex: 1; background: none; border: 0; color: var(--muted);
  padding: 9px; border-radius: 9px; font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: all .15s;
}
.tab.on { color: var(--gold); background: rgba(20, 16, 32, .7); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.tabpanel { display: block; }
.tabpanel.hidden { display: none; }
.gate { display: grid; place-items: center; min-height: 72vh; padding-top: 10px; }
.gate-card { max-width: 470px; text-align: center; padding: 38px 28px; }
.gate-emoji {
  font-size: 62px; line-height: 1; margin-bottom: 8px; display: inline-block;
  filter: drop-shadow(0 6px 24px rgba(255, 159, 28, .45));
}
.gate-card h1 {
  margin: 6px 0 2px; font-size: 32px; letter-spacing: .3px;
  background: linear-gradient(120deg, #ffe29a, var(--gold) 45%, var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--gold); font-weight: 700; margin: 0 0 12px; font-size: 15px; }
.gate-card form { margin: 18px 0; }

/* ---------- modal / bottom sheet ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 3, 8, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 14px;
  animation: fadeIn .2s ease both;
}
.modal-card { width: 100%; max-width: 430px; animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1) both; }
.sheet-grab { width: 44px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .22); margin: -4px auto 12px; display: none; }
.quick-log { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 10px 0; }
.modal-close { margin-top: 8px; width: 100%; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #261a02; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 14px; text-align: center;
  box-shadow: var(--shadow); animation: toastIn .25s ease;
}
.toast.err { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; }
.toast.out { opacity: 0; transition: opacity .35s; }

/* ---------- animaciones ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheetUp { from { opacity: .4; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ responsive ============ */
@media (min-width: 961px) {
  .desktop-only { display: inline-flex; }
  .nav { display: flex; }
  .tabbar { display: none; }
  #toasts { bottom: 18px; }
  .card:hover:not(.post) { border-color: var(--line-strong); }
}

@media (max-width: 960px) {
  .wrap { padding: 0 12px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 20px); }
  .top-inner { padding: 8px 12px; }
  .brand-txt { display: none; }
  .top-right .btn-ghost { display: none; }
  .chip-info { max-width: 110px; }
  .feed-main { max-width: 100%; }
  .chat { grid-template-columns: 1fr; }
  .chat-main { height: calc(100dvh - 132px); }
  .chat.has-conv .chat-list { display: none; }
  .chat.has-conv { grid-template-columns: 1fr; }
  .chat.has-conv .chat-main { height: calc(100dvh - 132px); }
  .chat-back { display: inline-block; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { max-width: 100%; border-radius: 24px 24px 0 0; margin: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .sheet-grab { display: block; }
  .modal-card h3 { text-align: center; }
  .dash-grid { grid-template-columns: 1fr; }
  .hero-today { margin-left: 0; }
  .post-title { font-size: 16.5px; }
  .p-stats { width: 100%; }
}

@media (max-width: 480px) {
  .main { padding-top: 14px; }
  .card { padding: 15px; border-radius: 16px; }
  .msg { max-width: 88%; }
  .quick-log .btn { font-size: 15px; }
  .hero-today { gap: 18px; }
  .big { font-size: 24px; }
  .post-foot { gap: 12px; }
}
/* ============ v2 · iconos, campana, salas, perfil ============ */

.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic-md { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; }

.brand-ico svg { width: 19px; height: 19px; color: #261a02; }
.gate-emoji svg { width: 64px; height: 64px; color: var(--gold); filter: drop-shadow(0 6px 24px rgba(255, 159, 28, .45)); }
.tabbar-add svg { width: 26px; height: 26px; color: #261a02; }
.ti-ico .ic { width: 21px; height: 21px; }
.vote .ic { width: 16px; height: 16px; }
.btn-com .ic { width: 16px; height: 16px; }
.empty-emoji .ic { width: 46px; height: 46px; color: var(--gold); }
.chal-emoji .ic { width: 27px; height: 27px; }
.flame .ic { width: 30px; height: 30px; color: var(--gold); }
.chal-foot .ic { width: 15px; height: 15px; vertical-align: -2px; }

/* avatares con iniciales */
.avatar { color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .3px;
  background: linear-gradient(135deg, #7c4dff, #3f2d7a);
  border: 1.5px solid rgba(255, 255, 255, .22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.avatar.big { font-size: 26px; border-width: 2px; }
.avatar.big::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.avatar { position: relative; }

.gavatar {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .3px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  box-shadow: 0 2px 10px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.18);
}
.gavatar.sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }

/* botón de icono del header */
.icon-btn {
  width: 38px; height: 38px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border-radius: 11px; display: inline-grid; place-items: center; position: relative;
  border: 1px solid var(--line); text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--gold); background: var(--surface-2); border-color: var(--line-strong); text-decoration: none; }
.icon-btn .ic { width: 19px; height: 19px; }

/* campana */
.bell { position: relative; }
.bell-badge { position: absolute; top: -5px; right: -6px; }
.bell-panel {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 90;
  width: min(340px, calc(100vw - 24px));
  background: #161128; border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
  overflow: hidden; animation: sheetUp .2s ease both;
}
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.bell-list { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.notif {
  display: flex; gap: 10px; padding: 11px 14px; align-items: flex-start;
  color: var(--txt); border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background .12s;
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: rgba(255, 209, 102, .07); }
.notif-ic {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  display: grid; place-items: center; color: var(--gold);
  background: var(--gold-soft); border: 1px solid rgba(255,209,102,.2);
}
.notif-ic .ic { width: 16px; height: 16px; }
.notif-txt { font-size: 13px; line-height: 1.4; min-width: 0; }
.notif-txt b { color: var(--txt); }
.notif-txt i { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bell-empty { padding: 16px; margin: 0; text-align: center; }

/* etiquetas y acciones de post */
.flair {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: var(--gold); background: var(--gold-soft);
  border: 1px solid rgba(255, 209, 102, .25); border-radius: 6px;
  padding: 1px 7px; margin-left: 6px; vertical-align: 1px; text-transform: uppercase;
}
.post-actions { display: flex; gap: 3px; margin-left: auto; }
.act {
  width: 34px; height: 34px; border: 0; cursor: pointer;
  background: none; color: var(--muted); border-radius: 9px;
  display: inline-grid; place-items: center;
  transition: color .12s, background .12s, transform .12s;
}
.act:hover { color: var(--txt); background: var(--surface-2); }
.act:active { transform: scale(.92); }
.act.on { color: var(--gold); }
.act.del:hover { color: var(--red); }
.act .ic { width: 17px; height: 17px; }
.report-box { margin-top: 10px; }
.report-box form { display: flex; gap: 8px; align-items: center; }
.report-box .inp { margin: 0; flex: 1; }
.post-title a { color: var(--txt); }
.post-title a:hover { color: var(--gold); text-decoration: none; }
.post-title.detail { font-size: 21px; margin: 2px 0 8px; }
.mini-del {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 3px 6px; border-radius: 7px; vertical-align: -2px;
  transition: color .12s, background .12s;
}
.mini-del:hover { color: var(--red); background: rgba(248, 113, 113, .12); }
.mini-del .ic { width: 14px; height: 14px; }

/* páginas */
.page-h { display: flex; align-items: center; gap: 8px; margin: 2px 2px 14px; font-size: 18px; }
.page-h .ic { color: var(--gold); }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form .inp { margin: 0; flex: 1; }
.search-user {
  display: flex; align-items: center; gap: 11px; padding: 9px 4px;
  border-bottom: 1px solid var(--line); color: var(--txt);
}
.search-user:last-child { border-bottom: 0; }
.search-user:hover { text-decoration: none; color: var(--gold); }
.search-user span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.search-user i { font-style: normal; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* calendario de racha */
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; margin-top: 15px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted); font-weight: 600;
}
.cal-cell.on { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #261a02; border-color: transparent; }
.cal-cell.today { box-shadow: 0 0 0 2px rgba(255, 209, 102, .55); }
.nextbadge { border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.nextbadge-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.nextbadge-label .ic { width: 16px; height: 16px; color: var(--gold); }

/* chat: pestañas directos/salas */
.chat-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.ctab {
  flex: 1; text-align: center; color: var(--muted); font-weight: 700; font-size: 13px;
  padding: 8px 6px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
}
.ctab:hover { text-decoration: none; color: var(--txt); }
.ctab.on { color: var(--gold); background: rgba(20, 16, 32, .75); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.ctab .ic { width: 15px; height: 15px; }
.badge-join {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  color: #261a02; background: linear-gradient(135deg, var(--gold), var(--gold2));
}
.room-count { margin-left: auto; font-size: 12.5px; }
.msg .who { display: block; font-size: 11.5px; font-weight: 700; color: var(--gold); margin-bottom: 3px; }

/* perfil: banner y medallas */
.p-banner { height: 96px; border-radius: 16px; margin-bottom: 16px; border: 1px solid var(--line); }
.p-side { display: flex; flex-direction: column; gap: 8px; }
.admin { color: var(--gold); }
.admin .ic { width: 16px; height: 16px; vertical-align: -2px; }

/* ranking: podio */
.rk-pod {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #261a02;
}
.rk-1 { background: linear-gradient(135deg, #ffe29a, #f5b301); box-shadow: 0 2px 8px rgba(255, 190, 40, .4); }
.rk-2 { background: linear-gradient(135deg, #eef1f6, #b9c2cf); box-shadow: 0 2px 8px rgba(200, 210, 225, .3); }
.rk-3 { background: linear-gradient(135deg, #f2c49b, #c07a3a); box-shadow: 0 2px 8px rgba(210, 130, 60, .3); }
.rk-n { color: var(--muted); font-weight: 700; font-size: 13px; }
.medal-t1 { color: #d28a4e !important; }
.medal-t2 { color: #c7cedb !important; }
.medal-t3 { color: var(--gold) !important; }

/* insignias con iconos */
.badge span .ic { width: 24px; height: 24px; color: var(--gold); }
.badge span { line-height: 1.15; }

@media (max-width: 480px) {
  .cal { gap: 4px; }
  .cal-cell { border-radius: 6px; font-size: 10px; }
  .p-banner { height: 74px; }
  .report-box form { flex-wrap: wrap; }
}