:root {
  --navy: #061726;
  --navy-2: #0c2c43;
  --yellow: #ffd23f;
  --white: #f8fbff;
  --muted: #a9c0d0;
  --green: #57e389;
  --red: #ff5f6d;
  --panel: rgba(5, 20, 32, 0.94);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: transparent; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--white); }
#overlay { width: 100vw; height: 100vh; position: relative; pointer-events: none; }

.panel-hidden { opacity: 0 !important; visibility: hidden !important; transform: translateY(24px) scale(.98) !important; }
.eyebrow { color: var(--yellow); font-size: 15px; letter-spacing: .22em; font-weight: 900; }

.lower-third {
  position: absolute;
  left: 3.2vw;
  right: 3.2vw;
  bottom: 3.2vh;
  height: 96px;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(360px, 1.5fr) minmax(330px, 1fr);
  align-items: stretch;
  background: linear-gradient(100deg, rgba(4, 18, 29, .96), rgba(10, 42, 63, .92));
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity .35s ease, transform .35s ease;
}
.lower-third::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--yellow); }
.brand-block, .city-block, .stats-block { display: flex; align-items: center; }
.brand-block { gap: 14px; padding-left: 28px; }
.tour-mark { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 14px; background: var(--yellow); color: var(--navy); font-weight: 1000; letter-spacing: -.06em; font-size: 20px; transform: rotate(-3deg); }
.tour-name { font-size: 21px; font-weight: 1000; letter-spacing: .06em; }
.episode-line { margin-top: 5px; color: var(--muted); font-weight: 800; font-size: 12px; letter-spacing: .16em; }
.city-block { padding: 0 24px; gap: 15px; border-left: 1px solid rgba(255,255,255,.1); border-right: 1px solid rgba(255,255,255,.1); }
.pin { color: var(--yellow); font-size: 24px; transform: rotate(45deg); }
.current-city { font-size: 26px; font-weight: 1000; letter-spacing: .02em; line-height: 1; }
.current-location { margin-top: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.stats-block { justify-content: center; gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 5px; min-width: 105px; }
.stat-label { color: var(--muted); font-size: 10px; letter-spacing: .18em; font-weight: 900; }
.stat strong { font-size: 18px; letter-spacing: .04em; }
.divider { width: 1px; height: 38px; background: rgba(255,255,255,.15); }

.mission-card {
  position: absolute;
  top: 4.3vh;
  right: 3.2vw;
  width: min(390px, 31vw);
  padding: 22px 24px 20px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.16);
  border-top: 5px solid var(--yellow);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.2,1), visibility .35s;
}
.mission-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mission-badge { font-size: 11px; letter-spacing: .16em; font-weight: 1000; color: var(--yellow); }
.mission-reward { padding: 7px 10px; background: rgba(255,210,63,.14); border: 1px solid rgba(255,210,63,.35); border-radius: 999px; font-size: 11px; font-weight: 900; }
.mission-card h2 { margin: 16px 0 8px; font-size: 26px; line-height: 1.08; }
.mission-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.mission-bottom { display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: center; margin-top: 18px; }
#missionTimer { font-variant-numeric: tabular-nums; font-weight: 1000; }
.timer-track { height: 7px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.timer-progress { height: 100%; width: 100%; background: var(--yellow); transition: width .4s linear; }
.mission-card.success { border-top-color: var(--green); }
.mission-card.success .mission-badge, .mission-card.success .mission-reward { color: var(--green); }
.mission-card.failed { border-top-color: var(--red); }
.mission-card.failed .mission-badge { color: var(--red); }

.bingo-card {
  position: absolute;
  left: 3.2vw;
  top: 4.3vh;
  width: min(480px, 37vw);
  padding: 22px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.2,1), visibility .35s;
}
.bingo-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 15px; }
.bingo-title { font-size: 30px; font-weight: 1000; letter-spacing: .08em; }
.bingo-score { font-size: 20px; font-weight: 1000; color: var(--yellow); }
.bingo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bingo-cell { min-height: 86px; display: grid; place-items: center; padding: 8px; text-align: center; border-radius: 11px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.12); color: #dbe9f2; font-size: 13px; font-weight: 800; position: relative; overflow: hidden; }
.bingo-cell.done { color: var(--navy); background: var(--yellow); border-color: var(--yellow); transform: scale(.98); }
.bingo-cell.done::after { content: "✓"; position: absolute; right: 7px; bottom: 2px; font-size: 22px; font-weight: 1000; opacity: .45; }
.bingo-win { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: rgba(6,23,38,.88); color: var(--yellow); font-size: 72px; font-weight: 1000; letter-spacing: .06em; text-shadow: 0 8px 30px rgba(255,210,63,.25); transition: .35s ease; }

.event-banner {
  position: absolute;
  left: 50%;
  top: 15%;
  transform: translateX(-50%);
  min-width: min(650px, 70vw);
  max-width: 850px;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 20px 26px;
  border-radius: 18px;
  background: linear-gradient(100deg, rgba(255,210,63,.98), rgba(255,233,141,.98));
  color: var(--navy);
  box-shadow: var(--shadow);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.2,1), visibility .35s;
}
.event-banner.panel-hidden { transform: translateX(-50%) translateY(-25px) scale(.96) !important; }
.event-icon { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: var(--yellow); font-size: 28px; font-weight: 1000; }
.event-title { font-size: 12px; letter-spacing: .18em; font-weight: 1000; }
.event-text { margin-top: 4px; font-size: 23px; font-weight: 1000; }

.takeover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(7,31,47,.52), rgba(0,0,0,.18));
  backdrop-filter: blur(4px);
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.9,.2,1), visibility .45s;
  z-index: 20;
}
.takeover-card { width: min(1120px, 86vw); max-height: 78vh; padding: 34px 38px; border-radius: 28px; background: linear-gradient(145deg, rgba(5,21,34,.98), rgba(11,45,66,.97)); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 35px 120px rgba(0,0,0,.58); }
.takeover-title { margin-top: 8px; font-size: 43px; line-height: 1; font-weight: 1000; }
.takeover-title b { color: var(--yellow); }

.map-shell {
  height: 57vh;
  min-height: 410px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(45,105,132,.28), rgba(7,27,41,.15) 42%, rgba(4,18,29,.76)),
    rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.1);
  isolation: isolate;
}
.hill-route-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .2;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), transparent 75%);
}
.hill-sky-glow {
  position: absolute;
  width: 230px;
  height: 230px;
  right: 7%;
  top: -90px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,210,63,.3), rgba(255,210,63,.04) 48%, transparent 70%);
}
.hill-layer {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -1px;
  z-index: 0;
  transform-origin: bottom;
}
.hill-layer-back {
  height: 69%;
  opacity: .58;
  background: linear-gradient(160deg, #173f51, #0c2939 68%);
  clip-path: polygon(0 38%, 8% 31%, 17% 37%, 28% 18%, 39% 30%, 49% 12%, 60% 27%, 72% 7%, 84% 22%, 93% 13%, 100% 24%, 100% 100%, 0 100%);
}
.hill-layer-front {
  height: 52%;
  opacity: .78;
  background: linear-gradient(155deg, #123748, #061d2b 74%);
  clip-path: polygon(0 37%, 12% 20%, 24% 34%, 38% 10%, 51% 29%, 64% 12%, 77% 31%, 90% 16%, 100% 31%, 100% 100%, 0 100%);
}
#routeSvg {
  position: absolute;
  inset: 3% 5%;
  width: 90%;
  height: 94%;
  z-index: 2;
  overflow: visible;
}
#routeShadow, #routeRoad, #routeBack, #routeDone {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
#routeShadow {
  stroke: rgba(0,0,0,.36);
  stroke-width: 21px;
  transform: translateY(3px);
  filter: blur(2px);
}
#routeRoad {
  stroke: rgba(236,228,199,.92);
  stroke-width: 16px;
}
#routeBack {
  stroke: rgba(19,46,59,.82);
  stroke-width: 5px;
  stroke-dasharray: 1.4 1.15;
}
#routeDone {
  stroke: var(--yellow);
  stroke-width: 5px;
  stroke-dasharray: 0 100;
  filter: drop-shadow(0 0 7px rgba(255,210,63,.72));
  transition: stroke-dasharray .8s cubic-bezier(.2,.9,.2,1);
}
.route-start-sign, .route-finish-sign {
  position: absolute;
  z-index: 5;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 10px;
  letter-spacing: .16em;
  font-weight: 1000;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.route-start-sign {
  top: 2.7%;
  left: 8.5%;
  color: var(--navy);
  background: var(--yellow);
  transform: rotate(-4deg);
}
.route-finish-sign {
  right: 8%;
  bottom: 2.6%;
  color: #eafff8;
  background: #188c6a;
  border: 1px solid rgba(255,255,255,.4);
  transform: rotate(3deg);
}
.map-node {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.node-dot {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #d8e6ed;
  background: #425f70;
  border: 3px solid #e8e1c9;
  box-shadow: 0 0 0 5px rgba(3,17,27,.38), 0 5px 15px rgba(0,0,0,.35);
  font-size: 9px;
  line-height: 1;
  font-weight: 1000;
}
.node-label {
  position: absolute;
  top: 50%;
  min-width: max-content;
  padding: 5px 9px;
  border-radius: 7px;
  transform: translateY(-50%);
  color: #d7e5ed;
  background: rgba(3,16,26,.9);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  font-size: 10px;
  letter-spacing: .015em;
  font-weight: 900;
  white-space: nowrap;
}
.map-node.side-left .node-label { right: 32px; text-align: right; }
.map-node.side-right .node-label { left: 32px; text-align: left; }
.map-node.visited .node-dot {
  color: #06281f;
  background: var(--green);
  border-color: #d8fff3;
}
.map-node.visited .node-label {
  color: var(--green);
  border-color: rgba(71,230,181,.25);
}
.map-node.current { z-index: 8; }
.map-node.current .node-dot {
  width: 31px;
  height: 31px;
  color: var(--navy);
  background: var(--yellow);
  border-color: #fff7d5;
  font-size: 11px;
  animation: routePulse 1.45s infinite;
}
.map-node.current .node-label {
  padding: 7px 11px;
  color: var(--navy);
  background: var(--yellow);
  border-color: #fff4bd;
  font-size: 12px;
}
@keyframes routePulse {
  0%,100% { box-shadow: 0 0 0 5px rgba(255,210,63,.16), 0 5px 18px rgba(0,0,0,.4); }
  50% { box-shadow: 0 0 0 15px rgba(255,210,63,.025), 0 5px 18px rgba(0,0,0,.4); }
}

.map-footer { display: flex; align-items: center; gap: 22px; margin-top: 17px; color: var(--muted); font-size: 13px; font-weight: 700; }
.legend-dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; }
.legend-dot.current { background: var(--yellow); }
.legend-dot.visited { background: var(--green); }
.map-countdown { margin-left: auto; color: var(--yellow); font-weight: 900; }

.leaderboard-rows { margin-top: 26px; display: grid; gap: 10px; max-height: 52vh; overflow: hidden; }
.leaderboard-row { display: grid; grid-template-columns: 60px 1fr 130px; align-items: center; padding: 15px 20px; border-radius: 14px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); }
.leaderboard-row:first-child { background: rgba(255,210,63,.14); border-color: rgba(255,210,63,.35); }
.rank-num { color: var(--yellow); font-size: 23px; font-weight: 1000; }
.rank-city { font-size: 20px; font-weight: 900; }
.rank-score { text-align: right; font-size: 20px; font-weight: 1000; }

.passport-head { display: flex; justify-content: space-between; align-items: center; }
.passport-counter { padding: 12px 17px; border-radius: 12px; color: var(--yellow); border: 1px solid rgba(255,210,63,.38); background: rgba(255,210,63,.08); font-weight: 1000; }
.passport-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-height: 51vh; }
.stamp { min-height: 110px; padding: 14px; display: grid; place-items: center; text-align: center; border: 3px double rgba(169,192,208,.24); border-radius: 50% 45% 52% 48%; transform: rotate(-2deg); opacity: .28; }
.stamp:nth-child(even) { transform: rotate(2deg); }
.stamp.visited { opacity: 1; color: var(--yellow); border-color: var(--yellow); background: rgba(255,210,63,.045); }
.stamp-city { font-size: 17px; font-weight: 1000; }
.stamp-tag { margin-top: 5px; font-size: 9px; letter-spacing: .12em; font-weight: 900; }
.stamp-year { margin-top: 7px; font-size: 10px; }

.rating-rows { margin-top: 28px; display: grid; gap: 16px; }
.rating-row { display: grid; grid-template-columns: 220px 1fr 55px; align-items: center; gap: 16px; }
.rating-name { color: #d9e7ef; font-weight: 900; }
.rating-track { height: 13px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.1); }
.rating-fill { height: 100%; background: var(--yellow); border-radius: inherit; transition: width .6s ease; }
.rating-value { font-size: 18px; font-weight: 1000; text-align: right; }
.rating-total { margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.15); display: flex; justify-content: space-between; align-items: center; }
.rating-total span { letter-spacing: .16em; color: var(--muted); font-weight: 900; }
.rating-total strong { color: var(--yellow); font-size: 38px; }

@media (max-width: 1100px) {
  .lower-third { grid-template-columns: 240px 1fr 260px; }
  .stats-block { gap: 12px; }
  .stat { min-width: 80px; }
  .mission-card { width: 340px; }
  .bingo-card { width: 390px; }
}

.mission-order-overlay {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
}
.mission-reward { margin-left: 0; }
.bingo-win { text-align: center; }
.bingo-win span { display: block; }
.bingo-win small { display: block; margin-top: 4px; font-size: 22px; letter-spacing: .18em; }

.wheel-takeover {
  z-index: 30;
  background: radial-gradient(circle at center, rgba(11,52,72,.78), rgba(0,0,0,.45));
  backdrop-filter: blur(7px);
}
.wheel-stage {
  width: min(900px, 86vw);
  display: grid;
  justify-items: center;
  text-align: center;
}
.wheel-title {
  margin-top: 7px;
  font-size: 54px;
  line-height: 1;
  font-weight: 1000;
  letter-spacing: .04em;
  text-shadow: 0 10px 38px rgba(0,0,0,.45);
}
.wheel-wrap {
  position: relative;
  width: min(520px, 48vw);
  aspect-ratio: 1;
  margin-top: 24px;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.52));
}
.event-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 12px solid #f9f4df;
  box-shadow: inset 0 0 0 8px rgba(6,23,38,.35), 0 0 0 7px rgba(255,210,63,.25);
  overflow: hidden;
  transform: rotate(0deg);
}
.event-wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, transparent 48%, rgba(4,18,29,.18) 72%, rgba(4,18,29,.38));
}
.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 145px;
  margin-left: -72px;
  margin-top: -13px;
  color: #071827;
  font-size: 12px;
  line-height: 1.05;
  font-weight: 1000;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
  z-index: 2;
}
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118px;
  height: 118px;
  transform: translate(-50%, -50%);
  display: grid;
  place-content: center;
  border-radius: 50%;
  color: var(--yellow);
  background: linear-gradient(145deg, #071827, #123d55);
  border: 8px solid #f9f4df;
  box-shadow: 0 12px 35px rgba(0,0,0,.48);
  z-index: 4;
}
.wheel-center span { font-size: 25px; line-height: .9; font-weight: 1000; }
.wheel-center strong { font-size: 15px; letter-spacing: .15em; }
.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -23px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 0;
  border-bottom: 58px solid var(--yellow);
  filter: drop-shadow(0 7px 7px rgba(0,0,0,.42));
  z-index: 8;
}
.wheel-subtitle {
  margin-top: 20px;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: .07em;
}

@media (max-width: 1100px) {
  .wheel-wrap { width: min(460px, 58vw); }
  .wheel-label { transform-origin: center; font-size: 10px; width: 120px; margin-left: -60px; }
}
