:root {
  --card-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
}

.interrupted-memory-game {
  --hud-w: 90vw;
  --content-w: 90vw;
  --object-card-size: 30vw;
}

.interrupted-memory-game .hud {
  grid-template-columns: minmax(0, 1fr) minmax(8.8rem, 1.05fr);
}

.board {
  height: min(calc(100svh - var(--hud-top) - var(--hud-h) - 0.35rem), 50rem);
  padding: clamp(0.95rem, 2.5vmin, 1.3rem);
  display: grid;
  place-items: center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.board.phaseSwap {
  transform: translateY(0.18rem) scale(0.994);
  opacity: 0.96;
}

.sampleWrap,
.cupsWrap,
.choicesWrap {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  gap: clamp(1rem, 2.6vmin, 1.35rem);
}

.sectionTitle {
  margin: 0;
  text-align: center;
  color: var(--kiosk-ink);
  font-family: "custom_heading_font", "Comic Sans MS", dk-new-beginnings, "custom_body_font", system-ui, sans-serif;
  font-size: clamp(1.15rem, 3.4vmin, 1.7rem);
  line-height: 1.05;
  font-weight: 1000;
}

.cupsWrap.cupsFadeIn {
  animation: cupsFadeIn 220ms ease-out both;
}

@keyframes cupsFadeIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.objectCard {
  width: var(--object-card-size);
  aspect-ratio: 1;
  justify-self: center;
  align-self: center;
  border: 0;
  border-radius: 24px;
  background: var(--card-bg, #f4efc9);
  color: var(--card-fg, var(--kiosk-ink));
  padding: clamp(0.4rem, 1.4vmin, 0.65rem);
  font-size: 15.2vmin;
  line-height: 1.05;
  font-weight: 900;
  border: 2px solid var(--card-border, rgba(13, 74, 57, 0.18));
  box-shadow: var(--card-shadow);
  transition:
    transform 110ms ease,
    filter 140ms ease,
    background-color 170ms ease,
    color 170ms ease,
    border-color 170ms ease,
    opacity 220ms ease,
    box-shadow 170ms ease;
}

.objectCard.sampleGone {
  opacity: 0;
  transform: translateY(0.6rem) scale(0.92);
}

.choiceCard {
  width: min(30vw, 100%);
  max-width: none;
  cursor: pointer;
  font-size: 15.2vmin;
}

.choiceCard:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

.objectCard.correct {
  box-shadow:
    0 0 0 0.35rem rgba(53, 185, 124, 0.25),
    var(--card-shadow);
}

.objectCard.wrong {
  box-shadow:
    0 0 0 0.35rem rgba(231, 106, 114, 0.24),
    var(--card-shadow);
}

.choicesRow {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, var(--object-card-size));
  column-gap: clamp(1rem, 3.8vmin, 2rem);
  row-gap: clamp(1rem, 3.2vmin, 1.75rem);
  justify-content: center;
}

.choicesWrap[data-choice-count="2"] .choicesRow {
  column-gap: clamp(1.35rem, 5.4vmin, 2.35rem);
}

.choicesWrap[data-choice-count="2"] .choiceCard {
  font-size: clamp(3.9rem, 13.2vmin, 6.2rem);
}

.choicesWrap[data-choice-count="3"] .choicesRow,
.choicesWrap[data-choice-count="4"] .choicesRow {
  column-gap: clamp(0.9rem, 2.8vmin, 1.4rem);
  row-gap: clamp(0.95rem, 2.8vmin, 1.45rem);
}

.choicesWrap[data-choice-count="3"] .choiceCard,
.choicesWrap[data-choice-count="4"] .choiceCard {
  width: var(--object-card-size);
}

.choicesWrap[data-choice-count="4"] .choiceCard {
  font-size: clamp(2.95rem, 10.4vmin, 4.7rem);
}

.choicesWrap:not(.hidden) .choiceCard:not(.hidden) {
  animation: choiceSpreadIn 210ms ease-out both;
}

@keyframes choiceSpreadIn {
  from {
    opacity: 0;
    transform: translateY(0.7rem) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cupsArena {
  position: relative;
  width: 90%;
  height: 50%;
  margin: 0 auto;
  align-self: center;
  border-radius: 24px;
  border: 1px solid rgba(13, 74, 57, 0.1);
  background:
    linear-gradient(180deg, rgba(19, 168, 117, 0.16), rgba(255, 255, 255, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.token {
  position: absolute;
  width: clamp(2.6rem, 8.5vmin, 3.2rem);
  height: clamp(2.6rem, 8.5vmin, 3.2rem);
  display: grid;
  place-items: center;
  font-size: clamp(1.85rem, 6vmin, 2.25rem);
  line-height: 1;
  bottom: clamp(1.1rem, 3.2vmin, 1.7rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: left 280ms linear, opacity 180ms ease;
}

.token.tokenHidden {
  opacity: 0;
}

.cup {
  position: absolute;
  width: 17%;
  height: 42%;
  bottom: clamp(1.1rem, 3.2vmin, 1.6rem);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 16px 16px 26px 26px / 10px 10px 88px 88px;
  background:
    radial-gradient(135% 95% at 30% 26%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #20b983 0%, #0a7d57 100%);
  box-shadow:
    inset -0.32rem -0.5rem 0.8rem rgba(4, 66, 44, 0.34),
    inset 0.22rem 0.22rem 0.42rem rgba(255, 255, 255, 0.14),
    0 0.6rem 1rem rgba(0, 0, 0, 0.16);
  cursor: default;
  z-index: 2;
  --lift: 0rem;
  transform: translate(-50%, var(--lift)) rotate(180deg);
  transition: left 300ms ease, transform 220ms ease, filter 130ms ease;
}

.cupsWrap.guessMode .cup {
  cursor: pointer;
}

.cupsWrap.guessMode .cup:hover {
  filter: brightness(1.08);
}

.cup.peek {
  --lift: -2.4rem;
}

.modal.briefNotice {
  background: transparent;
  backdrop-filter: none;
  align-items: start;
  padding-top: clamp(1rem, 4vmin, 1.8rem);
}

.modal.briefNotice .modalCard {
  width: auto;
  min-height: 0;
  padding: 0.95rem 1.4rem;
  border-radius: 18px;
  gap: 0.35rem;
}

.modal.briefNotice .modalTitle {
  font-size: clamp(1.1rem, 3.2vmin, 1.45rem);
}

.modal.briefNotice .modalText {
  font-size: clamp(0.82rem, 1.95vmin, 0.92rem);
}

@media (max-height: 760px) {
  .interrupted-memory-game {
    --object-card-size: min(100%, 11.8rem);
  }

  .board {
    padding: 0.82rem;
  }

  .cupsArena {
    width: min(100%, 22.8rem);
    height: clamp(11.8rem, 36vmin, 14.2rem);
  }

  .cup.peek {
    --lift: -2rem;
  }
}
