/* ============================================================================
   Diamond Decks — Persona-Styled Wiki Stylesheet
   Design system sampled from gauntlet/ref/*.png & src/ui/dd_theme.gd.
   Aesthetic: Persona 5 Royal (ink, cream, crimson, angular skew) & 
              Persona 3 Reload (deep midnight ink, neon cyan, hard offset shadows).
   Fonts: Archivo Black (Display) + Barlow Condensed (Label & Body).
   ========================================================================= */

@font-face {
  font-family: "DD Display";
  src: url("../../assets/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DD Label";
  src: url("../../assets/fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "DD Label Bold";
  src: url("../../assets/fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "DD Body";
  src: url("../../assets/fonts/BarlowCondensed-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DD Body Medium";
  src: url("../../assets/fonts/BarlowCondensed-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "DD Body Bold";
  src: url("../../assets/fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* --- Palette Tokens (dd_theme.gd & gauntlet/progress.html 1:1) --- */
  --ink: #08080A;
  --ink-base: #0D0D0D;
  --ink-raised: #141414;
  --ink-deep: #050507;
  --panel: #141418;
  --panel2: #1C1C21;
  --panel-raised: #22222A;
  --line: #2A2A31;
  --line-bright: #3D3D4B;
  
  --cream: #F4F2ED;
  --cream-bright: #FFFFFF;
  --cream-dim: #DDDBD7;
  --dim: #8E8C85;
  --grey: #6C6C6C;
  --grey-deep: #3A3A3A;
  
  /* Persona 5 Crimson */
  --red: #FF3B47;
  --red-deep: #D8121F;
  --red-wedge: #C8121E;
  
  /* Persona 3 Cyan & Deep Blue */
  --p3-cyan: #3BC0FF;
  --p3-blue: #2E5FA3;
  --p3-glow: #4C7BE0;
  
  /* Amber / Gold */
  --amber: #F2BE77;
  --amber-hot: #F2A93B;
  
  /* Turf & Greens */
  --green: #2FBF71;
  --green-deep: #1E7A45;
  --field-green: #15663C;
  --field-stripe: #28744C;
  --field-line: #0D4B2B;
  --infield: #2CA152;
  --dirt: #EFBE77;
  --felt-dark: #0A3B22;
  
  /* Pitch Families */
  --fastball: #FF3B47;
  --breaking: #2FBF71;
  --changeup: #B15DFF;
  --defense-blue: #2E5FA3;
  --qol-cyan: #3BC0FF;

  /* Page Surface */
  --page: var(--ink);
  --page-2: var(--panel);
  --rule: var(--line);
  --text: var(--cream);
  --text-soft: #B8B5AD;
  --text-muted: var(--dim);

  --sidebar-w: 260px;
  --measure: 78ch;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: "DD Body", "Barlow Condensed", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(ellipse at 85% 10%, rgba(255, 59, 71, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 15% 90%, rgba(59, 192, 255, 0.04) 0%, transparent 45%);
  min-height: 100vh;
}

/* ---------------------------------------------------------------- layout */

.shell { display: flex; align-items: flex-start; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px 48px 24px;
  border-right: 1px solid var(--line);
  background: var(--ink-base);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--ink); }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.sidebar .brand {
  display: block;
  text-decoration: none;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--red);
}
.sidebar .brand b {
  display: block;
  font-family: "DD Display", sans-serif;
  font-size: 22px;
  letter-spacing: .01em;
  color: var(--cream);
  line-height: 1.0;
  text-transform: uppercase;
}
.sidebar .brand span {
  display: inline-block;
  margin-top: 6px;
  font-family: "DD Label", sans-serif;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  padding: 2px 10px 1px;
  transform: skewX(-11deg);
  box-shadow: 2px 2px 0px var(--red-deep);
}
.sidebar h4 {
  font-family: "DD Label", sans-serif;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 22px 0 8px;
  padding-left: 2px;
}
.sidebar a.nav {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  margin: 2px 0;
  border-radius: 2px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 16.5px;
  font-family: "DD Body Medium", "Barlow Condensed", sans-serif;
  letter-spacing: .01em;
  transition: all 0.12s ease;
  position: relative;
}
.sidebar a.nav:hover {
  background: var(--panel2);
  color: var(--cream);
  padding-left: 14px;
  border-left: 3px solid var(--red);
}
.sidebar a.nav.here {
  background: var(--red);
  color: #FFFFFF;
  font-weight: 700;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  padding-left: 12px;
  box-shadow: 3px 3px 0px var(--ink-deep);
}

main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 44px clamp(24px, 5vw, 72px) 140px;
}
.wrap { max-width: 1100px; margin: 0 auto; }

/* --------------------------------------------------------------- headings */

h1 {
  font-family: "DD Display", sans-serif;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.02;
  letter-spacing: -.015em;
  margin: 0 0 10px;
  color: var(--cream-bright);
  text-transform: uppercase;
  text-wrap: balance;
  border-bottom: 3px solid var(--red);
  padding-bottom: 14px;
}

h2 {
  font-family: "DD Display", sans-serif;
  font-size: 26px;
  line-height: 1.15;
  margin: 56px 0 14px;
  padding-top: 20px;
  border-top: 2px solid var(--line-bright);
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 20px;
  background: var(--red);
  transform: skewX(-11deg);
}

h3 {
  font-family: "DD Label", sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 34px 0 8px;
  color: var(--cream);
}
h4 {
  font-family: "DD Label", sans-serif;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber-hot);
  margin: 24px 0 8px;
}

p, li { max-width: var(--measure); }
p { margin: 0 0 14px; color: var(--text-soft); }
ul, ol { margin: 0 0 16px; padding-left: 24px; color: var(--text-soft); }
li { margin-bottom: 6px; }
li b, p b { color: var(--cream); }

.lede {
  font-size: 21px;
  color: var(--cream-dim);
  max-width: 68ch;
  margin-bottom: 28px;
  line-height: 1.5;
}

a {
  color: var(--p3-cyan);
  text-decoration: none;
  transition: color 0.12s;
  border-bottom: 1px solid rgba(59, 192, 255, 0.3);
}
a:hover {
  color: #fff;
  border-bottom-color: var(--red);
}

code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  background: var(--panel2);
  color: var(--amber);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
}
pre {
  background: var(--ink-base);
  color: var(--cream);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--p3-cyan);
  border-radius: 4px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* ----------------------------------------------------------------- slabs */

.slab {
  display: inline-flex;
  align-items: center;
  font-family: "DD Display", sans-serif;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 14px 4px;
  transform: skewX(-11deg);
  background: var(--panel2);
  color: var(--cream);
  border: 1px solid var(--line);
  box-shadow: 4px 4px 0px var(--ink-deep);
}
.slab > span { display: inline-block; transform: skewX(11deg); }
.slab.red {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red-deep);
  box-shadow: 4px 4px 0px var(--red-deep);
}
.slab.amber {
  background: var(--amber-hot);
  color: var(--ink);
  border-color: var(--amber);
  box-shadow: 4px 4px 0px #000;
}
.slab.blue, .slab.cyan {
  background: var(--p3-cyan);
  color: var(--ink);
  border-color: var(--p3-blue);
  box-shadow: 4px 4px 0px var(--p3-blue);
}
.slab.cream {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream-dim);
  box-shadow: 4px 4px 0px var(--red-deep);
}

/* ---------------------------------------------------------------- tables */

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 18px 0 28px;
  font-size: 16.5px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
}
th {
  text-align: left;
  font-family: "DD Label", sans-serif;
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--panel2);
  border-bottom: 2px solid var(--red);
  padding: 10px 14px;
  vertical-align: bottom;
}
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  vertical-align: top;
  color: var(--text-soft);
}
tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
tr:hover td { background: rgba(255, 59, 71, 0.06); color: var(--cream); }
td b { color: var(--cream); }
td:last-child, th:last-child { border-right: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; color: var(--cream); }
.scroll-x { overflow-x: auto; }

/* ---------------------------------------------------------------- callout */

.note {
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  background: var(--panel);
  padding: 16px 22px;
  margin: 22px 0;
  max-width: var(--measure);
  box-shadow: 4px 4px 0px rgba(0,0,0,0.35);
  position: relative;
}
.note.blue, .note.cyan { border-left-color: var(--p3-cyan); }
.note.amber { border-left-color: var(--amber-hot); }
.note.green { border-left-color: var(--green); }
.note p:last-child { margin-bottom: 0; }
.note b { color: var(--cream); font-family: "DD Label", sans-serif; letter-spacing: .02em; }

.src {
  display: inline-block;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  color: var(--dim);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 8px;
  margin: 0 0 16px;
}

/* ------------------------------------------------------------- card grids */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin: 22px 0 36px;
  max-width: none;
}
.card-cell {
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.card-cell:hover {
  transform: translateY(-4px);
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(255, 59, 71, 0.25), 4px 4px 0px var(--red-deep);
}
.card-cell .art {
  position: relative;
  display: block;
  background: #000;
  aspect-ratio: 420 / 588;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.card-cell .art img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.card-cell:hover .art img {
  transform: scale(1.03);
}
.card-cell .meta { padding: 10px 12px 12px; }
.card-cell .code {
  font-family: "DD Display", sans-serif;
  font-size: 14px;
  color: var(--cream);
  letter-spacing: .02em;
}
.card-cell .name { font-size: 15.5px; line-height: 1.25; color: var(--text-soft); margin-top: 2px; }
.card-cell .tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  display: inline-block;
  font-family: "DD Label", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 9px 2px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: var(--panel2);
  color: var(--cream);
  white-space: nowrap;
}
.chip.fastball { background: var(--fastball); color: #fff; }
.chip.breaking { background: var(--breaking); color: #04240f; }
.chip.changeup { background: var(--changeup); color: #fff; }
.chip.q { background: var(--cream); color: var(--ink); font-weight: 700; }
.chip.count { background: var(--amber-hot); color: var(--ink); font-weight: 700; }
.chip.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); clip-path: none; }

/* Filter bar */
#card-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}
button[data-filter] {
  background: var(--panel2);
  color: var(--cream);
  border: 1px solid var(--line);
  font-family: "DD Label", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 6px 14px 5px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  cursor: pointer;
  transition: all 0.15s ease;
}
button[data-filter]:hover {
  background: var(--panel-raised);
  border-color: var(--dim);
}
button[data-filter][aria-pressed="true"] {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red);
  box-shadow: 3px 3px 0px var(--red-deep);
}

/* art variants row */
.variants { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.variants a {
  display: block; width: 44px; border: 1px solid var(--line); overflow: hidden;
  transition: border-color 0.15s ease;
}
.variants a:hover { border-color: var(--p3-cyan); }
.variants img { width: 100%; display: block; }

/* --------------------------------------------------------------- figures */

figure { margin: 26px 0 32px; max-width: none; }
figure img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
}
figcaption {
  font-size: 15.5px;
  color: var(--text-soft);
  margin-top: 10px;
  max-width: var(--measure);
}
figcaption b { color: var(--cream); }

/* screenshot with numbered hotspots */
.shot { position: relative; display: block; line-height: 0; }
.shot img { width: 100%; }
.hotspot {
  position: absolute;
  border: 2px solid var(--qol-cyan);
  box-shadow: 0 0 12px rgba(59, 192, 255, 0.4), inset 0 0 8px rgba(59, 192, 255, 0.2);
  pointer-events: none;
}
.hotspot::before {
  content: attr(data-n);
  position: absolute;
  top: -12px; left: -12px;
  width: 24px; height: 24px;
  background: var(--red);
  color: #fff;
  font-family: "DD Display", sans-serif;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  box-shadow: 2px 2px 0px var(--ink-deep);
}
.legend { list-style: none; padding: 0; margin: 16px 0 0; max-width: none; }
.legend li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  max-width: 80ch;
}
.legend .n {
  font-family: "DD Display", sans-serif;
  font-size: 12px;
  color: #fff;
  background: var(--red);
  width: 24px; height: 24px;
  line-height: 24px;
  text-align: center;
  box-shadow: 2px 2px 0px var(--ink-deep);
}

/* ------------------------------------------------------------- home cards */

.hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin: 28px 0 46px;
}
.hub a {
  display: block;
  border: 1px solid var(--line);
  padding: 20px 22px 22px;
  text-decoration: none;
  color: var(--cream);
  background: var(--panel);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  position: relative;
}
.hub a:hover {
  transform: translate(-3px, -3px);
  border-color: var(--red);
  box-shadow: 6px 6px 0px var(--red-deep);
}
.hub a b {
  display: block;
  font-family: "DD Display", sans-serif;
  font-size: 19px;
  color: var(--cream-bright);
  margin: 10px 0 6px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.hub a > span:not(.slab) {
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.48;
  display: block;
}

/* --------------------------------------------------------------- diagrams */

.diagram {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
  margin: 22px 0 28px;
  overflow-x: auto;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.4);
}
.diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.diagram + figcaption { margin-top: -14px; }

/* =========================================================== ANIMATION LAB */

.lab {
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 20px 0 38px;
  background: var(--panel);
  box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
}

.lab-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.lab-id {
  font-family: "DD Label", sans-serif;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 4px 12px 3px;
  white-space: nowrap;
  background: var(--ink-base);
}
.lab-id b { color: var(--cream); font-weight: 700; }

.btn {
  font-family: "DD Label", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 14px 5px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  border: 1px solid var(--line-bright);
  background: var(--panel);
  color: var(--cream);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}
.btn:hover { border-color: var(--red); color: #fff; }
.btn.go {
  background: var(--green);
  border-color: #22995a;
  color: #04240f;
  font-weight: 700;
}
.btn.go:hover { filter: brightness(1.15); box-shadow: 3px 3px 0px #04240f; }
.btn[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #FFFFFF;
  box-shadow: 3px 3px 0px var(--red-deep);
}
.btn:disabled { opacity: .4; cursor: default; }

.lab-speed {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.lab-speed .lbl {
  font-family: "DD Label", sans-serif;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.lab-stage {
  position: relative;
  background: var(--felt-dark);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.lab-status {
  background: var(--ink-base);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--amber);
  padding: 10px 16px;
  min-height: 38px;
  border-top: 1px solid var(--line);
}

/* --- the mock game screen, in stage coordinates (960 x 540) --- */

.scene {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}
.scene-inner {
  position: absolute;
  top: 0; left: 0;
  width: 960px; height: 540px;
  transform-origin: 0 0;
  perspective: 1100px;
}
.layer { position: absolute; inset: 0; }
.field-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.mock-card {
  position: absolute;
  width: 88px; height: 123px;
  transform-style: preserve-3d;
  will-change: transform;
}
.mock-card .side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,.6);
  background: #141418;
}
.mock-card .side img { width: 100%; height: 100%; display: block; object-fit: cover; }
.mock-card .back { transform: rotateY(180deg); }
.mock-card.lit .side { box-shadow: 0 0 0 3px var(--amber-hot), 0 8px 20px rgba(0,0,0,.6); }
.mock-card.combo .side { box-shadow: 0 0 0 3px var(--green), 0 8px 20px rgba(0,0,0,.6); }

.slot-ghost {
  position: absolute;
  border: 2px dashed rgba(244,242,237,.28);
  border-radius: 4px;
  width: 88px; height: 123px;
}

.mock-hud {
  position: absolute;
  font-family: "DD Label", sans-serif;
  color: var(--cream);
}
.bug {
  left: 14px; top: 12px;
  width: 246px; height: 52px;
  background: linear-gradient(#161616, #0D0D0D);
  border: 2px solid var(--cream);
  display: grid;
  grid-template-columns: 78px 46px 1fr;
  align-items: center;
  font-size: 11px;
}
.bug .sc { padding-left: 9px; line-height: 1.35; }
.bug .sc i { font-style: normal; color: var(--grey-mid); letter-spacing: .1em; }
.bug .sc b { font-family: "DD Display", sans-serif; font-size: 13px; margin-left: 7px; }
.bug .sc .away b { color: var(--red); }
.bug .sc .home b { color: var(--defense-blue); }
.bug .inn {
  justify-self: center;
  background: var(--cream); color: var(--ink);
  font-family: "DD Display", sans-serif; font-size: 11px;
  padding: 4px 8px 3px; transform: skewX(-11deg);
  border-left: 2px solid var(--grey);
}
.bug .bso { padding-left: 10px; border-left: 2px solid var(--grey); height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.bug .row { display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--grey); }
.dot.on { background: var(--p3-cyan); border-color: var(--p3-cyan); }
.dot.out.on, .dot.strike.on { background: var(--red); border-color: var(--red); }
.dot.strike { border-radius: 0; transform: rotate(45deg); }

.banner {
  left: 60px; top: 226px;
  width: 590px;
  padding: 9px 0;
  text-align: center;
  white-space: nowrap;
  border: 2px solid var(--cream);
  font-family: "DD Display", sans-serif;
  font-size: 19px;
  letter-spacing: .05em;
  color: var(--cream);
  box-shadow: 0 10px 28px rgba(0,0,0,.7);
}

.pill {
  left: 50%; bottom: 168px;
  transform: translateX(-50%);
  min-width: 330px;
  background: rgba(13,13,13,.95);
  border: 2px solid var(--cream);
  display: flex; align-items: center;
  height: 32px;
  font-size: 13px;
  white-space: nowrap;
}
.pill .ph {
  background: var(--red); color: #fff;
  font-family: "DD Display", sans-serif; font-size: 10px; letter-spacing: .08em;
  height: 100%; display: flex; align-items: center; padding: 0 14px;
  transform: skewX(-11deg); margin-right: 12px;
}
.pill .ph span { transform: skewX(11deg); }
.pill em { font-style: normal; color: var(--amber-hot); margin-left: 6px; font-weight: 700; }

.counter {
  position: absolute;
  font-family: "DD Display", sans-serif;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(0,0,0,.7);
  pointer-events: none;
}
.floater {
  position: absolute;
  font-family: "DD Display", sans-serif;
  font-size: 22px;
  color: var(--amber-hot);
  text-shadow: 0 3px 0 rgba(0,0,0,.75);
  pointer-events: none;
  opacity: 0;
}
.wire {
  position: absolute;
  height: 3px;
  background: var(--green);
  transform-origin: 0 50%;
  border-radius: 2px;
  opacity: 0;
  box-shadow: 0 0 12px rgba(47,191,113,.95);
  pointer-events: none;
}
.die {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 6px;
  background-size: cover;
  box-shadow: 0 6px 14px rgba(0,0,0,.6);
  will-change: transform;
}
.stamp {
  position: absolute;
  font-family: "DD Display", sans-serif;
  font-size: 54px;
  letter-spacing: .04em;
  color: var(--red);
  -webkit-text-stroke: 2px #fff;
  opacity: 0;
  pointer-events: none;
}
.runner {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--cream);
  box-shadow: 0 3px 6px rgba(0,0,0,.6);
}
.runner.batter { background: var(--amber-hot); }
.trail {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,59,71,.6);
  opacity: 0;
  pointer-events: none;
}
.meter {
  position: absolute;
  right: 18px; bottom: 96px;
  width: 250px;
  font-family: "DD Label", sans-serif;
  color: var(--cream);
  font-size: 11px;
}
.meter .bar {
  height: 16px;
  background: var(--ink-base);
  border: 1px solid var(--grey-deep);
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}
.meter .fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
}
.meter .val { font-family: "DD Display", sans-serif; font-size: 14px; }

.flashlayer {
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 45%, rgba(0,0,0,.6) 100%);
}

.cam-marker {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--qol-cyan);
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--qol-cyan);
}
.cam-label {
  position: absolute;
  font-family: "DD Label", sans-serif;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--qol-cyan);
  transform: translate(-50%, 10px);
  white-space: nowrap;
}

.opt-table td:first-child { width: 92px; }
.opt-key {
  font-family: "DD Display", sans-serif;
  font-size: 13px;
  color: var(--cream);
}

.decide {
  border: 2px dashed var(--line-bright);
  padding: 16px 20px;
  margin: 10px 0 36px;
  background: var(--panel2);
  max-width: var(--measure);
}
.decide h4 { margin-top: 0; color: var(--red); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    position: static; width: auto; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  main { padding: 28px 20px 80px; }
}

@media print {
  .sidebar, .lab-bar, .lab-status { display: none; }
}

/* ====================================================== UI PROPOSAL MOCKS */

.pv {
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 18px 0 14px;
  background: var(--panel);
  box-shadow: 4px 4px 0px rgba(0,0,0,0.4);
}
.pv-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
}
.pv-bar .btn b {
  font-family: "DD Display", sans-serif;
  font-size: 11px;
  margin-right: 5px;
  color: var(--red);
}
.pv-bar .btn[aria-pressed="true"] b { color: var(--amber-hot); }

.pv-stage {
  background: #15663C;
  background-image: radial-gradient(ellipse at 50% 40%, #1e7a45 0%, #0A3B22 80%);
  padding: 24px 26px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pv-note-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel2);
  font-size: 16px;
  color: var(--text-soft);
}
.pv-note-bar b { color: var(--cream); font-family: "DD Display", sans-serif; font-size: 12px; letter-spacing: .04em; }

.pv-hint {
  font-family: "DD Label", sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  color: rgba(244,242,237,.75);
}
.pv-lab {
  font-family: "DD Label", sans-serif;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  display: inline-block;
  min-width: 96px;
}
.pv-card { border-radius: 4px; box-shadow: 0 6px 14px rgba(0,0,0,.6); display: block; }
.pv-split { display: flex; align-items: flex-start; gap: 24px; width: 100%; }

/* score bug */
.pv-bug {
  width: 300px;
  background: linear-gradient(#161616, #0D0D0D);
  border: 2px solid var(--cream);
  display: grid;
  grid-template-columns: 96px auto 1fr;
  align-items: center;
  font-family: "DD Label", sans-serif;
  color: var(--cream);
  font-size: 12px;
  box-shadow: 6px 6px 0px var(--red-deep);
}
.pv-bug .sc { padding: 7px 0 7px 10px; }
.pv-bug .sc i { font-style: normal; color: var(--dim); letter-spacing: .1em; font-size: 10px; }
.pv-bug .sc b { font-family: "DD Display", sans-serif; font-size: 14px; margin-left: 8px; }
.pv-bug .away b { color: var(--red); }
.pv-bug .home b { color: var(--defense-blue); }
.pv-bug .inn {
  background: var(--cream); color: var(--ink);
  font-family: "DD Display", sans-serif; font-size: 11px;
  padding: 5px 9px; transform: skewX(-11deg);
  text-align: center;
}
.pv-bug .bso { padding: 6px 0 6px 12px; border-left: 2px solid var(--grey); }
.pv-bug .row { display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--dim); margin: 1px 0; }
.pv-bug .pips { display: flex; gap: 3px; justify-content: center; margin-top: 4px; }
.pv-bug .pips i { width: 6px; height: 6px; border-radius: 50%; background: #555; }
.pv-bug .pips i.done { background: var(--dim); }
.pv-bug .pips i.now { background: var(--red); }

/* prompt pill */
.pv-pill {
  display: flex; align-items: center; gap: 10px;
  background: rgba(13,13,13,.95);
  border: 2px solid var(--cream);
  height: 38px;
  padding-right: 16px;
  font-family: "DD Label", sans-serif;
  color: var(--cream);
  font-size: 14.5px;
  align-self: flex-start;
  max-width: 100%;
  box-shadow: 6px 6px 0px var(--red-deep);
}
.pv-pill .ph {
  background: var(--red); color: #fff;
  font-family: "DD Display", sans-serif; font-size: 10.5px; letter-spacing: .1em;
  height: 100%; display: flex; align-items: center; padding: 0 16px;
  transform: skewX(-11deg); margin-right: 8px;
}
.pv-pill .ph > span { transform: skewX(11deg); }
.pv-pill em { font-style: normal; color: var(--amber-hot); font-weight: 700; }
.pv-pill .rt { margin-left: 24px; color: var(--dim); font-size: 12px; white-space: nowrap; }
.pv-pill .pmeter { color: var(--amber); }
.inline-count { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); }
.inline-count .dot { margin-right: 1px; }

/* decision stack */
.pv-stack { width: 250px; font-family: "DD Label", sans-serif; color: var(--cream); }
.pv-stack .rail {
  display: flex; justify-content: space-between;
  background: rgba(13,13,13,.95); border: 1px solid var(--grey-deep);
  padding: 7px 8px; font-size: 8.5px; letter-spacing: .08em; color: var(--dim);
}
.pv-stack .rail .on { color: var(--red); font-weight: 700; }
.pv-stack .ctx {
  background: rgba(13,13,13,.95); border: 1px solid var(--grey-deep); border-top: 0;
  padding: 8px; font-size: 12px; color: var(--text-soft); line-height: 1.35;
}
.pv-stack .ctx.count { display: flex; gap: 14px; }
.pv-stack .ctx.count .row { display: flex; align-items: center; gap: 3px; font-size: 9px; }
.pv-stack .cta {
  margin-top: 8px; height: 44px;
  display: grid; place-items: center;
  background: #202026; color: var(--dim);
  font-family: "DD Display", sans-serif; font-size: 16px;
  border: 1px solid var(--line);
}
.pv-stack .cta.armed { background: var(--red); color: #fff; box-shadow: 4px 4px 0 var(--red-deep); border-color: var(--red); }

/* P1 mat */
.pv-mat { display: flex; flex-direction: column; gap: 8px; }
.pv-row { display: flex; align-items: center; gap: 8px; }
.pv-row .tell { font-size: 13px; margin-left: -4px; margin-right: 6px; }
.pv-readout {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: rgba(13,13,13,.92); border: 2px solid var(--green);
  padding: 8px 16px; align-self: flex-start;
  font-family: "DD Label", sans-serif; color: var(--cream);
  box-shadow: 4px 4px 0px rgba(0,0,0,0.6);
}
.pv-readout b { font-family: "DD Display", sans-serif; font-size: 30px; color: var(--green); }
.pv-readout span { font-size: 11px; letter-spacing: .12em; }
.pv-readout em { font-style: normal; font-size: 11px; color: var(--dim); }
.pv-chips { display: flex; flex-direction: column; gap: 6px; }
.pv-chips > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* P2 intel */
.pv-edge { display: flex; align-items: center; gap: 16px; }
.pv-tab {
  background: rgba(13,13,13,.95); border: 1px solid var(--line);
  border-left: 0;
  padding: 10px 14px; margin-left: -26px;
  font-family: "DD Display", sans-serif; font-size: 11px; color: var(--cream);
  display: flex; align-items: center; gap: 8px;
}
.pv-tab .fams { display: flex; gap: 2px; }
.pv-tab .fams i { width: 7px; height: 14px; display: block; }
.pv-tab .seen { color: var(--dim); font-family: "DD Label", sans-serif; font-size: 10px; }
.pv-rail {
  width: 210px; background: rgba(13,13,13,.95); border: 1px solid var(--line);
  padding: 10px 12px; font-family: "DD Label", sans-serif; color: var(--cream); font-size: 12px;
}
.pv-rail .fam { display: flex; align-items: center; gap: 7px; margin: 3px 0; }
.pv-rail .fam i { width: 10px; height: 10px; display: block; }
.pv-rail .fam b { margin-left: auto; font-family: "DD Display", sans-serif; font-size: 12px; }
.pv-qrow { display: flex; align-items: center; gap: 7px; margin: 2px 0; font-size: 11px; }
.pv-qrow > span:first-child { width: 20px; color: var(--dim); }
.pv-qrow .bar { flex: 1; height: 7px; background: #232323; display: block; }
.pv-qrow .bar i { display: block; height: 100%; background: var(--qol-cyan); }
.pv-qrow b { font-family: "DD Display", sans-serif; font-size: 10px; width: 32px; text-align: right; }
.pv-seat {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(#161616, #0D0D0D); border: 2px solid var(--cream);
  padding: 9px 14px; font-family: "DD Label", sans-serif; color: var(--cream); font-size: 12px;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.6);
}
.pv-seat .team { background: var(--defense-blue); padding: 3px 10px; transform: skewX(-11deg); font-family: "DD Display", sans-serif; font-size: 11px; }
.pv-seat .persona { color: var(--amber-hot); }
.pv-seat .pile { font-family: "DD Display", sans-serif; font-size: 15px; display: flex; flex-direction: column; align-items: center; }
.pv-seat .pile i { font-style: normal; font-family: "DD Label", sans-serif; font-size: 8px; letter-spacing: .1em; color: var(--dim); }
.pv-seat .pile.lens { color: var(--qol-cyan); }
.pv-seat .lensbars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.pv-seat .lensbars i { width: 8px; display: block; }

/* P4 zones */
.pv-zones { display: flex; gap: 60px; padding: 4px 6px; }
.pv-zones .z { text-align: center; font-family: "DD Label", sans-serif; color: var(--cream); font-size: 10px; letter-spacing: .12em; position: relative; }
.pv-zones .stack { position: relative; display: flex; }
.pv-zones .stack.fanned img { margin-left: -46px; transform: rotate(-4deg); }
.pv-zones .stack.fanned img:first-child { margin-left: 0; }
.pv-zones .stack.sealed img { filter: saturate(.4) brightness(.75); }
.pv-zones .stack .lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.pv-zones .stack.dashed { outline: 2px dashed var(--dim); outline-offset: 3px; }
.pv-zones .stack.solid { outline: 2px solid var(--qol-cyan); outline-offset: 3px; }
.pv-zones .badge {
  position: absolute; top: -9px; right: -9px;
  background: var(--cream); color: var(--ink);
  font-family: "DD Display", sans-serif; font-size: 10px;
  width: 22px; height: 22px; display: grid; place-items: center;
  transform: rotate(45deg);
}
.pv-zones b { display: block; margin-top: 8px; font-weight: 400; color: var(--cream); }

/* P5 linescore */
.pv-line { font-family: "DD Label", sans-serif; color: var(--cream); font-size: 12px; background: rgba(13,13,13,.95); border: 1px solid var(--line); padding: 8px 12px; align-self: flex-start; }
.pv-line > div { display: flex; gap: 2px; }
.pv-line span { width: 26px; text-align: center; }
.pv-line span:first-child { width: 56px; text-align: left; color: var(--dim); letter-spacing: .1em; font-size: 10px; }
.pv-line b { width: 30px; text-align: center; font-family: "DD Display", sans-serif; }
.pv-line .away b { color: var(--red); }
.pv-line .home b { color: var(--defense-blue); }
.pv-line .live { color: var(--amber-hot); }

/* P6 colour roles */
.pv-roles { display: flex; flex-direction: column; gap: 5px; font-family: "DD Label", sans-serif; color: var(--cream); font-size: 13px; }
.pv-role { display: flex; align-items: center; gap: 10px; }
.pv-role i { width: 28px; height: 16px; display: block; border: 1px solid rgba(255,255,255,.3); }
.pv-role b { width: 130px; font-weight: 600; color: var(--cream); }
.pv-role span { color: var(--dim); font-size: 12px; }
.pv-role.changed b::after { content: " →"; color: var(--amber-hot); }

/* P7 settings */
.pv-panel { background: rgba(13,13,13,.95); border: 1px solid var(--line); padding: 6px 0; align-self: flex-start; min-width: 380px; }
.pv-set { display: flex; align-items: baseline; gap: 12px; padding: 6px 14px; font-family: "DD Label", sans-serif; color: var(--cream); font-size: 13px; }
.pv-set b { min-width: 160px; font-weight: 600; }
.pv-set span { color: var(--dim); font-size: 12px; }
.pv-set.on b { color: var(--dim); }
.pv-set.on::after { content: "shipped"; margin-left: auto; font-size: 9px; letter-spacing: .12em; color: var(--grey); }
.pv-set:not(.on) b { color: var(--amber-hot); }
.pv-panel .pv-note { padding: 6px 14px; font-size: 11.5px; color: var(--dim); font-family: "DD Label", sans-serif; }

/* P8 build */
.pv-build { display: flex; gap: 16px 14px; flex-wrap: wrap; padding-bottom: 12px; }
.pv-build .tag { position: relative; display: block; }
.pv-build .tag i {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--ink-base); color: var(--cream); font-style: normal;
  font-size: 10px; padding: 1px 5px; border-radius: 2px; white-space: nowrap;
  border: 1px solid var(--line);
}
.pv-build .tag.pit i { background: var(--defense-blue); }
.pv-build .tag.bat i { background: var(--red-deep); }
.pv-build.ghosted .pick { display: block; outline: 2px solid var(--amber-hot); outline-offset: 2px; }
.pv-build.ghosted .skip { display: block; opacity: .35; }

/* ========================================================= PROMPT INSPECTOR */

.prompt-toggle-btn {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 9999;
  background: var(--panel2);
  border: 1.5px solid var(--line);
  color: var(--cream);
  padding: 6px 14px;
  border-radius: 4px;
  font-family: "DD Label", sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .16s ease;
}
.prompt-toggle-btn:hover {
  border-color: var(--p3-cyan);
  box-shadow: 0 0 10px rgba(59,192,255,0.4);
}
.prompt-toggle-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red-deep);
  box-shadow: 0 0 14px rgba(255,59,71,0.6), 3px 3px 0px var(--red-deep);
  transform: scale(1.04);
}

.prompt-tooltip {
  position: absolute;
  display: none;
  z-index: 10000;
  background: var(--ink);
  color: var(--p3-cyan);
  border: 1.5px solid var(--p3-cyan);
  padding: 4px 10px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: bold;
  pointer-events: none;
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.8), 2px 2px 0px var(--red-deep);
}

.prompt-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  background: var(--panel);
  color: var(--cream);
  border: 2px solid var(--p3-cyan);
  border-left: 6px solid var(--red);
  padding: 12px 20px;
  font-family: "DD Display", sans-serif;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8), 4px 4px 0px var(--red-deep);
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.prompt-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

body.prompt-inspector-active [data-ui-id] {
  cursor: copy !important;
}
body.prompt-inspector-active [data-ui-id]:hover {
  outline: 2px dashed var(--p3-cyan) !important;
  outline-offset: 2px !important;
  background-color: rgba(59,192,255,0.06) !important;
}
