/* ===== HODL Chat ===== */
.hodl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hodl-chat-msg {
  position: relative;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-system);
  line-height: 1.4;
  background: #f8f6f0;
  border: 1px solid #e8e4d8;
  flex-shrink: 0;
  cursor: pointer;
}

.hodl-chat-msg:hover {
  background: #f0ede4;
}

.hodl-chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hodl-chat-name {
  font-weight: 700;
  font-size: 11px;
}

.hodl-chat-time {
  font-size: 9px;
  color: #999;
}

.hodl-chat-text {
  color: #222;
  word-break: break-word;
  white-space: pre-wrap;
  margin-top: 1px;
}

/* Chat reactions */
.chat-react-picker {
  display: flex;
  gap: 2px;
  padding: 3px 4px;
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin-top: 4px;
  width: fit-content;
}

.chat-react-btn {
  font-size: 16px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s;
}

.chat-react-btn:hover {
  transform: scale(1.3);
  background: #f0ede4;
}

.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  font-size: 11px;
  background: #eae7de;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.4;
}

.chat-reaction-pill:hover {
  background: #ddd9ce;
}

.chat-reaction-pill.mine {
  background: #fff3d0;
  border-color: #f59500;
}

.hodl-chat-system {
  text-align: center;
  color: #999;
  font-size: 11px;
  font-style: italic;
  padding: 20px;
  flex-shrink: 0;
}
.hodl-chat-loading {
  text-align: center;
  color: #999;
  font-size: 10px;
  padding: 8px;
  font-style: italic;
}

.hodl-chat-date-sep {
  text-align: center;
  font-size: 10px;
  font-family: var(--font-system);
  color: #999;
  padding: 6px 0 2px;
  margin: 4px 0;
  position: relative;
  flex-shrink: 0;
}

.hodl-chat-date-sep::before,
.hodl-chat-date-sep::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  background: #ddd;
  width: calc(50% - 40px);
}

.hodl-chat-date-sep::before { left: 0; }
.hodl-chat-date-sep::after { right: 0; }

.hodl-chat-input-bar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #ece9d8;
  border-top: 1px solid #d4d0c8;
  flex-shrink: 0;
}

.hodl-chat-input {
  flex: 1;
  height: 32px;
  padding: 0 8px;
  font-size: 16px; /* must be ≥16px — iOS Safari zooms inputs below this threshold */
  font-family: var(--font-system);
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background: #fff;
  color: #000;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.hodl-chat-input:focus {
  border-color: var(--hodl-orange);
}

.hodl-chat-send {
  padding: 0 14px;
  height: 26px;
  font-size: 11px;
  font-family: var(--font-system);
  font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #ece9d8 100%);
  border: 1px solid #999;
  border-radius: 2px;
  cursor: pointer;
  color: #000;
}

.hodl-chat-send:hover {
  background: linear-gradient(180deg, #fff 0%, #e0ddd0 100%);
}

.hodl-chat-send:active {
  background: #ddd;
}

.hodl-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Chat emoji picker button */
.hodl-chat-emoji-btn {
  width: 32px;
  height: 26px;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  background: linear-gradient(180deg, #fff 0%, #ece9d8 100%);
  border: 1px solid #999;
  border-radius: 2px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hodl-chat-emoji-btn:hover {
  background: linear-gradient(180deg, #fff 0%, #e0ddd0 100%);
}
.hodl-chat-emoji-btn:active,
.hodl-chat-emoji-btn.active {
  background: #ddd;
  border-color: #888;
}

/* Chat emoji picker popup */
.hodl-chat-emoji-picker {
  position: absolute;
  left: 8px;
  right: 8px;
  max-height: 220px;
  background: #f5f0e6;
  border: 1px solid #b8b4a8;
  border-radius: 4px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hodl-chat-emoji-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #d4d0c8;
  flex-shrink: 0;
  background: #ece9d8;
}
.hodl-chat-emoji-tab {
  flex: 1;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}
.hodl-chat-emoji-tab:hover {
  background: #e0ddd0;
}
.hodl-chat-emoji-tab.active {
  border-bottom-color: #f59500;
  background: #f5f0e6;
}

.hodl-chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
  flex: 1;
}
.hodl-chat-emoji-item {
  font-size: 20px;
  line-height: 1;
  padding: 2px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.hodl-chat-emoji-item:hover {
  transform: scale(1.15);
  background: #e8e4d8;
}

/* Chat reply badge */
.chat-reply-badge {
  font-size: 10px;
  color: #3b82f6;
  cursor: pointer;
  margin-top: 3px;
  font-family: var(--font-system);
}
.chat-reply-badge:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Reply preview bar */
.hodl-chat-reply-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #f0ede4;
  border-left: 3px solid #f59500;
  border-top: 1px solid #e8e4d8;
  font-size: 10px;
  font-family: var(--font-system);
  color: #555;
  flex-shrink: 0;
}
.reply-preview-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-preview-cancel {
  background: none;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.reply-preview-cancel:hover {
  color: #c00;
}

/* Reply thread container */
.chat-replies-container {
  margin-left: 16px;
  border-left: 2px solid #e8e4d8;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 8px;
  flex-shrink: 0;
}

/* Reply bubble */
.hodl-chat-reply {
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-system);
  line-height: 1.4;
  background: #f4f2ec;
  border: 1px solid #e8e4d8;
  cursor: pointer;
}
.hodl-chat-reply:hover {
  background: #eceae2;
}
.hodl-chat-reply.hodl-chat-creator {
  background: linear-gradient(135deg, #fff8e8 0%, #fff3d0 100%);
  border-color: #f5c842;
}
.hodl-chat-reply.hodl-chat-creator:hover {
  background: linear-gradient(135deg, #fff3d0 0%, #ffedb8 100%);
}

/* Picker divider */
.chat-react-sep {
  color: #ccc;
  font-size: 14px;
  line-height: 1;
  padding: 2px 1px;
  user-select: none;
}

/* Creator (GameKyuubi) message styling */
.hodl-chat-creator {
  background: linear-gradient(135deg, #fff8e8 0%, #fff3d0 100%);
  border-color: #f5c842;
}
.hodl-chat-creator:hover {
  background: linear-gradient(135deg, #fff3d0 0%, #ffedb8 100%);
}
.hodl-chat-creator .hodl-chat-name {
  font-weight: 800;
}
.creator-crown {
  font-size: 11px;
  margin-right: 1px;
}

/* Creator status in chat status bar */
.creator-status {
  white-space: nowrap;
}
.creator-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.creator-dot.online {
  background: #00c853;
  box-shadow: 0 0 4px rgba(0, 200, 83, 0.6);
}
.creator-dot.offline {
  background: #ff3b30;
  box-shadow: 0 0 4px rgba(255, 59, 48, 0.4);
}
