:root {
  --room-surface: rgba(5, 17, 24, .97);
  --room-surface-2: rgba(8, 27, 36, .96);
  --room-line: rgba(87, 244, 209, .18);
  --room-blue: #6ebdff;
}

main .hero { grid-template-columns: minmax(0, 1fr) minmax(360px, 410px); align-items: stretch; }

.community-panel {
  position: relative;
  min-height: 640px;
  padding: 20px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 95% 0, rgba(87,244,209,.13), transparent 16rem),
    linear-gradient(155deg, rgba(8,31,39,.98), rgba(3,12,18,.99));
}

.community-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .2;
  background: repeating-linear-gradient(135deg, transparent 0 17px, rgba(121,231,220,.04) 17px 18px);
  mask-image: linear-gradient(to bottom, #000, transparent 46%);
}

.community-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.community-head h1 { margin: 7px 0 0; font-size: clamp(30px, 3vw, 42px); }
.community-head h1 span { color: var(--cyan); }
.community-intro { margin: 13px 0 14px !important; color: #9db6bf !important; font-size: 12px !important; line-height: 1.55 !important; }

.desk-state {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid rgba(246,201,91,.23);
  color: var(--gold);
  background: rgba(246,201,91,.055);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}
.desk-state i, .presence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 11px currentColor; }
.desk-state[data-tone="online"] { border-color: rgba(87,244,209,.25); color: var(--cyan); background: rgba(87,244,209,.055); }
.desk-state[data-tone="online"] i, .presence-dot { background: var(--cyan); }
.desk-state[data-tone="degraded"] { color: #ff9d62; border-color: rgba(255,157,98,.27); }
.desk-state[data-tone="locked"] { color: #ff6b83; border-color: rgba(255,107,131,.25); }

.member-strip {
  min-height: 48px;
  margin: 0 0 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--room-line);
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(87,244,209,.075), rgba(87,244,209,.015));
}
.member-strip small, .member-strip strong { display: block; }
.member-strip small { color: var(--cyan); font-size: 7px; font-weight: 900; letter-spacing: .16em; }
.member-strip strong { margin-top: 3px; font-size: 11px; letter-spacing: .08em; }
.member-strip a { color: #99b3bc; font-size: 7px; font-weight: 900; letter-spacing: .1em; text-align: right; text-decoration: none; }
.member-strip a:hover { color: var(--cyan); }

.room-meta {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 9px;
  border: 1px solid rgba(110,189,255,.14);
  background: rgba(4,14,21,.82);
  color: #718e98;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .11em;
}
.room-meta span:first-child { display: flex; align-items: center; gap: 6px; }
.room-meta span:nth-child(2) { overflow: hidden; color: #9fb9c3; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.room-meta a { color: #718e98; text-decoration: none; }
.room-meta a:hover { color: var(--cyan); }

.room-feed {
  min-height: 230px;
  max-height: 330px;
  margin-top: 9px;
  padding: 3px 5px 3px 1px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #164555 transparent;
}

.room-message {
  width: min(94%, 520px);
  padding: 10px 11px;
  align-self: flex-start;
  border: 1px solid rgba(87,244,209,.15);
  border-left: 2px solid var(--cyan);
  background: linear-gradient(105deg, rgba(10,34,43,.92), rgba(5,18,26,.92));
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
}
.room-message.is-member { align-self: flex-end; border-color: rgba(110,189,255,.2); border-left-color: var(--room-blue); background: rgba(10,29,44,.94); }
.room-message.is-pending { opacity: .72; border-style: dashed; }
.room-message header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.room-message header strong { color: #effcff; font-size: 8px; letter-spacing: .12em; }
.room-message header time { margin-left: auto; color: #526e78; font-size: 7px; }
.room-message p { margin: 0 !important; color: #bed1d7 !important; font-size: 11px !important; line-height: 1.5 !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.verified-badge, .member-badge, .topic-tag { padding: 3px 5px; font-size: 6px; font-weight: 900; letter-spacing: .09em; }
.verified-badge { color: #061512; background: var(--cyan); }
.member-badge { color: var(--room-blue); border: 1px solid rgba(110,189,255,.23); }
.topic-tag { color: var(--gold); border: 1px solid rgba(246,201,91,.2); }

.room-actions { display: flex; gap: 6px; margin: 10px 0 8px; overflow-x: auto; scrollbar-width: none; }
.room-actions::-webkit-scrollbar { display: none; }
.room-actions button {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid rgba(110,189,255,.17);
  color: #91aab4;
  background: #071721;
  font: inherit;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .04em;
  cursor: pointer;
}
.room-actions button:hover, .room-actions button:focus-visible { border-color: rgba(87,244,209,.5); color: var(--cyan); }

.live-market-menu { margin-bottom: 8px; padding: 9px; border: 1px solid var(--room-line); background: rgba(2,11,16,.97); }
.menu-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.menu-title strong { color: var(--cyan); font-size: 7px; letter-spacing: .13em; }
.menu-title span { color: #6b8994; font-size: 8px; }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; max-height: 145px; overflow-y: auto; }
.market-grid button { min-width: 0; padding: 7px 5px; border: 1px solid rgba(110,189,255,.15); color: #deeff4; background: #071722; cursor: pointer; }
.market-grid button:hover { border-color: var(--cyan); }
.market-grid button strong, .market-grid button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-grid button strong { font-size: 9px; }
.market-grid button small { margin-top: 2px; color: #627f89; font-size: 6px; letter-spacing: .09em; }
.market-grid p { grid-column: 1/-1; padding: 8px; color: #78939d !important; font-size: 10px !important; }

.room-form label { display: block; margin-bottom: 6px; color: #688590; font-size: 7px; font-weight: 900; letter-spacing: .15em; }
.room-composer { display: grid; grid-template-columns: 1fr 68px; overflow: hidden; border: 1px solid rgba(87,244,209,.29); background: #031018; }
.room-composer:focus-within { border-color: rgba(87,244,209,.65); box-shadow: 0 0 0 3px rgba(87,244,209,.055); }
.room-composer textarea { min-height: 58px; padding: 10px; resize: none; border: 0; outline: 0; color: #ecfbff; background: transparent; font: inherit; font-size: 11px; line-height: 1.4; }
.room-composer textarea::placeholder { color: #4e6b75; }
.room-composer button { border: 0; color: #03120f; background: linear-gradient(150deg, #d2fff4, #54eac8 62%, #20bfa0); font: inherit; font-size: 8px; font-weight: 950; letter-spacing: .08em; cursor: pointer; }
.room-composer button:disabled, .room-actions button:disabled, .market-grid button:disabled { opacity: .42; cursor: wait; }
.room-form > small { display: block; margin-top: 6px; color: #536f79; font-size: 7px; line-height: 1.35; }

.live-access-gate {
  position: absolute;
  z-index: 8;
  inset: 0;
  padding: 26px;
  display: grid;
  align-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 25%, rgba(87,244,209,.14), transparent 18rem),
    rgba(2,9,14,.965);
  backdrop-filter: blur(11px);
}
.live-access-gate[hidden] { display: none; }
.gate-kicker { color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.live-access-gate > strong { margin-top: 12px; font-size: 27px; letter-spacing: -.025em; }
.live-access-gate > p { max-width: 330px; margin: 10px auto 18px !important; color: #91aab4 !important; font-size: 12px !important; line-height: 1.6 !important; }
.gate-actions { display: grid; gap: 8px; width: min(100%, 330px); margin-inline: auto; }
.gate-actions a { min-height: 46px; display: grid; place-items: center; padding: 0 12px; text-decoration: none; font-size: 9px; font-weight: 950; letter-spacing: .09em; }
.gate-primary { color: #03110f; background: linear-gradient(120deg, #d6fff6, #59efcf); box-shadow: 0 0 36px rgba(87,244,209,.16); }
.gate-secondary { color: #bcd0d7; border: 1px solid rgba(110,189,255,.25); background: rgba(8,24,34,.9); }
.live-access-gate > small { margin-top: 11px; color: #5f7c86; font-size: 8px; }

@media (max-width: 1120px) {
  main .hero { grid-template-columns: 1fr; }
  .community-panel { min-height: 610px; }
  .room-feed { max-height: 360px; }
}

@media (max-width: 620px) {
  .community-panel { min-height: 590px; padding: 16px; }
  .community-head h1 { font-size: 31px; }
  .community-intro { font-size: 11px !important; }
  .desk-state { padding: 7px; }
  .desk-state span { display: none; }
  .member-strip { align-items: flex-start; }
  .member-strip a { max-width: 142px; }
  .room-feed { min-height: 220px; max-height: 330px; }
  .room-meta { grid-template-columns: auto 1fr; }
  .room-meta a { display: none; }
  .market-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .live-access-gate { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .desk-state i, .presence-dot { box-shadow: none; }
}
