/* ChessPM web analysis - shared by the Razor and the ASPX site */
.an-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  font-family: Arial, sans-serif;
  color: #2c3e50;
}

.an-hero {
  text-align: center;
  margin-bottom: 22px;
}

  .an-hero h1 {
    font-size: 28px;
    margin: 6px 0;
  }

  .an-hero .an-sub {
    color: #666;
    font-size: 15px;
  }

.an-card {
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-left: 4px solid #4a90d9;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 16px 0;
}

  .an-card h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
  }

.an-bullets {
  margin: 6px 0 0 0;
  padding-left: 20px;
  color: #444;
  font-size: 14px;
  line-height: 1.6;
}

.an-note {
  font-size: 13px;
  color: #777;
  margin-top: 6px;
}

.an-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 240px;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  resize: vertical;
}

.an-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.an-count {
  margin-left: auto;
  font-size: 12px;
  color: #888;
}

.an-btn {
  display: inline-block;
  background: #4a90d9;
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

  .an-btn:hover {
    background: #3a7dc4;
    color: #fff;
    text-decoration: none;
  }

  .an-btn:disabled {
    background: #9db9d6;
    cursor: default;
  }

.an-btn-ghost {
  background: #fff;
  color: #2b6cb0;
  border: 1px solid #2b6cb0;
}

  .an-btn-ghost:hover {
    background: #eef5fc;
    color: #2b6cb0;
  }

.an-btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.an-hp {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* honeypot */

.an-msg {
  min-height: 20px;
  font-size: 14px;
  color: #555;
}

.an-msg-err {
  color: #b00020;
  font-weight: 600;
}

.an-quota {
  display: none;
  background: #fff8e1;
  border-left: 4px solid #e0a800;
  padding: 12px 18px;
  margin: 14px 0;
  border-radius: 4px;
}

/* status */
.an-status {
  text-align: center;
  padding: 40px 10px;
}

.an-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 14px auto;
  border: 4px solid #d6e4f3;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: an-spin 0.9s linear infinite;
}

@keyframes an-spin {
  to {
    transform: rotate(360deg);
  }
}

/* result */
.an-title {
  text-align: center;
  margin: 4px 0 2px 0;
  font-size: 24px;
}

.an-subtitle {
  text-align: center;
  color: #777;
  font-size: 13px;
  margin-bottom: 14px;
}

.an-grid {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 18px;
  align-items: start;
}

.an-boardwrap {
  width: 100%;
}

#anBoard {
  width: 100%;
  max-width: 440px;
}

.an-evalbar {
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 8px;
}

.an-evalfill {
  height: 100%;
  width: 50%;
  background: #f2f2f2;
  transition: width 0.25s;
}

.an-evaltext {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 3px;
  min-height: 16px;
}

.an-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}

.an-info {
  margin: 0 0 10px 0;
  padding: 10px 12px;
  background: #f0f7ff;
  border: 1px solid #b8d4f0;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  min-height: 70px;
}

.an-info-head {
  font-weight: 700;
  margin-bottom: 4px;
}

.an-moves {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.9;
  font-size: 14px;
  background: #fff;
  position: relative;
}

.an-mnum {
  color: #888;
  margin-left: 6px;
  font-size: 13px;
}

.an-mv {
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
}

  .an-mv:hover {
    background: #e8f1fb;
  }

  .an-mv.an-cur {
    background: #4a90d9;
    color: #fff;
  }

.an-c-inaccuracy {
  color: #b7791f;
}

.an-c-mistake {
  color: #dd6b20;
  font-weight: 600;
}

.an-c-blunder {
  color: #c53030;
  font-weight: 700;
}

.an-c-best, .an-c-great, .an-c-brilliant {
  color: #2f855a;
}

.an-c-great, .an-c-brilliant {
  font-weight: 700;
}

.an-c-interesting {
  color: #2b6cb0;
  font-weight: 600;
}

.an-mv.an-cur.an-c-inaccuracy, .an-mv.an-cur.an-c-mistake, .an-mv.an-cur.an-c-blunder {
  color: #fff;
}

.an-summary {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

  .an-summary th, .an-summary td {
    border: 1px solid #ddd;
    padding: 5px 8px;
    text-align: center;
  }

    .an-summary th:first-child {
      text-align: left;
    }

  .an-summary thead th {
    background: #f2f2f2;
  }

.an-hint {
  min-height: 18px;
  font-size: 12px;
  color: #b7791f;
  text-align: center;
}

.an-cta {
  margin: 26px 0 10px 0;
  text-align: center;
  background: #f0f7ff;
  border: 1px solid #b8d4f0;
  border-radius: 8px;
  padding: 18px;
}

  .an-cta p {
    margin: 0 0 10px 0;
    color: #444;
  }

@media (max-width: 760px) {
  .an-grid {
    grid-template-columns: 1fr;
  }

  .an-moves {
    max-height: 200px;
  }
}

/* ---- engine choice (submit page) ---- */
.an-engine {
  margin: 14px 0 4px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

  .an-engine label.an-opt {
    display: block;
    border: 1px solid #ccd6e2;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    background: #fff;
  }

    .an-engine label.an-opt:hover {
      background: #f4f8fc;
    }

    .an-engine label.an-opt input {
      margin-right: 8px;
    }

  .an-engine .an-opt-title {
    font-weight: 600;
  }

  .an-engine .an-opt-desc {
    display: block;
    font-size: 13px;
    color: #666;
    margin: 2px 0 0 24px;
  }

.an-depth {
  margin: 6px 0 0 24px;
  font-size: 13px;
  color: #555;
}

  .an-depth select {
    padding: 3px 6px;
  }

.an-sample {
  font-size: 13px;
  margin-left: auto;
}

/* ---- result page extras ---- */
.an-progress {
  width: 100%;
  max-width: 420px;
  height: 8px;
  background: #e3ebf4;
  border-radius: 4px;
  margin: 12px auto 0 auto;
  overflow: hidden;
}

  .an-progress > div {
    height: 100%;
    width: 0%;
    background: #4a90d9;
    transition: width 0.2s;
  }

.an-banner {
  background: #fff8e1;
  border-left: 4px solid #e0a800;
  padding: 8px 14px;
  margin: 0 0 14px 0;
  border-radius: 4px;
  font-size: 13px;
  color: #5c4a00;
}

.an-graph {
  margin: 12px 0 0 0;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #333;
  overflow: hidden;
}

.an-graph-svg {
  display: block;
  width: 100%;
  height: 70px;
}

.an-graph-area {
  fill: #f2f2f2;
}

.an-graph-line {
  fill: none;
  stroke: #4a90d9;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.an-graph-mid {
  stroke: #888;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.an-graph-cur {
  stroke: #e53e3e;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.an-graph-cap {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
  text-align: center;
}

.an-info-pv {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #555;
  margin-top: 6px;
}

.an-info-head.an-c-mistake, .an-info-head.an-c-blunder, .an-info-head.an-c-inaccuracy {
  font-weight: 700;
}

.an-opt-off {
  opacity: 0.6;
  cursor: default !important;
  background: #f3f3f3 !important;
}

.an-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 10px;
  background: #e0a800;
  color: #fff;
  vertical-align: middle;
}

.an-badge-ok {
  background: #2f855a;
}

/* ---- server analysis extras ---- */
.an-dl {
  text-align: center;
  margin-top: 6px;
}

/* ---- server analysis: the waiting screen ---- */
.an-wait {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
  background: #fff;
  border: 1px solid #d6e4f3;
  border-radius: 10px;
  padding: 18px 22px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.an-wait-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.an-wait-line {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.an-wait-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #4a90d9;
}

.an-wait-queued { background: #4a90d9; animation: an-pulse 1.4s ease-in-out infinite; }
.an-wait-running { background: #2f855a; animation: an-pulse 1s ease-in-out infinite; }
.an-wait-offline { background: #e0a800; }
.an-wait-failed { background: #c53030; }

@keyframes an-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.an-wait-bar {
  max-width: none;
  height: 10px;
  margin: 12px 0 0 0;
}

.an-wait-meta {
  font-size: 14px;
  color: #555;
  margin-top: 8px;
  min-height: 18px;
}

.an-wait-note {
  font-size: 13px;
  color: #777;
  margin-top: 12px;
  line-height: 1.5;
}

.an-wait-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.an-wait-conn {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  min-height: 16px;
}

/* ---- result: key moments ---- */
.an-keys {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  margin: 0 0 10px 0;
  padding: 6px 8px;
  font-size: 13px;
}

.an-keys-head {
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 4px 2px;
}

.an-key {
  display: flex;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.4;
}

  .an-key:hover {
    background: #e8f1fb;
  }

  .an-key.an-key-cur {
    background: #dbeafe;
  }

.an-key-mv {
  flex: 0 0 auto;
  min-width: 78px;
}

.an-key-tx {
  color: #555;
}

/* ---- result: dots on the eval graph ---- */
.an-gdot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 1px solid #fff;
  cursor: pointer;
}

.an-gdot-blunder { background: #c53030; }
.an-gdot-mistake { background: #dd6b20; }
.an-gdot-great, .an-gdot-brilliant { background: #2f855a; }

/* ---- result: squares of the move / of the better line ---- */
.an-sq-last {
  box-shadow: inset 0 0 0 3px #f6e05e !important;
}

.an-sq-line {
  box-shadow: inset 0 0 0 3px #4a90d9 !important;
}

/* ---- result: the better line, clickable ---- */
.an-pvmv {
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  color: #2b6cb0;
}

  .an-pvmv:hover {
    background: #e8f1fb;
  }

  .an-pvmv.an-pv-cur {
    background: #4a90d9;
    color: #fff;
  }

.an-line-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.an-line-note {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  min-height: 15px;
}

/* ---- server analysis: "a quick web analysis - deeper in ChessPM" ---- */
.an-server-note {
  max-width: 720px;
  margin: -8px auto 14px auto;
  text-align: center;
  font-size: 13px;
  color: #555;
  background: #f0f7ff;
  border: 1px solid #b8d4f0;
  border-radius: 6px;
  padding: 6px 12px;
}

/* ---- lines inside a comment (book games, alternatives): clickable, ▶ plays them ---- */
.an-cline {
  white-space: normal;
}

.an-play-sm {
  border: 1px solid #4a90d9;
  background: #fff;
  color: #4a90d9;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  vertical-align: middle;
}

  .an-play-sm:hover {
    background: #4a90d9;
    color: #fff;
  }

/* ---- the result columns ----
   narrow: one column; middle: board | comment + key moments, moves, summary (as before);
   wide (the PAGE, not the window, >= 1000px): board + summary | comment + key moments | moves + graph */
.an-wrap { container-type: inline-size; max-width: 1380px; }   /* 3 columns when the page has room */
.an-grid {
  grid-template-areas: "board info" "board moves" "board sum";
  grid-template-rows: auto auto 1fr;
}
.an-boardwrap { grid-area: board; }
.an-col-info { grid-area: info; }
.an-col-moves { grid-area: moves; min-width: 0; }
.an-col-sum { grid-area: sum; }

@media (max-width: 760px) {
  .an-grid { grid-template-areas: "board" "info" "moves" "sum"; grid-template-rows: auto; }
}

@container (min-width: 1000px) {
  .an-grid {
    grid-template-columns: 400px minmax(0, 1fr) minmax(0, 1fr);   /* fixed board column: the board never changes size */
    grid-template-areas: "board info moves" "sum info moves";
    grid-template-rows: auto 1fr;
  }
  .an-moves { max-height: 420px; }
}
