/* ============================================================
   DUNGEON OF ETERNAL MAGIC — extra patterns
   notifications · friends panel · currency · season banner
   news · daily quests · party finder · achievements · floor progress
   ============================================================ */

/* ── Header currency / chips ─────────────────────────────────── */
.coin-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}
.coin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--text);
  cursor: default;
}
.coin .mark {
  width: 12px; height: 12px;
  display: inline-block;
  border-radius: 50%;
  flex: none;
}
.coin.gold   .mark { background: radial-gradient(circle at 35% 35%, var(--gold-bright), var(--gold-dim)); box-shadow: 0 0 6px var(--gold-glow); }
.coin.shard  .mark {
  background: linear-gradient(135deg, var(--cyan), #2a4d6b);
  box-shadow: 0 0 6px var(--cyan-glow);
  border-radius: 2px;
  transform: rotate(45deg);
  width: 10px; height: 10px;
}
.coin.key    .mark {
  background: radial-gradient(circle at 30% 30%, #d8b46e, #6b4d22);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.coin-sep {
  width: 1px; height: 14px; background: var(--line-soft);
}

/* ── Notifications bell + dropdown ───────────────────────────── */
.icon-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--line);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  cursor: pointer;
  transition: all calc(0.2s * var(--anim-mult, 1));
}
.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--gold-bright);
  background: rgba(212,175,106,0.05);
}
.icon-btn.is-on {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
  background: rgba(212,175,106,0.10);
}
.icon-btn .pip {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--gold-bright);
  color: var(--bg-0);
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 10px var(--gold-glow);
  font-family: var(--font-body);
}

/* ── User menu dropdown (avatar click) ───────────────────────── */
.user-menu-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.user-menu-trigger > button.row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.user-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 28px);
  background: rgba(10, 14, 23, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 70;
  padding: 10px 0 8px;
  animation: dropfade calc(0.18s * var(--anim-mult, 1)) ease both;
  overflow: hidden;
}
/* flechita centrada bajo el avatar: el avatar mide 34px y empieza tras el padding-left
   del trigger (~6px), así que su centro está a ~23px desde la izquierda del trigger,
   o lo que es lo mismo a (trigger_width − 23)px desde su derecha. Calculamos en runtime
   con una variable. */
.user-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: var(--user-menu-arrow-right, 22px);
  width: 12px; height: 12px;
  background: rgba(10, 14, 23, 0.97);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.user-menu-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.user-menu-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 3px;
}
.user-menu-section-label {
  padding: 8px 14px 4px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.user-menu-presence {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 10px 6px;
}
.user-menu-presence-item span:not(.presence-dot) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-presence-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  transition: all calc(0.15s * var(--anim-mult, 1)) ease;
}
.user-menu-presence-item:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
.user-menu-presence-item.active {
  background: rgba(212, 175, 106, 0.08);
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}
.user-menu-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 6px 0;
}
.user-menu-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background calc(0.15s * var(--anim-mult, 1)) ease, color calc(0.15s * var(--anim-mult, 1)) ease;
}
.user-menu-item:hover {
  background: rgba(212, 175, 106, 0.06);
  color: var(--gold-bright);
}
.user-menu-item.danger:hover {
  background: rgba(196, 90, 71, 0.10);
  color: #d77c6b;
}

/* ── Lateral menu (hamburger) button ─────────────────────────── */
.icon-btn-menu {
  width: 44px;
  height: 44px;
  border-color: var(--line-strong);
  background: rgba(212, 175, 106, 0.04);
}
.icon-btn-alert,
.icon-btn-friends {
  width: 44px;
  height: 44px;
  border-color: var(--line-strong);
  background: rgba(212, 175, 106, 0.04);
}
.icon-btn-menu.has-alert {
  border-color: #c45a47;
  color: #fff;
  background: rgba(196, 90, 71, 0.18);
  box-shadow: 0 0 14px rgba(196, 90, 71, 0.45);
  animation: chat-pulse 1.8s ease-in-out infinite;
}
.icon-btn-alert.has-alert {
  border-color: #c45a47;
  color: #fff;
  background: rgba(196, 90, 71, 0.18);
  box-shadow: 0 0 14px rgba(196, 90, 71, 0.45);
  animation: chat-pulse 1.8s ease-in-out infinite;
}
.icon-btn-friends.has-online {
  border-color: rgba(109, 228, 255, 0.32);
  background: rgba(109, 228, 255, 0.08);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(109, 228, 255, 0.18);
}

/* ── Chat button (bigger + alert glow when unread) ───────────── */
.icon-btn-chat {
  width: 44px;
  height: 44px;
  border-color: var(--line-strong);
  background: rgba(212, 175, 106, 0.04);
}
.icon-btn-chat.has-unread {
  border-color: #c45a47;
  color: #fff;
  background: rgba(196, 90, 71, 0.18);
  box-shadow: 0 0 14px rgba(196, 90, 71, 0.45);
  animation: chat-pulse 1.8s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(196, 90, 71, 0.45); }
  50%      { box-shadow: 0 0 22px rgba(196, 90, 71, 0.75); }
}
.icon-btn .pip.pip-strong {
  background: #c45a47;
  color: #fff;
  min-width: 18px; height: 18px;
  font-size: 10.5px;
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 12px rgba(196, 90, 71, 0.85);
  top: -2px; right: -2px;
}

/* Home download CTA */
.download-cta {
  overflow: hidden;
  isolation: isolate;
  border-color: var(--gold);
  color: var(--gold-bright);
  background:
    linear-gradient(110deg, transparent 0%, transparent 34%, rgba(240, 210, 138, 0.22) 48%, transparent 62%, transparent 100%),
    radial-gradient(circle at 50% -40%, rgba(240, 210, 138, 0.36), transparent 48%),
    linear-gradient(180deg, rgba(212, 175, 106, 0.24), rgba(212, 175, 106, 0.06));
  background-size: 240% 100%, 100% 100%, 100% 100%;
  background-position: 140% 0, 0 0, 0 0;
  box-shadow:
    0 0 0 1px rgba(212, 175, 106, 0.22) inset,
    0 0 22px rgba(212, 175, 106, 0.18),
    0 10px 34px rgba(0, 0, 0, 0.34);
}
.download-cta::before {
  z-index: 1;
}
.download-cta::after {
  z-index: 1;
}
.download-cta > * {
  position: relative;
  z-index: 2;
}
.download-cta:before,
.download-cta:after {
  pointer-events: none;
}
.download-cta::before {
  animation: download-corner-pulse 2.8s ease-in-out infinite;
}
.download-cta::after {
  animation: download-corner-pulse 2.8s ease-in-out infinite reverse;
}
.download-cta:hover {
  transform: translateY(-1px);
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 1px rgba(240, 210, 138, 0.34) inset,
    0 0 32px rgba(212, 175, 106, 0.34),
    0 14px 42px rgba(0, 0, 0, 0.42);
}
.download-cta svg:first-child {
  animation: download-sigil 2.4s ease-in-out infinite;
}
.download-cta {
  animation:
    download-breath 3.2s ease-in-out infinite,
    download-shimmer 4.8s ease-in-out infinite;
}
@keyframes download-breath {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(212, 175, 106, 0));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(212, 175, 106, 0.22));
  }
}
@keyframes download-shimmer {
  0%, 42% {
    background-position: 140% 0, 0 0, 0 0;
  }
  72%, 100% {
    background-position: -140% 0, 0 0, 0 0;
  }
}
@keyframes download-corner-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes download-sigil {
  0%, 100% {
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 0 0 rgba(240, 210, 138, 0));
  }
  50% {
    transform: rotate(18deg) scale(1.08);
    filter: drop-shadow(0 0 8px rgba(240, 210, 138, 0.55));
  }
}

.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 14px;
  width: 380px;
  max-height: 460px;
  background: rgba(10,14,23,0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  z-index: 60;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: dropfade calc(0.18s * var(--anim-mult, 1)) ease both;
}
@keyframes dropfade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.dropdown::before {
  content: "";
  position: absolute;
  top: -6px; right: 14px;
  width: 12px; height: 12px;
  background: rgba(10,14,23,0.96);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.dropdown-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
}
.dropdown-head .clear {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}
.dropdown-head .clear:hover { color: var(--gold-bright); }
.dropdown-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.notif-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 16px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item.unread { border-left-color: var(--gold); }
.notif-item.unread::before {
  content: "";
  position: absolute;
  top: 18px; right: 14px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-glow);
}
.notif-item .ni-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex: none;
}
.notif-item .ni-text {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
}
.notif-item .ni-text b {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 500;
}
.notif-item .ni-time {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  margin-top: 2px;
}
.notif-actions {
  display: flex; gap: 6px;
  margin-top: 8px;
}
.dropdown-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ── Lateral panel tabs ──────────────────────────────────────── */
.lateral-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 14, 0.4);
}
.lateral-tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  transition: color calc(0.15s * var(--anim-mult, 1)) ease, background calc(0.15s * var(--anim-mult, 1)) ease;
}
.lateral-tab:hover { color: var(--gold-dim); background: rgba(212, 175, 106, 0.04); }
.lateral-tab.active { color: var(--gold-bright); }
.lateral-tab.active::after {
  content: "";
  position: absolute;
  left: 14%; right: 14%; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}
.lateral-tab-count {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 18px; height: 16px;
  padding: 0 5px;
  font-size: 9.5px;
  border-radius: 10px;
  background: rgba(212, 175, 106, 0.18);
  color: var(--gold-bright);
  letter-spacing: 0;
}
.lateral-tab-count.alert {
  background: #b14b3b;
  color: #fff;
  box-shadow: 0 0 8px rgba(177, 75, 59, 0.5);
}

/* ── Friends slide-out panel ─────────────────────────────────── */
.friends-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: default;
}
.friends-panel {
  position: fixed;
  top: 0; right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-left: 1px solid var(--line-strong);
  box-shadow: -20px 0 60px rgba(0,0,0,0.55);
  z-index: 80;
  display: flex; flex-direction: column;
  animation: slideright calc(0.28s * var(--anim-mult, 1)) cubic-bezier(.2,.7,.2,1) both;
}
@keyframes slideright { from { transform: translateX(100%); } to { transform: none; } }
.friends-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.friends-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.06em;
}
.friends-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.friend-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}
.friend-row:hover { background: rgba(212,175,106,0.05); }
.friend-row .fr-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.friend-row .fr-meta {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.friend-row .fr-status[data-s="in_dungeon"] { color: var(--cyan); }
.friend-row .fr-status[data-s="in_town"]    { color: var(--success); }
.friend-row .fr-status[data-s="afk"]        { color: var(--gold-dim); }
.fr-invite {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
}
.fr-invite:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ── Season banner ───────────────────────────────────────────── */
.season-banner {
  position: relative;
  margin: 28px 0 36px;
  padding: 28px 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 60% 100% at 100% 0%, rgba(184,156,255,0.16), transparent 60%),
    radial-gradient(ellipse 60% 100% at 0% 100%, rgba(109,228,255,0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.season-banner::before {
  content: "";
  position: absolute;
  top: 12px; left: 12px;
  width: 22px; height: 22px;
  border-top: 1px solid var(--gold); border-left: 1px solid var(--gold);
  opacity: 0.6;
}
.season-banner::after {
  content: "";
  position: absolute;
  bottom: 12px; right: 12px;
  width: 22px; height: 22px;
  border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold);
  opacity: 0.6;
}
.season-banner .sb-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--purple);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.season-banner .sb-eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
  animation: pulse calc(2s / var(--anim-mult, 1)) ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.season-banner h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
  line-height: 1.05;
}
.season-banner .sb-tag {
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 16px;
}
.season-banner .sb-meta {
  display: flex; gap: 28px; align-items: center;
}
.season-banner .sb-meta .label {
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.season-banner .sb-meta .value {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.sb-progress {
  margin-top: 16px;
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  max-width: 480px;
}
.sb-progress .sb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  box-shadow: 0 0 12px var(--purple);
  border-radius: 999px;
  position: relative;
}
.sb-rewards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-reward {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.02);
  min-width: 240px;
}
.sb-reward.is-locked { opacity: 0.45; }
.sb-reward .sb-slot {
  width: 36px; height: 36px;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex: none;
}
.sb-reward .sb-slot svg { width: 70%; height: 70%; }
.sb-reward .sb-tier {
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim);
}
.sb-reward .sb-name {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

@media (max-width: 880px) {
  .season-banner { grid-template-columns: 1fr; padding: 22px; }
  .sb-rewards { flex-direction: row; flex-wrap: wrap; }
}

/* ── Home grid (news + quests) ───────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  margin-top: 18px;
}
@media (max-width: 880px) { .home-grid { grid-template-columns: 1fr; } }

.news-list {
  display: flex; flex-direction: column;
}
.news-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.15s;
}
.news-item:hover { background: rgba(212,175,106,0.03); }
.news-item:last-child { border-bottom: none; }
.news-tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-dim);
  white-space: nowrap;
}
.news-tag[data-kind="patch"]  { color: var(--cyan);   border-color: rgba(109,228,255,0.30); }
.news-tag[data-kind="lore"]   { color: var(--purple); border-color: rgba(184,156,255,0.30); }
.news-tag[data-kind="event"]  { color: var(--gold-bright); border-color: var(--line-strong); }
.news-title {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.25;
}
.news-blurb { color: var(--text-soft); font-size: 13px; line-height: 1.55; }
.news-date {
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ── Daily quests panel ─────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.04em;
  margin: 0;
}
.panel-head .reset {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 6px;
}
.quest {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.quest:last-child { border-bottom: none; }
.quest .q-icon {
  width: 38px; height: 38px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.quest .q-icon svg { width: 70%; height: 70%; }
.quest .q-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 6px;
}
.quest .q-bar {
  height: 4px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 4px;
}
.quest .q-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  box-shadow: 0 0 6px var(--gold-glow);
  border-radius: 999px;
}
.quest .q-progress {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.quest .q-reward {
  text-align: right;
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.quest.is-done .q-icon { color: var(--success); border-color: rgba(110,208,154,0.4); }
.quest.is-done .q-title { color: var(--success); text-decoration: line-through; opacity: 0.7; }
.quest.is-done .q-fill { background: var(--success); box-shadow: 0 0 6px rgba(110,208,154,0.5); }

/* ── Party Finder modal & cards ──────────────────────────────── */
.party-modal {
  max-width: 720px;
  padding: 32px 36px;
}
.party-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.party-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.15s, background 0.15s;
}
.party-row:hover { border-color: var(--line-strong); background: rgba(212,175,106,0.04); }
.party-row .p-floor {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
  letter-spacing: 0.04em;
  text-align: center;
  min-width: 44px;
}
.party-row .p-floor-l {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}
.party-row .p-host {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
}
.party-row .p-note {
  color: var(--text-soft);
  font-size: 12.5px;
  margin-top: 3px;
  line-height: 1.4;
}
.party-row .p-meta {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}
.party-row .p-slots {
  display: flex; gap: 4px;
  margin-bottom: 6px;
}
.party-row .p-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
}
.party-row .p-dot.filled { background: var(--gold); box-shadow: 0 0 6px var(--gold-glow); }
.party-row .p-size {
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.party-row.is-full { opacity: 0.5; }

/* ── Achievements grid ──────────────────────────────────────── */
.achv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.achv {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  align-items: start;
  position: relative;
  transition: border-color 0.2s;
}
.achv:hover { border-color: var(--line-strong); }
.achv.is-locked { opacity: 0.55; }
.achv.is-locked .achv-icon { color: var(--text-faint); border-color: var(--line-soft); }
.achv-icon {
  width: 56px; height: 56px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.achv[data-rarity="uncommon"]  .achv-icon { color: var(--r-uncommon); box-shadow: 0 0 0 1px rgba(92,227,154,0.30) inset; }
.achv[data-rarity="rare"]      .achv-icon { color: var(--r-rare); box-shadow: 0 0 0 1px rgba(109,184,255,0.34) inset; }
.achv[data-rarity="epic"]      .achv-icon { color: var(--r-epic); box-shadow: 0 0 0 1px rgba(192,132,255,0.40) inset; }
.achv[data-rarity="legendary"] .achv-icon { color: var(--r-legendary); box-shadow: 0 0 0 1px rgba(240,192,96,0.46) inset, 0 0 14px rgba(240,192,96,0.18); }
.achv[data-rarity="mythic"]    .achv-icon { color: var(--r-mythic); box-shadow: 0 0 0 1px rgba(255,127,180,0.50) inset; }
.achv-icon svg { width: 60%; height: 60%; }
.achv-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.achv-desc {
  color: var(--text-soft);
  font-size: 12.5px;
  margin-top: 4px;
  line-height: 1.5;
}
.achv-meta {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.achv-progress {
  margin-top: 8px;
  height: 4px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.achv-progress .fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
}

/* ── Floor progression viz ───────────────────────────────────── */
.floor-prog {
  margin-top: 22px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
}
.floor-prog-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.floor-prog-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.floor-prog-current {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.floor-prog-head .legend {
  display: flex; gap: 14px; font-size: 9px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim);
}
.floor-prog-head .legend .sw {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px;
  vertical-align: middle;
}
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
  gap: 5px;
}
.floor-cell {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: var(--bg-3);
  position: relative;
  cursor: default;
  transition: transform 0.12s;
}
.floor-cell[data-state="cleared"] {
  background: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(212,175,106,0.4) inset;
}
.floor-cell[data-state="deepest"] {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow), 0 0 0 1px var(--cyan) inset;
}
.floor-cell[data-state="boss"] {
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple) inset;
}
.floor-cell:hover { transform: scale(1.4); z-index: 2; }

@media (max-width: 760px) {
  .floor-prog-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .floor-prog-head .legend {
    flex-wrap: wrap;
  }
}
.floor-cell::after {
  content: attr(data-n);
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-0);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 3px 7px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.floor-cell:hover::after { opacity: 1; }

/* ── Chat modal ─────────────────────────────────────────────── */
.modal.chat-modal {
  max-width: 960px;
  padding: 0;
  overflow: hidden;
  height: min(720px, 86vh);
  display: flex;
}
.chat-modal .close {
  z-index: 6;
  top: 14px;
  right: 14px;
}
.chat-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  width: 100%;
  height: 100%;
}
.chat-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(8, 9, 14, 0.4);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.chat-sidebar-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0;
  color: var(--text);
}
.chat-sidebar-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.chat-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background calc(0.15s * var(--anim-mult, 1)) ease;
}
.chat-list-text { min-width: 0; }
.chat-list-item:hover { background: rgba(212, 175, 106, 0.04); }
.chat-list-item.active {
  background: rgba(212, 175, 106, 0.08);
  border-left-color: var(--gold-bright);
}
.chat-list-item.has-unread {
  background: rgba(196, 90, 71, 0.06);
  border-left-color: #c45a47;
}
.chat-list-item.has-unread.active {
  background: rgba(196, 90, 71, 0.12);
}
.chat-list-preview.unread {
  color: var(--text);
  font-weight: 500;
}
.chat-list-name {
  font-family: var(--font-display);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-list-name-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-linklike {
  cursor: pointer;
  transition: color calc(0.15s * var(--anim-mult, 1)) ease, opacity calc(0.15s * var(--anim-mult, 1)) ease;
}
.chat-linklike:hover,
.chat-linklike:focus-visible {
  color: var(--gold-bright);
  opacity: 1;
}
.chat-list-preview {
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.chat-list-time {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.chat-unread-pip {
  background: #b14b3b;
  color: #fff;
  font-size: 10px;
  padding: 0 6px;
  height: 16px;
  min-width: 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.chat-thread {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 72px 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 14, 0.25);
}
.chat-thread-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
}
.chat-thread-link {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}
.chat-thread-head-main {
  min-width: 0;
  flex: 1;
}
.chat-thread-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  padding-right: 6px;
  flex-wrap: wrap;
}
.chat-head-action {
  min-height: 36px;
  padding-inline: 14px;
}
.chat-head-action.is-active {
  border-color: rgba(212, 175, 106, 0.45);
  color: var(--gold-bright);
}
.chat-thread-meta {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}
.chat-report-banner {
  margin: 12px 22px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.chat-report-banner.ok {
  border-color: rgba(63, 185, 106, 0.35);
  color: #88d9a7;
}
.chat-report-banner.error {
  border-color: rgba(196, 90, 71, 0.4);
  color: #d77c6b;
}
.chat-report-card {
  margin: 12px 22px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(8, 9, 14, 0.6);
  display: grid;
  gap: 12px;
}
.chat-report-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
}
.chat-report-copy {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.chat-report-grid {
  display: grid;
  gap: 12px;
}
.chat-report-select,
.chat-report-input {
  width: 100%;
}
.chat-report-input {
  min-height: 88px;
}
.chat-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty-thread {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
  max-width: 360px;
}
.chat-bubble {
  max-width: 70%;
  padding: 8px 12px 6px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
  color: var(--text);
}
.chat-bubble.mine {
  align-self: flex-end;
  background: rgba(212, 175, 106, 0.16);
  border: 1px solid rgba(212, 175, 106, 0.32);
  border-top-right-radius: 4px;
  color: var(--text);
}
.chat-bubble-time {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 4px;
  text-align: right;
}
.chat-composer {
  border-top: 1px solid var(--line);
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(8, 9, 14, 0.4);
}
.chat-composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.chat-input {
  width: 100%;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color calc(0.15s * var(--anim-mult, 1)) ease;
}
.chat-input:focus { border-color: var(--gold-dim); }
.chat-send-btn {
  align-self: stretch;
  padding: 0 22px;
  white-space: nowrap;
  min-width: 110px;
}
.chat-error {
  color: #d77c6b;
  font-size: 12px;
}
.chat-char-count {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: right;
}
.chat-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
}
.chat-empty h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-soft);
  margin: 0;
}
.chat-empty p { font-size: 13px; max-width: 320px; margin: 0; }

@media (max-width: 720px) {
  .modal.chat-modal { height: 90vh; max-width: 96vw; }
  .chat-grid { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
}

/* ============================================================
   RESPONSIVE — components extras (mobile/tablet)
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .friends-panel { width: 340px; }
  .modal.chat-modal { max-width: 96vw; height: 84vh; }
  .chat-grid { grid-template-columns: 240px 1fr; }
  .home-grid { grid-template-columns: 1fr; gap: 18px; }
  .season-banner { grid-template-columns: 1fr; padding: 22px; }
  .sb-rewards { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sb-reward { flex: 1 1 calc(50% - 8px); min-width: 140px; }
  .news-item { grid-template-columns: auto 1fr; }
  .news-item .news-date { grid-column: 1 / -1; text-align: left; padding-top: 4px; }
  .party-row { grid-template-columns: auto 1fr auto; gap: 12px; }
  .achv-grid { grid-template-columns: 1fr; }
  .floor-grid { grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); }
  /* Tweaks panel: en tablet lo recogemos como botón flotante */
  .tweaks-trigger { right: 10px; bottom: 10px; }
  .tweaks-panel { width: min(320px, 92vw); }
}

/* Mobile */
@media (max-width: 600px) {
  /* Header icons */
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn-menu, .icon-btn-chat, .icon-btn-alert, .icon-btn-friends { width: 40px; height: 40px; }
  .coin-chips { padding: 4px 6px; }
  .coin { font-size: 11px; padding: 2px 6px; gap: 4px; }
  .coin .mark { width: 9px; height: 9px; }
  /* Lateral panel a pantalla completa */
  .friends-panel { width: 100vw; max-width: 100vw; border-left: none; }
  .friends-panel-head { padding: 14px 18px; }
  .friend-row { padding: 10px 16px; }
  .lateral-tab { font-size: 10px; padding: 10px 4px; }
  /* User menu */
  .user-menu { width: calc(100vw - 24px); max-width: 320px; right: 0; }
  .user-menu-presence { grid-template-columns: repeat(3, 1fr); }
  .user-menu-head { padding: 10px 12px 12px; }
  .user-menu-item { padding: 10px 12px; }
  /* Chat: ocultar sidebar en mobile, mostrar solo el thread activo */
  .modal.chat-modal { max-width: 100vw; height: 100vh; border-radius: 0; }
  .chat-grid { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-thread-head { padding: 12px 16px; }
  .chat-thread-head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-right: 52px;
  }
  .chat-thread-actions {
    width: 100%;
    margin-left: 0;
    padding-right: 0;
  }
  .chat-head-action {
    flex: 1 1 0;
    justify-content: center;
  }
  .chat-report-banner,
  .chat-report-card {
    margin-left: 14px;
    margin-right: 14px;
  }
  .chat-messages { padding: 14px 14px; }
  .chat-composer { padding: 10px 14px 14px; }
  .chat-composer-row { grid-template-columns: 1fr auto; gap: 8px; }
  .chat-send-btn { min-width: 92px; padding: 0 14px; font-size: 12px; }
  .chat-bubble { max-width: 84%; }
  /* Cuando el modal de chat está abierto en mobile y NO hay conversación activa,
     mostramos sidebar a pantalla completa */
  .modal.chat-modal:not(:has(.chat-thread-head)) .chat-sidebar {
    display: flex; flex-direction: column;
  }
  /* Dropdown notifications: full width minus padding */
  .dropdown { width: calc(100vw - 28px); max-width: 360px; }
  /* Notificación item */
  .notif-item { grid-template-columns: 28px 1fr; padding: 10px 14px; }
  .notif-item::before { right: 10px; }
  /* Season banner */
  .season-banner h2 { font-size: clamp(26px, 7vw, 36px); }
  .season-banner .sb-meta { flex-wrap: wrap; gap: 12px; }
  /* Parties */
  .party-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .party-row .p-slots { justify-self: flex-start; }
  /* Floor grid en mobile: celdas más pequeñas */
  .floor-grid { grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 4px; }
  .floor-cell { width: 22px; height: 22px; }
}

/* XS */
@media (max-width: 420px) {
  .friends-panel-head h3 { font-size: 14px; }
  .lateral-tab { font-size: 9.5px; gap: 4px; }
  .lateral-tab-count { min-width: 14px; height: 14px; font-size: 9px; }
  .user-menu { width: calc(100vw - 16px); }
  .user-menu-presence { grid-template-columns: 1fr; }
  .user-menu-presence-item { padding: 6px 6px; font-size: 10.5px; }
  .chat-send-btn { font-size: 11px; padding: 0 10px; min-width: 72px; }
  .modal h2 { font-size: 20px; }
}

/* Pantallas táctiles: aumenta un poco el hit target */
@media (hover: none) and (pointer: coarse) {
  .btn { padding: 12px 18px; }
  .icon-btn { width: 40px; height: 40px; }
  .nav-link { padding: 10px 4px; }
  .chat-list-item { padding: 12px 14px; }
}
