/* ============================================================
   layout.css — HUD frame, top bar, docks, panels
   ============================================================ */

/* ---------------- top bar ---------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 30px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  padding: 4px;
  border-radius: 14px;
  transition: transform var(--t) var(--ease);
}
.brand:hover { color: var(--text); transform: translateY(-1px); }
.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(80, 160, 220, 0.35));
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.brand-text b { font-size: 17px; font-weight: 650; letter-spacing: 0.06em; }
.brand-text i {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.32em;
  color: var(--text-3);
  text-transform: uppercase;
}

.topbar-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.5);
  backdrop-filter: var(--blur);
}

.topbar-note[hidden] { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }

/* live numbers live in the header now, not in a floating card */
.topbar-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 6px;
  padding: 7px 15px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.45);
  backdrop-filter: var(--blur);
  box-shadow: 0 18px 44px -34px rgba(0, 0, 0, 0.9);
}
.tstat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}
.tstat b {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: #eef6ff;
}
.tstat i { font-style: normal; font-size: 10px; letter-spacing: 0.05em; }
.tstat + .tstat { padding-left: 12px; border-left: 1px solid var(--stroke); }
.tstat-text { font-size: 10px; }
.tstat-sun { color: rgba(240, 178, 122, 0.82); }
.tstat-sun .sun-glyph { font-size: 10px; color: var(--warm); }

/* ---------------- mood rail (left) ---------------- */
.mood-dock {
  position: fixed;
  z-index: 22;
  top: 92px;
  left: 24px;
  width: 238px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--blur);
}
.mood-head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-align: left;
  transition: background var(--t-fast);
}
.mood-head:hover { background: var(--fill); }
.mood-head .spark { width: 15px; height: 15px; color: var(--accent); }
.mood-head-label { color: var(--text-2); }
.mood-current {
  margin-left: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  color: #cfe6fb;
  background: var(--accent-soft);
  border: 1px solid rgba(109, 179, 238, 0.24);
}
.mood-head .chev { margin-left: auto; display: block; transition: transform var(--t) var(--ease); }
.mood-dock.is-collapsed .mood-head .chev { transform: rotate(-90deg); }
.mood-dock.is-collapsed { width: 224px; }
.mood-dock.is-collapsed .mood-body { display: none; }

.mood-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: none;
}
.mood-dock.is-collapsed .mood-body { max-height: none; opacity: 1; }
.mood-dock.is-collapsed { width: 238px; }

.mood-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px 2px 6px;
}

/* ---------------- hot panel ---------------- */
.hot-panel {
  position: fixed;
  z-index: 20;
  top: 92px;
  right: 24px;
  bottom: 24px;
  width: 358px;
  max-height: none;
  box-shadow: 0 26px 64px -44px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  padding: 6px;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.hot-panel[hidden] { display: none; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 10px 10px 14px;
}
.panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-title h2 { font-size: 14.5px; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; }
.title-orb {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffd9b0, #e2795a 46%, #8c3b2c 100%);
  box-shadow: 0 0 18px rgba(226, 121, 90, 0.45);
}
.panel-tools { display: flex; align-items: center; gap: 4px; position: relative; }

.hot-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 2px 6px 6px;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 22px), transparent 100%);
}
.panel-foot { padding: 8px 8px 8px; border-top: 1px solid var(--stroke); }

.panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
}

/* ---------------- stat card ---------------- */
.stat-card {
  position: fixed;
  z-index: 18;
  left: 26px;
  bottom: 26px;
  width: 210px;
  padding: 14px 16px 12px;
}
.stat-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  color: var(--text-3);
  text-transform: uppercase;
}
.stat-rows { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 10px; }
.stat-row { display: flex; align-items: baseline; gap: 8px; }
.stat-row b {
  font-family: var(--font-num);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #f2f7ff;
  line-height: 1.15;
  min-width: 34px;
}
.stat-row span { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.04em; }
.stat-sun { border-top: 0; padding-top: 2px; font-size: 9.5px; color: rgba(240, 178, 122, 0.72); display: flex; align-items: center; gap: 5px; }
.sun-glyph { font-size: 10px; color: var(--warm); }
.stat-foot {
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- topic card ---------------- */
.topic-card {
  position: fixed;
  z-index: 18;
  right: 26px;
  bottom: 26px;
  width: 352px;
  padding: 16px 18px 18px;
}
.topic-card[hidden] { display: none !important; }

/* ---------- poll mini ranking in the side panel ---------- */
.poll-mini { padding: 10px 12px 12px; border-top: 1px solid var(--stroke); }
.poll-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.poll-mini-title { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 0.08em; color: var(--text-3); }
.poll-mini-title .icon { width: 14px; height: 14px; color: var(--accent); }
.poll-mini-title b { color: var(--text-2); font-weight: 500; }
.poll-mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 2px;
  border-radius: 7px;
  font-size: 11.5px;
  color: #cfdae8;
  text-align: left;
}
.poll-mini-row:hover { background: rgba(255, 255, 255, 0.045); }
.poll-mini-rank { width: 14px; flex: none; font-family: var(--font-num); font-size: 10px; color: var(--text-3); }
.poll-mini-q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-mini-row b { flex: none; font-family: var(--font-num); font-size: 10px; font-weight: 500; color: var(--text-3); }
.poll-mini-empty { padding: 3px 0; font-size: 10.5px; color: var(--text-3); }

/* topic is part of the right-hand panel now, not a floating card */
.topic-card.topic-inline {
  position: static;
  width: auto;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--stroke);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(240, 178, 122, 0.05), rgba(10, 15, 25, 0.96) 26%, rgba(10, 15, 25, 0.99));
  box-shadow: 0 -18px 28px -26px rgba(0, 0, 0, 0.95);
}
.topic-inline .topic-head { margin-bottom: 6px; }
.topic-inline h3 { font-size: 12.5px; -webkit-line-clamp: 1; margin-bottom: 2px; }
.topic-inline p { font-size: 10.5px; -webkit-line-clamp: 1; margin-bottom: 8px; }
.topic-inline .ghost-btn { height: 30px; font-size: 11px; }
.topic-inline.is-flip #topicTitle,
.topic-inline.is-flip #topicDesc { animation: topic-flip 0.5s var(--ease) both; }
@keyframes topic-flip {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.topic-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.topic-head .icon { width: 15px; height: 15px; color: var(--warm); }
.topic-card h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-card p {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- compose ---------------- */
.compose-wrap {
  position: fixed;
  z-index: 19;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 30px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f4fbff;
  background: linear-gradient(135deg, #7cc0f2 0%, #3f7fd6 55%, #3468bd 100%);
  box-shadow: 0 18px 44px -14px rgba(63, 127, 214, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 -8px 24px -12px rgba(255, 255, 255, 0.5) inset;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), filter var(--t);
}
.compose-btn .icon { width: 18px; height: 18px; }
.compose-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px -14px rgba(63, 127, 214, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  filter: brightness(1.04);
}
.compose-btn:active { transform: translateY(0) scale(0.985); }
.compose-hint {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: rgba(150, 172, 198, 0.55);
  text-transform: uppercase;
}

/* ---------------- mobile chrome ---------------- */
.mobile-bar { display: none; }
.hot-fab { display: none; }

/* ---------------- friend links (left, bottom) ---------------- */
.links-panel {
  position: fixed;
  z-index: 18;
  left: 24px;
  bottom: 24px;
  width: 238px;
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--blur);
}
.links-panel[hidden] { display: none !important; }
.links-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 5px 7px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.links-title { display: inline-flex; align-items: center; gap: 6px; }
.links-title .icon { width: 14px; height: 14px; color: var(--accent); }
.links-title b { color: var(--text-2); font-weight: 500; }
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #cfdae8;
  font-size: 10.5px;
  text-decoration: none;
  min-width: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.link-card:hover { color: #eaf4ff; border-color: var(--stroke-strong); background: rgba(255, 255, 255, 0.055); }
.link-card img { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.link-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-panel.is-collapsed { width: 168px; }
.links-panel.is-collapsed .links-grid { display: none; }
.links-panel.is-collapsed .links-head .icon-btn .icon { transform: rotate(180deg); }