* {
  box-sizing: border-box;
}

:root {
  --cream: #fff7e8;
  --paper: #fffdf8;
  --brown: #3a2a1f;
  --muted: #6b5647;
  --orange: #ef8b34;
  --orange-dark: #c86c22;
  --blue: #2f93d1;
  --green: #43a047;
  --red: #d94b42;
  --line: #e1c9a8;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--brown);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 222, 122, 0.55), transparent 34%),
    radial-gradient(circle at 80% 15%, rgba(92, 187, 235, 0.38), transparent 35%),
    linear-gradient(180deg, #f7e6c8 0%, #e7f6ff 45%, #fff2d9 100%);
}

button {
  font-family: inherit;
}

.app {
  width: min(1420px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

.screen {
  animation: appear 0.25s ease;
}

.hidden {
  display: none;
}

.introScreen,
.finishScreen {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.introCard,
.finishCard {
  width: min(900px, 100%);
  padding: clamp(24px, 4vw, 46px);
  border: 3px solid #f0c777;
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 20px 50px rgba(86, 55, 22, 0.18);
  text-align: center;
}

.label {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: var(--orange-dark);
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
}

.introText,
.introNote,
.finishText {
  margin: 0 auto 18px;
  max-width: 780px;
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 1.55;
  color: var(--muted);
}

.introNote {
  padding: 18px 20px;
  border: 2px dashed #efb654;
  border-radius: 22px;
  background: #fff4d7;
  font-weight: 800;
  color: #6a3b15;
}

.mainBtn {
  border: none;
  border-radius: 20px;
  padding: 16px 28px;
  background: linear-gradient(180deg, #ffb448, var(--orange));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 0 #b85b18, 0 18px 28px rgba(96, 52, 16, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mainBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 0 #b85b18, 0 22px 32px rgba(96, 52, 16, 0.24);
}

.mainBtn:active {
  transform: translateY(4px);
  box-shadow: 0 5px 0 #b85b18, 0 14px 20px rgba(96, 52, 16, 0.2);
}

.topPanel {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px 22px;
  border: 3px solid #f0c777;
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 30px rgba(86, 55, 22, 0.12);
}

.topPanel h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
}

.timerBox {
  min-width: 210px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 22px;
  background: #e7f6ff;
  border: 3px solid #83c9f2;
  color: #175d8c;
  font-weight: 900;
}

.timerValue {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.timerLabel {
  font-size: 16px;
}

.boardShell {
  padding: 10px;
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.82);
  border: 3px solid #ffffff;
  box-shadow: 0 16px 36px rgba(43, 92, 115, 0.22);
}

.boardWrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 24px;
  background: #dff5ff;
}

.mapImage {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pointButtons {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.pointBtn {
  position: absolute;
  width: clamp(34px, 3.8vw, 54px);
  height: clamp(34px, 3.8vw, 54px);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #a4510b;
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 900;
  cursor: default;
  pointer-events: auto;
  box-shadow: 0 5px 12px rgba(41, 34, 24, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.pointBtn.active {
  cursor: pointer;
  background: #ffd24f;
  color: #7b3d00;
  border-color: #fff7c8;
  box-shadow: 0 0 0 6px rgba(255, 183, 66, 0.42), 0 0 22px rgba(255, 120, 26, 0.7);
  animation: pulsePoint 1.1s ease-in-out infinite;
}

.pointBtn.active:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.pointBtn.passed {
  background: #dff4e1;
  border-color: #72c77b;
  color: #1f6a35;
}

.pointBtn.finishPoint {
  background: rgba(230, 244, 255, 0.92);
  color: #1a5e8a;
  border-color: #b6dfff;
}

.pointBtn:disabled {
  opacity: 1;
}

.heroToken {
  position: absolute;
  width: clamp(58px, 6.3vw, 100px);
  height: auto;
  transform: translate(-50%, -92%);
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.26));
  transition: left 0.65s ease, top 0.65s ease, transform 0.25s ease;
  z-index: 4;
  pointer-events: none;
}

.heroToken.jump {
  transform: translate(-50%, -99%) scale(1.08);
}

.hintCard {
  margin-top: 14px;
  padding: 14px 18px;
  border: 2px dashed #efb654;
  border-radius: 20px;
  background: rgba(255, 244, 215, 0.95);
  color: #6a3b15;
  font-size: 18px;
  line-height: 1.35;
  text-align: center;
}

.questionModal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(36, 58, 76, 0.42);
  backdrop-filter: blur(3px);
}

.questionModal.hidden {
  display: none !important;
}

.questionCard {
  padding: clamp(18px, 2.6vw, 28px);
  border: 3px solid #83c9f2;
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 24px 70px rgba(15, 45, 62, 0.28);
}

.modalCard {
  position: relative;
  width: min(860px, 100%);
  margin: 0;
}

.closeQuestionBtn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #fff0cf;
  color: #8a4d19;
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.closeQuestionBtn:hover {
  background: #ffe1a2;
}

.questionMeta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--orange-dark);
  font-weight: 900;
}

.questionCard h2 {
  margin: 0 0 18px;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.25;
}

.optionsBox {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.optionBtn {
  min-height: 72px;
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 15px 18px;
  background: #fff7e8;
  color: var(--brown);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.optionBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #fff0cf;
  border-color: #e9ad48;
}

.optionBtn:disabled {
  cursor: default;
  pointer-events: auto;
}

.optionBtn.correct {
  background: #e6f7e9;
  border-color: var(--green);
  color: #1e6533;
}

.optionBtn.wrong {
  background: #ffe3df;
  border-color: var(--red);
  color: #8a251f;
}

.feedback {
  min-height: 32px;
  margin: 16px 0 0;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.feedback.success {
  color: #1e6533;
}

.feedback.error {
  color: #8a251f;
}

.finishCard.fail {
  border-color: #e97b72;
}

.finishCard.success {
  border-color: #67c379;
}

@keyframes pulsePoint {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(255, 183, 66, 0.34), 0 0 18px rgba(255, 120, 26, 0.6);
  }
  50% {
    box-shadow: 0 0 0 11px rgba(255, 183, 66, 0.14), 0 0 28px rgba(255, 120, 26, 0.85);
  }
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.hidden {
  display: none !important;
}

@media (max-width: 800px) {
  .app {
    width: min(100% - 16px, 1420px);
    padding: 8px 0 14px;
  }

  .topPanel {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
    border-radius: 22px;
  }

  .timerBox {
    width: 100%;
  }

  .boardShell {
    padding: 6px;
    border-radius: 20px;
  }

  .boardWrap {
    border-radius: 16px;
  }

  .questionMeta {
    flex-direction: column;
  }

  .optionsBox {
    grid-template-columns: 1fr;
  }

  .hintCard {
    font-size: 15px;
  }

  .questionModal {
    padding: 12px;
  }

  .closeQuestionBtn {
    width: 36px;
    height: 36px;
    font-size: 28px;
  }

  .pointBtn {
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-width: 2px;
  }
}
