.gallery-shell {
  --gallery-green: #2d665a;
  --gallery-green-soft: #e5eee9;
  --gallery-gold: #c99734;
  --gallery-red: #8e493f;
  max-width: 900px;
  margin: 0 auto;
  padding: 4px 12px 48px;
}

.gallery-lobby {
  max-width: 680px;
}

.gallery-eyebrow {
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .09em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.gallery-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .98;
  margin: 8px 0 18px;
}

.gallery-intro {
  color: #4e4b44;
  font-size: 1.05rem;
  max-width: 610px;
}

.gallery-rules {
  background: #f0eee8;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding: 18px;
}

.gallery-rule {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 32px minmax(0, 1fr);
  margin: 0;
}

.gallery-rule strong {
  align-items: center;
  background: var(--gallery-green);
  border-radius: 50%;
  color: #fff;
  display: flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.gallery-primary,
.gallery-secondary {
  border-radius: 8px;
  font: inherit;
  font-weight: 760;
  min-height: 46px;
  padding: 11px 18px;
}

.gallery-primary {
  background: var(--gallery-green);
  border: 1px solid #245348;
  color: #fff;
}

.gallery-primary:hover:not(:disabled) {
  background: #214e44;
}

.gallery-primary:disabled {
  cursor: default;
  opacity: .55;
}

.gallery-secondary {
  background: #fffefa;
  border: 1px solid var(--line);
  color: var(--ink);
}

.gallery-progress {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 0 0 18px;
}

.gallery-progress-track {
  background: #dfddd5;
  border-radius: 999px;
  flex: 1;
  height: 7px;
  overflow: hidden;
}

.gallery-progress-track span {
  background: var(--gallery-green);
  display: block;
  height: 100%;
}

.gallery-progress small {
  color: #5d5a53;
  font-weight: 700;
}

.gallery-round-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.gallery-round-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 0;
}

.gallery-selection-count {
  color: #5d5a53;
  flex-shrink: 0;
  font-size: .9rem;
  font-weight: 750;
}

.gallery-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 20px 0;
}

.gallery-card {
  background: #fffefa;
  border: 2px solid transparent;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(36, 32, 25, .08);
  color: var(--ink);
  display: block;
  min-height: 0 !important;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
  width: 100%;
}

.gallery-card:not(:disabled):hover {
  border-color: #78978f;
  transform: translateY(-2px);
}

.gallery-card.is-selected {
  border-color: var(--gallery-green);
  box-shadow: 0 0 0 2px rgba(45, 102, 90, .16), 0 12px 28px rgba(36, 32, 25, .11);
}

.gallery-card img {
  aspect-ratio: 2 / 3;
  background: #ded8ca;
  display: block;
  object-fit: cover;
  width: 100%;
}

.gallery-card-copy {
  display: block;
  min-height: 69px;
  padding: 10px 11px 12px;
}

.gallery-card-copy strong,
.gallery-card-copy small {
  display: block;
}

.gallery-card-copy strong {
  font-size: .88rem;
  line-height: 1.2;
}

.gallery-card-copy small {
  color: #66635c;
  margin-top: 4px;
}

.gallery-check {
  align-items: center;
  background: var(--gallery-green);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: .8rem;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  opacity: 0;
  position: absolute;
  right: 8px;
  top: 8px;
  transform: scale(.8);
  transition: opacity 140ms ease, transform 140ms ease;
  width: 28px;
}

.gallery-card.is-selected .gallery-check {
  opacity: 1;
  transform: scale(1);
}

.gallery-card.result-correct-selected,
.gallery-card.result-correct-missed {
  border-color: var(--gallery-green);
}

.gallery-card.result-correct-selected {
  background: #f2f7f4;
}

.gallery-card.result-correct-missed {
  border-style: dashed;
}

.gallery-card.result-decoy-selected {
  border-color: var(--gallery-red);
}

.gallery-card.result-decoy-unselected {
  opacity: .72;
}

.gallery-card-state {
  align-items: center;
  background: rgba(255, 254, 250, .94);
  border: 1px solid rgba(25, 25, 23, .12);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(25, 25, 23, .1);
  display: inline-flex;
  gap: 5px;
  font-size: .7rem;
  font-weight: 850;
  left: 9px;
  padding: 5px 9px;
  position: absolute;
  top: 9px;
  z-index: 1;
}

.gallery-card-state.state-correct_selected {
  background: #dcebe3;
  border-color: rgba(45, 102, 90, .3);
  color: #214e44;
}

.gallery-card-state.state-correct_missed {
  background: #f3ead7;
  border-color: rgba(201, 151, 52, .42);
  color: #6e501d;
}

.gallery-card-state.state-decoy_selected {
  background: #f5e6e2;
  border-color: rgba(142, 73, 63, .35);
  color: #653c35;
}

.gallery-card-state svg {
  height: 15px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 15px;
}

.gallery-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 18px;
}

.gallery-clue {
  background: #f3ead7;
  border-left: 4px solid var(--gallery-gold);
  border-radius: 6px;
  margin: 16px 0;
  padding: 13px 15px;
}

.gallery-clue strong,
.gallery-clue span {
  display: block;
}

.gallery-clue span {
  margin-top: 4px;
}

.gallery-reveal-summary {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 8px 0 4px;
}

.gallery-reveal-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.gallery-reveal-story {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.gallery-credit-summary {
  border-left: 3px solid var(--gallery-green);
  padding: 4px 4px 4px 17px;
}

.gallery-credit-summary .gallery-eyebrow,
.gallery-decoy-summary .gallery-eyebrow {
  margin-bottom: 6px;
}

.gallery-credit-sentence {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.7vw, 1.65rem);
  line-height: 1.42;
  margin: 0;
  max-width: 780px;
}

.gallery-decoy-summary {
  background: #f2f0ea;
  border: 1px solid rgba(216, 212, 200, .88);
  border-radius: 10px;
  padding: 18px;
}

.gallery-decoy-summary h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0 0 10px;
}

.gallery-decoy-copy p {
  display: grid;
  gap: 3px;
  grid-template-columns: minmax(130px, .34fr) minmax(0, 1fr);
  margin: 0;
  padding: 10px 0;
}

.gallery-decoy-copy p + p {
  border-top: 1px solid rgba(216, 212, 200, .95);
}

.gallery-decoy-copy span {
  color: #4e4b44;
  line-height: 1.45;
}

.gallery-discovery {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 26px;
}

.gallery-discovery-header {
  margin-bottom: 16px;
}

.gallery-discovery-header .gallery-eyebrow {
  margin-bottom: 5px;
}

.gallery-discovery-header h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -.025em;
  margin: 0;
}

.gallery-discovery-header > p:last-child {
  color: var(--muted);
  margin: 6px 0 0;
}

.gallery-creator-action,
.gallery-discovery-film {
  align-items: stretch;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.gallery-creator-action {
  box-shadow: 0 9px 24px rgba(36, 32, 25, .06);
  margin-bottom: 12px;
}

.gallery-identity-link,
.gallery-film-link {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 10px;
  text-align: left;
}

.gallery-identity-link:hover,
.gallery-identity-link:focus-visible,
.gallery-film-link:hover,
.gallery-film-link:focus-visible {
  background: var(--gallery-green-soft);
  outline: 0;
}

.gallery-identity-link img,
.gallery-film-link img {
  background: #ded8ca;
  border-radius: 6px;
  display: block;
  height: 62px;
  object-fit: cover;
  width: 46px;
}

.gallery-identity-link img {
  border-radius: 50%;
  height: 52px;
  width: 52px;
}

.gallery-creator-monogram {
  align-items: center;
  background: var(--gallery-green-soft);
  border: 1px solid rgba(45, 102, 90, .22);
  border-radius: 50%;
  color: var(--gallery-green);
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
  height: 52px;
  justify-content: center;
  letter-spacing: .03em;
  width: 52px;
}

.gallery-identity-copy {
  min-width: 0;
}

.gallery-identity-copy strong,
.gallery-identity-copy small,
.gallery-identity-copy span {
  display: block;
}

.gallery-identity-copy strong {
  line-height: 1.25;
}

.gallery-identity-copy small,
.gallery-identity-copy span {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
  margin-top: 3px;
}

.gallery-action-arrow {
  color: var(--gallery-green);
  font-size: 1.2rem;
  padding-inline: 4px;
}

.gallery-follow-action,
.gallery-save-action {
  align-self: center;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--gallery-green);
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  min-height: 44px;
  padding: 12px 16px;
}

.gallery-follow-action:hover,
.gallery-follow-action:focus-visible,
.gallery-save-action:hover,
.gallery-save-action:focus-visible {
  background: var(--gallery-green-soft);
  outline: 0;
}

.gallery-follow-action.selected,
.gallery-save-action.selected {
  background: var(--gallery-green-soft);
  color: #214e44;
}

.gallery-discovery-films {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-finish-score {
  align-items: baseline;
  display: flex;
  gap: 10px;
  margin: 24px 0;
}

.gallery-finish-score strong {
  color: var(--gallery-green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 500;
  line-height: 1;
}

.gallery-error {
  background: #f6e9e5;
  border: 1px solid #d9b5ad;
  border-radius: 8px;
  color: #653c35;
  padding: 14px;
}

@media (max-width: 760px) {
  .gallery-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-card-copy {
    min-height: 64px;
  }

  .gallery-decoy-copy p {
    grid-template-columns: 1fr;
  }

  .gallery-discovery-films {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .gallery-shell {
    padding-left: 0;
    padding-right: 0;
  }

  .gallery-round-head {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .gallery-identity-link,
  .gallery-film-link {
    gap: 9px;
    padding: 8px;
  }

  .gallery-follow-action,
  .gallery-save-action {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-check {
    transition: none;
  }
}
