/* ==========================================================================
   Shared replay chrome — controls, status, move list (all games)
   Loaded before css/replay/{game}.css on match pages with replay=true.
   ========================================================================== */

.retro-match-replay {
  margin: 1rem 0 1.4rem;
}

.retro-match-replay .retro-match-replay__panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.retro-match-replay .retro-match-replay__title {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.retro-match-replay .retro-match-replay__controls {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.retro-match-replay .retro-match-replay__nav-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.retro-match-replay .retro-match-replay__controls button,
.retro-match-replay .retro-match-replay__controls select {
  border: 1px solid var(--retro-line);
  background: var(--retro-surface-highlight);
  color: var(--retro-ink);
  font-family: var(--retro-sans);
  cursor: pointer;
}

.retro-match-replay .retro-match-replay__controls .retro-match-replay__control-btn,
.retro-match-replay .retro-match-replay__controls .retro-match-replay__speed-select {
  border-width: 2px;
  border-style: solid;
  border-color: var(--retro-line);
  border-radius: 0.35rem;
  box-shadow: 2px 2px 0 rgba(30, 25, 20, 0.2);
  background: var(--retro-surface-highlight);
  color: var(--retro-ink);
  min-height: 2.85rem;
}

.retro-match-replay .retro-match-replay__controls .retro-match-replay__control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.85rem;
  padding: 0.35rem 0.55rem;
  text-transform: none;
  letter-spacing: 0;
}

.retro-match-replay .retro-match-replay__btn-icon {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  fill: currentColor;
}

.retro-match-replay .retro-match-replay__speed-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-family: var(--retro-sans);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--retro-ink);
}

.retro-match-replay .retro-match-replay__controls .retro-match-replay__speed-select {
  padding: 0 1.85rem 0 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.85rem;
}

.retro-match-replay .retro-match-replay__controls button:disabled,
.retro-match-replay .retro-match-replay__controls .retro-match-replay__speed-select:disabled,
.retro-match-replay .retro-match-replay__move-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.retro-match-replay .retro-match-replay__status {
  font-family: var(--retro-sans);
  color: var(--retro-ink);
  margin: 0;
  min-height: 1.2em;
}

.retro-match-replay .retro-match-replay__move-list {
  position: relative;
  margin-top: 0;
  max-height: 10rem;
  overflow-y: auto;
  border: 1px solid var(--retro-line);
  background: var(--retro-surface-inset);
}

.retro-match-replay .retro-match-replay__move-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px dashed var(--retro-border-soft);
  background: transparent;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  font-family: var(--retro-sans);
  font-size: 1rem;
  line-height: 1.35;
  color: var(--retro-ink);
}

.retro-match-replay .retro-match-replay__move-item:last-child {
  border-bottom: none;
}

.retro-match-replay .retro-match-replay__move-item.is-active {
  background: var(--retro-surface-highlight);
  font-weight: 700;
}

.retro-match-replay .retro-match-replay__error {
  color: #8e1d1d;
  margin: 0.5rem 0;
  font-family: var(--retro-sans);
}

/* Shared by flight animations in game stylesheets. */
@property --fly-lift {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@media (max-width: 720px) {
  .retro-match-replay .retro-match-replay__controls {
    flex-wrap: nowrap;
    gap: 0.25rem;
    width: 100%;
  }

  .retro-match-replay .retro-match-replay__nav-btns {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 0.2rem;
    min-width: 0;
  }

  .retro-match-replay .retro-match-replay__controls .retro-match-replay__control-btn,
  .retro-match-replay .retro-match-replay__controls .retro-match-replay__speed-select {
    min-height: 2.35rem;
    box-shadow: 1px 1px 0 rgba(30, 25, 20, 0.2);
  }

  .retro-match-replay .retro-match-replay__controls .retro-match-replay__control-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.25rem;
  }

  .retro-match-replay .retro-match-replay__btn-icon {
    width: 1.35rem;
    height: 1.35rem;
  }

  .retro-match-replay .retro-match-replay__speed-label {
    flex: 0 0 auto;
    gap: 0;
    font-size: 0;
  }

  .retro-match-replay .retro-match-replay__controls .retro-match-replay__speed-select {
    min-width: 3.1rem;
    padding: 0 1.45rem 0 0.4rem;
    font-size: 0.8rem;
  }
}

@media print {
  .retro-match-replay .retro-match-replay__controls,
  .retro-match-replay .retro-match-replay__status,
  .retro-match-replay .retro-match-replay__move-list {
    display: none !important;
  }
}
