.duels-replay-library {
  color: #f1eff3;
  background: #18181c;
  border: 1px solid #38363e;
  border-radius: 14px;
  width: min(640px, calc(100% - 24px));
  max-height: min(80dvh, 720px);
  padding: 0;
  box-shadow: 0 24px 80px #0009;
}
.duels-replay-library::backdrop { background: #09080bc7; }
.duels-replay-library > header { display: flex; justify-content: space-between; gap: 16px; align-items: start; padding: 20px; border-bottom: 1px solid #343239; }
.duels-replay-library h2, .duels-replay-library h3, .duels-replay-library p { margin: 0; }
.duels-replay-library p { color: #b4b0bd; margin-top: 6px; font-size: .875rem; }
.duels-replay-library-body { padding: 20px; }
:is(#replay-list,#puzzle-list) { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
:is(#replay-list,#puzzle-list) button { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid #3c3945; color: inherit; background: #222127; border-radius: 8px; cursor: pointer; }
:is(#replay-list,#puzzle-list) button:hover { border-color: #cfb4ff; background: #2b2535; }
:is(#replay-list,#puzzle-list) button:focus-visible { outline: 2px solid #cfb4ff; outline-offset: 2px; }
:is(#replay-list,#puzzle-list) button :is(strong, small) { display: block; overflow-wrap: anywhere; }
:is(#replay-list,#puzzle-list) button small { color: #bcb6c8; margin-top: 4px; }
.duels-replay-open { color: #d8c2ff; white-space: nowrap; }
.duels-replay-action { display: grid; justify-items: end; gap: 5px; }
.duels-replay-outcome {
  padding: 2px 7px;
  border: 1px solid #5e516f;
  border-radius: 999px;
  background: #31283d;
  color: #e4d1f8;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.duels-replay-outcome[data-outcome="won"] { border-color: #42745a; background: #21392b; color: #a8efba; }
.duels-replay-outcome[data-outcome="lost"] { border-color: #854858; background: #41262f; color: #ffc0cb; }
.duels-puzzle-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 16px; }
.duels-puzzle-hint { margin-top: 12px; border-radius: 8px; padding: 10px; background: #25212c; }
.duels-puzzle-hint summary { cursor: pointer; }
#table[data-archive-replay] #puzzle-result { display: none; }
#table[data-archive-replay] .controls { overflow: visible; }
#table[data-archive-replay] .controls :is(#turn-status,#table-coach,#selection-actions,.turn-actions,.match-notice),
#table[data-archive-replay] :is(#table-feed-replay,#replay-opponent,#duels-concede,#new-match,#hide-hand) { display: none; }
#table[data-archive-replay] .duels-replay-transport {
  position: fixed;
  z-index: 14;
  right: 14px;
  bottom: 14px;
  width: min(350px, calc(100vw - 28px));
  padding: 11px;
  display: grid;
  gap: 8px;
  background: #17151ef5;
  border: 1px solid #8e78ad;
  border-radius: 8px;
  box-shadow: 0 8px 28px #0008;
  color: #f6efff;
}
.duels-replay-caption { margin: 0; font-size: .75rem; line-height: 1.3; }
.duels-replay-timeline { display: grid; gap: 3px; font-size: .7rem; }
.duels-replay-timeline input { margin: 0; width: 100%; accent-color: #d3b3ff; }
.duels-replay-moments {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: .75rem;
}
.duels-replay-moments select {
  min-width: 0;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid #594c6b;
  border-radius: 5px;
  color-scheme: dark;
  color: inherit;
  background: #24202e;
  font: inherit;
}
.duels-replay-moments select:focus-visible { outline: 2px solid #d3b3ff; outline-offset: 2px; }
.duels-replay-buttons { display: flex; gap: 5px; }
.duels-replay-buttons .btn { font-size: .7rem; padding: 5px 8px; min-height: 30px; }
#replay-close { margin-left: auto; }
.duels-replay-fork { justify-self: stretch; min-height: 36px; color: #ebddff; }
.duels-replay-status, .duel-resume-status { margin: 0; color: #e1d1f1; font-size: .8rem; line-height: 1.4; }
@media (max-width: 900px), (max-height: 739px) {
  #table[data-archive-replay] { padding-bottom: 240px; }
}
