/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0a1628;
  --blue:   #1a3a6b;
  --accent: #ff6b35;
  --green:  #22c55e;
  --red:    #ef4444;
  --gray:   #64748b;
  --light:  #f1f5f9;
  --white:  #ffffff;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--light);
  color: #1e293b;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: var(--white);
  padding: 1.25rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 1rem; }
.logo-icon { font-size: 2.5rem; }
.logo h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.5px; }
.logo .subtitle { font-size: 0.8rem; opacity: 0.75; margin-top: 2px; }
.badge {
  background: var(--accent);
  color: white;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Main layout ──────────────────────────────────────────────── */
main { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }

.layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* ── Panels ───────────────────────────────────────────────────── */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.panel-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.date-badge {
  background: var(--blue);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-small {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.panel-desc { font-size: 0.82rem; color: var(--gray); margin-bottom: 1.25rem; line-height: 1.5; }

/* ── Game cards ───────────────────────────────────────────────── */
.predictions-list { display: flex; flex-direction: column; gap: 0.75rem; }

.game-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  position: relative;
  transition: box-shadow 0.15s;
}
.game-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); }

.game-card .rank {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 0.7rem;
  color: var(--gray);
  font-weight: 600;
}

.matchup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.team-name { font-weight: 700; font-size: 0.92rem; }
.team-record { font-size: 0.75rem; color: var(--gray); }
.at-sign { color: var(--gray); font-weight: 500; }

.pitchers {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 0.7rem;
  font-style: italic;
}

.prob-bar-wrap { margin-bottom: 0.5rem; }
.prob-bar {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.prob-fill-home { height: 100%; border-radius: 4px; transition: width 0.5s; }

.prob-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--gray);
}

.winner-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
}
.winner-home { background: #dcfce7; color: #166534; }
.winner-away { background: #dbeafe; color: #1e40af; }

.game-time { font-size: 0.72rem; color: var(--gray); margin-top: 0.35rem; }

/* ── Chat ─────────────────────────────────────────────────────── */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 540px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
  margin-bottom: 1rem;
}
.msg { display: flex; }
.msg.user  { justify-content: flex-end; }
.msg.assistant { justify-content: flex-start; }
.msg-bubble {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.msg.user .msg-bubble {
  background: var(--blue);
  color: white;
  border-bottom-right-radius: 3px;
}
.msg.assistant .msg-bubble {
  background: var(--light);
  color: #1e293b;
  border-bottom-left-radius: 3px;
}
.msg.thinking .msg-bubble { color: var(--gray); font-style: italic; }

.chat-input-row {
  display: flex;
  gap: 0.5rem;
}
.chat-input-row input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}
.chat-input-row input:focus { border-color: var(--blue); }
.chat-input-row button {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-input-row button:hover { background: var(--navy); }
.chat-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Architecture grid ────────────────────────────────────────── */
.arch-panel { margin-top: 0; }
.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.arch-card {
  background: var(--light);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.arch-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.arch-card h3 { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--navy); }
.arch-card p  { font-size: 0.75rem; color: var(--gray); line-height: 1.5; }

/* ── Misc ─────────────────────────────────────────────────────── */
.loading  { color: var(--gray); font-size: 0.88rem; padding: 1rem 0; text-align: center; }
.error-msg { color: var(--red); font-size: 0.85rem; padding: 0.5rem 0; }
.hidden   { display: none !important; }

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--gray);
}
footer a { color: var(--blue); text-decoration: none; }
