:root {
  --ink: #23212a;
  --muted: #6b6678;
  --panel: #fff9ed;
  --line: #3f2d22;
  --board: #e9b65f;
  --board-edge: #b57330;
  --mint: #7ac9a7;
  --coral: #ff7f6e;
  --sky: #80bde8;
  --sun: #ffd166;
  --shadow: 0 20px 50px rgba(55, 39, 23, 0.18);
}

/* 2.0 Xiao Qishi visual system */
:root {
  --ink: #2f2925;
  --muted: #756962;
  --panel: #fffaf0;
  --line: #5a3521;
  --board: #e8b25d;
  --board-edge: #ad5b32;
  --mint: #55bca1;
  --coral: #f05a50;
  --sky: #58aee3;
  --sun: #ffbe3d;
  --cream: #fff4dd;
  --shadow: 0 14px 34px rgba(90, 53, 33, 0.15);
}

body {
  background: #fff7e8;
}

.app-shell {
  width: min(1320px, calc(100vw - 28px));
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.play-area,
.side-panel,
.review-workspace {
  border: 3px solid #f0dfc4;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.play-area {
  padding: 20px;
  border-radius: 8px;
}

.side-panel {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 8px;
  background: #fffaf0;
}

.topbar {
  align-items: center;
}

.brand-lockup,
.top-actions,
.panel-title-row,
.command-row,
.ai-actions,
.review-header,
.review-header-actions,
.review-controls {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-lockup h1 {
  color: #36271f;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
}

.brand-subtitle {
  margin: 5px 0 0;
  color: #a44f39;
  font-size: 0.86rem;
  font-weight: 900;
}

.eyebrow {
  color: #c24e3e;
}

.top-actions {
  gap: 8px;
}

.turn-pill {
  min-width: 154px;
  padding: 9px 12px;
  background: #ffca55;
  border-color: #cf8234;
}

.mascot-sprite {
  display: block;
  flex: 0 0 auto;
  background-image: url("./assets/mascot/xiaoqishi-sheet.png");
  background-repeat: no-repeat;
}

.mascot-head {
  width: 62px;
  height: 62px;
  border: 3px solid #ffc54b;
  border-radius: 50%;
  background-size: 234px 234px;
  background-position: -21px -23px;
  background-color: #fff3d6;
  box-shadow: 0 6px 12px rgba(164, 79, 57, 0.15);
}

.mascot-full {
  width: 126px;
  height: 138px;
  background-size: 292px 292px;
  background-position: -2px -21px;
  background-color: #ffedc4;
  background-blend-mode: multiply;
  filter: saturate(1.06) contrast(1.02);
}

.mascot-thinking {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-size: 294px 294px;
  background-position: -173px -118px;
  background-color: #fff4dc;
}

.mascot-panel {
  min-height: 142px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 10px 14px 0;
  overflow: hidden;
  background: #ffedc4;
  border-bottom: 3px solid #f2d59e;
}

.mascot-copy {
  min-width: 0;
  align-self: center;
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
}

.mascot-copy strong {
  color: #a43f35;
  font-size: 1rem;
}

.mascot-copy > span:last-child {
  color: #76655a;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.45;
}

.mascot-name {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
  background: #ef5a4d;
  font-size: 0.76rem;
  font-weight: 950;
}

.panel-section {
  padding: 14px;
  border-bottom: 2px solid #f0dfc4;
}

.panel-section h2 {
  color: #46362d;
}

.setup-panel {
  display: grid;
  gap: 12px;
}

.setup-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.setup-row > div {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 46px;
  gap: 7px;
}

.mode-segment {
  grid-template-columns: 1fr 1fr;
}

.segmented button {
  min-width: 0;
  color: #5b4c45;
  background: #fffdf8;
  border-color: #e7d5ba;
}

.segmented button.active {
  color: #fff;
  background: #ee6255;
  border-color: #c9453d;
}

.segmented-boards {
  grid-template-columns: repeat(5, 1fr);
}

.setup-row .segmented {
  min-width: 0;
  height: 46px;
  align-items: stretch;
  gap: 6px;
}

.setup-row .segmented button {
  width: 100%;
  height: 46px;
  min-height: 46px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  line-height: 1;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.command-row {
  gap: 8px;
}

.command-row .primary-button {
  flex: 1 1 auto;
}

.primary-button,
.ai-button,
.icon-text-button,
.square-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
}

.primary-button,
.ai-button {
  color: #fff;
  background: #e95249;
  border: 2px solid #c9433c;
}

.primary-button:hover,
.ai-button:hover {
  background: #d94740;
}

.ai-button,
.icon-text-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
}

.icon-text-button {
  color: #704231;
  background: #fff2d3;
  border: 2px solid #e7c485;
}

.square-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #6d4738;
  background: #fff5df;
  border: 2px solid #e5c99b;
  font-size: 1.05rem;
}

.board-stage {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
}

.board-wrap {
  width: 100%;
}

.board {
  border: 8px solid #ae6238;
  background: #e8b25d;
  box-shadow: inset 0 0 0 3px #f8d48d, 0 14px 26px rgba(86, 50, 29, 0.2);
}

.grid-line {
  background: #563421;
}

.grid-line.horizontal.edge,
.grid-line.vertical.edge {
  background: #4c2b1c;
}

.hoshi::before {
  background: #70412a;
}

.stone {
  border-width: 2px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12), inset 0 3px 0 rgba(255, 255, 255, 0.2), 0 3px 7px rgba(63, 42, 29, 0.28);
}

.stone.black {
  color: #fff7e7;
  background: #363136;
  border-color: #171417;
}

.stone.white {
  color: #473d36;
  background: #fff8e9;
  border-color: #cdbda4;
}

.stone::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 12%;
  width: 25%;
  height: 12%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(-22deg);
}

.stone .cheek {
  top: 58%;
  width: 14%;
  height: 9%;
  border: 0;
  border-radius: 50%;
  background: #ff8f86;
  opacity: 0.9;
}

.stone .cheek.left {
  left: 12%;
}

.stone .cheek.right {
  right: 12%;
}

.stone.black .cheek {
  background: #ff8178;
}

.stone .face {
  z-index: 2;
  font-weight: 900;
}

.stone .hair {
  z-index: 2;
}

.stone.danger {
  outline: 3px solid rgba(239, 83, 73, 0.6);
  outline-offset: 1px;
}

.coach-note {
  position: relative;
  left: auto;
  bottom: auto;
  width: min(100%, 620px);
  max-width: none;
  box-sizing: border-box;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 7px;
  border: 2px solid #efc879;
  border-radius: 8px;
  color: #704230;
  background: #fff8e8;
  box-shadow: 0 8px 18px rgba(85, 53, 30, 0.12);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.4;
  z-index: 1;
}

.coach-note .coach-avatar {
  width: 44px;
  height: 44px;
  background-size: 168px 168px;
  background-position: -15px -17px;
}

.message {
  border-color: #ecd5ac;
  background: #fff7e7;
}

.ai-panel {
  display: grid;
  gap: 10px;
  background: #fff1dd;
}

.panel-title-row {
  justify-content: space-between;
  gap: 10px;
}

.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a786e;
  font-size: 0.74rem;
  font-weight: 900;
}

.ai-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e4a43a;
}

.ai-status.ready i {
  background: #39a77f;
}

.ai-status.offline i {
  background: #df5a52;
}

.ai-level-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.ai-level-row label {
  color: #775d50;
  font-size: 0.8rem;
  font-weight: 850;
}

.ai-level-row select {
  width: 100%;
  min-height: 36px;
  border: 2px solid #e6cda4;
  border-radius: 8px;
  padding: 5px 8px;
  color: #3e342e;
  background: #fffdf7;
  font: inherit;
  font-weight: 850;
}

.ai-level-note {
  display: block;
  margin-top: -4px;
  color: #8b7468;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.4;
}

.ai-actions {
  gap: 8px;
}

.ai-actions > * {
  flex: 1 1 0;
}

.ai-insight {
  min-height: 62px;
  display: grid;
  gap: 3px;
  padding: 10px;
  border-left: 5px solid #58aee3;
  border-radius: 4px;
  background: #fffdf8;
}

.ai-insight strong {
  color: #3a6785;
  font-size: 0.86rem;
}

.ai-insight span {
  color: #6f6761;
  font-size: 0.78rem;
  line-height: 1.42;
}

.ai-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.ai-marker {
  position: absolute;
  left: calc(var(--grid-start) + var(--x) * var(--cell));
  top: calc(var(--grid-start) + var(--y) * var(--cell));
  width: clamp(18px, calc(var(--cell) * 0.7), 32px);
  height: clamp(18px, calc(var(--cell) * 0.7), 32px);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #e95349;
  box-shadow: 0 3px 8px rgba(76, 42, 27, 0.3);
  font-size: 0.72rem;
  font-weight: 950;
}

.ai-marker:nth-child(2) { background: #4f9fd1; }
.ai-marker:nth-child(3) { background: #49aa87; }

.player-card.active {
  border-color: #f05a50;
  background: #fff0d5;
}

.current-player,
.player-card,
.position-panel,
.analysis-summary,
.analysis-card {
  border-color: #ead8bb;
  background: #fffdf8;
}

.review-workspace {
  width: min(1320px, calc(100vw - 28px));
  margin: 0 auto 18px;
  border-radius: 8px;
  overflow: hidden;
}

.review-header {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 3px solid #f0dfc4;
  background: #fff1d7;
}

.review-header h2 {
  color: #4b3328;
  font-size: 1.25rem;
}

.review-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.obsidian-save-tools {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px 7px;
}

.obsidian-save-tools > span {
  grid-column: 1 / -1;
  color: #846d61;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: right;
}

.obsidian-save-tools > span.success,
.reward-archive-status.success {
  color: #257553;
}

.obsidian-save-tools > span.error,
.reward-archive-status.error {
  color: #c3433c;
}

.obsidian-save-tools .ghost-button,
.obsidian-open-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.obsidian-open-link[hidden] {
  display: none;
}

.review-layout {
  padding: 16px;
}

.review-controls {
  gap: 8px;
  margin-bottom: 14px;
}

.review-controls input[type="range"] {
  min-width: 0;
  flex: 1 1 auto;
  accent-color: #e95349;
}

.review-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 14px;
  margin-bottom: 14px;
}

.review-visual-card {
  min-width: 0;
  padding: 14px;
  border: 2px solid #ead9bf;
  border-radius: 8px;
  background: #fffdf8;
}

.review-visual-head {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-visual-head h3 {
  margin: 0;
  color: #49362d;
  font-size: 1rem;
}

.review-visual-head span {
  display: block;
  margin-top: 3px;
  color: #857269;
  font-size: 0.74rem;
  font-weight: 800;
}

.chart-legend,
.variation-legend {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #745e54;
  font-size: 0.72rem;
  font-weight: 900;
}

.chart-legend i {
  width: 18px;
  height: 4px;
  border-radius: 4px;
  background: #ef554b;
}

.variation-legend b {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #ef554b;
  font-size: 0.68rem;
}

.variation-legend i {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 3px solid #ef554b;
  border-radius: 50%;
  background: transparent;
}

.chart-canvas-wrap,
.variation-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 250px;
  overflow: hidden;
  border-radius: 6px;
  background: #fff8e9;
}

#winrateChart,
#variationCanvas {
  width: 100%;
  height: 250px;
  display: block;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #9a8376;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
  pointer-events: none;
}

.tactic-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 8px;
  color: #fff;
  background: #ee5a4f;
  font-size: 0.68rem;
  font-weight: 950;
}

.review-move-button small {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.tactic-badge.skill-hane,
.tactic-badge.skill-kosumi,
.tactic-badge.skill-jump,
.tactic-badge.skill-smallKnight,
.tactic-badge.skill-largeKnight {
  background: #4f9fd1;
}

.tactic-badge.skill-sanSan,
.tactic-badge.skill-shusaku,
.tactic-badge.skill-tengen {
  color: #593721;
  background: #f3bb42;
}

.tactic-badge.skill-connect,
.tactic-badge.skill-tiger,
.tactic-badge.skill-extend {
  background: #47a884;
}

.achievement-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  min-width: 240px;
  max-width: min(340px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 3px solid #f2b636;
  border-radius: 8px;
  color: #503329;
  background: #fff3c9;
  box-shadow: 0 12px 30px rgba(96, 57, 33, 0.24);
  animation: achievement-in 0.28s ease-out;
}

.achievement-toast[hidden] {
  display: none;
}

.achievement-star {
  color: #f09b22;
  font-size: 1.75rem;
}

.achievement-toast strong,
.achievement-toast small {
  display: block;
}

.achievement-toast small {
  margin-top: 2px;
  color: #84675a;
  font-size: 0.76rem;
  font-weight: 800;
}

.winner-rewards {
  margin-bottom: 10px;
  padding: 12px;
  border: 2px solid #f1c66a;
  border-radius: 8px;
  background: #fff4cf;
}

.winner-rewards[hidden],
.reward-modal[hidden] {
  display: none;
}

.winner-reward-heading {
  display: grid;
  gap: 3px;
  text-align: center;
}

.winner-reward-heading span {
  color: #bd563d;
  font-size: 0.76rem;
  font-weight: 950;
}

.winner-reward-heading strong {
  color: #4c3328;
  font-size: 0.92rem;
}

.winner-reward-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.reward-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(71, 45, 31, 0.58);
  backdrop-filter: blur(3px);
}

.reward-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px;
  border: 4px solid #f3b631;
  border-radius: 8px;
  color: #4b3328;
  background: #fff7df;
  box-shadow: 0 24px 70px rgba(75, 44, 25, 0.34);
  text-align: center;
  animation: reward-dialog-in 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}

.reward-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.reward-kicker {
  display: inline-block;
  margin-bottom: 5px;
  color: #d65b42;
  font-size: 0.8rem;
  font-weight: 950;
}

.reward-dialog h2 {
  margin: 0;
  color: #493027;
  font-size: 1.65rem;
}

.reward-dialog > p {
  margin: 8px auto 2px;
  color: #765d50;
  font-weight: 850;
}

.reward-dialog > .reward-archive-status {
  min-height: 20px;
  margin: 2px auto 12px;
  color: #876b58;
  font-size: 0.76rem;
  font-weight: 850;
}

.reward-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.reward-badge-item {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 12px 10px;
  border: 2px solid #efd291;
  border-radius: 8px;
  background: #fffdf5;
}

.reward-medal {
  --medal-size: 162px;
  position: relative;
  width: var(--medal-size);
  height: var(--medal-size);
  isolation: isolate;
  filter: drop-shadow(0 8px 8px rgba(135, 79, 27, 0.2));
  animation: reward-medal-pop 0.58s cubic-bezier(0.2, 0.95, 0.28, 1.18) both;
}

.reward-badge-item:nth-child(2) .reward-medal {
  animation-delay: 0.12s;
}

.reward-flower,
.reward-flower::before,
.reward-flower::after {
  position: absolute;
  inset: 9%;
  border: 3px solid #e4a91e;
  border-radius: 38%;
  background: #ffd84f;
  content: "";
}

.reward-flower::before {
  inset: -3px;
  transform: rotate(30deg);
}

.reward-flower::after {
  inset: -3px;
  transform: rotate(60deg);
}

.reward-medal-wisdom .reward-flower,
.reward-medal-wisdom .reward-flower::before,
.reward-medal-wisdom .reward-flower::after {
  border-color: #e59a24;
  background: #ffc650;
}

.reward-ring {
  position: absolute;
  inset: 19%;
  z-index: 2;
  border: 15px solid #ec8817;
  border-radius: 50%;
  background: #fff9e8;
  box-shadow: inset 0 0 0 3px #ffefa4;
}

.reward-medal-wisdom .reward-ring {
  border-color: #e85d45;
}

.reward-ring-label {
  position: absolute;
  top: 19%;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  color: #fff4a8;
  font-size: 0.74rem;
  font-weight: 950;
  white-space: nowrap;
}

.reward-ring-stars {
  position: absolute;
  top: 45%;
  z-index: 5;
  color: #ffe75e;
  font-size: 0.9rem;
}

.reward-star-left { left: 19%; }
.reward-star-right { right: 19%; }

.reward-medal-mascot {
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 4;
  transform: translate(-50%, -50%) scale(0.9);
  box-shadow: none;
}

.reward-medal .mascot-thinking {
  border: 3px solid #ffc24a;
  background-color: #fff6df;
}

.reward-badge-copy {
  display: grid;
  gap: 3px;
}

.reward-badge-copy strong {
  color: #52362a;
  font-size: 1rem;
}

.reward-badge-copy span {
  color: #816b5f;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.reward-badge-item.compact {
  gap: 2px;
  padding: 5px 3px;
  border: 0;
  background: transparent;
}

.reward-badge-item.compact .reward-medal {
  --medal-size: 112px;
  margin: -5px 0;
}

.reward-badge-item.compact .reward-ring {
  border-width: 10px;
}

.reward-badge-item.compact .reward-ring-label {
  font-size: 0.58rem;
}

.reward-badge-item.compact .reward-ring-stars {
  font-size: 0.68rem;
}

.reward-badge-item.compact .reward-medal-mascot {
  transform: translate(-50%, -50%) scale(0.62);
}

.reward-badge-item.compact .reward-badge-copy strong {
  font-size: 0.76rem;
}

.reward-continue {
  width: min(280px, 100%);
}

@keyframes reward-dialog-in {
  from { transform: translateY(18px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes reward-medal-pop {
  from { transform: translateY(18px) rotate(-8deg) scale(0.55); opacity: 0; }
  65% { transform: translateY(-4px) rotate(3deg) scale(1.05); opacity: 1; }
  to { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
}

@keyframes achievement-in {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 520px) {
  .reward-dialog {
    padding: 20px 12px 16px;
  }

  .reward-dialog h2 {
    padding: 0 34px;
    font-size: 1.35rem;
  }

  .reward-badge-grid {
    gap: 8px;
  }

  .reward-badge-item {
    padding: 9px 4px;
  }

  .reward-medal {
    --medal-size: min(40vw, 146px);
  }

  .reward-ring {
    border-width: 12px;
  }

  .reward-ring-label {
    font-size: 0.66rem;
  }

  .reward-badge-copy span {
    display: none;
  }
}

.review-main {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
}

.review-move-list {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 6px;
}

.review-move-button {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 2px solid #ead9bf;
  border-radius: 8px;
  color: #4d4038;
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
}

.review-move-button.active {
  border-color: #e95349;
  background: #fff0d9;
}

.review-move-number {
  color: #a3523d;
  font-weight: 950;
}

.review-detail {
  min-height: 260px;
  padding: 16px;
  border: 2px solid #ead9bf;
  border-radius: 8px;
  background: #fffdf8;
}

.review-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #79695f;
  text-align: center;
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.review-stat {
  padding: 10px;
  border-radius: 8px;
  background: #fff1d9;
}

.review-stat span {
  display: block;
  color: #847168;
  font-size: 0.72rem;
  font-weight: 850;
}

.review-stat strong {
  display: block;
  margin-top: 3px;
  color: #3e312b;
  font-size: 1.15rem;
}

.review-commentary {
  margin: 0;
  color: #5f534c;
  line-height: 1.75;
  font-weight: 750;
}

.review-progress {
  margin-top: 10px;
  color: #9c5947;
  font-size: 0.82rem;
  font-weight: 900;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    max-height: none;
    order: 0;
  }

  .mascot-panel {
    min-height: 122px;
  }

  .mascot-full {
    width: 110px;
    height: 120px;
    background-size: 254px 254px;
    background-position: -1px -18px;
  }
}

@media (max-width: 620px) {
  .app-shell,
  .review-workspace {
    width: min(100vw - 12px, 560px);
  }

  .play-area,
  .side-panel {
    padding: 0;
  }

  .play-area {
    padding: 12px;
  }

  .topbar {
    gap: 10px;
  }

  .brand-lockup {
    width: 100%;
  }

  .mascot-head {
    width: 50px;
    height: 50px;
    background-size: 190px 190px;
    background-position: -17px -18px;
  }

  .brand-lockup h1 {
    font-size: 1.45rem;
  }

  .top-actions {
    width: 100%;
  }

  .turn-pill {
    min-width: 0;
    flex: 1 1 auto;
  }

  .coach-note {
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: none;
    padding: 6px 8px 6px 5px;
    font-size: 0.72rem;
  }

  .coach-note .coach-avatar {
    width: 36px;
    height: 36px;
    background-size: 138px 138px;
    background-position: -12px -14px;
  }

  .setup-row {
    grid-template-columns: 1fr;
  }

  .review-main {
    grid-template-columns: 1fr;
  }

  .review-header {
    align-items: stretch;
    flex-direction: column;
  }

  .review-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .obsidian-save-tools {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .obsidian-save-tools > span {
    text-align: left;
  }

  .review-header-actions > .ai-button {
    flex: 1 1 auto;
  }

  .review-visuals {
    grid-template-columns: 1fr;
  }

  .chart-canvas-wrap,
  .variation-canvas-wrap {
    min-height: 220px;
  }

  #winrateChart,
  #variationCanvas {
    height: 220px;
  }

  .review-move-list {
    max-height: 190px;
  }

  .review-stats {
    grid-template-columns: 1fr 1fr;
  }

  .achievement-toast {
    right: 10px;
    bottom: 10px;
  }
}
