/* ── Event Chat / Forum ── */

/* Panel tabs */
.panel-tabs {
  display: flex;
  background: white;
  border-bottom: 0.5px solid var(--pb);
  flex-shrink: 0;
}
.panel-tab {
  flex: 1;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #90A4AE;
  cursor: pointer;
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.panel-tab:hover { color: var(--ps); }
.panel-tab.on    { color: var(--pn); border-bottom-color: var(--pn); font-weight: 600; }
.panel-tab--draws:not(.on) { color: #6A1B9A; }
.panel-tab--draws.on { color: #6A1B9A; border-bottom-color: #6A1B9A; }
.panel-tab[hidden] { display: none !important; }
.panel-tab-badge {
  background: #E53935;
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* Chat compose bar */
.chat-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 0.5px solid var(--pb);
  background: white;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #ECEFF1;
  border-radius: 20px;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  color: var(--ps);
  outline: none;
  background: #F7F9F7;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--pg); background: white; }
.chat-send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--pg);
  color: white;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--pgd); }

/* Chat feed */
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
}

/* Pinned announcement */
.chat-pinned {
  background: #FFF8E1;
  border: 0.5px solid #FFE082;
  border-radius: var(--prs);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.chat-pinned-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  color: #E65100;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.chat-pinned-text { font-size: 12px; color: var(--ps); line-height: 1.5; }

/* Message bubble */
.chat-msg {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  align-items: flex-start;
}
.chat-msg.own { flex-direction: row-reverse; }
.chat-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}
.chat-av.user-av {
  font-size: 0;
  font-weight: normal;
  color: transparent;
}
.chat-bubble-wrap { display: flex; flex-direction: column; max-width: 75%; }
.chat-msg.own .chat-bubble-wrap { align-items: flex-end; }
.chat-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}
.chat-msg.own .chat-meta { flex-direction: row-reverse; }
.chat-sender { font-size: 11px; font-weight: 600; color: var(--ps); }

/* Clickable player avatar / name in event & group chats */
.chat-player-profile-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: inherit;
  line-height: inherit;
  -webkit-tap-highlight-color: transparent;
}
.chat-player-profile-link--av {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 50%;
  vertical-align: top;
}
.chat-player-profile-link--av:focus-visible {
  outline: 2px solid var(--pn);
  outline-offset: 2px;
}
.chat-player-profile-link--name {
  display: inline;
  border-radius: 4px;
}
.chat-player-profile-link--name:focus-visible {
  outline: 2px solid var(--pn);
  outline-offset: 1px;
}
.chat-player-profile-link--name:hover .chat-sender,
button.group-msg-from.chat-player-profile-link--name:hover {
  color: var(--pn);
  text-decoration: underline;
}
.chat-time   { font-size: 10px; color: #B0BEC5; }
.chat-org-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8px;
  font-weight: 700;
  background: #FFF8E1;
  color: #E65100;
  padding: 1px 6px 1px 4px;
  border-radius: 8px;
  border: 0.5px solid #FFE082;
}
.chat-org-lion {
  font-size: 11px;
  line-height: 1;
  display: inline-block;
  animation: chat-org-lion-roar 2.4s ease-in-out infinite;
}
@keyframes chat-org-lion-roar {
  0%, 100% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.14) rotate(-6deg); }
  55% { transform: scale(1.08) rotate(4deg); }
}
.chat-bubble {
  background: #F7F9F7;
  border-radius: 12px 12px 12px 3px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ps);
  line-height: 1.4;
  border: 0.5px solid var(--pb);
  word-break: break-word;
}
.chat-msg.own .chat-bubble {
  background: var(--pn);
  color: white;
  border-radius: 12px 12px 3px 12px;
  border-color: transparent;
}
.chat-reactions-wrap {
  position: relative;
  margin-top: 6px;
  max-width: 100%;
}
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.chat-reaction {
  background: #F7F9F7;
  border: 0.5px solid var(--pb);
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: inherit;
  line-height: 1.3;
}
.chat-reaction-add {
  opacity: 0.8;
  padding: 2px 8px;
  color: #78909C;
}
.chat-reaction-add .ti { font-size: 14px; }
.chat-reaction-add:hover { opacity: 1; background: #ECEFF1; }
.chat-reaction:hover { background: #ECEFF1; transform: scale(1.06); }
.chat-reaction.reacted { background: var(--pgl); border-color: var(--pg); opacity: 1; }
.chat-reaction-count { font-size: 10px; color: #607D8B; font-weight: 600; }
.chat-reaction-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  display: none;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 0.5px solid var(--pb);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(17, 24, 39, 0.14);
  width: min(220px, calc(100vw - 48px));
}
.chat-reaction-picker.open { display: flex; }
.chat-msg.own .chat-reaction-picker {
  left: auto;
  right: 0;
}
.chat-reaction-picker-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, transform 0.12s;
}
.chat-reaction-picker-btn:hover {
  background: #F0F4F0;
  transform: scale(1.12);
}

/* Date separator */
.chat-date-sep {
  text-align: center;
  font-size: 10px;
  color: #B0BEC5;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-date-sep::before,
.chat-date-sep::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: #ECEFF1;
}

/* Empty state */
.chat-empty {
  text-align: center;
  padding: 32px 20px;
  color: #90A4AE;
}
.chat-empty i { font-size: 32px; margin-bottom: 8px; display: block; }
.chat-empty p { font-size: 12px; line-height: 1.5; }

/* Pin button on organizer messages */
.chat-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-msg:hover .chat-actions { opacity: 1; }
.chat-action-btn {
  font-size: 10px;
  color: #B0BEC5;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}
.chat-action-btn:hover { color: var(--ps); }

/* Desktop — larger readable chat type (event panel) */
@media (min-width: 1024px) {
  .chat-feed { padding: 18px 24px; }
  .chat-compose { padding: 16px 24px; gap: 10px; }
  .chat-input {
    font-size: 18px;
    padding: 14px 18px;
  }
  .chat-send-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  .chat-msg { gap: 14px; padding: 8px 0; }
  .chat-av {
    width: 52px;
    height: 52px;
    font-size: 15px;
    margin-top: 4px;
  }
  .chat-meta { gap: 8px; margin-bottom: 6px; }
  .chat-pinned-text { font-size: 17px; }
  .chat-sender { font-size: 16px; }
  .chat-time { font-size: 14px; }
  .chat-org-badge {
    font-size: 14px;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    border-radius: 12px;
    letter-spacing: 0.02em;
  }
  .chat-org-lion { font-size: 22px; }
  .chat-bubble {
    font-size: 20px;
    line-height: 1.5;
    padding: 13px 18px;
    border-radius: 16px 16px 16px 5px;
  }
  .chat-msg.own .chat-bubble {
    border-radius: 16px 16px 5px 16px;
  }
  .chat-reaction { font-size: 15px; padding: 4px 10px; }
  .chat-reaction-add .ti { font-size: 16px; }
  .chat-reaction-count { font-size: 12px; }
  .chat-date-sep { font-size: 13px; padding: 10px 0; }
  .chat-empty p { font-size: 16px; }
  .chat-action-btn { font-size: 12px; }
}
