/* Global burrow page */
.page-chat { background: var(--cream); --gb-head: 112px; }

.gb-top {
  background: linear-gradient(90deg, var(--cream) 50%, var(--lilac) 50%);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.gb-top::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(180deg, var(--p900) 0 10px, transparent 10px 20px);
  opacity: .14; transform: translateX(-1px);
}
.gb-top-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-top: 48px; padding-bottom: 40px; position: relative; z-index: 1;
}
/* title uses the shared .h1 scale; only spacing is set here */
.gb-lede { font-size: 17px; color: var(--muted); font-weight: 500; line-height: 1.5; margin: 14px 0 0; max-width: 540px; }
.gb-top-art { width: 360px; flex: none; }
.gb-top-art svg { width: 100%; height: auto; display: block; }
.gb-bubble { transition: transform .3s ease; }
.gb-top-art:hover .gb-bubble-a { transform: translateY(-3px); }
.gb-top-art:hover .gb-bubble-b { transform: translateY(-5px); }

/* live room numbers */
.gb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 10px; margin: 22px 0 0; }
.gb-stats > div {
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 14px; min-width: 0;
  box-shadow: 0 2px 0 rgba(46,21,72,.08);
}
.gb-stats > div:first-child { background: var(--p900); border-color: var(--p900); box-shadow: 0 3px 0 #12061f; }
.gb-stats > div:first-child dt { color: var(--p300); }
.gb-stats > div:first-child dd { color: #fff; }
.gb-stats dt { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.gb-stats dd { margin: 2px 0 0; font-size: 21px; font-weight: 900; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }

/* body layout */
.gb-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start;
  padding-top: 24px; padding-bottom: 72px;
}
.gb-chat-col { position: sticky; top: calc(var(--gb-head) + 16px); min-width: 0; }
.gb-chat {
  height: calc(100vh - var(--gb-head) - 40px); min-height: 560px; max-height: 920px;
  display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 2px solid var(--p900); border-radius: 26px;
  box-shadow: 0 6px 0 var(--p900); overflow: hidden;
}
.gb-chat > * { flex: none; }
.gb-chat > .bc-body { flex: 1 1 auto; min-height: 0; }

/* side cards */
.gb-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gb-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 18px 18px 20px;
}
.gb-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.gb-card-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.gb-card-note { font-size: 13px; font-weight: 700; color: var(--muted); }
.gb-card-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; margin: -10px -8px; border-radius: 10px; font-size: 13.5px; font-weight: 800; color: var(--p700); }
.gb-card-link:hover { color: var(--p900); text-decoration: underline; }

/* you */
.gb-you { background: var(--lilac); border-color: var(--lilac3); }
.gb-you-text { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0 0 14px; font-weight: 500; }
.gb-you-row { display: flex; align-items: center; gap: 12px; }
.gb-avatar {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--p900); color: var(--p300); font-weight: 900; font-size: 19px;
}
.gb-you-id { display: flex; flex-direction: column; min-width: 0; }
.gb-you-id b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-you-id span { font-size: 13px; color: var(--muted); font-weight: 600; }
.gb-bag { margin-top: 14px; background: #fff; border: 1px solid var(--lilac3); border-radius: 14px; padding: 12px; }
.gb-bag-top, .gb-bag { font-size: 13px; }
.gb-bag-top { display: flex; justify-content: space-between; align-items: baseline; }
.gb-bag:not(:has(.gb-bag-top)) { display: flex; justify-content: space-between; }
.gb-bag-label { color: var(--muted); font-weight: 700; }
.gb-bag-num { font-weight: 900; font-size: 16px; color: var(--ink); }
.gb-bag-bar { height: 8px; border-radius: 9px; background: var(--lilac2); overflow: hidden; margin-top: 10px; }
.gb-bag-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--p500), var(--p700)); }
.gb-bag-bar.is-core i { background: var(--p900); }
.gb-bag-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.gb-bag-act { margin-top: 12px; min-height: 44px; }

/* talking now */
.gb-here[hidden] { display: none; }
.gb-here-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gb-here-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 12px; min-width: 0; }
.gb-here-item.is-me { background: var(--lilac); }
.gb-here-av {
  width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-weight: 900; font-size: 13px; border: 1.5px solid rgba(46,21,72,.1);
}
.gb-here-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; }
.gb-here-name b { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-here-name em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--p600); flex: none; }
.gb-here-tag { flex: none; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--lilac2); color: var(--p800); }
.gb-here-tag.is-core { background: var(--p900); color: #fff; }
.gb-here-time { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.gb-here-more { font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 0 0; }

/* layers */
.gb-layers-body { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.gb-onion { width: 96px; height: 96px; display: block; }
.gb-layer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.gb-layer-list li { display: flex; gap: 10px; align-items: flex-start; }
.gb-layer-list li > div { min-width: 0; }
.gb-layer-list b { font-size: 14px; font-weight: 800; }
.gb-layer-list p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 500; }
.gb-layer-list p b { font-size: 13px; color: var(--p700); }
/* small onion icons, same shapes as the chat tabs (not form controls) */
.gb-ring { width: 20px; height: 18px; flex: none; margin-top: 1px; display: block; }
.gb-buy { margin-top: 16px; }
.gb-fine { margin: 10px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.4; }

/* hot rooms */
.gb-hot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gb-hot-item {
  display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px; margin: 0 -8px; border-radius: 14px; transition: background .15s;
}
.gb-hot-item:hover { background: var(--lilac); }
.gb-hot-rank { font-size: 13px; font-weight: 900; color: var(--muted); text-align: center; }
.gb-hot-img {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: var(--lilac2);
  display: grid; place-items: center; font-weight: 900; color: var(--p700);
}
.gb-hot-img img, .gb-hot-img svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.gb-hot-main { display: flex; flex-direction: column; min-width: 0; }
.gb-hot-main b { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-hot-main span { font-size: 12.5px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-hot-num { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; font-weight: 700; }
.gb-hot-num b { font-size: 13.5px; font-weight: 800; }
.gb-hot-num .up { color: var(--up); }
.gb-hot-num .down { color: var(--down); }
.gb-hot-empty { font-size: 13.5px; color: var(--muted); font-weight: 600; padding: 6px 0; }
.gb-hot-empty a, .gb-retry { color: var(--p700); font-weight: 800; text-decoration: underline; background: none; border: 0; padding: 0 4px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; min-height: 40px; }

/* rules */
.gb-rules { background: var(--cream); border-color: var(--line); }
.gb-rule-list { margin: 0; padding: 0; list-style: none; counter-reset: rule; display: flex; flex-direction: column; gap: 10px; }
.gb-rule-list li {
  counter-increment: rule; position: relative; padding-left: 34px;
  font-size: 13.5px; line-height: 1.45; color: var(--muted); font-weight: 500;
}
.gb-rule-list li::before {
  content: counter(rule); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 8px;
  background: var(--p900); color: #fff; font-weight: 900; font-size: 12px; display: grid; place-items: center;
}
.gb-rule-list b { color: var(--ink); font-weight: 800; }
.gb-rules-lede { margin: -4px 0 14px; font-size: 13.5px; line-height: 1.45; color: var(--muted); font-weight: 500; }
.gb-rules-more { margin: 12px 0 0; font-size: 13.5px; }
.gb-rules-more a { display: inline-flex; align-items: center; min-height: 40px; color: var(--p700); font-weight: 800; text-decoration: underline; }

/* skeletons (static, no animation) */
.gb-skel { height: 64px; border-radius: 14px; background: rgba(255,255,255,.6); }
.gb-skel-row { height: 48px; border-radius: 12px; background: var(--lilac); margin-bottom: 4px; }

/* tablet */
@media (max-width: 1080px) {
  .gb-body { grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
}

/* mobile: panel drops below chat */
@media (max-width: 900px) {
  .gb-top-inner { padding-top: 36px; padding-bottom: 30px; }
  .gb-top-art { width: 220px; }
  .gb-body { grid-template-columns: 1fr; padding-top: 16px; padding-bottom: 48px; }
  .gb-chat-col { position: static; }
  /* --gb-vv follows the visible viewport (it shrinks when the phone keyboard opens) */
  .gb-chat { height: calc(var(--gb-vv, 100dvh) - var(--gb-head) - 32px); min-height: min(480px, calc(var(--gb-vv, 100dvh) - var(--gb-head) - 32px)); max-height: none; border-radius: 22px; box-shadow: 0 5px 0 var(--p900); }
  .gb-side { display: block; columns: 2; column-gap: 14px; }
  .gb-side > .gb-card { break-inside: avoid; margin-bottom: 14px; display: block; }
  .gb-side > .gb-card[hidden] { display: none; }
}
@media (max-width: 640px) {
  .gb-top { background: linear-gradient(180deg, var(--cream), var(--lilac)); }
  .gb-top::after { display: none; }
  .gb-top-art { display: none; }
  .gb-lede { font-size: 15px; }
  .gb-side { columns: 1; }
  .gb-top-inner { padding-top: 28px; padding-bottom: 24px; }
  .gb-chat { height: calc(var(--gb-vv, 100dvh) - var(--gb-head) - 24px); min-height: min(440px, calc(var(--gb-vv, 100dvh) - var(--gb-head) - 24px)); }
  .gb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gb-stats > div { padding: 9px 12px; }
  .gb-stats dd { font-size: 19px; }
  .gb-stats dt { font-size: 13px; }
  .gb-card { padding: 16px; }
  .gb-layers-body { grid-template-columns: 72px 1fr; gap: 12px; }
  .gb-onion { width: 72px; height: 72px; }
  .gb-layer-list p, .gb-layer-list p b { font-size: 13.5px; }
}
@media (max-width: 360px) {
  .gb-layers-body { grid-template-columns: 1fr; }
  .gb-onion { display: none; }
}

/* make the shared chat fill the column */
.gb-chat.bchat { --bc-h: 300px; }
.gb-chat.bchat .bc-body { flex: 1 1 auto; height: auto; min-height: 0; }
.gb-chat .bc-empty { min-height: 100%; }
.gb-you-hint { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 600; }

/* phone keyboard open: the header scrolls away and the chat title folds,
   so the tabs, the messages and the composer all fit above the keyboard */
@media (max-width: 900px) {
  html.gb-typing .site-header { position: relative; }
  html.gb-typing .gb-chat { height: calc(var(--gb-vv, 100dvh) - 16px); min-height: 0; }
  html.gb-typing .gb-chat .bc-head { display: none; }
}
