.history-page {
  min-height: 100vh;
  padding: 120px 20px 96px;
  background: #eeeeeb;
  color: #202020;
  font-family:
    "Yu Gothic",
    "Hiragino Kaku Gothic ProN",
    Meiryo,
    sans-serif;
}

.history-page,
.history-page * {
  box-sizing: border-box;
}

.history-page .history-document {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 46px 52px 58px;
  border: 1px solid #b9b9b3;
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.history-page .history-header {
  padding-bottom: 22px;
  border-bottom: 3px double #2a2a2a;
}

.history-page .history-kicker {
  margin: 0 0 8px;
  color: #777770;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.history-page h1 {
  margin: 0;
  font-family:
    "Yu Mincho",
    "Hiragino Mincho ProN",
    "MS PMincho",
    serif;
  font-size: clamp(30px, 5vw, 43px);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.history-page .history-description {
  max-width: 720px;
  margin: 13px 0 0;
  color: #666660;
  font-size: 13px;
  line-height: 1.8;
}

.history-page .history-status {
  display: grid;
  gap: 14px;
  margin: 24px 0 26px;
  padding: 11px 14px;
  border: 1px solid #ccccC6;
  background: #f4f4f0;
}

.history-page .history-status__count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.history-page .history-status__count span {
  color: #666660;
  font-size: 12px;
}

.history-page .history-status__count strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.05em;
}

.history-page .history-groups {
  display: grid;
  gap: 26px;
}

.history-page .history-group {
  border: 1px solid #aeadA6;
  background: #ffffff;
}

.history-page .history-group__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid #aaaaa4;
  background: #262626;
  color: #ffffff;
}

.history-page .history-group__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.history-page .history-group__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-page .history-entry {
  position: relative;
  min-height: 86px;
  padding: 15px 18px 15px 42px;
  border-bottom: 1px dotted #bcbcb6;
}

.history-page .history-entry:last-child {
  border-bottom: 0;
}

.history-page .history-entry::before {
  position: absolute;
  top: 15px;
  left: 18px;
  color: #676761;
  font-family: Georgia, "Times New Roman", serif;
  content: ">";
}

.history-page .history-entry.is-unvisited {
  display: flex;
  min-height: 58px;
  align-items: center;
  color: #90908a;
  background:
    repeating-linear-gradient(
      135deg,
      #fafaf7 0,
      #fafaf7 9px,
      #f4f4ef 9px,
      #f4f4ef 18px
    );
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.16em;
}

.history-page .history-entry__title {
  display: block;
  margin-bottom: 5px;
  color: #202020;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.history-page .history-entry__url {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #344f69;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.history-page .history-entry__meta {
  display: block;
  margin-top: 6px;
  color: #777770;
  font-size: 11px;
  line-height: 1.6;
}

.history-page .completion-reward {
  margin: 0 0 26px;
  padding: 22px;
  border: 1px solid #1d1d1b;
  background: #111111;
  color: #ffffff;
  text-align: center;
}

.history-page .completion-reward__label {
  margin: 0 0 8px;
  color: #b9a477;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.history-page .completion-reward h2 {
  margin: 0;
  font-family:
    "Yu Mincho",
    "Hiragino Mincho ProN",
    serif;
  font-size: 23px;
  font-weight: 600;
}

.history-page .completion-reward p {
  margin: 12px 0 18px;
  color: #c8c8c8;
  font-size: 13px;
}

.history-page .completion-reward__link {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid #b9a477;
  color: #e4d1a5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.history-page .completion-reward__link:hover,
.history-page .completion-reward__link:focus-visible {
  background: #b9a477;
  color: #111111;
}

.history-page .history-loading,
.history-page .history-error {
  color: #777770;
  font-size: 13px;
}

.history-page .history-error {
  margin: 22px 0 0;
  padding: 14px;
  border: 1px solid #a45454;
  color: #7a2f2f;
  background: #fff2f2;
}

@media (max-width: 720px) {
  .history-page {
    padding: 88px 0 72px;
    background: #ffffff;
  }

  .history-page .history-document {
    padding: 30px 15px 40px;
    border: 0;
    box-shadow: none;
  }

  .history-page .history-group__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .history-page .history-entry {
    padding-right: 12px;
    padding-left: 38px;
  }

  .history-page .history-entry::before {
    left: 15px;
  }
}

@media print {
  .history-page {
    padding: 0;
    background: #ffffff;
  }

  .history-page .history-document {
    width: 100%;
    border: 0;
    box-shadow: none;
  }

  .history-page .history-group {
    break-inside: avoid;
  }
}

.history-page .completion-reward.is-revealing {
  position: relative;
  overflow: hidden;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(6px);
  animation: completionRewardReveal 2.4s ease-out forwards;
}

@keyframes completionRewardReveal {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(6px);
  }
  45% {
    opacity: 0.38;
    filter: blur(4px);
  }
  75% {
    opacity: 0.78;
    filter: blur(1.5px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.history-page .completion-reward__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.history-page .completion-reward__links .completion-reward__link {
  margin: 0;
}

@media (max-width: 720px) {
  .history-page .completion-reward__links {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .history-page .completion-reward__links .completion-reward__link {
    text-align: center;
  }
}

.history-page #history-title {
  position: relative;
  display: inline-block;
}

.history-page #history-title.is-glitched::before,
.history-page #history-title.is-glitched::after {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  content: attr(data-glitch-text);
}

.history-page #history-title.is-glitched::before {
  clip-path: inset(8% 0 62% 0);
  opacity: 0.8;
  transform: translate(-3px, -1px);
  animation: historyGlitchNoiseBefore 0.1s steps(2, end) infinite;
}

.history-page #history-title.is-glitched::after {
  clip-path: inset(58% 0 12% 0);
  opacity: 0.65;
  transform: translate(3px, 1px);
  animation: historyGlitchNoiseAfter 0.08s steps(2, end) infinite;
}

@keyframes historyGlitchNoiseBefore {
  0% {
    clip-path: inset(6% 0 72% 0);
    transform: translate(-4px, 0);
  }

  25% {
    clip-path: inset(40% 0 42% 0);
    transform: translate(4px, -1px);
  }

  50% {
    clip-path: inset(74% 0 8% 0);
    transform: translate(-2px, 1px);
  }

  75% {
    clip-path: inset(24% 0 58% 0);
    transform: translate(5px, 0);
  }

  100% {
    clip-path: inset(54% 0 26% 0);
    transform: translate(-3px, -1px);
  }
}

@keyframes historyGlitchNoiseAfter {
  0% {
    clip-path: inset(68% 0 10% 0);
    transform: translate(3px, 1px);
  }

  25% {
    clip-path: inset(18% 0 64% 0);
    transform: translate(-5px, 0);
  }

  50% {
    clip-path: inset(48% 0 30% 0);
    transform: translate(4px, -1px);
  }

  75% {
    clip-path: inset(82% 0 4% 0);
    transform: translate(-3px, 1px);
  }

  100% {
    clip-path: inset(32% 0 50% 0);
    transform: translate(5px, 0);
  }
}
