/*
  Design philosophy — Tournament Editorial.
  Board-first, deliberate density, graphite-and-parchment hierarchy, and
  reliable mobile reflow. This file changes only /review/ presentation;
  it does not alter blog styles, selectors, or review functionality.
*/

:root {
  --display: "Space Grotesk", sans-serif;
  --body: "Source Sans 3", sans-serif;
  --review-ink: #14202b;
  --review-ink-soft: #203241;
  --review-paper: #f4f6f8;
  --review-accent: #d14a2c;
  --review-accent-soft: #f8e4de;
}

.logo-container-3d { gap: 8px; }
.review-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

/* The visible ad placeholder previously consumed prime first-screen space. */
.stage .ad-top { display: none; }

.stage {
  max-width: 1360px;
  padding-top: clamp(16px, 2.4vw, 32px);
}

.review-intro {
  position: relative;
  isolation: isolate;
  max-width: 1280px;
  min-height: 250px;
  margin: 0 auto 20px;
  padding: clamp(26px, 4vw, 52px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 24px;
  background:
    linear-gradient(92deg, rgba(16, 27, 37, .97) 0%, rgba(16, 27, 37, .93) 48%, rgba(16, 27, 37, .62) 100%),
    url("/img/review-pattern.jpg") center / cover,
    var(--review-ink);
  box-shadow: 0 24px 60px rgba(16, 27, 37, .18);
}

.review-intro::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(42vw, 430px);
  height: 3px;
  content: "";
  background: var(--review-accent);
  z-index: -1;
}

.review-intro h1 {
  max-width: 690px;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.06em;
}

.review-intro p {
  max-width: 590px;
  margin-top: 18px;
  color: rgba(239, 246, 248, .76);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

.intro-kicker {
  color: #b6dfce;
  font-family: var(--mono);
}

.live-dot {
  background: #7fd1a9;
  box-shadow: 0 0 0 4px rgba(127, 209, 169, .14);
}

.intro-meta { gap: 14px; }

.privacy-pill {
  border-color: rgba(182, 223, 206, .26);
  background: rgba(255, 255, 255, .08);
  color: #d7f4e6;
  backdrop-filter: blur(8px);
}

.text-action { color: #fff; }
.text-action:hover { color: #ffd0c2; }

.setup-row {
  max-width: 1280px;
  margin-bottom: 20px;
}

.setup-row .card { min-height: 238px; }

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
  grid-template-areas: "board side";
  max-width: 1280px;
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
}

.board-col {
  grid-area: board;
  width: 100%;
  min-width: 0;
  max-width: none !important;
}

.panel-col {
  display: flex !important;
  grid-area: side;
  width: auto;
  min-width: 0;
  gap: 14px;
}

/* Avoid a large, non-informative card before the first review is loaded. */
.graph-card:has(#eval-graph-wrap[style*="display: none"]) { display: none; }

.lines-panel,
.graph-card,
.rating-card,
.ledger-card,
.insights-card {
  border-radius: 16px;
}

.ledger-card {
  min-height: 238px;
  max-height: 430px;
}

.ledger-empty { padding: 34px 20px; }

.board-with-eval { gap: 12px; }
.board-wrap { min-width: 0; }

/* Tournament Editorial: keep board, navigation and active lesson together. */
@media (min-width: 1000px) {
  .review-grid { grid-template-columns: minmax(0, 630px) minmax(390px, 1fr); justify-content: center; }
  .board-col { width: 100%; max-width: 630px !important; }
  .board-with-eval { width: 100%; max-width: 608px; margin-inline: auto; }
  .board-wrap { max-width: 566px; }
  #myBoard { max-width: 566px; margin-inline: auto; }
  .below-board-panel { max-width: 608px; margin-inline: auto; }
}

.move-coach-panel {
  position: relative;
  margin-top: 12px;
  padding: 14px 15px;
  border: 1px solid rgba(33, 135, 107, .28);
  border-left: 4px solid #1BA6A0;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fcf9 0%, #eef8f5 100%);
  box-shadow: 0 10px 24px rgba(20, 81, 65, .08);
}
.move-coach-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.move-coach-kicker { color:#17836e; font:700 10px/1 var(--mono,monospace); letter-spacing:.12em; }
.move-coach-phase { color:#62737a; font:700 10px/1 var(--mono,monospace); text-transform:uppercase; }
.move-coach-panel h3 { margin:0 0 5px; color:#162d35; font-size:15px; line-height:1.25; }
.move-coach-panel p { margin:0; color:#486068; font-size:12.5px; line-height:1.55; }
.move-coach-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.move-coach-chip { padding:4px 7px; border-radius:999px; color:#23515a; background:#fff; border:1px solid rgba(31, 88, 98, .15); font:700 10px/1.1 var(--mono,monospace); }
.move-coach-candidate { margin-top:10px; padding:8px 10px; border-radius:9px; color:#19434b; background:rgba(255,255,255,.7); border:1px solid rgba(31,88,98,.12); font-size:12px; line-height:1.45; }
.move-coach-candidate strong { color:#0f766e; }

.analysis-workbench { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:12px; }
.analysis-workbench .workbench-card { padding:10px; border-radius:10px; background:#f7fafb; border:1px solid var(--hair); }
.analysis-workbench .workbench-card.wide { grid-column:1/-1; }
.analysis-workbench h4 { margin:0 0 5px; color:#28454e; font-size:11px; letter-spacing:.04em; text-transform:uppercase; }
.analysis-workbench p { margin:0; color:#61737b; font-size:11.5px; line-height:1.5; }

/* Two explicit advantage regions make the graph readable at a glance. */
#eval-graph { height: 156px; }
.eval-graph-wrap { padding: 10px 12px; overflow:hidden; }
.eval-graph-legend { justify-content:space-between; margin-top:9px; font-weight:700; }
.eval-graph-legend span:last-child { color:#334155; }

.board-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) 46px;
  gap: 7px;
}

.board-controls .btn.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 5px;
  font-size: 11px;
}

.board-controls .icon-control {
  width: auto;
  min-width: 0;
  padding: 0 !important;
}

.depth-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.depth-card .depth-opt { min-width: 0; }

.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab { min-width: 0; white-space: normal; line-height: 1.2; }

@media (max-width: 999px) {
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "board"
      "side";
  }

  .panel-col { width: 100%; }
  .move-coach-panel { margin-top:10px; }
}

@media (max-width: 720px) {
  .stage { padding: 16px 14px 48px; }

  .review-intro {
    min-height: 0;
    padding: 28px 22px 26px;
    border-radius: 18px;
  }

  .review-intro h1 { font-size: clamp(34px, 11vw, 48px); }
  .review-intro p { font-size: 14px; line-height: 1.55; }
  .intro-meta { align-items: flex-start; gap: 10px; }

  .setup-row .card { min-height: 0; }
  .depth-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Restore the full-width horizontal evaluation rail after the desktop
     30px rail override. This keeps the board at its natural mobile width. */
  .board-with-eval { flex-direction: column; gap: 7px; }
  .eval-col {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    gap: 3px 8px;
    align-items: center;
  }
  .eval-rail {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    height: 18px;
    min-height: 0;
    flex-direction: row;
    justify-content: flex-start;
    border: 1px solid #b9c5cd;
  }
  #eval-fill {
    width: var(--eval-pct, 50%);
    height: 100% !important;
  }
  .eval-label {
    display: flex !important;
    top: 0 !important;
    right: 0;
    bottom: 0 !important;
    left: 0;
    align-items: center;
    justify-content: center;
    transform: none !important;
  }

  .board-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-controls .icon-control { width: auto; }

  .panel-col { gap: 12px; }
}

@media (max-width: 420px) {
  .stage { padding-right: 10px; padding-left: 10px; }
  .review-mark { width: 28px; height: 28px; flex-basis: 28px; }
  .logo-img { max-width: 33vw; }
  .review-intro { padding: 24px 18px; }
  .review-intro h1 { font-size: 34px; }
  .depth-options { grid-template-columns: 1fr; }
  .board-controls .btn.ghost { min-height: 42px; font-size: 10px; }
  #eval-graph { height: 112px; }
  .analysis-workbench { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .review-intro,
  .setup-row .card,
  .board-col,
  .panel-col {
    animation: review-enter 260ms cubic-bezier(.23, 1, .32, 1) both;
  }

  .setup-row .depth-card { animation-delay: 45ms; }
  .review-grid { animation: review-enter 300ms cubic-bezier(.23, 1, .32, 1) 70ms both; }
}

@keyframes review-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
