:root {
  --bg: #10212a;
  --panel: #f8fbff;
  --ink: #10212a;
  --muted: #5f7180;
  --line: rgba(16, 33, 42, 0.14);
  --blue: #1677c8;
  --cyan: #35b8c8;
  --green: #28a96b;
  --yellow: #f1b840;
  --red: #e35d5d;
  --shadow: 0 20px 60px rgba(6, 18, 24, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(53, 184, 200, 0.28), transparent 38%),
    linear-gradient(225deg, rgba(241, 184, 64, 0.2), transparent 34%),
    #dfeef2;
}

button {
  font: inherit;
}

.tour-game {
  width: min(1240px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.start-screen,
.finish-screen {
  min-height: calc(100vh - 48px);
  display: none;
  align-items: center;
  justify-content: center;
}

.start-screen.is-active,
.finish-screen.is-active {
  display: flex;
}

.start-panel,
.finish-panel {
  width: min(680px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.badge,
.eyebrow {
  display: inline-flex;
  color: #13607c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.start-panel h1,
.finish-panel h1 {
  margin: 12px 0 12px;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1;
}

.start-panel p,
.finish-panel p {
  margin: 0 auto 24px;
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.btn {
  min-height: 44px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, filter 0.14s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.btn.ghost {
  color: var(--ink);
  background: #eef5f8;
  border: 1px solid var(--line);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(30px, 4vw, 46px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
}

.stats div,
.final-score {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.88);
  box-shadow: 0 10px 24px rgba(16, 33, 42, 0.08);
}

.stats span,
.final-score span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stats strong,
.final-score strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.dialog-panel,
.monitor,
.destination-panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.94);
  box-shadow: var(--shadow);
}

.dialog-panel {
  padding: 18px;
}

.operator-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.client-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), transparent 42%),
    #dff3ec;
  border: 2px solid rgba(22, 119, 200, 0.18);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.62);
  font-size: 30px;
  font-weight: 900;
}

.operator-row h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.dialog-chat {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.message-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 14px rgba(16, 33, 42, 0.08);
  font-size: 20px;
  font-weight: 900;
}

.message p {
  position: relative;
  margin: 0;
  padding: 14px 15px;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1.5;
}

.message-client p {
  background: #e9f6fb;
  border: 1px solid rgba(22, 119, 200, 0.18);
}

.message-client p::before {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 13px;
  width: 12px;
  height: 12px;
  background: #e9f6fb;
  border-left: 1px solid rgba(22, 119, 200, 0.18);
  border-bottom: 1px solid rgba(22, 119, 200, 0.18);
  transform: rotate(45deg);
}

.message-agent {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.message-agent .message-avatar {
  grid-column: 2;
  grid-row: 1;
  background: #163647;
  color: white;
  font-size: 13px;
}

.message-agent p {
  grid-column: 1;
  grid-row: 1;
  background: #f4f8fa;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.message-agent p::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 13px;
  width: 12px;
  height: 12px;
  background: #f4f8fa;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

.brief {
  padding: 14px;
  border-radius: 8px;
  background: #fff8e7;
  border: 1px solid rgba(241, 184, 64, 0.32);
}

.brief ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.feedback {
  min-height: 48px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #eef5f8;
  border: 1px solid var(--line);
  line-height: 1.45;
}

.feedback.good {
  color: #10633f;
  background: rgba(40, 169, 107, 0.12);
  border-color: rgba(40, 169, 107, 0.3);
}

.feedback.bad {
  color: #9a3030;
  background: rgba(227, 93, 93, 0.12);
  border-color: rgba(227, 93, 93, 0.3);
}

.monitor {
  padding: 14px;
}

.monitor-frame {
  overflow: hidden;
  border-radius: 8px;
  background: #163647;
  border: 10px solid #18313d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.monitor-toolbar {
  height: 42px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 14px;
  color: #d9edf5;
  background: #10212a;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red {
  background: var(--red);
}

.dot.yellow {
  background: var(--yellow);
}

.dot.green {
  background: var(--green);
}

.monitor-toolbar strong {
  margin-left: 8px;
  font-size: 14px;
}

.map {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: #d9d0bd url("../../img/prof-games/tourism-map.jpg") center / cover no-repeat;
}

.map::before {
  display: none;
}

.map::after {
  display: none;
}

.map-water,
.map-park,
.map-streets,
.map-blocks {
  display: none;
}

.map-water-main {
  left: -10%;
  bottom: -14%;
  width: 66%;
  height: 36%;
  border-radius: 50% 44% 38% 40%;
  background:
    repeating-linear-gradient(168deg, transparent 0 10px, rgba(255, 255, 255, 0.28) 11px 14px, transparent 15px 26px),
    linear-gradient(135deg, #67cce0, #31a9c2 55%, #1687a7);
  transform: rotate(7deg);
  box-shadow: inset 0 12px 24px rgba(255, 255, 255, 0.18);
}

.map-water-coast {
  right: -13%;
  bottom: -20%;
  width: 55%;
  height: 36%;
  border-radius: 52% 0 0 0;
  background:
    repeating-linear-gradient(170deg, transparent 0 9px, rgba(255, 255, 255, 0.24) 10px 13px, transparent 14px 25px),
    linear-gradient(140deg, #6ed0e2, #1689a8);
}

.map-park {
  background:
    radial-gradient(circle at 16% 24%, #1f7b35 0 4px, transparent 5px),
    radial-gradient(circle at 35% 58%, #4aa33d 0 4px, transparent 5px),
    radial-gradient(circle at 56% 32%, #2c8734 0 4px, transparent 5px),
    radial-gradient(circle at 74% 68%, #67a946 0 4px, transparent 5px),
    radial-gradient(circle at 86% 34%, #2f7d35 0 4px, transparent 5px),
    #a8d36b;
  border-radius: 42% 58% 48% 52%;
  opacity: 0.95;
  box-shadow: inset 0 0 0 2px rgba(38, 76, 34, 0.18);
}

.park-one {
  left: 48%;
  top: 18%;
  width: 24%;
  height: 20%;
  transform: rotate(-9deg);
}

.park-two {
  right: 8%;
  top: 4%;
  width: 21%;
  height: 18%;
  transform: rotate(12deg);
}

.park-three {
  left: 5%;
  bottom: 8%;
  width: 17%;
  height: 15%;
  transform: rotate(18deg);
}

.map-streets {
  inset: 0;
  background:
    repeating-linear-gradient(18deg, transparent 0 48px, rgba(32, 29, 24, 0.78) 49px 52px, rgba(245, 244, 239, 0.95) 53px 64px, rgba(32, 29, 24, 0.76) 65px 68px, transparent 69px 108px),
    repeating-linear-gradient(105deg, transparent 0 58px, rgba(32, 29, 24, 0.72) 59px 62px, rgba(245, 244, 239, 0.92) 63px 74px, rgba(32, 29, 24, 0.7) 75px 78px, transparent 79px 124px);
  opacity: 0.78;
}

.map-blocks {
  inset: 0;
  background:
    repeating-linear-gradient(11deg, transparent 0 20px, rgba(150, 91, 43, 0.64) 21px 31px, rgba(237, 194, 70, 0.7) 32px 40px, transparent 41px 64px),
    repeating-linear-gradient(96deg, transparent 0 24px, rgba(172, 73, 49, 0.48) 25px 35px, rgba(232, 156, 62, 0.55) 36px 43px, transparent 44px 72px);
  clip-path: polygon(26% 0, 100% 0, 100% 84%, 58% 84%, 54% 62%, 30% 58%, 24% 36%);
  opacity: 0.62;
}

.route-line {
  display: none;
}

.map-pins {
  position: absolute;
  inset: 0;
}

.place-pin {
  position: absolute;
  width: 70px;
  height: 86px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -84%);
  filter: drop-shadow(0 8px 7px rgba(16, 33, 42, 0.28));
}

.place-pin::before {
  content: "";
  position: absolute;
  left: 24px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 0 0 8px 0;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: 4px 4px 0 rgba(16, 33, 42, 0.14);
}

.pin-art {
  position: relative;
  z-index: 1;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 6px solid #ffffff;
  border-radius: 50%;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(135deg, #72d3d9, #f3cc4d);
  box-shadow: inset 0 0 0 3px rgba(16, 33, 42, 0.18), 0 3px 0 rgba(16, 33, 42, 0.14);
  font-size: 28px;
}

.pin-label {
  position: absolute;
  left: 50%;
  top: -8px;
  z-index: 3;
  width: 164px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(16, 33, 42, 0.12);
  box-shadow: 0 10px 24px rgba(16, 33, 42, 0.14);
  text-align: left;
  opacity: 0;
  transform: translate(-50%, -82%) scale(0.96);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.label-bottom .pin-label {
  top: 78px;
  transform: translate(-50%, 8px) scale(0.96);
}

.label-right .pin-label {
  left: 82px;
  top: 34px;
  transform: translate(10px, -50%) scale(0.96);
}

.label-left .pin-label {
  left: auto;
  right: 82px;
  top: 34px;
  transform: translate(-10px, -50%) scale(0.96);
}

.pin-label strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.pin-label span {
  display: block;
  color: #51606b;
  font-size: 12px;
}

.place-pin.is-selected {
  filter: drop-shadow(0 0 0 rgba(22, 119, 200, 0)) drop-shadow(0 12px 10px rgba(16, 33, 42, 0.32));
}

.place-pin.is-selected .pin-art {
  box-shadow: inset 0 0 0 3px var(--blue), 0 0 0 5px rgba(22, 119, 200, 0.26), 0 3px 0 rgba(16, 33, 42, 0.14);
}

.place-pin.is-selected .pin-label {
  opacity: 1;
  transform: translate(-50%, -96%) scale(1);
}

.label-bottom.is-selected .pin-label {
  transform: translate(-50%, 0) scale(1);
}

.label-right.is-selected .pin-label {
  transform: translate(0, -50%) scale(1);
}

.label-left.is-selected .pin-label {
  transform: translate(0, -50%) scale(1);
}

.place-pin.is-correct .pin-art {
  box-shadow: inset 0 0 0 3px var(--green), 0 0 0 5px rgba(40, 169, 107, 0.26), 0 3px 0 rgba(16, 33, 42, 0.14);
}

.place-pin.is-wrong .pin-art {
  box-shadow: inset 0 0 0 3px var(--red), 0 0 0 5px rgba(227, 93, 93, 0.24), 0 3px 0 rgba(16, 33, 42, 0.14);
}

.destination-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  box-shadow: none;
}

.destination-panel h2 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.destination-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 26, 0.68);
  z-index: 20;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f8;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-card h2 {
  margin: 8px 0 8px;
  font-size: 28px;
}

.modal-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.activity-option input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--blue);
}

.activity-option strong {
  display: block;
  margin-bottom: 3px;
}

.activity-option span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.activity-option.is-selected {
  border-color: var(--blue);
  background: #f4fbff;
}

.activity-option.is-correct {
  border-color: var(--green);
}

.activity-option.is-wrong {
  border-color: var(--red);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
  }

  .stats {
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .map {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .tour-game {
    width: min(100% - 16px, 1240px);
    padding: 12px 0;
  }

  .start-panel,
  .finish-panel,
  .dialog-panel,
  .monitor,
  .modal-card {
    padding: 14px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .monitor-frame {
    border-width: 6px;
  }

  .map {
    min-height: 620px;
  }

  .place-pin {
    width: 58px;
    height: 72px;
  }

  .place-pin::before {
    left: 20px;
    width: 18px;
    height: 18px;
  }

  .pin-art {
    width: 58px;
    height: 58px;
    border-width: 5px;
    font-size: 24px;
  }

  .pin-label {
    width: 150px;
  }

  .label-bottom .pin-label {
    top: 66px;
  }

  .label-right .pin-label {
    left: 68px;
    top: 29px;
  }

  .label-left .pin-label {
    right: 68px;
    top: 29px;
  }

  .destination-panel,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .destination-panel .btn,
  .modal-actions .btn {
    width: 100%;
  }
}
