@font-face {
  font-family: "League Spartan";
  src: url("../assets/fonts/LeagueSpartan-VariableFont_wght.woff2")
    format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 100%;
  font-style: normal;
  font-display: swap;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

html {
  font-size: 16px;
  font-size: calc(min(100vw / 80, 100vh / 50));
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  font-family: "League Spartan", sans-serif;
  font-weight: 400;
  overflow: hidden;
}

#container {
  border: none;
  width: 80rem;
  height: 50rem;
  display: flex;
  box-sizing: border-box;
  position: relative;
}

#shop {
  width: 80rem;
  height: 50rem;
  background-image: url("europa.svg");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  margin: 0;
  position: relative;
}

#intro-ui {
  position: absolute;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-text {
  position: relative;
  width: 38rem;
  max-width: 38rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #0b2d3f;
  text-align: center;
}

.intro-text__title {
  margin: 0 0 1rem;
  font-size: 2.6rem;
  line-height: 1.05;
  color: #00699f;
}

.intro-text__p {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.intro-text__p:last-child {
  margin-bottom: 0;
}

.intro-text__start {
  margin-top: 0.9rem;
  padding: 0.8rem 2.4rem;
  font-size: 1.7rem;
  font-weight: 700;
  background: #00699f;
  color: #ffffff;
  border: none;
  border-radius: 0.8rem;
  cursor: pointer;
}

.intro-text__start:focus-visible {
  outline: 0.3rem solid #faee5e;
  outline-offset: 0.35rem;
}

.progress {
  position: absolute;
  left: 2rem;
  right: 2rem;
  top: 46rem;
  z-index: 60;
  display: none;
  gap: 0.6rem;
  align-items: center;
}

.progress__item {
  flex: 1 1 0;
  height: 2.2rem;
  border-radius: 1.2rem;
  border: 0.2rem solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tickets {
  position: absolute;
  left: 1.8rem;
  top: 9.2rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.6rem 0.5rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.75);
  border: 0.2rem solid rgba(0, 0, 0, 0.2);
}

.tickets__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0b2d3f;
  opacity: 0.9;
}

.ticket {
  width: 6rem;
  height: 3rem;
  border-radius: 0.35rem;
  background: url("rd8-2_Pl4_S02_018.png") no-repeat center / contain;
  border: none;
  box-sizing: border-box;
}

.ticket.is-used {
  opacity: 0.22;
  filter: grayscale(1);
}

.progress__item.is-done {
  background: rgba(170, 255, 170, 0.9);
  border-color: rgba(0, 120, 0, 0.55);
}

.progress__item.is-current {
  background: rgba(250, 238, 94, 0.95);
  border-color: rgba(0, 0, 0, 0.5);
}

.question {
  position: absolute;
  transform: translate(-50%, -50%);
  background: url("pin_red.svg") no-repeat center / contain;
  border-radius: 0;
  box-shadow: none;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
  color: transparent;
  left: 52rem;
  top: 15rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 1s;
  opacity: 0;
}

.finish-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: 5.2rem;
  height: 5.2rem;
  background: url("rd8-2_Pl3_S03_005.png") no-repeat center / contain;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.question.answered {
  background-image: url("pin_green.svg");
  border: none;
  cursor: default;
}

#popup {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  z-index: 100;
  width: 38rem;
  max-width: 38rem;
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  padding-bottom: 6rem;
}

#check_button {
  position: absolute;
  left: 50%;
  bottom: 0.4rem;
  transform: translateX(-50%);
  width: 4rem;
  height: 4rem;
  border: none;
  padding: 0;
  margin: 0;
  background: url("checkBtn.svg") center/contain no-repeat;
  cursor: pointer;
}

#check_button:disabled {
  opacity: 0.4;
  cursor: default;
}

#check_button:focus-visible {
  outline: 0.3rem solid #faee5e;
  outline-offset: 0.35rem;
  border-radius: 0.6rem;
}

.option.is-selected {
  outline: 0.22rem solid #00699f;
  outline-offset: 0.12rem;
}

.popup-feedback {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: none;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
}

.popup-feedback.is-visible {
  display: block;
  pointer-events: auto;
}

.popup-feedback__frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--pf-width, 44rem);
  height: var(--pf-height, 28rem);
  border-radius: 1.2rem;
  background: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: none;
  padding: var(--pf-pad-top, 3.6rem) var(--pf-pad-right, 3.6rem) var(--pf-pad-bottom, 3.2rem) var(--pf-pad-left, 14.2rem);
  box-sizing: border-box;
  overflow: hidden;
}

.popup-feedback__title {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
  line-height: 1.05;
  font-weight: 900;
}

.popup-feedback__text {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
  line-height: 1.25;
}

.popup-feedback__photos {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  height: auto;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  margin-top: 0.4rem;
  margin-bottom: 6.2rem;
}

.popup-feedback__photo {
  width: 14.1rem;
  height: 9.9rem;
  object-fit: cover;
  border-radius: 0.6rem;
  background: #fff;
  box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.22);
  transform: translateY(1.2rem) rotate(var(--r, -2deg)) scale(0.92);
  opacity: 0;
  animation: feedback-photo-pop 420ms ease-out forwards;
  animation-delay: var(--d, 0ms);
}

.popup-feedback__photo--portrait {
  width: 8rem;
  height: 12rem;
  object-fit: contain;
  background: transparent;
}

@keyframes feedback-photo-pop {
  from {
    opacity: 0;
    transform: translateY(1.2rem) rotate(var(--r, -2deg)) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--r, -2deg)) scale(1);
  }
}

.popup-feedback__button {
  position: absolute;
  right: 4.2rem;
  bottom: 4.2rem;
  width: 12.2rem;
  height: 3.9rem;
  border: none;
  border-radius: 0.6rem;
  background: #00699f;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0.6rem 1.2rem rgba(0, 0, 0, 0.15);
}

.popup-feedback--gameover .popup-feedback__button {
  background: #3aa63a;
}

.popup-feedback__button:focus-visible {
  outline: 0.3rem solid #faee5e;
  outline-offset: 0.35rem;
}

.popup-feedback--good .popup-feedback__title,
.popup-feedback--good .popup-feedback__text {
  color: #2d8a2d;
}

.popup-feedback--bad .popup-feedback__title,
.popup-feedback--bad .popup-feedback__text {
  color: #b81f2a;
}

.popup-feedback--good .popup-feedback__frame {
  background-image: url("good.svg");
}

.popup-feedback--win .popup-feedback__frame {
  background-image: url("outro.jpg");
  background-size: cover;
}

.popup-feedback--bad .popup-feedback__frame {
  background-image: url("bad.svg");
}

#popup h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #00699f;
}

.popup-images {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.popup-image {
  display: block;
  height: 8.5rem;
  width: auto;
  border-radius: 0.6rem;
}

.travel-overlay {
  position: absolute;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.travel-overlay--hidden {
  display: none;
}

.travel-overlay__img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: var(--travel-size, 2.5rem);
  height: auto;
  margin: 0;
  filter: drop-shadow(0 0.6rem 1.2rem rgba(0, 0, 0, 0.25));
}

/* Per-asset sizing for travel animation */
.travel-overlay__img--004 {
  width: var(--travel-size-004, 7rem);
}

.travel-overlay__img--005 {
  width: var(--travel-size-005, 2.5rem);
}

.travel-overlay__img--006 {
  width: var(--travel-size-006, 3.2rem);
}

.travel-overlay__img--train {
  width: var(--travel-size-train, 4.2rem);
}

.travel-overlay__img--plane {
  width: var(--travel-size-plane, 4rem);
}

.travel-overlay__img--ship {
  width: var(--travel-size-ship, 4.6rem);
}

#popup a.option {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#popup button.close {
  background-color: #f9f9f9;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #333;
}

#popup a:hover {
  background-color: #ececec;
}

#status-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  background-image: url("outro.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 300;
  text-align: center;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

#status-overlay h2 {
  font-size: 2.2rem;
  margin: 0 0 1rem;
  color: #00699f;
  position: relative;
  z-index: 2;
}

#status-overlay p {
  font-size: 1.8rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
  max-width: 48rem;
  white-space: pre-line;
  position: relative;
  z-index: 2;
}

#status-overlay button {
  padding: 0.8rem 2.2rem;
  font-size: 1.5rem;
  background-color: #faee5e;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.status-photos {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56rem;
  height: 26rem;
  padding: 1.6rem 3.2rem 3.6rem;
  pointer-events: none;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1.2rem;
  box-sizing: border-box;
}

.status-photo {
  width: 9.4rem;
  height: 6.6rem;
  object-fit: cover;
  border-radius: 0.6rem;
  background: #fff;
  box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(1.2rem) rotate(var(--r, -2deg)) scale(0.92);
  animation: status-photo-pop 420ms ease-out forwards;
  animation-delay: var(--d, 0ms);
  justify-self: center;
  align-self: center;
}

.status-photo--portrait {
  width: 6.5rem;
  height: 9.75rem;
  object-fit: contain;
  background: transparent;
}

.status-photo:nth-child(1) { grid-column: 1; grid-row: 1; }
.status-photo:nth-child(2) { grid-column: 3; grid-row: 1; }
.status-photo:nth-child(3) { grid-column: 1; grid-row: 3; }
.status-photo:nth-child(4) { grid-column: 3; grid-row: 3; }
.status-photo:nth-child(5) { grid-column: 1; grid-row: 2; }
.status-photo:nth-child(6) { grid-column: 3; grid-row: 2; }

@keyframes status-photo-pop {
  from {
    opacity: 0;
    transform: translateY(1.2rem) rotate(var(--r, -2deg)) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--r, -2deg)) scale(1);
  }
}

.paths-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  display: none;
}

.paths-overlay.is-visible {
  display: block;
}

.transport-debug {
  position: absolute;
  inset: 0;
  z-index: 85;
  pointer-events: none;
}

.transport-debug__img {
  position: absolute;
  width: 4.6rem;
  height: auto;
  filter: drop-shadow(0 0.6rem 1.2rem rgba(0, 0, 0, 0.25));
}

.transport-debug__img--train {
  width: var(--travel-size-004, 7rem);
}
.transport-debug__img--plane {
  width: var(--travel-size-005, 4rem);
}
.transport-debug__img--ship {
  width: var(--travel-size-006, 4.6rem);
}

.transport-debug__legend {
  position: absolute;
  right: 1rem;
  top: 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.75);
  border: 0.2rem solid rgba(0, 0, 0, 0.18);
}

.transport-debug__legend-img {
  display: block;
  height: auto;
  opacity: 0;
  transform: translateY(0.6rem) scale(0.96);
  animation: transport-debug-pop 320ms ease-out forwards;
  animation-delay: var(--d, 0ms);
  filter: drop-shadow(0 0.5rem 1rem rgba(0, 0, 0, 0.22));
}

@keyframes transport-debug-pop {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#timer.progress__item--timer {
  min-width: 7.4rem;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  border-width: 0.25rem;
}

#timer.is-green {
  color: #063a18;
  background: rgba(34, 197, 94, 0.55);
  border-color: rgba(6, 70, 28, 0.6);
}

#timer.is-yellow {
  color: #3b2a00;
  background: rgba(250, 204, 21, 0.65);
  border-color: rgba(122, 91, 0, 0.6);
}

#timer.is-red {
  color: #3b0000;
  background: rgba(239, 68, 68, 0.72);
  border-color: rgba(155, 13, 13, 0.7);
}

@keyframes timer-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.2;
  }
}

#timer.is-blink {
  animation: timer-blink 0.6s steps(2, end) infinite;
}

