/* Strategy Lab — five AIs pool results and teach each other.
   Electric cyan/teal skin over arena-v3.css + btc.css layout patterns.
   Sections: hero → lab board → playbook library → fleet (chart + per-model). */

/* ─── Theme: electric cyan/teal accent ───────────────────────────────────── */
:root {
  --accent: #2ee6c6;
  --accent-2: oklch(85% .18 185);
  --accent-deep: oklch(75% .18 185);
  --accent-glow: oklch(82% .18 185 / .55);

  --bg: #050708;
  --bg-2: oklch(12% .008 200);
  --bg-3: oklch(16% .008 200);
}
.cosmos-glow-1 { background: radial-gradient(circle, oklch(72% .20 185 / .22), transparent 60%); }
.cosmos-glow-2 { background: radial-gradient(circle, oklch(60% .16 220 / .16), transparent 60%); }

/* ─── Layout shell ────────────────────────────────────────────────────────── */
.p2-wrap { max-width: var(--container); margin: 0 auto; padding: 36px 22px 80px; }

.p2-hero { text-align: center; margin: 12px 0 36px; }
.p2-title { font-size: clamp(24px, 4.5vw, 52px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.02; }
.p2-title-sep { color: var(--fg-4); }
.p2-title-accent { color: var(--accent); text-shadow: 0 0 28px var(--accent-glow); }
.p2-lead { max-width: 640px; margin: 12px auto 0; color: var(--fg-2); font-size: 15.5px; }

.p2-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.p2-stat { min-width: 148px; padding: 11px 18px; background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 3px; }
.p2-stat-hero { border-color: var(--accent); box-shadow: 0 0 38px var(--accent-glow); }
.p2-stat-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }
.p2-stat-value { font-family: var(--mono); font-size: 21px; font-weight: 700; color: var(--fg); }

.p2-col-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.p2-col-eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
.p2-col-note { font-size: 12px; color: var(--fg-3); }

.p2-panel { background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 16px 18px; }
.p2-empty { padding: 36px 18px; text-align: center; color: var(--fg-3); font-size: 13px; }
.pnl-pos { color: var(--green); }
.pnl-neg { color: var(--red); }

/* ─── Sections ────────────────────────────────────────────────────────────── */
.lab-section { margin-bottom: 40px; }

/* ─── Row: chart + fleet col ─────────────────────────────────────────────── */
.p2-top { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 880px) { .p2-top { grid-template-columns: 1fr; } }
.p2-chart { display: flex; flex-direction: column; }
.chart-frame { position: relative; flex: 1; min-height: 300px; }
.lab-fleet-col { display: flex; flex-direction: column; }

/* ─── Fleet: per-model compact cards ─────────────────────────────────────── */
.fleet { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.botcard {
  position: relative; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.botcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--agent, var(--accent));
}
.botcard:hover {
  border-color: var(--agent, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.botcard-head { display: flex; align-items: center; gap: 9px; }
.botcard-avatar {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #080808;
  background: var(--agent, var(--accent));
}
.botcard-name { font-weight: 600; font-size: 14px; line-height: 1.1; }
.botcard-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule);
}
.botcard-eq { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--fg); }
.botcard-roi { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.botcard-sub { font-family: var(--mono); font-size: 10px; color: var(--fg-4); margin-top: 4px; }

/* ─── Lab Board: strategy cells ──────────────────────────────────────────── */
.labboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
@media (max-width: 640px) { .labboard { grid-template-columns: 1fr; } }

.labcell {
  background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
/* status border variant via left stripe */
.labcell::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cell-accent, var(--fg-4));
}
.labcell-proven { --cell-accent: var(--green); }
.labcell-open   { --cell-accent: #f5a623; }
.labcell-dead   { --cell-accent: var(--red); opacity: 0.65; }

.labcell-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.labcell-name {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--fg-2); text-transform: capitalize;
}
.labcell-status {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
}
.status-proven { color: var(--green); background: oklch(82% .22 145 / .15); }
.status-open   { color: #f5a623; background: oklch(80% .17 65 / .15); }
.status-dead   { color: var(--red); background: oklch(72% .22 25 / .15); }

.labcell-expectancy {
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  line-height: 1; letter-spacing: -0.02em;
}
.exp-pos { color: var(--green); text-shadow: 0 0 18px oklch(82% .22 145 / .35); }
.exp-neg { color: var(--red); }
.exp-zero { color: var(--fg-3); }

.labcell-stats {
  font-family: var(--mono); font-size: 11px; color: var(--fg-4);
  letter-spacing: 0.02em; line-height: 1.4;
}

.labcell-contributors { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.labcell-contributor {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: #080808; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px var(--bg-2);
}

/* ─── Playbook Library ────────────────────────────────────────────────────── */
.playbooks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
@media (max-width: 640px) { .playbooks { grid-template-columns: 1fr; } }

.pb-card {
  background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
  transition: border-color 200ms, transform 200ms;
}
.pb-card:hover { border-color: var(--accent-deep); transform: translateY(-2px); }
.pb-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-deep), transparent); opacity: 0.5;
}

.pb-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pb-name { font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--fg); flex: 1; min-width: 0; }
.pb-author {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--fg-3); white-space: nowrap;
}
.pb-author-badge {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #080808;
}
.pb-proof {
  display: inline-block;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 999px;
  background: oklch(82% .22 145 / .13); color: var(--green); font-weight: 700;
}
.pb-principle {
  font-size: 14px; font-style: italic; color: var(--fg-2); line-height: 1.5;
  border-left: 2px solid var(--accent-deep); padding-left: 12px;
}
.pb-setup {
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-3);
  background: var(--bg-3); border-radius: var(--radius-sm);
  padding: 10px 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.pb-setup-label { color: var(--accent); font-weight: 700; margin-right: 4px; }
.pb-meta { font-family: var(--mono); font-size: 10px; color: var(--fg-4); letter-spacing: 0.06em; }

/* ─── Reasoning drawer fixup (same pattern as btc.css) ───────────────────── */
#drawer.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
}
#drawer .drawer-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
}
#drawer .drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: auto;
  height: 100%;
  width: min(580px, 92vw);
  max-width: 100%;
}
