:root {
  font-family: "Trebuchet MS", sans-serif;
  color: #20203b;
  background: #f0edf5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  padding: 26px max(5vw, 20px) 38px;
  background: #ffe487;
  border-bottom: 4px solid #20203b;
}
nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
a {
  color: #20203b;
  font-weight: bold;
}
.museum-title {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: center;
}
h1 {
  font-size: clamp(44px, 5vw, 88px);
  margin: 28px 0 6px;
  letter-spacing: -0.065em;
}
header p {
  font-size: 20px;
  margin: 0;
}
#score {
  border: 3px solid #20203b;
  background: #fffdf4;
  padding: 20px 28px;
  font-size: 22px;
  transform: rotate(2deg);
  white-space: nowrap;
  box-shadow: 5px 5px #20203b;
}
main {
  max-width: 1800px;
  margin: auto;
  padding: 30px max(4vw, 20px) 70px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
}
h2 {
  font-size: 32px;
  margin: 0;
  letter-spacing: -0.04em;
}
.section-heading span {
  color: #575267;
}
.hall {
  margin-bottom: 38px;
}
#hall-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.fail-card {
  --accent: #ffe487;
  background: #fffdf4;
  border: 3px solid #20203b;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 5px 6px 0 #20203b;
  min-width: 0;
}
.hero-card {
  display: grid;
  grid-template-columns: 42% 58%;
}
.award {
  grid-column: 1 / -1;
  padding: 10px 18px;
  background: var(--accent);
  font-weight: 900;
  font-size: 18px;
  border-bottom: 3px solid #20203b;
}
.card-media {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  background: #284be8;
}
.fail-frame {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.hero-card .fail-frame {
  height: 100%;
  min-height: 245px;
}
.culprit-sticker {
  position: absolute;
  bottom: 10px;
  right: 12px;
  width: 100px;
  height: 130px;
  object-fit: contain;
  transform: rotate(9deg);
  filter: drop-shadow(3px 0 white) drop-shadow(-3px 0 white)
    drop-shadow(0 3px white) drop-shadow(0 -3px white);
}
.kind-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  border: 2px solid #20203b;
  border-radius: 5px;
  background: var(--accent);
  padding: 5px 10px;
  font-weight: bold;
  font-size: 14px;
}
.card-content {
  padding: 20px;
  min-width: 0;
}
.card-meta {
  font-size: 13px;
  color: #62596d;
  margin: 0 0 7px;
}
h3 {
  font-size: 25px;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.event-line {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 20px;
}
.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 14px;
  padding-top: 12px;
  border-top: 1px solid #d0cad7;
}
time {
  color: #62596d;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.card-footer span {
  color: #62596d;
  font-size: 14px;
}
button {
  font:
    800 16px "Trebuchet MS",
    sans-serif;
  color: #20203b;
  border: 2px solid #20203b;
  border-radius: 7px;
  background: #fffdf4;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
}
.card-footer button {
  background: var(--accent);
}
button:hover {
  background: #ffe487;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
:focus-visible {
  outline: 4px solid #284be8;
  outline-offset: 4px;
}
.kind-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kind-filters button[aria-pressed="true"] {
  color: #fffdf4;
  background: #20203b;
}
.archive-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 24px;
  font-size: 14px;
}
.archive-filter input {
  width: 20px;
  height: 20px;
  accent-color: #284be8;
}
#gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
dialog {
  width: min(95vw, 1300px);
  max-height: 96vh;
  border: 4px solid #20203b;
  border-radius: 12px;
  background: #fffdf4;
  padding: 20px;
}
dialog::backdrop {
  background: #20203bdd;
}
dialog canvas {
  width: 100%;
  background: #fffdf4;
}
#close {
  float: right;
}
#replay-status {
  margin: 0 0 10px;
}
.missing-frame {
  color: #fffdf4;
  padding: 35px;
}
@media (max-width: 1000px) {
  #gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-card {
    display: block;
  }
  .hero-card .fail-frame {
    height: 180px;
    min-height: 0;
  }
  .museum-title {
    align-items: flex-start;
    flex-direction: column;
  }
  #score {
    margin-top: 12px;
    padding: 12px 18px;
  }
}
@media (max-width: 620px) {
  header {
    padding: 20px 18px 28px;
  }
  nav {
    font-size: 14px;
  }
  h1 {
    font-size: 48px;
  }
  header p {
    font-size: 17px;
  }
  main {
    padding: 26px 18px 50px;
  }
  #gallery,
  #hall-cards {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hero-card {
    display: grid;
    grid-template-columns: 36% 64%;
  }
  .hero-card .fail-frame {
    height: 100%;
    min-height: 245px;
  }
  .hero-card .card-content {
    padding: 15px;
  }
  .hero-card h3 {
    font-size: 23px;
  }
  .hero-card .culprit-sticker {
    width: 80px;
    right: 0;
  }
  .section-heading {
    display: block;
  }
  .section-heading span {
    display: block;
    margin-top: 8px;
  }
  .kind-badge {
    left: 7px;
    top: 8px;
    font-size: 12px;
    padding: 4px 6px;
  }
  #score {
    font-size: 19px;
  }
}
