/* Size Up Business Stylesheet - Blueprint Engine matching Size It Up */
.sab-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  font-family: inherit;
  color: var(--text, #16202e);
}

.sab-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.sab-header h1 {
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  color: var(--text, #16202e);
}

.sab-header p {
  color: var(--text-dim, #596779);
  font-size: 13.5px;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.45;
}

/* Card Wrap matching .game-card in Size It Up */
.sab-game-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  border-radius: var(--radius-lg, 14px);
  padding: 16px 20px 24px;
  box-shadow: var(--shadow-card, 0 4px 20px rgba(15, 28, 46, 0.06));
}

/* Game HUD */
.sab-hud {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  margin-bottom: 12px;
}

.sab-hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sab-mode-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  background: var(--surface-raise, rgba(22, 32, 46, 0.04));
  color: var(--text-dim, #596779);
  border: 1px solid var(--line-strong, rgba(22, 32, 46, 0.16));
  transition: all 0.15s;
}

.sab-mode-pill.active {
  background: var(--accent, #c83225);
  color: #fff;
  border-color: var(--accent, #c83225);
}

.sab-hud-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sab-stat-item {
  font-size: 13px;
  color: var(--text-dim, #596779);
  font-family: var(--font-mono, monospace);
}

.sab-stat-item strong {
  color: var(--text, #16202e);
  font-size: 15px;
}

/* Active Metric Banner */
.sab-metric-banner {
  background: linear-gradient(135deg, #183f73, #1f4f8e);
  color: #ffffff;
  border-radius: var(--radius-sm, 7px);
  padding: 7px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

.sab-metric-banner .sab-as-of {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 500;
}

/* Prompt Head */
.sab-prompt-head {
  padding: 6px 0 12px;
  text-align: center;
}

.sab-prompt-text {
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 500;
  color: var(--text-dim, #596779);
  margin: 0;
}

.sab-target-title {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--siu-target, #ff6b5c);
}

.sab-target-subtext {
  font-size: 12px;
  color: var(--text-faint, #6c7889);
  margin-top: 2px;
}

/* Blueprint Board Frame */
.sab-frame {
  position: relative;
  width: 100%;
}

.sab-board {
  position: relative;
  width: 100%;
  height: clamp(230px, 32vh, 320px);
  border-radius: var(--radius-md, 10px);
  background-color: var(--siu-board, #1f4f8e);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sab-board[data-dragging="true"] {
  cursor: grabbing;
}

.sab-board[data-live="false"] {
  cursor: default;
}

.sab-plan {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--siu-grid-major, rgba(255, 255, 255, 0.18)) 1px, transparent 1px),
    linear-gradient(90deg, var(--siu-grid-major, rgba(255, 255, 255, 0.18)) 1px, transparent 1px),
    linear-gradient(var(--siu-grid, rgba(255, 255, 255, 0.08)) 1px, transparent 1px),
    linear-gradient(90deg, var(--siu-grid, rgba(255, 255, 255, 0.08)) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 10px 10px, 10px 10px;
}

.sab-stage-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.sab-ground {
  stroke: var(--siu-ground, #ffffffd9);
  stroke-width: 2px;
}

.sab-strip {
  fill: var(--siu-strip, #183f73);
}

.sab-tick {
  stroke: var(--siu-ink, #ffffffeb);
  stroke-width: 1.5px;
}

.sab-tick-minor {
  stroke: var(--siu-ink-soft, #ffffff78);
  stroke-width: 1px;
}

.sab-tick-label {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  fill: var(--siu-ink, #ffffffeb);
  font-family: var(--font-mono, monospace);
  user-select: none;
}

/* Reveal Result Flags on Ruler matching Size It Up */
.sab-flag line {
  stroke-width: 2px;
}

.sab-flag text {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, monospace);
  user-select: none;
}

.sab-flag-you line {
  stroke: var(--siu-ink-soft, #ffffff78);
  stroke-dasharray: 3 3;
}

.sab-flag-you text {
  fill: var(--siu-ink, #ffffffeb);
}

.sab-flag-real line {
  stroke: #10b981;
}

.sab-flag-real text {
  fill: #10b981;
}

/* Interactive Handles matching Size It Up */
.sab-knob {
  cursor: ew-resize;
}

.sab-knob-stem {
  stroke: var(--siu-target, #ff6b5c);
  stroke-width: 2px;
}

.sab-knob-grip {
  fill: var(--siu-target, #ff6b5c);
}

.sab-knob-lines {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5px;
  stroke-linecap: round;
}

.sab-handle-group {
  cursor: nesw-resize;
}

/* Reference Label (Top-Left of Blueprint) */
.sab-ref-label {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  margin: 0;
  pointer-events: none;
  font-size: 12.5px;
  color: var(--siu-ink, #ffffffeb);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 32, 62, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sab-ref-label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #ffffff;
  flex-shrink: 0;
}

.sab-ref-label b {
  font-weight: 700;
  color: #ffffff;
}

.sab-ref-label span {
  font-family: var(--font-mono, monospace);
  color: #93c5fd;
}

/* Floating Target Dimension Pill */
.sab-pill {
  position: absolute;
  z-index: 3;
  background: var(--siu-pill, #ffffff);
  color: var(--siu-pill-ink, #183f73);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  border-radius: 8px;
  padding: 4px 10px;
  box-shadow: 0 3px 12px rgba(8, 24, 48, 0.35);
  font-family: var(--font-mono, monospace);
  transition: transform 0.05s ease-out;
}

/* Zoom Controls (Top Right of Board) */
.sab-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  background: rgba(8, 24, 48, 0.65);
  border-radius: 9px;
  padding: 2px;
  display: flex;
  gap: 2px;
  backdrop-filter: blur(4px);
}

.sab-zoom button {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: #ffffff;
  border-radius: 7px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.sab-zoom button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.sab-zoom button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Bottom Deck Controls */
.sab-foot {
  padding-top: 14px;
}

.sab-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}

.sab-slider-wrap {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sab-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sab-slider-track {
  flex: 1;
  display: flex;
  align-items: center;
}

.sab-nudge-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm, 7px);
  background: var(--surface-raise, rgba(22, 32, 46, 0.04));
  border: 1px solid var(--line-strong, rgba(22, 32, 46, 0.16));
  color: var(--text, #16202e);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.sab-nudge-btn:hover {
  background: var(--surface-raise-2, rgba(22, 32, 46, 0.08));
  border-color: var(--text-dim, #596779);
}

.sab-nudge-btn:active {
  transform: scale(0.92);
  background: var(--accent, #c83225);
  color: #fff;
}

.sab-range-input {
  width: 100%;
  accent-color: var(--accent, #c83225);
  cursor: pointer;
  height: 6px;
}

.sab-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim, #596779);
}

/* Lock In & Action Buttons */
.sab-btn-lock {
  min-width: 160px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md, 10px);
  border: none;
  cursor: pointer;
  background: var(--accent, #c83225);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200, 50, 37, 0.28);
  transition: all 0.12s;
}

.sab-btn-lock:hover {
  background: var(--accent-hover, #b0271c);
  transform: translateY(-1px);
}

.sab-btn-lock:active {
  transform: scale(0.98);
}

/* Reveal Result Deck */
.sab-deck.sab-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "verdict points next"
    "fact fact fact";
  align-items: center;
  gap: 12px 20px;
}

@media (max-width: 640px) {
  .sab-deck.sab-result {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "verdict points"
      "fact fact"
      "next next";
  }
  .sab-btn-lock {
    width: 100%;
  }
}

.sab-verdict {
  grid-area: verdict;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sab-verdict-head {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sab-accuracy {
  font-size: clamp(20px, 3.2vw, 24px);
  font-weight: 800;
  color: var(--text, #16202e);
  font-family: var(--font-mono, monospace);
}

.sab-off-badge {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.sab-off-badge.spot-on { background: #dcfce7; color: #15803d; }
.sab-off-badge.very-close { background: #e0f2fe; color: #0369a1; }
.sab-off-badge.close { background: #fef3c7; color: #b45309; }
.sab-off-badge.off { background: #fee2e2; color: #b91c1c; }

.sab-verdict-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-dim, #596779);
}

.sab-points-badge {
  grid-area: points;
  font-size: 22px;
  font-weight: 800;
  color: #15803d;
  font-family: var(--font-mono, monospace);
}

.sab-next-btn {
  grid-area: next;
  height: 44px;
  padding: 0 20px;
  font-weight: 700;
  border-radius: var(--radius-md, 10px);
  border: none;
  cursor: pointer;
  background: #15803d;
  color: #fff;
  transition: all 0.12s;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25);
}

.sab-next-btn:hover {
  background: #166534;
}

.sab-fact-card {
  grid-area: fact;
  background: var(--surface-raise, rgba(22, 32, 46, 0.04));
  border-left: 3px solid var(--accent, #c83225);
  border-radius: 0 var(--radius-sm, 7px) var(--radius-sm, 7px) 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim, #596779);
}

.sab-fact-bonus {
  font-weight: 600;
  color: var(--text, #16202e);
  margin-top: 4px;
}

/* In-place Game Over Screen matching Size It Up */
.sab-over {
  padding: 16px 0 6px;
  text-align: center;
}

.sab-over .over-header {
  margin-bottom: 12px;
}

.sab-over .siu-actions button {
  min-width: 150px;
}

/* SEO Grid */
.sab-seo-grid {
  margin-top: 3rem;
  border-top: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  padding-top: 2rem;
}

.sab-seo-grid h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text, #16202e);
}

.sab-pairs-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.sab-pair-card {
  display: block;
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  border-radius: var(--radius-md, 10px);
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}

.sab-pair-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #c83225);
}

.sab-pair-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text, #16202e);
  margin-bottom: 2px;
}

.sab-pair-hook {
  font-size: 12px;
  color: var(--text-dim, #596779);
  line-height: 1.35;
}

.sab-seo-sub {
  margin: -0.75rem 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-dim, #596779);
  line-height: 1.5;
}

/* Editorial & FAQ Section */
.sab-editorial-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  color: var(--text, #16202e);
}

.sab-editorial-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 1.75rem 0 0.75rem;
  color: var(--text, #16202e);
}

.sab-editorial-section h2:first-child {
  margin-top: 0;
}

.sab-editorial-section p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-dim, #596779);
  margin: 0 0 0.85rem;
}

.sab-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 1rem 0 1.5rem;
}

.sab-step-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
}

.sab-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent, #c83225);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.sab-step-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text, #16202e);
  margin-bottom: 6px;
}

.sab-step-card p {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}

.sab-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0.75rem 0 1.5rem;
}

.sab-faq-item {
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(22, 32, 46, 0.08));
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
}

.sab-faq-q {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text, #16202e);
  margin: 0 0 6px;
}

.sab-faq-a {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-dim, #596779);
  margin: 0;
}

.sab-more-games-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sab-more-game-pill {
  padding: 6px 12px;
  background: var(--surface, #fff);
  border-radius: 8px;
  border: 1px solid var(--line, rgba(22, 32, 46, 0.12));
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text, #16202e);
  transition: border-color 0.15s, transform 0.15s;
}

.sab-more-game-pill:hover {
  border-color: var(--accent, #c83225);
  transform: translateY(-1px);
}

/* Hide empty shells until game.js fills in the first round (no placeholder flash) */
.sab-prompt-text:has(#sab-target-title:empty),
.sab-ref-label:has(#sab-ref-name:empty),
.sab-pill:has(#sab-pill-metric:empty) { visibility: hidden; }
