*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --surface:   #141414;
  --surface-2: #1c1c1c;
  --border:    #2a2a2a;
  --border-hi: #444;
  --text:      #f0f0f0;
  --text-muted:#888;
  --accent:    #ffffff;
  --green:     #4ade80;
  --red:       #f87171;
  --radius:    10px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ══════════════════════════════════════
   Header
   ══════════════════════════════════════ */
header {
  background: #000;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo { display: flex; align-items: center; gap: 10px; flex: 1; }

.header-ball-icon {
  width: 34px; height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.header-ball-icon svg {
  width: 18px; height: 18px;
  stroke: var(--text); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.header-text h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: .2px; }
.header-text p  { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.header-badges { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.brand-badge {
  display: flex; align-items: center; gap: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px; height: 34px;
}

.brand-badge img { display: block; height: 14px; width: auto; filter: brightness(0) invert(1); opacity: .85; }
.brand-badge-divider { width: 1px; height: 16px; background: var(--border); }
.watsonx-text { font-size: .78rem; font-weight: 700; color: var(--text-muted); letter-spacing: .4px; }

/* ══════════════════════════════════════
   Layout
   ══════════════════════════════════════ */
.container { max-width: 1140px; margin: 0 auto; padding: 32px 24px 100px; }

.top-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}

.date-bar {
  font-size: .73rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.2px;
}

/* ══════════════════════════════════════
   Status pill
   ══════════════════════════════════════ */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .72rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px; letter-spacing: .3px;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}

.status-dot.loading {
  background: #facc15;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ══════════════════════════════════════
   Sport tabs
   ══════════════════════════════════════ */
.sport-tabs { display: flex; gap: 4px; margin-bottom: 20px; }

.sport-tab {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 20px; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: inherit;
}

.sport-tab:hover { border-color: var(--border-hi); color: var(--text); }

.sport-tab.active {
  background: var(--accent); color: #000; border-color: var(--accent);
}

/* ══════════════════════════════════════
   Games grid
   ══════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

/* ══════════════════════════════════════
   Game card
   ══════════════════════════════════════ */
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}

.game-card:hover { border-color: var(--border-hi); }

/* Card top — has the team color gradient behind it */
.card-top {
  position: relative;
  padding: 20px;
  cursor: pointer;
  overflow: hidden;
}

/* The gradient band sits behind the logo area */
.card-gradient {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 72px;
  opacity: .18;
  pointer-events: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.matchup-header {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 14px;
}

.team-block {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex: 1;
}

.team-logo { width: 36px; height: 36px; object-fit: contain; position: relative; z-index: 1; }

.team-logo-placeholder {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.team-name {
  font-weight: 700; font-size: .88rem;
  text-align: center; line-height: 1.3;
  position: relative; z-index: 1;
}

.vs-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; margin-bottom: 22px;
  position: relative; z-index: 1;
}

.pitcher-info {
  font-size: .76rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 3px;
}

.pitcher-row { display: flex; align-items: center; gap: 6px; }
.pitcher-row .label {
  color: #555; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .5px; min-width: 32px;
}

/* Inline odds on card */
.card-odds { display: flex; gap: 8px; margin-top: 12px; }

.mini-odds {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px; text-align: center;
}

.mini-odds .mo-team  { font-size: .65rem; color: var(--text-muted); margin-bottom: 2px; }
.mini-odds .mo-price { font-size: 1rem; font-weight: 700; }
.mini-odds .mo-price.positive { color: var(--green); }
.mini-odds .mo-price.negative { color: var(--red); }

/* Card toggle */
.card-toggle {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 20px;
  border-top: 1px solid var(--border);
  cursor: pointer; font-size: .75rem; font-weight: 600;
  color: var(--text-muted);
  transition: color .15s, background .15s;
  user-select: none; background: transparent;
}

.card-toggle:hover { color: var(--text); background: rgba(255,255,255,.03); }
.card-toggle .chevron { display: inline-block; transition: transform .2s; font-size: .6rem; }
.card-toggle.open .chevron { transform: rotate(180deg); }

/* Card analysis body */
.card-analysis { display: none; padding: 0 20px 20px; }
.card-analysis.open { display: block; }

.card-analysis-text {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  line-height: 1.65;
  white-space: pre-wrap;
  font-size: .84rem;
  color: #bbb;
}

.card-analysis-loading {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--text-muted); padding: 8px 0;
}

/* ══════════════════════════════════════
   Section labels
   ══════════════════════════════════════ */
.section-label {
  font-size: .68rem; text-transform: uppercase;
  letter-spacing: 1.1px; color: var(--text-muted);
  margin-bottom: 10px; font-weight: 600;
}

/* ══════════════════════════════════════
   Loading & spinner
   ══════════════════════════════════════ */
.loading-msg {
  text-align: center; padding: 80px 20px;
  color: var(--text-muted); font-size: .95rem;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #333; border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   No games
   ══════════════════════════════════════ */
.no-games { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.no-games h2 { font-size: 1.05rem; margin-bottom: 6px; color: var(--text); }
.no-games p  { font-size: .85rem; }

/* ══════════════════════════════════════
   Chat FAB — pill-shaped, prominent
   ══════════════════════════════════════ */
.chat-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  height: 50px;
  padding: 0 22px 0 18px;
  border-radius: 25px;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  box-shadow: 0 4px 24px rgba(0,0,0,.55);
  transition: transform .15s, background .15s, box-shadow .15s;
  z-index: 900;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .2px;
}

.chat-fab:hover {
  transform: translateY(-2px);
  background: #f0f0f0;
  box-shadow: 0 6px 30px rgba(0,0,0,.65);
}

.chat-fab svg { width: 20px; height: 20px; flex-shrink: 0; }

.chat-fab-badge {
  font-size: .58rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 5px;
  letter-spacing: .4px;
  margin-left: 2px;
}

/* ══════════════════════════════════════
   Chat panel
   ══════════════════════════════════════ */
.chat-panel {
  position: fixed;
  bottom: 90px; right: 24px;
  width: 390px; max-height: 530px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: none;
  flex-direction: column;
  z-index: 950;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
  overflow: hidden;
}

.chat-panel.open { display: flex; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header-left { display: flex; align-items: center; gap: 8px; }
.chat-header-left span { font-size: .88rem; font-weight: 700; }

.chat-header-left .chat-badge {
  font-size: .6rem; font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px; color: var(--text-muted); letter-spacing: .5px;
}

.chat-close-btn {
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; padding: 4px; line-height: 1;
  transition: color .15s;
}

.chat-close-btn:hover { color: var(--text); }

/* Messages area */
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 200px; max-height: 340px;
}

.chat-msg {
  max-width: 88%; padding: 10px 14px;
  border-radius: 10px;
  font-size: .84rem; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: #fff; color: #000;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #ccc;
  border-bottom-left-radius: 4px;
}

.chat-msg.typing { color: var(--text-muted); font-style: italic; }

/* Chat input */
.chat-input-row {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text); font-size: .84rem;
  outline: none; font-family: inherit;
  transition: border-color .15s;
}

.chat-input:focus { border-color: var(--border-hi); }
.chat-input::placeholder { color: #555; }

.chat-send-btn {
  background: #fff; color: #000;
  border: none; border-radius: 8px;
  padding: 0 16px;
  font-size: .82rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s; flex-shrink: 0;
}

.chat-send-btn:hover { background: #e0e0e0; }
.chat-send-btn:disabled { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }

/* ══════════════════════════════════════
   Utility
   ══════════════════════════════════════ */
.powered-by { margin-top: 14px; font-size: .7rem; color: #444; text-align: right; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar       { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */
@media (max-width: 500px) {
  header { padding: 14px 16px; }
  .container { padding: 24px 14px 100px; }
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 84px; }
  .chat-fab { bottom: 16px; right: 16px; }
}
