@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@500;600;700;800&display=swap");

:root {
  --bg: #1f1f1d;
  --panel: #2b2a28;
  --panel-soft: #302f2d;
  --text: #f3f4f5;
  --muted: #a8adb3;
  --green: #8bc34a;
  --board-dark: #769656;
  --board-light: #eeeed2;
  --accent: #5e9040;
  --danger: #c64c4c;
}

* {
  box-sizing: border-box;
  font-family:
    "Nunito Sans",
    "Helvetica Neue",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #343331, var(--bg) 58%);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.layout {
  --panel-w: 440px;
  --layout-gap: 10px;
  --layout-pad-x: 20px;
  --layout-pad-y: 32px;
  --bar-total-h: 112px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 8px minmax(320px, var(--panel-w));
  justify-content: start;
  gap: var(--layout-gap);
  padding: 12px 12px 12px 8px;
  height: 100vh;
  align-items: center;
}

.board-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
}

.game-shell {
  width: min(
    calc(100vh - var(--layout-pad-y) - var(--bar-total-h)),
    calc(100vw - var(--layout-pad-x) - var(--panel-w) - 34px)
  );
  min-width: 280px;
  max-width: 100%;
  position: relative;
}

.match-intro {
  position: absolute;
  inset: 56px 0 56px 0;
  z-index: 6;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(14, 16, 14, 0.38);
  backdrop-filter: blur(1px);
  pointer-events: none;
  animation: matchIntroFade 1.25s ease-out forwards;
}

.match-card {
  width: min(430px, 90%);
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.match-card.top {
  background: #1f2124;
  color: #f4f4f5;
}

.match-card.bottom {
  background: #fefefe;
  color: #1e2023;
}

.match-avatar {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: linear-gradient(180deg, #adadad, #707070);
  background-size: cover;
  background-position: center;
}

.match-meta {
  display: grid;
  gap: 2px;
}

.match-meta strong {
  font-size: 24px;
  line-height: 1;
}

.match-meta span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.86;
}

.match-vs {
  width: 90px;
  height: 70px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #f4f5f7;
  background: #3a3b3f;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

@keyframes matchIntroFade {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  14% {
    opacity: 1;
    transform: scale(1);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.pane-resizer {
  width: 8px;
  height: calc(100vh - 24px);
  border-radius: 8px;
  background: transparent;
  cursor: col-resize;
  transition: background-color 0.15s ease;
}

.pane-resizer:hover,
.pane-resizer.dragging {
  background: rgba(255, 255, 255, 0.12);
}

.player-bar {
  height: 56px;
  background: #1f1f1d;
  border: 1px solid #343330;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #ececec;
}

.player-bar.top {
  border-radius: 10px 10px 0 0;
  border-bottom: 0;
}

.player-bar.bottom {
  border-radius: 0 0 10px 10px;
  border-top: 0;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(180deg, #a6a6a6, #717171);
}

.avatar-ai {
  background-color: #ffffff;
  background-image: url("./assets/magnus-avatar.png");
  background-size: cover;
  background-position: center;
  border: 1px solid #d0d0d0;
}

.avatar-user {
  background: linear-gradient(180deg, #9bc2ff, #6177c8);
}

.avatar-user-photo {
  background-color: #ffffff;
  background-image: url("./assets/player-avatar.png");
  background-size: cover;
  background-position: center;
  border: 1px solid #d0d0d0;
}

.identity {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
}

.identity span {
  color: #b7bdc4;
  font-size: 14px;
}

.clock {
  min-width: 82px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: #2e2d2a;
  color: #d8d8d8;
  font-weight: 700;
  font-size: 18px;
}

.clock.active {
  background: #ffffff;
  color: #141414;
}

.clock.low {
  background: #c7443e;
  color: #fff;
  animation: pulseClock 1s infinite;
}

@keyframes pulseClock {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.board {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid #4f4d4b;
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(255, 255, 255, 0.08) inset;
}

.board-area {
  width: 100%;
  position: relative;
}

.board-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.square {
  display: grid;
  place-items: center;
  font-size: clamp(28px, 3.3vw, 42px);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease;
  position: relative;
  border: 0;
  padding: 0;
  line-height: 1;
  width: 100%;
  height: 100%;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}

.square:focus,
.square:focus-visible {
  outline: none;
}

.square.light {
  background: var(--board-light);
}

.square.dark {
  background: var(--board-dark);
}

.square.annot-red {
  box-shadow: inset 0 0 0 9999px rgba(201, 96, 74, 0.72);
}

.square:hover {
  background-image: linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04));
}

.square.selected {
  box-shadow: inset 0 0 0 9999px rgba(246, 246, 105, 0.52);
}

.square.last-move {
  box-shadow: inset 0 0 0 9999px rgba(246, 246, 105, 0.42);
}

.square.premove-mark {
  box-shadow: inset 0 0 0 9999px rgba(206, 92, 78, 0.55);
}

.square.move-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: rgba(55, 55, 55, 0.26);
  pointer-events: none;
  z-index: 1;
}

.square.capture-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  aspect-ratio: 1 / 1;
  border: 7px solid rgba(40, 40, 40, 0.32);
  border-radius: 999px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.coord-file {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.coord-rank {
  position: absolute;
  left: 5px;
  top: 3px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.85;
}

.square.light .coord-file,
.square.light .coord-rank {
  color: #71904f;
}

.square.dark .coord-file,
.square.dark .coord-rank {
  color: #f0eed8;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border: 1px solid #44413d;
  border-radius: 14px;
  padding: 20px;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  max-height: calc(100vh - 24px);
  overflow: auto;
  scrollbar-width: thin;
  align-self: stretch;
}

h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.block {
  display: grid;
  gap: 6px;
  min-height: auto;
}

label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"],
input[type="number"] {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #4a4845;
  background: #403d39;
  color: var(--text);
  padding: 0 12px;
}

select,
button {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #4a4845;
  background: #403d39;
  color: var(--text);
  padding: 0 12px;
}

button {
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.07);
}

.hidden {
  display: none !important;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.review-access-btn {
  width: 100%;
  background: #3c4959;
  border: 1px solid #55677e;
  color: #e6eef8;
}

.review-access-btn:disabled {
  opacity: 0.72;
  background: #343330;
  border-color: #4a4845;
  color: #b0b6bd;
  cursor: not-allowed;
}

.time-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-group {
  background: #282725;
  border: 1px solid #3f3c39;
  border-radius: 10px;
  padding: 10px;
}

.time-group-title {
  font-weight: 800;
  margin-bottom: 8px;
  color: #d7d7d7;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.time-btn {
  height: 34px;
  border-radius: 8px;
  border: 1px solid #4a4845;
  background: #353330;
  color: #e9e9e9;
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
}

.time-btn.active {
  border-color: #78b847;
  box-shadow: inset 0 0 0 2px rgba(120, 184, 71, 0.25);
}

.time-custom {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 24px 1fr auto;
  gap: 6px;
  align-items: center;
}

.time-custom input {
  height: 34px;
  border-radius: 8px;
  border: 1px solid #4a4845;
  background: #353330;
  color: #e9e9e9;
  padding: 0 8px;
}

.time-plus {
  text-align: center;
  color: #b8bec4;
  font-weight: 700;
}

#applyCustomTime {
  height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  background: #4e5f80;
  border: 1px solid #667ba2;
}

#newGame {
  background: var(--green);
  color: #15250f;
  border: 1px solid var(--accent);
}

#undo {
  background: #574f4a;
}

.status {
  background: #292826;
  border: 1px solid #44413e;
  border-radius: 10px;
  padding: 12px;
  min-height: 74px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status.error {
  border-color: var(--danger);
}

textarea#pgnOutput {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #44413e;
  background: #232220;
  color: #d7d7d7;
  padding: 10px;
  resize: none;
  min-height: 86px;
  max-height: 150px;
  line-height: 1.4;
}

.notation-card {
  border: 1px solid #44413e;
  border-radius: 10px;
  background: #232220;
  overflow: hidden;
}

.notation-opening {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #d7d7d7;
  border-bottom: 1px solid #3e3b38;
  background: linear-gradient(180deg, #2b2a28, #262523);
}

.notation-replay-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #3a3734;
  background: #262523;
}

.notation-replay-controls button {
  background: #3a3835;
  color: #e5e7ea;
  border: 1px solid #4b4844;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.notation-replay-controls button:hover {
  background: #4a4743;
}

.replay-label {
  margin: 0 2px;
  font-size: 12px;
  color: #b5bcc4;
  min-width: 74px;
  text-align: center;
}

.notation-rows {
  max-height: 210px;
  overflow: auto;
}

.notation-row {
  display: grid;
  grid-template-columns: 46px 1fr 1fr;
  align-items: center;
  min-height: 34px;
  padding: 4px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.notation-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

.notation-num {
  color: #9ca2a8;
  font-weight: 800;
}

.notation-move {
  color: #e6e7e8;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.notation-move.clickable {
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
}

.notation-move.clickable:hover {
  background: rgba(255, 255, 255, 0.08);
}

.notation-move.active {
  background: rgba(120, 186, 89, 0.28);
  border: 1px solid rgba(153, 214, 116, 0.4);
}

.notation-icon {
  color: #c4c8cc;
  font-size: 21px;
  line-height: 1;
}

textarea#auditOutput {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #44413e;
  background: #1f1f1d;
  color: #bec4cb;
  padding: 10px;
  resize: none;
  min-height: 110px;
  max-height: 180px;
  line-height: 1.35;
  font-size: 12px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
}

.meta {
  margin-top: 0;
  background: #292826;
  border: 1px solid #44413e;
  border-radius: 10px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.meta h3 {
  margin: 0 0 4px;
  color: #ddd;
  font-size: 14px;
}

.meta p {
  margin: 0;
}

.piece {
  position: relative;
  z-index: 2;
  width: 86%;
  height: 86%;
  object-fit: contain;
  pointer-events: none;
  image-rendering: auto;
}

.drag-ghost {
  position: fixed;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
}

.result-modal {
  position: absolute;
  inset: 56px 0 56px 0;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 8, 0.5);
  z-index: 5;
}

.result-modal.hidden {
  display: none;
}

.result-card {
  width: min(440px, 92%);
  position: relative;
  border-radius: 12px;
  background: #252525;
  border: 1px solid #3d3d3d;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  animation: resultPop 240ms ease-out;
  overflow: hidden;
}

@keyframes resultPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-result {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8f8f8f;
  font-size: 18px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid #393939;
}

.result-icon {
  font-size: 34px;
}

.result-header h2 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
}

.result-header p {
  margin: 2px 0 0;
  color: #cbcbcb;
  font-size: 21px;
}

.result-body {
  padding: 16px;
  color: #e1e1e1;
}

.result-body p {
  margin: 0;
  font-size: 20px;
}

.result-review {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.review-title {
  font-weight: 700;
  font-size: 13px;
  color: #e8edf4;
  letter-spacing: 0.2px;
}

.review-grid {
  display: grid;
  gap: 6px;
}

.review-pill {
  --pill-bg: #3a3f46;
  --pill-border: #4b5159;
  --pill-text: #dbe2ea;
  --pill-icon-bg: #4b5159;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  font-size: 13px;
  color: var(--pill-text);
}

.review-pill-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--pill-icon-bg);
}

.review-pill-label {
  font-weight: 800;
}

.review-pill-count {
  font-weight: 900;
  min-width: 20px;
  text-align: right;
}

.review-pill-brilliant {
  --pill-bg: rgba(25, 180, 188, 0.18);
  --pill-border: rgba(34, 196, 205, 0.6);
  --pill-text: #2de2ef;
  --pill-icon-bg: #11a8b0;
}

.review-pill-great {
  --pill-bg: rgba(47, 133, 204, 0.2);
  --pill-border: rgba(68, 154, 224, 0.62);
  --pill-text: #5db8ff;
  --pill-icon-bg: #2f8fdd;
}

.review-pill-best {
  --pill-bg: rgba(131, 193, 54, 0.2);
  --pill-border: rgba(156, 215, 78, 0.62);
  --pill-text: #9bdd47;
  --pill-icon-bg: #7dbb32;
}

.review-pill-book {
  --pill-bg: rgba(214, 181, 142, 0.2);
  --pill-border: rgba(230, 199, 160, 0.62);
  --pill-text: #e3c59b;
  --pill-icon-bg: #c69a65;
}

.review-pill-excellent {
  --pill-bg: rgba(121, 187, 67, 0.2);
  --pill-border: rgba(145, 207, 92, 0.62);
  --pill-text: #8ddf54;
  --pill-icon-bg: #73b53f;
}

.review-pill-good {
  --pill-bg: rgba(133, 173, 125, 0.22);
  --pill-border: rgba(156, 196, 147, 0.62);
  --pill-text: #b8e2b1;
  --pill-icon-bg: #77ab72;
}

.review-pill-inaccuracy {
  --pill-bg: rgba(235, 169, 40, 0.2);
  --pill-border: rgba(247, 188, 73, 0.62);
  --pill-text: #ffc84d;
  --pill-icon-bg: #ecab1f;
}

.review-pill-mistake {
  --pill-bg: rgba(230, 141, 18, 0.2);
  --pill-border: rgba(244, 157, 37, 0.62);
  --pill-text: #ffa631;
  --pill-icon-bg: #e68d12;
}

.review-pill-miss {
  --pill-bg: rgba(235, 94, 94, 0.2);
  --pill-border: rgba(245, 118, 118, 0.64);
  --pill-text: #ff8c8c;
  --pill-icon-bg: #e85c5c;
}

.review-pill-blunder {
  --pill-bg: rgba(215, 58, 58, 0.2);
  --pill-border: rgba(233, 80, 80, 0.64);
  --pill-text: #ff5f5f;
  --pill-icon-bg: #d73a3a;
}

.review-notes {
  font-size: 12px;
  color: #bfc7d0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-jump {
  background: rgba(255, 255, 255, 0.08);
  color: #d7e2ee;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.review-jump:hover {
  background: rgba(255, 255, 255, 0.16);
}

.review-jump-brilliant {
  border-color: rgba(34, 196, 205, 0.55);
  color: #83f2ff;
}

.review-jump-great {
  border-color: rgba(68, 154, 224, 0.55);
  color: #9ed3ff;
}

.review-jump-inaccuracy {
  border-color: rgba(247, 188, 73, 0.58);
  color: #ffd67a;
}

.review-jump-mistake {
  border-color: rgba(244, 157, 37, 0.6);
  color: #ffbe67;
}

.review-jump-blunder {
  border-color: rgba(233, 80, 80, 0.6);
  color: #ff9c9c;
}

.result-actions {
  padding: 8px 16px 16px;
}

.result-review-btn {
  width: 100%;
  height: 54px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #78b847;
  background: linear-gradient(180deg, #7fbe49, #5d9e33);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.review-workspace {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.review-nav {
  display: flex;
  justify-content: flex-end;
}

#exitReviewBtn {
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
  padding: 0 10px;
  background: #3a3835;
  border: 1px solid #4b4844;
  color: #e5e7ea;
}

.in-review-mode .review-hidden {
  display: none !important;
}

.review-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.review-player {
  background: #232220;
  border: 1px solid #3f3c39;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-player .avatar {
  width: 28px;
  height: 28px;
  background-size: cover;
  background-position: center;
}

.review-player-meta {
  display: grid;
  gap: 1px;
}

.review-player-meta strong {
  font-size: 12px;
  color: #e7ecf2;
}

.review-player-meta span {
  font-size: 11px;
  color: #b9c2cd;
}

.review-graph-card {
  background: #232220;
  border: 1px solid #3f3c39;
  border-radius: 10px;
  padding: 8px 10px;
}

.review-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #d6dce4;
  margin-bottom: 4px;
}

.review-eval-now {
  font-weight: 900;
  color: #e6eef8;
}

.review-graph {
  width: 100%;
  height: 92px;
  display: block;
}

.review-graph-mid {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.9;
}

.review-graph-line {
  fill: none;
  stroke: #8fcd58;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-graph-cursor {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 0.8;
  stroke-dasharray: 2 2;
}

.review-graph-dot {
  fill: #9ee168;
}

.review-dot {
  cursor: pointer;
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 0.4;
}

.review-dot-brilliant { fill: #1ed9e2; }
.review-dot-great { fill: #4aa7f3; }
.review-dot-best { fill: #8fdc47; }
.review-dot-book { fill: #c79f6f; }
.review-dot-excellent { fill: #7dcc4c; }
.review-dot-good { fill: #9ccf8f; }
.review-dot-inaccuracy { fill: #f4c24f; }
.review-dot-mistake { fill: #f09a34; }
.review-dot-miss { fill: #f26a6a; }
.review-dot-blunder { fill: #eb4e4e; }

.review-recap-opening {
  font-weight: 800;
  font-size: 13px;
  color: #e8edf4;
  letter-spacing: 0.2px;
  margin: 2px 2px -2px;
}

.review-recap-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.review-recap-row:first-child {
  border-top: 0;
}

.review-recap-moveNo {
  color: #9ca2a8;
  font-weight: 900;
  text-align: right;
}

.review-recap-cell {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #dce2ea;
  cursor: pointer;
}

.review-recap-cell:hover {
  background: rgba(255, 255, 255, 0.08);
}

.review-recap-cell.active {
  background: rgba(120, 186, 89, 0.2);
  border-color: rgba(153, 214, 116, 0.35);
}

.review-step-icon-badge {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--pill-text, #dbe2ea);
  background: var(--pill-bg, #3a3f46);
  border: 1px solid var(--pill-border, #4b5159);
  flex: 0 0 auto;
}

.review-recap-san {
  flex: 1 1 auto;
  text-align: left;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-recap-eval {
  flex: 0 0 auto;
  font-weight: 900;
  font-size: 12px;
  color: rgba(220, 226, 234, 0.95);
}

.review-recap-empty {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(220, 226, 234, 0.35);
}

.review-move-list {
  background: #232220;
  border: 1px solid #3f3c39;
  border-radius: 10px;
  overflow: auto;
  max-height: 240px;
}

.review-move-row {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 7px 10px;
  color: #dce2ea;
  font-size: 12px;
}

.review-move-row:first-child {
  border-top: 0;
}

.review-move-row.active {
  background: rgba(120, 186, 89, 0.2);
}

.review-move-index {
  color: #9ba3ad;
  font-weight: 800;
}

.review-move-san {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-move-tag {
  --pill-bg: #3a3f46;
  --pill-border: #4b5159;
  --pill-text: #dbe2ea;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--pill-text);
  font-weight: 800;
  font-size: 11px;
}

.review-move-eval {
  color: #bbc5d1;
  font-weight: 900;
  min-width: 42px;
  text-align: right;
}

.promotion-modal {
  position: absolute;
  inset: 56px 0 56px 0;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 8, 0.45);
  z-index: 7;
}

.promotion-modal.hidden {
  display: none;
}

.promotion-card {
  width: 176px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
}

.promotion-options {
  display: flex;
  flex-direction: column;
}

.promotion-choice {
  height: 96px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #e7e7e7;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}

.promotion-choice img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.promotion-choice:last-child {
  border-bottom: 1px solid #e7e7e7;
}

.promotion-cancel {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #8f8f8f;
  font-size: 44px;
  line-height: 1;
  font-weight: 300;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    overflow: hidden;
  }

  .game-shell {
    width: min(96vw, calc(100vh - 40vh - 44px - 112px));
    min-width: 260px;
  }

  .panel {
    max-width: min(96vw, 760px);
    margin: 0 auto;
    width: 100%;
    max-height: 36vh;
  }

  .pane-resizer {
    display: none;
  }

  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
