/* Roc Mountain — Floating Public Chat (right dock) */

:root {
  --rc-w: 360px;
  --rc-gold: #d4af37;
  --rc-gold-bright: #f0d78c;
  --rc-panel-bg: #12141a;
  --rc-header: #0c0d10;
  --rc-msg-bg: linear-gradient(180deg, #e8c85a 0%, #c9a227 48%, #a8861a 100%);
  --rc-bubble: #f4f4f6;
  --rc-ink: #1a1a1a;
  --rc-muted: #8a8a96;
  --rc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.roc-chat-toggle {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 99980;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 30% 25%, #f0d78c, #d4af37 45%, #8a6a1a);
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.45), 0 0 0 2px rgba(0, 0, 0, 0.35);
  color: #1a1408;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--rc-ease), right 0.35s var(--rc-ease);
}
.roc-chat-toggle:hover { transform: scale(1.06); }
.roc-chat-toggle svg { width: 26px; height: 26px; }
.roc-chat-toggle__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font: 700 10px/18px system-ui, sans-serif;
  display: none;
}
.roc-chat-toggle__badge.is-on { display: inline-block; }

body.roc-chat-open .roc-chat-toggle {
  right: calc(var(--rc-w) + 22px);
}

.roc-chat-dock {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--rc-w);
  max-width: 100vw;
  z-index: 99990;
  display: flex;
  flex-direction: column;
  background: var(--rc-panel-bg);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
  transform: translateX(105%);
  transition: transform 0.38s var(--rc-ease);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.roc-chat-open .roc-chat-dock {
  transform: translateX(0);
}

.roc-chat-head {
  flex: 0 0 auto;
  background: var(--rc-header);
  color: #eee;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.roc-chat-head__back,
.roc-chat-head__menu,
.roc-chat-head__close {
  background: transparent;
  border: 0;
  color: #cfcfd6;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.roc-chat-head__back:hover,
.roc-chat-head__menu:hover,
.roc-chat-head__close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.roc-chat-head__menuwrap {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}
.roc-chat-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: #16161c;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  padding: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.roc-chat-menu[hidden] { display: none !important; }
.roc-chat-menu a,
.roc-chat-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #e8e8ec;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.roc-chat-menu a:hover,
.roc-chat-menu button:hover {
  background: rgba(212, 175, 55, 0.14);
  color: #ffd76a;
}
.roc-chat-head__logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: #111;
}
.roc-chat-head__meta { flex: 1; min-width: 0; }
.roc-chat-head__title {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roc-chat-text,
.roc-chat-input {
  font-family: system-ui, -apple-system, "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", Roboto, sans-serif;
}
.roc-chat-head__sub {
  font-size: 11px;
  color: var(--rc-gold-bright);
  opacity: 0.9;
}

.roc-chat-hello {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #0a0a0c;
  color: #ddd;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.roc-chat-hello button {
  background: transparent;
  border: 0;
  color: #999;
  cursor: pointer;
  font-size: 14px;
}

.roc-chat-stream {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 18px;
  background: var(--rc-msg-bg);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(40, 32, 12, 0.75) rgba(0, 0, 0, 0.12);
}
.roc-chat-stream::-webkit-scrollbar { width: 8px; }
.roc-chat-stream::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
}
.roc-chat-stream::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a6a1a, #3a2e0c);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
}
.roc-chat-stream::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #d4af37, #8a6a1a);
}
.roc-chat-stream::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

.roc-chat-day {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}
.roc-chat-day span {
  background: rgba(20, 20, 24, 0.72);
  color: #e8e8ee;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

.roc-chat-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 8px 0;
  justify-content: flex-start;
}
.roc-chat-row.is-mine {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
.roc-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 32px;
  background: #2a2a32 center/cover no-repeat;
  border: 1px solid rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
}
.roc-chat-bubble {
  position: relative;
  max-width: calc(100% - 48px);
  background: var(--rc-bubble);
  color: var(--rc-ink);
  border-radius: 14px 14px 14px 4px;
  padding: 8px 10px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.roc-chat-row.is-mine .roc-chat-bubble {
  background: #dcf8c6;
  color: #111;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.roc-chat-row.is-mine .roc-chat-quote {
  background: rgba(0, 0, 0, 0.06);
  border-left-color: #2e7d32;
}
.roc-chat-nick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 2px;
}
.roc-chat-nick.is-admin { color: #d4af37 !important; }
.roc-chat-nick.is-gm .roc-chat-nick__name,
.roc-chat-profile__name.is-gm {
  background: linear-gradient(
    90deg,
    #ff0040,
    #ff7a00,
    #ffee00,
    #00ff66,
    #00c2ff,
    #b400ff,
    #ff0040
  );
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  animation: roc-gm-rgb 2.8s linear infinite;
  font-weight: 800;
}
.roc-chat-nick__gm {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffd76a;
  text-shadow: 0 0 6px rgba(255, 180, 40, 0.45);
  flex: 0 0 auto;
}
.roc-chat-nick.is-gm .roc-chat-nick__gm {
  background: linear-gradient(90deg, #ff0040, #ffee00, #00ff66, #00c2ff, #b400ff, #ff0040);
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: roc-gm-rgb 2.8s linear infinite;
}
@keyframes roc-gm-rgb {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.roc-chat-nick__crown { font-size: 11px; }
.roc-chat-profile__av--img {
  background: #2a2a32 center/cover no-repeat !important;
  color: transparent !important;
}
.roc-chat-text {
  font-size: 13px;
  line-height: 1.35;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.roc-chat-meta {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  align-items: center;
}
.roc-chat-time {
  font-size: 10px;
  color: var(--rc-muted);
}
.roc-chat-actions {
  opacity: 0;
  transition: opacity 0.15s;
  display: inline-flex;
  gap: 4px;
}
.roc-chat-row:hover .roc-chat-actions { opacity: 1; }
.roc-chat-actions button {
  border: 0;
  background: transparent;
  color: #777;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
.roc-chat-actions button:hover { color: #333; }

.roc-chat-quote {
  background: rgba(0,0,0,0.06);
  border-left: 3px solid #c9a227;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.roc-chat-quote__who {
  font-weight: 700;
  color: #7a6a2a;
  margin-bottom: 2px;
}
.roc-chat-quote__body {
  color: #555;
  max-height: 3.2em;
  overflow: hidden;
}

.roc-chat-foot {
  flex: 0 0 auto;
  background: #0c0d10;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  padding: 10px 10px 12px;
}
.roc-chat-replybar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 10px;
  padding: 6px 8px;
  margin-bottom: 8px;
  color: #e8d9a0;
  font-size: 12px;
}
.roc-chat-replybar.is-on { display: flex; }
.roc-chat-replybar button {
  background: transparent;
  border: 0;
  color: #bbb;
  cursor: pointer;
}
.roc-chat-compose {
  display: flex;
  align-items: center;
  gap: 8px;
}
.roc-chat-emoji-btn,
.roc-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}
.roc-chat-emoji-btn {
  background: transparent;
  color: #aaa;
  font-size: 20px;
}
.roc-chat-emoji-btn:hover { color: var(--rc-gold); }
.roc-chat-input {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: #16171c;
  color: #f2f2f2;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}
.roc-chat-input:focus {
  border-color: var(--rc-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
}
.roc-chat-input::placeholder { color: #777; }
.roc-chat-send {
  background: radial-gradient(circle at 30% 25%, #f0d78c, #d4af37 50%, #9a7418);
  color: #1a1408;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}
.roc-chat-send:disabled { opacity: 0.45; cursor: not-allowed; }
.roc-chat-send svg { width: 18px; height: 18px; }

.roc-chat-gate {
  padding: 8px 4px 0;
  text-align: center;
  color: #cfcfd6;
  font-size: 12px;
}
.roc-chat-gate a {
  color: var(--rc-gold-bright);
  font-weight: 700;
  text-decoration: none;
}
.roc-chat-gate a:hover { text-decoration: underline; }

.roc-chat-rumuz-modal {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.62);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.roc-chat-rumuz-modal.is-on { display: flex; }
.roc-chat-rumuz-modal__card {
  width: 100%;
  max-width: 320px;
  background: #16171d;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 18px 16px 14px;
  color: #eee;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.roc-chat-rumuz-modal__card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--rc-gold-bright);
}
.roc-chat-rumuz-modal__card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #cfcfd6;
}
.roc-chat-rumuz-modal__card ol {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #ddd;
}
.roc-chat-rumuz-modal__card a {
  color: var(--rc-gold-bright);
  font-weight: 700;
}
.roc-chat-rumuz-modal__hint {
  font-size: 11px !important;
  color: #999 !important;
}
.roc-chat-rumuz-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.roc-chat-rumuz-modal__cta {
  display: block;
  text-align: center;
  text-decoration: none !important;
  background: radial-gradient(circle at 30% 25%, #f0d78c, #d4af37 55%, #9a7418);
  color: #1a1408 !important;
  font-weight: 800;
  border-radius: 10px;
  padding: 11px 12px;
}
.roc-chat-rumuz-modal__dismiss {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #bbb;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
}
.roc-chat-rumuz-modal__dismiss:hover { color: #fff; border-color: rgba(255,255,255,0.25); }

.roc-chat-emoji {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 64px;
  max-height: 220px;
  overflow: auto;
  background: #15161c;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  padding: 10px;
  z-index: 5;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  scrollbar-width: thin;
  scrollbar-color: #8a6a1a #1a1b22;
}
.roc-chat-emoji.is-on { display: block; }
.roc-chat-emoji::-webkit-scrollbar { width: 8px; }
.roc-chat-emoji::-webkit-scrollbar-track {
  background: #1a1b22;
  border-radius: 8px;
}
.roc-chat-emoji::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af37, #8a6a1a);
  border-radius: 8px;
  border: 1px solid rgba(240, 215, 140, 0.25);
}
.roc-chat-emoji::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f0d78c, #d4af37);
}
.roc-chat-emoji::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.roc-chat-emoji__grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.roc-chat-emoji__grid button {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
.roc-chat-emoji__grid button:hover { background: rgba(255,255,255,0.06); }
.roc-chat-emoji__head {
  display: flex;
  justify-content: space-between;
  color: #bbb;
  font-size: 12px;
  margin-bottom: 8px;
}
.roc-chat-emoji__head button {
  background: transparent;
  border: 0;
  color: #999;
  cursor: pointer;
}

.roc-chat-profile {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.roc-chat-profile.is-on { display: flex; }
.roc-chat-profile__card {
  width: 100%;
  background: #16171d;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  padding: 16px;
  color: #eee;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.roc-chat-profile__top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.roc-chat-profile__av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2a2a32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid rgba(212, 175, 55, 0.45);
}
.roc-chat-profile__name { font-size: 18px; font-weight: 800; }
.roc-chat-profile__role { font-size: 12px; color: #aaa; margin-top: 2px; }
.roc-chat-profile__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.roc-chat-profile__stat {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.roc-chat-profile__stat b { display: block; font-size: 16px; color: var(--rc-gold-bright); }
.roc-chat-profile__stat span { font-size: 11px; color: #999; }
.roc-chat-profile__close {
  width: 100%;
  margin-top: 8px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--rc-gold);
  color: #1a1408;
  font-weight: 700;
  cursor: pointer;
}

.roc-chat-empty {
  text-align: center;
  color: rgba(20,20,20,0.55);
  font-size: 13px;
  margin-top: 40%;
  font-weight: 600;
}

@media (max-width: 640px) {
  :root { --rc-w: 100vw; }
  .roc-chat-toggle { bottom: 72px; right: 14px; }
  body.roc-chat-open .roc-chat-toggle { display: none; }
}
