:root {
  --bg-0: #040713;
  --bg-1: #0a1230;
  --bg-2: #12092a;
  --panel: rgba(8, 13, 29, 0.92);
  --panel-edge: rgba(130, 166, 255, 0.35);
  --text: #eef4ff;
  --text-soft: #9fb2df;
  --neon-cyan: #46d7ff;
  --neon-green: #53f2b6;
  --neon-pink: #ff4f94;
  --danger: #ff7e95;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  background: url('slike/Vesolje.jpg') center/cover no-repeat fixed;
  color: var(--text);
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.16;
  z-index: 0;
  display: none;
}

.orb-a {
  width: 250px;
  height: 250px;
  left: -90px;
  top: -84px;
  background: #3f7cff;
  animation: drift 10s ease-in-out infinite alternate;
}

.orb-b {
  width: 320px;
  height: 320px;
  right: -120px;
  top: 24%;
  background: #ff4f94;
  animation: drift 12s ease-in-out infinite alternate-reverse;
}

.orb-c {
  width: 300px;
  height: 300px;
  left: 26%;
  bottom: -130px;
  background: #32eecf;
  animation: drift 11s ease-in-out infinite alternate;
}

.game-shell {
  position: relative;
  z-index: 1;
  width: min(96vw, 1120px);
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--panel-edge);
  background:
    linear-gradient(145deg, rgba(15, 23, 50, 0.82), rgba(12, 18, 40, 0.72)),
    var(--panel);
  backdrop-filter: blur(9px);
  box-shadow:
    0 24px 46px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(172, 195, 255, 0.12) inset;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  grid-template-areas:
    "top maze"
    "meta maze";
  gap: 14px 18px;
  align-items: start;
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(125deg, rgba(70, 215, 255, 0.44), rgba(255, 79, 148, 0.34), rgba(83, 242, 182, 0.34));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.top-bar {
  grid-area: top;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.title {
  margin: 4px 0 0;
  font-family: "Bungee", "Impact", sans-serif;
  font-size: 35px;
  line-height: 1.05;
  color: var(--text);
  text-shadow:
    0 0 10px rgba(70, 215, 255, 0.35),
    0 0 22px rgba(255, 79, 148, 0.2);
}

.button-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.start-button {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 14px;
  font-family: "Chakra Petch", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.start-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.start-button:active {
  transform: translateY(0);
}

.start-button {
  color: #04192e;
  background: linear-gradient(135deg, #68e4ff 0%, #46d7ff 64%, #3e8bff 100%);
  border-color: rgba(183, 245, 255, 0.4);
  box-shadow: 0 10px 22px rgba(22, 90, 159, 0.44);
}

.start-button.secondary {
  color: #2b0625;
  background: linear-gradient(135deg, #ff9aca 0%, #ff4f94 65%, #ce3d79 100%);
  border-color: rgba(255, 189, 219, 0.45);
  box-shadow: 0 10px 22px rgba(134, 31, 76, 0.44);
}

.meta-row {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-chip,
.meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18px;
}

.timer-chip {
  color: #bcefff;
  border: 1px solid rgba(70, 215, 255, 0.58);
  background: rgba(11, 30, 52, 0.94);
  box-shadow: 0 0 14px rgba(70, 215, 255, 0.12) inset;
}

.meta-chip {
  color: #dde8ff;
  border: 1px solid rgba(136, 168, 255, 0.42);
  background: rgba(18, 21, 49, 0.95);
}

.mission-chip {
  border-color: rgba(83, 242, 182, 0.5);
  color: #baf8df;
}

.objective-chip {
  border-color: rgba(255, 79, 148, 0.42);
  color: #ffbed8;
}

.visit-card {
  width: 100%;
  max-width: 245px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(144, 172, 255, 0.44);
  background:
    linear-gradient(135deg, rgba(70, 215, 255, 0.08), rgba(255, 79, 148, 0.08)),
    rgba(15, 20, 46, 0.95);
  box-shadow:
    0 0 0 1px rgba(188, 211, 255, 0.08) inset,
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.visit-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #9cc2ff;
}

.visit-line {
  margin: 0;
  color: #e9f2ff;
  font-size: 13px;
  line-height: 1.35;
}

.visit-line + .visit-line {
  margin-top: 2px;
}

.timer-chip.warning {
  border-color: rgba(255, 126, 149, 0.8);
  background: rgba(64, 17, 35, 0.96);
  color: #ffd5df;
  animation: pulse 0.9s ease-in-out infinite alternate;
}

.svg-canvas-container {
  grid-area: maze;
  position: relative;
  width: 100%;
  max-width: min(760px, calc(95vh - 52px));
  aspect-ratio: 1 / 1;
  align-self: center;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(131, 176, 255, 0.52);
  background:
    radial-gradient(circle at 18% 10%, rgba(70, 215, 255, 0.16), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(255, 79, 148, 0.13), transparent 44%),
    linear-gradient(160deg, #091428 0%, #130f2c 100%);
  box-shadow:
    0 0 0 2px rgba(4, 8, 20, 0.95),
    0 20px 34px rgba(0, 0, 0, 0.46),
    0 0 24px rgba(70, 215, 255, 0.13);
}

.svg-canvas-container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(166, 210, 255, 0.15), transparent 38%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 2px,
      transparent 2px,
      transparent 6px
    );
}

.svg-canvas-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}

.maze-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}



.maze-canvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

svg {
  background: transparent;
}

.proximity-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  text-align: center;
  opacity: 0;
  transition: opacity 200ms ease;
}

.proximity-hint.active {
  opacity: 1;
}

.proximity-hint-text {
  font-family: "Chakra Petch", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  animation: pulse-text 1s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.draw-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(24px, -20px) scale(1.08);
  }
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.03);
  }
}

.maze-alert-popup {
  border-radius: 16px !important;
  border: 2px solid rgba(70, 215, 255, 0.45) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34) !important;
}

.maze-alert-title {
  color: #111f3a !important;
  font-family: "Bungee", "Impact", sans-serif !important;
  font-size: 26px !important;
  letter-spacing: 0.7px !important;
  text-transform: uppercase !important;
}

.maze-alert-text {
  color: #334f7d !important;
  font-weight: 700 !important;
  font-size: 16px !important;
}

.maze-alert-confirm {
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 20px !important;
  background: linear-gradient(135deg, #46d7ff 0%, #3f7cff 100%) !important;
  color: #fff !important;
  font-family: "Chakra Petch", "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
}

.maze-alert-popup .swal2-icon.swal2-error {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.maze-alert-popup .swal2-x-mark-line-left,
.maze-alert-popup .swal2-x-mark-line-right {
  background-color: var(--danger) !important;
}

@media (max-width: 980px) {
  .game-shell {
    width: min(100%, 760px);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .top-bar {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
  }

  .button-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .start-button {
    min-width: 118px;
  }

  .meta-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .svg-canvas-container {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .game-shell {
    width: 100%;
    border-radius: 16px;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row {
    width: 100%;
    justify-content: stretch;
  }

  .start-button {
    flex: 1;
  }

  .title {
    font-size: 30px;
  }

  .meta-row {
    flex-direction: column;
  }
}
