/* ═══════════════════════════════════════════════════════
   MolteCarlo – Anthropic-Inspired Theme
   Shared styles for blog, player-profiles, poker-study
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #FAF7F2;
  --bg-warm: #F5F0E8;
  --surface: #FFFFFF;
  --surface-dim: #F0EBE3;
  --border: #E5DDD0;
  --border-strong: #D4C9B8;
  --text: #1A1612;
  --text-secondary: #5C5347;
  --text-dim: #8C8278;
  --text-muted: #AEA69C;
  --accent: #C15F3C;
  --accent-hover: #A74E30;
  --accent-light: rgba(193,95,60,0.08);
  --accent-medium: rgba(193,95,60,0.15);
  --teal: #2A7F6F;
  --teal-light: rgba(42,127,111,0.08);
  --blue: #3B6BA5;
  --blue-light: rgba(59,107,165,0.08);
  --code-bg: #2D2926;
  --code-text: #E8E0D6;
  --serif: 'Source Serif 4', 'Georgia', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --fierce-lion: #B8860B;
  --amnesia-jill: #3B6BA5;
  --musa: #7B5EA7;
  --amnesia-mickey: #2A7F6F;
  --rustic-moose: #C27333;
  --amnesia-minnie: #B85585;
  --darty-dan: #3B7A57;
  --sam-i-am: #5B6EA6;
  --demark-jo: #9B7B45;
  --green: #2A7F4F;
  --red: #B84444;
}

/* Force local symbol fonts for poker suit characters (♠♡♢♣♤♥♦♧) */
@font-face {
  font-family: 'SuitFallback';
  src: local('Apple Symbols'), local('Segoe UI Symbol'), local('Noto Sans Symbols'), local('Symbola');
  unicode-range: U+2660-U+2667;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'SuitFallback', var(--serif);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Top Nav ── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-family: var(--sans); font-weight: 700; font-size: 0.95rem;
  color: var(--text); letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.nav-brand svg { flex-shrink: 0; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  font-family: var(--sans); font-size: 0.82rem; color: var(--text-secondary);
  text-decoration: none; font-weight: 500; transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

/* ── Discord Nav Link ── */
.nav-discord {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  color: var(--text-dim); transition: color 0.15s, background 0.15s;
  flex-shrink: 0; margin-left: 8px;
}
.nav-discord:hover { color: #5865F2; background: rgba(88,101,242,0.08); }
.nav-discord svg { width: 20px; height: 20px; }

/* ── Discord Callout ── */
.discord-callout {
  margin: 2.5rem 0 1rem;
  padding: 22px 28px;
  background: rgba(88,101,242,0.06);
  border: 1px solid rgba(88,101,242,0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--sans);
}
.discord-callout svg { flex-shrink: 0; width: 28px; height: 28px; color: #5865F2; }
.discord-callout p { font-size: 0.95rem !important; color: var(--text-secondary) !important; margin-bottom: 0 !important; }
.discord-callout a { color: #5865F2; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(88,101,242,0.3); transition: border-color 0.15s; }
.discord-callout a:hover { border-color: #5865F2; }

/* ── Hero ── */
.hero {
  padding: 120px 20px 56px;
  max-width: 880px; margin: 0 auto; text-align: left;
}
.hero-label {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--serif); font-size: 2.6rem; font-weight: 700;
  line-height: 1.15; letter-spacing: -0.025em; margin-bottom: 20px;
}
.hero-subtitle {
  font-size: 1.15rem; color: var(--text-secondary); line-height: 1.6; max-width: 680px;
}
.hero-meta {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  font-family: var(--sans); font-size: 0.8rem; color: var(--text-dim);
}
.hero-meta time { font-weight: 500; color: var(--text-secondary); }
.hero-stats-row {
  display: flex; gap: 32px; flex-wrap: wrap; margin-top: 28px;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-family: var(--sans); font-size: 1.8rem; font-weight: 700; color: var(--text); }
.hero-stat .lbl { font-family: var(--sans); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Container ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 32px; }
.wide-container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ── Article Prose ── */
.article-wrap { max-width: 880px; margin: 0 auto; padding: 0 20px 60px; }
.article-wrap p { font-size: 1.1rem; font-family: var(--sans); color: var(--text); margin-bottom: 1.5em; line-height: 1.75; }
.article-wrap h2 { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; margin: 3rem 0 1rem; }
.article-wrap h3 { font-family: var(--sans); font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.8rem; }
.article-wrap strong { font-weight: 600; }
.article-wrap em { font-style: italic; }
.article-wrap a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(193,95,60,0.3); }
.article-wrap a:hover { text-decoration-color: var(--accent); }

/* ── Agent Thought Blocks ── */
.agent-thought {
  position: relative; margin: 1.5rem 0 2rem; padding: 20px 24px;
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.agent-thought .agent-name {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.agent-thought .agent-name .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.agent-thought p { font-style: italic; font-size: 1rem !important; font-family: var(--sans) !important; color: var(--text-secondary) !important; margin-bottom: 0 !important; line-height: 1.65 !important; }

/* ── Callout Boxes ── */
.callout { margin: 2rem 0; padding: 24px 28px; border-radius: 8px; border: 1px solid var(--border); }
.callout.insight { background: var(--accent-light); border-color: rgba(193,95,60,0.2); }
.callout.insight .callout-label { color: var(--accent); }
.callout.technical { background: var(--blue-light); border-color: rgba(59,107,165,0.2); }
.callout.technical .callout-label { color: var(--blue); }
.callout-label { font-family: var(--sans); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.callout p { font-size: 1rem !important; font-family: var(--sans) !important; margin-bottom: 0 !important; color: var(--text-secondary) !important; }

/* ── Section Separator ── */
.section-sep { width: 48px; height: 1px; background: var(--border-strong); margin: 3rem auto; }

/* ── Cards ── */
.visual-breakout { max-width: 1100px; margin: 3rem auto; padding: 0 32px; }
.visual-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.visual-card-header {
  padding: 18px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.visual-card-header h3 { font-family: var(--sans); font-size: 0.92rem; font-weight: 600; margin: 0; }
.visual-card-body { padding: 24px 28px; }
.badge {
  font-family: var(--sans); font-size: 0.65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 12px; border-radius: 999px;
}
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-model { background: var(--blue-light); color: var(--blue); }
.badge-memory { background: rgba(123,94,167,0.1); color: var(--musa); }
.badge-amnesia { background: rgba(184,68,68,0.08); color: var(--red); }
.badge-winner { background: rgba(42,127,79,0.1); color: var(--green); }
.badge-loser { background: rgba(184,68,68,0.08); color: var(--red); }

/* ── Sections ── */
section { padding: 48px 0; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: none; }
section h2 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.section-subtitle { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 28px; }

/* ── Profiles Grid ── */
.profiles-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
}
.profile-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; position: relative; overflow: hidden; transition: box-shadow 0.2s;
}
.profile-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.profile-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.profile-name { font-family: var(--sans); font-size: 1rem; font-weight: 700; }
.profile-meta { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.meta-pill {
  font-family: var(--sans); font-size: 0.63rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-dim); color: var(--text-dim);
}
.meta-pill.profit { color: var(--green); background: rgba(42,127,79,0.08); border: 1px solid rgba(42,127,79,0.2); }
.meta-pill.loss { color: var(--red); background: rgba(184,68,68,0.08); border: 1px solid rgba(184,68,68,0.2); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.profile-stat { text-align: center; padding: 8px; background: var(--bg-warm); border-radius: 6px; }
.profile-stat .val { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; }
.profile-stat .lbl { font-family: var(--sans); font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Trait Rows ── */
.trait-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 8px 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.trait-row:last-child { border-bottom: none; }
.trait-badge {
  font-family: var(--sans); font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap; margin-top: 2px;
}
.trait-badge.strength { color: var(--green); background: rgba(42,127,79,0.1); }
.trait-badge.weakness { color: var(--red); background: rgba(184,68,68,0.1); }
.trait-badge.neutral { color: var(--fierce-lion); background: rgba(184,134,11,0.1); }
.trait-badge.highlight { color: var(--teal); background: rgba(42,127,111,0.1); }
.trait-content h4 { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.trait-content p { font-size: 0.82rem !important; color: var(--text-dim) !important; line-height: 1.5 !important; margin-bottom: 0 !important; }
.hand-links { display: flex; gap: 5px; flex-wrap: wrap; align-self: center; }
.hand-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; background: var(--surface-dim); border: 1px solid var(--border);
  border-radius: 5px; color: var(--accent); font-size: 0.75rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: var(--sans); white-space: nowrap;
}
.hand-btn:hover { background: var(--accent-light); border-color: var(--accent); transform: translateY(-1px); }
.hand-btn::before { content: '#'; opacity: 0.5; }

/* ── Tables ── */
.comp-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.84rem; }
.comp-table th {
  text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700;
}
.comp-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-secondary); }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table tr:hover td { background: var(--bg-warm); }
.comp-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; font-weight: 700; color: var(--text); }

.grade {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  font-weight: 800; font-size: 0.75rem; font-family: var(--sans);
}
.grade-a { background: rgba(42,127,79,0.15); color: var(--green); }
.grade-b { background: rgba(59,107,165,0.15); color: var(--blue); }
.grade-c { background: rgba(184,134,11,0.15); color: var(--fierce-lion); }
.grade-d { background: rgba(194,115,51,0.15); color: var(--rustic-moose); }
.grade-f { background: rgba(184,68,68,0.15); color: var(--red); }

/* ── SKILL.md Snapshots ── */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.skill-snap { background: var(--bg-warm); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.skill-snap h4 { font-family: var(--sans); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal); margin-bottom: 8px; }
.skill-snap pre { font-family: var(--mono); font-size: 0.72rem; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.55; }

/* ── Action Bars ── */
.action-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 4px 0; }
.action-bar-fold { background: var(--text-muted); }
.action-bar-raise { background: var(--fierce-lion); }
.action-bar-call { background: var(--blue); }
.action-bar-check { background: var(--teal); }

/* ── Charts ── */
.chart-wrap { background: var(--surface); border-radius: 8px; padding: 20px; }
.chart-wrap canvas { width: 100% !important; height: 300px !important; }

/* ── Poker Cards ── */
.poker-card {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 60px; border-radius: 7px; font-size: 0.95rem;
  font-weight: 700; margin: 2px; border: 1.5px solid var(--border);
  background: white; color: #111; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-family: 'Georgia', serif; line-height: 1; flex-direction: column; gap: 1px;
}
.poker-card.red { color: #c42b2b; }
.poker-card.black { color: #1a1612; }
.poker-card.community { width: 50px; height: 66px; font-size: 0.95rem; }
.cards-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.board-display {
  display: flex; align-items: center; gap: 6px; padding: 16px;
  background: #1a5c3a; border-radius: 10px; justify-content: center;
  margin: 16px 0; border: 2px solid rgba(255,255,255,0.35); position: relative;
}
.board-display::before {
  content: 'BOARD'; position: absolute; top: -10px; left: 16px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6); background: #1a5c3a; padding: 0 6px; font-family: var(--sans);
}

/* ── Hand History ── */
.hand-history {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.hand-header {
  padding: 18px 24px; background: var(--bg-warm); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.hand-number { font-family: var(--sans); font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.hand-title { font-family: var(--sans); font-size: 0.92rem; font-weight: 600; }
.pot-size { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--fierce-lion); }
.hand-body { padding: 24px; }
.hand-players-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.hand-player {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-warm); border-radius: 8px; border: 1px solid var(--border);
  flex: 1; min-width: 200px;
}
.hand-player.winner { border-color: rgba(42,127,79,0.3); background: rgba(42,127,79,0.04); }
.hand-player.loser { border-color: rgba(184,68,68,0.2); background: rgba(184,68,68,0.03); }
.hand-player-info { flex: 1; }
.hand-player-name { font-family: var(--sans); font-weight: 700; font-size: 0.88rem; }
.hand-player-detail { font-family: var(--sans); font-size: 0.72rem; color: var(--text-dim); }
.hand-player-result { font-family: var(--sans); font-weight: 700; font-size: 0.95rem; }

/* ── Action Timeline ── */
.action-timeline { position: relative; padding-left: 24px; }
.action-timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.street-header {
  position: relative; padding: 8px 0 8px 16px;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
}
.street-header::before {
  content: ''; position: absolute; left: 8px; top: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
}
.action-item { position: relative; padding: 6px 0 6px 16px; margin-bottom: 3px; }
.action-item::before { content: ''; position: absolute; left: 4px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.action-item.fold::before { background: var(--text-muted); }
.action-item.call::before { background: var(--blue); }
.action-item.raise::before { background: var(--fierce-lion); }
.action-item.bet::before { background: var(--rustic-moose); }
.action-item.check::before { background: var(--teal); }
.action-item.all_in::before { background: var(--red); }
.action-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.action-player-name { font-family: var(--sans); font-weight: 700; font-size: 0.85rem; min-width: 110px; }
.action-desc { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; }
.action-desc.fold { color: var(--text-muted); }
.action-desc.call { color: var(--blue); }
.action-desc.raise { color: var(--fierce-lion); }
.action-desc.bet { color: var(--rustic-moose); }
.action-desc.check { color: var(--teal); }
.action-desc.all_in { color: var(--red); }

.reasoning-toggle { margin-top: 4px; }
.reasoning-toggle summary {
  cursor: pointer; font-family: var(--sans); font-size: 0.72rem;
  color: var(--text-muted); user-select: none; padding: 2px 0;
}
.reasoning-toggle summary:hover { color: var(--accent); }
.reasoning-text {
  margin-top: 6px; padding: 12px 16px; background: var(--bg-warm);
  border-radius: 6px; border-left: 3px solid var(--accent);
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.55;
  white-space: pre-wrap; max-height: 250px; overflow-y: auto; font-family: var(--sans);
}

.verdict {
  margin-top: 16px; padding: 16px; background: var(--accent-light);
  border-radius: 8px; border-left: 3px solid var(--accent);
}
.verdict h4 { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.verdict p { font-family: var(--sans); font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; }

/* ── Findings Grid ── */
.findings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.finding-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; }
.finding-card h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.finding-card p { font-family: var(--sans); color: var(--text-dim); font-size: 0.88rem; line-height: 1.55; }
.finding-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: white; font-weight: 800; font-size: 0.75rem; margin-right: 8px;
}

/* ── Conclusion Box ── */
.conclusion-box {
  margin: 2rem 0; padding: 28px;
  background: var(--accent-light); border: 1px solid rgba(193,95,60,0.15); border-radius: 10px;
}
.conclusion-box h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin-bottom: 14px; }
.conclusion-box p { color: var(--text-secondary) !important; font-size: 0.95rem !important; line-height: 1.7 !important; margin-bottom: 10px !important; }
.conclusion-box p:last-child { margin-bottom: 0 !important; }

/* ── Expandable ── */
.expand-section { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.expand-header {
  padding: 14px 22px; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; font-family: var(--sans); font-size: 0.88rem;
  font-weight: 600; color: var(--text); background: var(--surface); border: none;
  width: 100%; text-align: left; transition: background 0.15s;
}
.expand-header:hover { background: var(--bg-warm); }
.expand-header .arrow { transition: transform 0.2s; color: var(--text-dim); font-size: 0.75rem; }
.expand-header.open .arrow { transform: rotate(180deg); }
.expand-body { display: none; padding: 0 22px 18px; }
.expand-body.open { display: block; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(26,22,18,0.6); backdrop-filter: blur(4px);
  justify-content: center; align-items: flex-start;
  padding: 60px 20px; overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: 100%; max-width: 1200px; position: relative;
  animation: modalIn 0.2s ease-out; box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border-radius: 8px; background: var(--surface-dim); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s; z-index: 10;
}
.modal-close:hover { background: var(--red); color: white; border-color: var(--red); }
.modal-header { padding: 22px 26px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-family: var(--sans); font-size: 1.2rem; font-weight: 700; }
.modal-players { padding: 18px 26px; border-bottom: 1px solid var(--border); }
.modal-player-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.modal-player-row + .modal-player-row { border-top: 1px solid var(--border); padding-top: 8px; }
.modal-player-name { font-family: var(--sans); font-weight: 600; font-size: 0.88rem; min-width: 120px; }
.modal-player-cards { display: flex; gap: 4px; }
.modal-player-cards .poker-card { width: 34px; height: 46px; font-size: 0.75rem; }
.modal-player-outcome { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; margin-left: auto; padding: 2px 10px; border-radius: 4px; }
.modal-player-outcome.won { color: var(--green); background: rgba(42,127,79,0.1); }
.modal-player-outcome.lost { color: var(--red); background: rgba(184,68,68,0.1); }
.modal-player-outcome.tied { color: var(--text-muted); background: var(--surface-dim); }
.board-section { padding: 18px 26px; border-bottom: 1px solid var(--border); }
.board-label { font-family: var(--sans); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; }
.modal-actions { padding: 18px 26px; }
.modal-street { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); padding: 8px 0 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.modal-street:first-child { border-top: none; margin-top: 0; }
.modal-action-item { padding: 6px 0; display: grid; grid-template-columns: 120px auto 1fr; gap: 6px; align-items: start; font-size: 0.82rem; }
.modal-action-type {
  font-family: var(--sans); font-weight: 600; text-transform: uppercase;
  font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.modal-action-type.fold { color: var(--text-muted); background: var(--surface-dim); }
.modal-action-type.call { color: var(--blue); background: var(--blue-light); }
.modal-action-type.raise { color: var(--fierce-lion); background: rgba(184,134,11,0.1); }
.modal-action-type.check { color: var(--teal); background: var(--teal-light); }
.modal-action-type.bet { color: var(--rustic-moose); background: rgba(194,115,51,0.1); }
.modal-action-type.all-in { color: var(--red); background: rgba(184,68,68,0.1); }
.modal-reasoning-toggle {
  font-family: var(--sans); font-size: 0.72rem; color: var(--text-muted);
  cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
}
.modal-reasoning-toggle:hover { color: var(--accent); }
.modal-reasoning-toggle .arrow { transition: transform 0.2s; display: inline-block; }
.modal-reasoning-toggle.open .arrow { transform: rotate(90deg); }
.modal-reasoning-text {
  display: none; margin-top: 6px; padding: 10px 14px; background: var(--bg-warm);
  border-radius: 6px; font-family: var(--sans); font-size: 0.75rem;
  color: var(--text-secondary); line-height: 1.55; white-space: pre-wrap;
  word-break: break-word; max-height: 250px; overflow-y: auto; grid-column: 1 / -1;
}
.modal-reasoning-text.open { display: block; }

/* ── Footer ── */
.site-footer {
  text-align: center; padding: 40px 32px; border-top: 1px solid var(--border);
  font-family: var(--sans); font-size: 0.76rem; color: var(--text-muted);
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Four-Color Card Theme ── */
.poker-card.blue { color: #2266CC; }
.poker-card.green { color: #228844; }

/* ── Distill-Style Tooltips ── */
.term {
  border-bottom: 1px dotted var(--text-dim);
  cursor: help;
  position: relative;
  white-space: nowrap;
}
.term .tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-secondary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 50;
  white-space: normal;
  font-style: normal;
  text-align: left;
}
.term .tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}
.term:hover .tip {
  opacity: 1;
  pointer-events: auto;
}
.tip-title {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 0.82rem;
}

/* ── K+1 Theory of Mind Diagram ── */
.tom-diagram {
  margin: 2.5rem 0;
  font-family: var(--sans);
}
.tom-level {
  border-left: 3px solid var(--border);
  padding: 16px 20px;
  margin-left: 0;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  margin-bottom: 0;
}
.tom-level .tom-level {
  margin-top: 12px;
  margin-left: 8px;
}
.tom-level-0 { border-left-color: var(--fierce-lion); }
.tom-level-1 { border-left-color: var(--amnesia-jill); }
.tom-level-2 { border-left-color: var(--musa); }
.tom-level-3 { border-left-color: var(--text-muted); border-left-style: dashed; opacity: 0.7; }
.tom-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tom-level-0 .tom-label { color: var(--fierce-lion); }
.tom-level-1 .tom-label { color: var(--amnesia-jill); }
.tom-level-2 .tom-label { color: var(--musa); }
.tom-level-3 .tom-label { color: var(--text-muted); }
.tom-abstract {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.tom-example {
  padding: 10px 14px;
  background: var(--bg-warm);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  font-style: italic;
}
.tom-example .tom-agent {
  font-weight: 700;
  font-style: normal;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  display: block;
}

/* ── Poker Table Visualization ── */
.poker-table-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 50px 0 60px;
}
.poker-table-felt {
  position: relative;
  width: 100%;
  padding-bottom: 55%;
  background: radial-gradient(ellipse at center, #1a6b3a 0%, #145a2f 60%, #0f4a25 100%);
  border-radius: 50%;
  border: 8px solid #5c3a1e;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
}
.table-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}
.table-pot {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: #f0e6d0;
  background: rgba(0,0,0,0.35);
  padding: 4px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.table-community-cards {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.table-community-cards .poker-card {
  width: 46px;
  height: 60px;
  font-size: 0.92rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.table-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  min-width: 110px;
}
.table-seat.seat-0 { top: -4%; left: 50%; }
.table-seat.seat-1 { top: 20%; left: 93%; }
.table-seat.seat-2 { top: 78%; left: 93%; }
.table-seat.seat-3 { top: 104%; left: 50%; }
.table-seat.seat-4 { top: 78%; left: 7%; }
.table-seat.seat-5 { top: 20%; left: 7%; }
.seat-name {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
}
.seat-model {
  font-family: var(--sans);
  font-size: 0.58rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.seat-cards {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-bottom: 3px;
}
.seat-cards .poker-card {
  width: 36px;
  height: 48px;
  font-size: 0.82rem;
}
.seat-cards.folded .poker-card {
  opacity: 0.35;
  filter: grayscale(0.5);
}
.seat-stack {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--text-dim);
}
.seat-action-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 4px;
  margin-top: 2px;
}
.seat-action-badge.fold { color: var(--text-muted); background: rgba(140,130,120,0.15); }
.seat-action-badge.call { color: var(--blue); background: rgba(59,107,165,0.15); }
.seat-action-badge.raise { color: var(--fierce-lion); background: rgba(184,134,11,0.15); }
.seat-action-badge.bet { color: var(--rustic-moose); background: rgba(194,115,51,0.15); }
.seat-action-badge.check { color: var(--teal); background: rgba(42,127,111,0.15); }
.seat-action-badge.all_in { color: var(--red); background: rgba(184,68,68,0.15); }
.table-seat.active-turn {
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.5));
}
.dealer-chip {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f5f0e8;
  border: 2px solid #d4c9b8;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Step-Through Controls ── */
.step-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-family: var(--sans);
  flex-wrap: wrap;
}
.step-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.step-btn:hover { background: var(--bg-warm); border-color: var(--accent); color: var(--accent); }
.step-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.step-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.step-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 100px;
  text-align: center;
}
.street-jump-btns {
  display: flex;
  gap: 4px;
}
.street-jump-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-dim);
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.street-jump-btn:hover { border-color: var(--accent); color: var(--accent); }
.street-jump-btn.current { background: var(--accent-light); color: var(--accent); border-color: rgba(193,95,60,0.3); }

/* ── AI Reasoning Panel (Table View) ── */
.table-reasoning-panel {
  margin-top: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  animation: panelSlideIn 0.2s ease-out;
}
@keyframes panelSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.table-reasoning-panel .reasoning-agent {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-reasoning-panel .reasoning-action {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.table-reasoning-panel .reasoning-body {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

/* ── Hand Tabs ── */
.hand-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.hand-tab {
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.hand-tab:hover { color: var(--text); }
.hand-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.hand-tab-panel { display: none; padding: 20px 0; }
.hand-tab-panel.active { display: block; }

/* ── 3-Column Replay Layout ── */
.replay-layout {
  display: grid;
  grid-template-columns: 200px 1fr 320px;
  gap: 16px;
  align-items: start;
}
.replay-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.replay-player {
  padding: 10px 12px;
  background: var(--bg-warm);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.replay-player.winner { border-color: rgba(42,127,79,0.3); background: rgba(42,127,79,0.04); }
.replay-player.loser { border-color: rgba(184,68,68,0.2); background: rgba(184,68,68,0.03); }
.replay-player-name {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.replay-player-cards {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}
.replay-player-cards .poker-card {
  width: 32px;
  height: 42px;
  font-size: 0.72rem;
}
.replay-player-outcome {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
}
.replay-player-outcome.won { color: var(--green); }
.replay-player-outcome.lost { color: var(--red); }
.replay-player-outcome.tied { color: var(--text-muted); }

.replay-center {
  min-width: 0;
}

.replay-reasoning {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.replay-reasoning .table-reasoning-panel {
  margin-top: 0;
}

.replay-step-controls {
  grid-column: 1 / -1;
  order: -1;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .replay-layout { grid-template-columns: 1fr; }
  .replay-players { flex-direction: row; flex-wrap: wrap; }
  .replay-player { flex: 1; min-width: 140px; }
  .replay-reasoning { position: static; max-height: none; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.9rem; }
  .hero { padding: 100px 20px 40px; }
  .article-wrap, .container, .wide-container { padding-left: 16px; padding-right: 16px; }
  .visual-breakout { padding: 0 12px; }
  .profiles-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hand-players-row { flex-direction: column; }
  .trait-row { grid-template-columns: 1fr; }
  .hand-links { margin-top: 4px; }
  .modal-action-item { grid-template-columns: 1fr; gap: 3px; }
  .modal-header, .board-section, .modal-players, .modal-actions { padding-left: 18px; padding-right: 18px; }
  /* Poker table responsive */
  .poker-table-felt { border-radius: 16px; padding-bottom: 70%; }
  .table-seat { min-width: 80px; }
  .seat-cards .poker-card { width: 30px; height: 40px; font-size: 0.7rem; }
  .seat-name { font-size: 0.62rem; }
  .step-controls { gap: 4px; }
  .step-btn { padding: 4px 10px; font-size: 0.7rem; }
  .tom-level { padding: 12px 14px; }
  .tom-level .tom-level { margin-left: 4px; }
  .term .tip { width: 220px; font-size: 0.72rem; }
}
