/* =========================================================================
   RUEZALS.chat — Dining Room look (actions unchanged)
   Palette + type from CLAUDE - REALM/design.md + Dining Room draft v0.2
   Cinzel = brand display only. UI = Swiss sans.
   ========================================================================= */

:root {
  --gold:    #C8962A;
  --gold-lt: #e8b84a;
  --gold-soft: #e8b84a;
  --teal:    #29C4C0;
  --emerald: #0E4D30;
  --bg:      #0B0B0F;
  --panel:   rgba(8, 12, 11, 0.88);
  --panel-2: rgba(11, 11, 15, 0.92);
  --border:  rgba(200, 150, 42, 0.32);
  --text:    #F6F4EC;
  --muted:   #9EA39F;
  --radius:  12px;
  --bar-h:   72px;
  --rz-body: "Helvetica Neue", Inter, Arial, "Segoe UI", sans-serif;
  --rz-title: Cinzel, Georgia, serif;
}

html, body {
  background: #050608;
  color: var(--text);
  font-family: var(--rz-body);
}

/* ── House frame (decorative — never blocks clicks) ── */
#house-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
  padding: 28px 32px 44px;
}
#house-frame .rune-border {
  position: absolute;
  inset: 10px 14px 22px;
  border: 1px solid rgba(200, 150, 42, 0.28);
  border-radius: 14px;
  box-shadow:
    0 0 40px rgba(200, 150, 42, 0.08),
    inset 0 0 60px rgba(14, 77, 48, 0.12);
}
#house-frame .rune-line {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 10px;
  text-align: center;
  color: rgba(200, 150, 42, 0.48);
  font-size: 11px;
  letter-spacing: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 0 8px rgba(200, 150, 42, 0.28);
  animation: rune-twinkle 6s ease-in-out infinite;
}
#house-frame .rune-side {
  position: absolute;
  top: 48px;
  bottom: 16px;
  width: 22px;
  color: rgba(41, 196, 192, 0.2);
  font-size: 12px;
  line-height: 28px;
  overflow: hidden;
  text-align: center;
  animation: rune-twinkle 7.5s ease-in-out infinite;
}
#house-frame .rune-side.left { left: 18px; animation-delay: 0.8s; }
#house-frame .rune-side.right { right: 18px; animation-delay: 2.4s; }
@keyframes rune-twinkle {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.35; }
}

/* ── Brand lockup (Cinzel once) ── */
#brand-lockup {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 185;
  text-align: center;
  pointer-events: none;
  padding: 6px 18px 8px;
  border-radius: 10px;
  background: rgba(4, 7, 6, 0.55);
  border: 1px solid rgba(200, 150, 42, 0.22);
  backdrop-filter: blur(6px);
}
#brand-lockup h1 {
  margin: 0;
  font-family: var(--rz-title);
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(200, 150, 42, 0.4);
  line-height: 1.1;
}
#brand-lockup small {
  display: block;
  margin-top: 3px;
  font-family: var(--rz-body);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
}

/* ── Scene: transparent so world plate + molecules show through glass ── */
#scene {
  background: transparent;
}
/* JPEG plates live on #rz-room-plate (under molecules); in-scene plates unused */
#cafe-bg,
#room-bg {
  display: none;
}
#glow-left {
  background: radial-gradient(ellipse at 30% 90%, rgba(200, 120, 30, 0.22) 0%, transparent 70%);
}
#glow-right {
  background: radial-gradient(ellipse at 70% 20%, rgba(41, 196, 192, 0.12) 0%, transparent 65%);
}

/* Dining table silhouettes */
.bg-table {
  position: absolute;
  height: 18px;
  border-radius: 40% / 100%;
  background: linear-gradient(90deg, #1a1208 0%, #3a2810 45%, #1a1208 100%);
  border: 1px solid rgba(200, 150, 42, 0.18);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(14, 77, 48, 0.15);
}
.bg-table::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: -6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(200, 150, 42, 0.08);
}

/* Avatars — rounded plate, gold rim */
.avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(200, 150, 42, 0.45);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(14, 77, 48, 0.35);
}
.avatar-circle img { border-radius: 12px; }
.avatar-wrap.dragging {
  filter: drop-shadow(0 0 14px rgba(200, 150, 42, 0.75));
}
.avatar-name {
  font-family: var(--rz-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px #000, 0 0 10px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.02em;
}

.thought-bubble.balloon {
  background: linear-gradient(135deg, rgba(200, 150, 42, 0.92), rgba(232, 184, 74, 0.95));
  color: #080908;
}
.speech-bubble {
  background: rgba(8, 12, 11, 0.92);
  border: 1px solid rgba(200, 150, 42, 0.55);
  color: #fff;
  border-radius: 8px;
  max-width: min(300px, 62vw);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  overflow: visible;
}
/* Keep the avatar pointer visible with dining look */
.speech-bubble::after,
.thought-bubble::after {
  border-top-color: var(--gold, #C8962A);
}
.speech-bubble::before {
  border-top-color: rgba(8, 12, 11, 0.92);
}

/* Chat bar — composer plate */
#chat-bar {
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: var(--bar-h);
  width: auto;
  border-radius: 12px;
  border: 1px solid rgba(200, 150, 42, 0.4);
  background: linear-gradient(160deg, rgba(8, 12, 11, 0.94), rgba(4, 7, 6, 0.96));
  box-shadow: 0 0 36px rgba(200, 150, 42, 0.1), inset 0 0 40px rgba(14, 77, 48, 0.12);
  padding: 0 16px;
  gap: 10px;
}
#chat-input {
  height: 46px;
  border-radius: 9px;
  border: 1px solid rgba(200, 150, 42, 0.34);
  background: rgba(3, 6, 5, 0.72);
  color: #fff;
  font-family: var(--rz-body);
}
#chat-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(41, 196, 192, 0.1);
}
#send-btn {
  height: 46px;
  min-width: 88px;
  border-radius: 9px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #d1a33f, #9f741b);
  color: #080908;
  font-family: var(--rz-body);
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: filter 0.2s, transform 0.12s;
}
#send-btn:hover {
  background: linear-gradient(180deg, #e0b54d, #b08422);
  filter: brightness(1.05);
}
#send-btn:active { transform: scale(0.97); }

#history-panel {
  left: 22px;
  right: 22px;
  bottom: calc(var(--bar-h) + 22px);
  border-radius: 12px;
  border: 1px solid rgba(200, 150, 42, 0.35);
  background: linear-gradient(160deg, rgba(8, 12, 11, 0.94), rgba(5, 8, 7, 0.96));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(14, 77, 48, 0.08);
}
.msg-sender {
  font-family: var(--rz-body);
  font-weight: 700;
  color: #fff;
}
.msg-text {
  color: #d5d9d6;
  line-height: 1.45;
}
.msg-system {
  border: 1px solid rgba(200, 150, 42, 0.28);
  background: rgba(200, 150, 42, 0.05);
  border-radius: 9px;
  padding: 6px 12px;
  font-style: normal;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: #d9c18b;
}

#scroll-hint {
  right: 28px;
  bottom: calc(var(--bar-h) + 28px);
  background: linear-gradient(180deg, #d1a33f, #9f741b);
  color: #080908;
  border: 1px solid rgba(200, 150, 42, 0.5);
  box-shadow: 0 0 16px rgba(200, 150, 42, 0.25);
}

/* Top chrome */
#char-search-wrap {
  top: 56px;
  left: 28px;
  width: 200px;
}
#char-search {
  border-radius: 9px;
  border: 1px solid rgba(200, 150, 42, 0.32);
  background: rgba(8, 12, 11, 0.85);
  font-family: var(--rz-body);
}
#char-search:focus { border-color: var(--teal); }
#char-search-results {
  border-radius: 9px;
  border: 1px solid rgba(200, 150, 42, 0.32);
  background: rgba(8, 12, 11, 0.95);
}
.char-result:hover {
  background: rgba(14, 77, 48, 0.28);
  color: var(--gold-lt);
}

#room-rail {
  top: 56px;
  left: 240px;
  right: 28px;
}
.room-tab {
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(5, 8, 7, 0.72);
  color: #c9cfcb;
  font-family: var(--rz-body);
}
.room-tab:hover {
  background: rgba(14, 77, 48, 0.22);
  border-color: rgba(41, 196, 192, 0.22);
  color: #fff;
}
.room-tab.active {
  background: linear-gradient(90deg, rgba(14, 77, 48, 0.42), rgba(8, 12, 11, 0.35));
  border-color: rgba(200, 150, 42, 0.45);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold), 0 0 14px rgba(200, 150, 42, 0.12);
}
.room-tab.active .room-count { color: var(--teal); }

/* Modals / menus */
#avatar-ctx-menu,
.avatar-picker-card,
.profile-card,
#invite-toast,
.mod-card,
#float-room {
  background: linear-gradient(160deg, rgba(8, 12, 11, 0.96), rgba(5, 8, 7, 0.98));
  border-color: rgba(200, 150, 42, 0.4);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55), 0 0 28px rgba(200, 150, 42, 0.08);
}
.profile-name,
.invite-toast-title,
.avatar-picker-head h3 {
  color: var(--gold);
  font-family: var(--rz-body);
}
.profile-btn.primary,
.float-input-row button {
  background: linear-gradient(180deg, #d1a33f, #9f741b);
  color: #080908;
  border-color: var(--gold);
}
.ctx-item:hover {
  background: rgba(14, 77, 48, 0.28);
  color: var(--gold-lt);
}
.avatar-pick {
  border-radius: 10px;
  background: rgba(5, 8, 7, 0.55);
}
.avatar-pick img {
  border-radius: 12px;
  border-color: rgba(200, 150, 42, 0.4);
}
.avatar-upload-btn {
  border-color: rgba(200, 150, 42, 0.55);
  background: rgba(8, 12, 11, 0.9);
  color: var(--gold-lt);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
}

#float-room.scene-couch .float-scene {
  background: linear-gradient(160deg, #1a2418, #0a100c);
}
#float-room.scene-fireplace .float-scene {
  background: linear-gradient(160deg, #2a1404, #0d0a06);
}

@media (max-width: 720px) {
  #brand-lockup { top: 10px; padding: 4px 12px; }
  #brand-lockup h1 { font-size: 1rem; }
  #brand-lockup small { letter-spacing: 0.18em; font-size: 0.5rem; }
  #house-frame .rune-line,
  #house-frame .rune-side { display: none; }
  #char-search-wrap { top: 48px; width: 140px; }
  #room-rail { top: 48px; left: 160px; right: 12px; }
  #chat-bar { left: 10px; right: 10px; bottom: 10px; }
}
