/* ============================================================
   LosingNumbers.com — Iallways Lose components
   Character panel + live chat + lottery coverage cards.
   Scoped additions on top of style.css (uses its variables) —
   loads AFTER Bootstrap + style.css on index.php and chat.php.
   Replaces the old standalone v2.css.
   ============================================================ */

/* ── Character portrait ─────────────────────────────────── */
.char-portrait {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 60px var(--gold-glow);
}
.char-portrait img {
  width: 100%;
  height: auto;
  display: block;
  animation: char-bob 6s ease-in-out infinite;
}
.char-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(5,6,8,0.85) 100%);
  pointer-events: none;
}
@keyframes char-bob { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }

.char-name { text-align: center; margin-top: 1.25rem; }
.char-name .char-h {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text-primary);
}
.char-name .char-h span { color: var(--gold-bright); }
.char-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.char-record {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.char-record .w { color: var(--text-muted); }
.char-record .l { color: var(--gold-bright); font-weight: 600; }

/* ── Chat shell ─────────────────────────────────────────── */
.chat-shell {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-gold);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-deep);
}
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.chat-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-bright);
  animation: chat-pulse 2s infinite;
}
@keyframes chat-pulse { 50% { opacity: 0.4; } }
.chat-head-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.chat-head-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}

.chat-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 380px;
  max-height: 540px;
  overflow-y: auto;
}
.chat-body--page { min-height: 52vh; max-height: none; }

.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  animation: msg-in .35s ease both;
  color: var(--text-secondary);
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg-ai {
  align-self: flex-start;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  white-space: pre-line;
}
.msg-ai .num { font-family: var(--font-mono); color: var(--gold-bright); font-weight: 600; }
.msg-user {
  align-self: flex-end;
  background: rgba(245,200,66,0.1);
  border: 1px solid var(--border-gold);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}
.msg-error {
  align-self: flex-start;
  background: var(--red-dim);
  border: 1px solid rgba(255,68,68,0.3);
  border-bottom-left-radius: 4px;
}
.msg-disclaimer {
  display: block;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: normal;
}
.msg-cta { margin-top: 10px; white-space: normal; display: flex; gap: 8px; flex-wrap: wrap; }
.msg-balls { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mini-ball {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600;
  background: var(--red-dim);
  border: 1.5px solid rgba(255,68,68,0.4);
  color: var(--red-losing);
  text-decoration: line-through;
}
.typing { display: flex; gap: 4px; padding: 14px 18px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  animation: typing-blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-blink { 50% { opacity: 0.25; } }

.chat-suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 16px; }
.suggest-chip {
  font-size: 0.78rem;
  padding: 7px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.suggest-chip:hover { border-color: var(--border-gold); color: var(--gold-bright); }

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(245,200,66,0.1); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:disabled { opacity: 0.5; }

.chat-quota {
  padding: 8px 20px 14px;
  background: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.chat-quota a { color: var(--gold-bright); }

/* Character quote attribution (numbers section) */
.quote-attr {
  margin-top: 1.25rem;
  padding: 14px 18px;
  background: var(--bg-deep);
  border-left: 3px solid var(--gold-bright);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-secondary);
}
.quote-attr .who {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Lottery coverage cards ─────────────────────────────── */
.lottery-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.lottery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.lottery-card:hover { border-color: var(--border-gold); transform: translateY(-2px); }
.lottery-card.live { border-color: var(--border-gold); background: rgba(245,200,66,0.04); }
.lottery-flag { font-size: 1.3rem; }
.lottery-name { font-weight: 600; font-size: 0.92rem; color: var(--text-primary); }
.lottery-meta { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }
.badge-live, .badge-soon {
  position: absolute;
  top: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 100px;
}
.badge-live { color: var(--gold-bright); border: 1px solid var(--border-gold); }
.badge-soon { color: var(--text-muted); border: 1px solid var(--border); }
.badge-pro-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: #000;
  background: var(--gold-bright);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

/* Chat page intro */
.chat-page-intro { display: flex; align-items: center; gap: 16px; margin-bottom: 1.25rem; }
.chat-page-intro .char-mini {
  width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
  box-shadow: 0 0 24px var(--gold-glow);
}
.chat-page-intro .char-mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

@media (prefers-reduced-motion: reduce) {
  .char-portrait img, .chat-dot, .msg, .typing span { animation: none !important; }
}
