html, body {
  height: 100%;
  margin: 0;
  background: black;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

:root {
  --player-main-right: 0px;
  --player-main-bottom: 0px;
  --player-weather-size: 0px;
  --player-preview-size: 0px;
  --interactive-right-fade: clamp(22px, 2.2vw, 42px);
}

body.layout-default {
  --player-main-right: 0px;
  --player-main-bottom: 0px;
  --player-weather-size: 0px;
  --player-preview-size: 0px;
}

body.layout-bottom-weather {
  --player-main-right: 0px;
  --player-main-bottom: clamp(120px, 18vh, 210px);
  --player-weather-size: clamp(120px, 18vh, 210px);
  --player-preview-size: 0px;
}

body.layout-split-ads-weather {
  --player-main-right: clamp(220px, 30vw, 420px);
  --player-main-bottom: 0px;
  --player-weather-size: clamp(220px, 30vw, 420px);
  --player-preview-size: 0px;
}

body.layout-ads-map-preview {
  --player-main-right: 0px;
  --player-main-bottom: 0px;
  --player-weather-size: 0px;
  --player-preview-size: 0px;
}

#app {
  position: fixed;
  inset: 0;
}

#screen {
  position: absolute;
  top: 0;
  left: 0;
  right: var(--player-main-right);
  bottom: var(--player-main-bottom);
  background: black center / contain no-repeat;
  z-index: 0;
  pointer-events: none;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  z-index: 1;
  pointer-events: none;
}

#hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hotspot {
  position: absolute;
  pointer-events: auto;
  background: transparent;
  border: none;
}

.hotspot-pill {
  background: rgba(245, 245, 245, 0.96);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hotspot-pill-label {
  font-family: inherit;
  font-size: clamp(15px, 2.2vh, 22px);
  font-weight: 500;
  color: #1f2937;
  line-height: 1;
  pointer-events: none;
}

.hotspot.debug {
  outline: 2px solid lime;
}

.hotspot-label {
  position: absolute;
  font-size: 10px;
  color: lime;
  background: rgba(0,0,0,0.7);
  padding: 1px 3px;
  pointer-events: none;
  white-space: nowrap;
}

.pulse-debug {
  position: absolute;
  width: 6px;
  height: 6px;
  background: cyan;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pulse-debug::before,
.pulse-debug::after {
  content: "";
  position: absolute;
  background: cyan;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.pulse-debug::before {
  width: 100%;
  height: 2px;
}

.pulse-debug::after {
  width: 2px;
  height: 100%;
}

.hotspot.fullscreen {
  left: 0; top: 0; right: 0; bottom: 0; width: 100%; height: 100%;
}

.pulse {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid red;
  animation: pulse 1.2s infinite;
}

.route-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.route-path {
  fill: none;
  stroke: rgba(37, 99, 235, 0.95);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.28));
}

.route-path-animate {
  animation: route-draw 1s ease-out forwards;
}

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

@keyframes pulse {
  from { transform: scale(.6); opacity: 1; }
  to   { transform: scale(2.2); opacity: 0; }
}

/* Debug Editor Styles */
.debug-container {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 100;
}

.debug-box {
  position: absolute;
  outline: 3px solid #ffff00;
  background: rgba(255, 255, 0, 0.1);
  cursor: move;
  touch-action: none;
}

.debug-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ff00ff;
  border: 2px solid #ffff00;
  bottom: -8px;
  right: -8px;
  cursor: nwse-resize;
  touch-action: none;
  border-radius: 2px;
}

.debug-label {
  position: absolute;
  top: -22px;
  left: 0;
  font-size: 11px;
  font-family: monospace;
  color: #ffff00;
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 6px;
  white-space: nowrap;
  pointer-events: none;
}

.debug-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ffff;
  border: 2px solid #ffff00;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.debug-dot.dragging {
  cursor: grabbing;
}

.debug-dot-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: monospace;
  color: #00ffff;
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 4px;
  white-space: nowrap;
  pointer-events: none;
}

.debug-help {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  font-size: 12px;
  font-family: monospace;
  color: #00ff00;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #00ff00;
  padding: 12px;
  z-index: 200;
  pointer-events: none;
  line-height: 1.4;
}

/* touch hint pill */
#touchHint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(6px);
  padding: 14px 22px;
  font-size: 18px;
  max-width: 90vw;
  text-align: center;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  pointer-events: none;
  z-index: 9997;
  animation: float 3s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.3s;
}

@keyframes float {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}


.hidden { display: none !important; }

/* ads overlay layer */
.ads-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: var(--player-main-right);
  bottom: var(--player-main-bottom);
  z-index: 8000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease;
}
.ads-layer.show {
  opacity: 1;
}

body.layout-ads-map-preview.ads-anim-subtle .ads-layer.show {
  animation: ads-drift-left-subtle 6.6s ease-in-out infinite alternate;
}

body.layout-ads-map-preview.ads-anim-wow .ads-layer.show {
  animation: ads-drift-left-wow 5.9s cubic-bezier(0.45, 0.05, 0.25, 0.98) infinite alternate;
}

body.layout-ads-map-preview .ads-layer {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  will-change: transform, opacity, filter;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) calc(100% - var(--interactive-right-fade)),
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) calc(100% - var(--interactive-right-fade)),
    rgba(0, 0, 0, 0) 100%
  );
}

body.layout-ads-map-preview .ads-layer img,
body.layout-ads-map-preview .ads-layer video {
  object-fit: contain;
  background: #000;
}

body.layout-ads-map-preview.ads-anim-subtle .ads-layer.ads-exit-left {
  animation: ads-leave-left-subtle 380ms cubic-bezier(0.25, 0.72, 0.22, 1) forwards !important;
}

body.layout-ads-map-preview.ads-anim-wow .ads-layer.ads-exit-left {
  animation: ads-leave-left-wow 460ms cubic-bezier(0.22, 0.7, 0.2, 1) forwards !important;
}

@keyframes ads-drift-left-subtle {
  from { transform: translateX(0) scale(1.001); filter: saturate(1); }
  to { transform: translateX(-9%) scale(1.004); filter: saturate(1.02); }
}

@keyframes ads-drift-left-wow {
  from { transform: translateX(0) scale(1.001); filter: saturate(1); }
  to { transform: translateX(-10%) scale(1.009); filter: saturate(1.05); }
}

@keyframes ads-leave-left-subtle {
  from { transform: translateX(0) scale(1.005); opacity: 1; filter: brightness(1); }
  to { transform: translateX(-104%); opacity: 0; filter: brightness(0.96); }
}

@keyframes ads-leave-left-wow {
  0% { transform: translateX(0) scale(1.01); opacity: 1; filter: brightness(1); }
  45% { transform: translateX(-10%) scale(1.005); opacity: 1; filter: brightness(1.02); }
  100% { transform: translateX(-108%) scale(0.98); opacity: 0; filter: brightness(0.92); }
}
.ads-layer img,
.ads-layer video {
  width: 100%;
  height: 100%;
}

.ads-layer img {
  object-fit: contain;
  background: #000;
}

/* tap catcher sitting above ad visuals */
.ads-tap {
  position: fixed;
  top: 0;
  left: 0;
  right: var(--player-main-right);
  bottom: var(--player-main-bottom);
  z-index: 9996; /* above ads visuals (8000), below modals (9999) */
  background: transparent;
  pointer-events: none;
  display: block;
}
.ads-tap.hidden { display: none !important; }

.player-weather-panel {
  position: fixed;
  z-index: 6;
  background: linear-gradient(180deg, rgba(10, 15, 24, 0.94) 0%, rgba(17, 24, 39, 0.94) 100%);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-sizing: border-box;
  pointer-events: none;
}

.player-map-preview-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--player-preview-size);
  z-index: 7;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
  border-left: 1px solid rgba(148, 163, 184, 0.26);
  box-sizing: border-box;
  pointer-events: none;
}

body.layout-ads-map-preview .player-map-preview-panel {
  display: none !important;
}

.player-map-preview-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  box-sizing: border-box;
}

.player-map-preview-title {
  margin: 0;
  color: #e2e8f0;
  font-size: clamp(13px, 1.7vw, 18px);
  font-weight: 700;
}

.player-map-preview-surface {
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-color: #0f172a;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.player-map-preview-hint {
  margin: 0;
  color: #94a3b8;
  font-size: clamp(11px, 1.35vw, 14px);
  line-height: 1.3;
}

.player-weather-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  box-sizing: border-box;
  text-align: center;
}

.player-weather-title {
  margin: 0;
  font-size: clamp(13px, 1.7vw, 18px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.player-weather-status {
  margin: 0;
  font-size: clamp(12px, 1.5vw, 16px);
  opacity: 0.92;
}

body.layout-bottom-weather .player-weather-panel {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-weather-size);
  border-left: none;
  border-right: none;
  border-bottom: none;
}

body.layout-split-ads-weather .player-weather-panel {
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--player-weather-size);
  border-top: none;
  border-right: none;
  border-bottom: none;
}

/* admin shortcut link, visible only in debug mode */
#adminLink {
  position: fixed;
  bottom: 5px;
  right: 5px;
  font-size: 10px;
  color: #fff;
  background: rgba(0,0,0,0.4);
  padding: 2px 4px;
  border-radius: 3px;
  z-index: 1000;
  display: none;
}

/* Modal for store info */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden { display: none; }

.modal-card {
  width: min(900px, 90vw);
  max-height: 85vh;
  overflow: auto;
  background: #111;
  color: white;
  padding: 20px;
  border-radius: 14px;
}

.modal-card #storeClose {
  position: absolute;
  right: 18px;
  top: 12px;
  background: transparent;
  color: #fff;
  border: none;
  font-size: 20px;
}

.store-popup-canvas {
  position: relative;
  width: min(880px, 86vw);
  max-width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 auto;
}

.store-popup-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-popup-logo {
  position: absolute;
  width: clamp(64px, 7vw, 100px);
  height: clamp(64px, 7vw, 100px);
  object-fit: contain;
  display: block;
}

.store-popup-text {
  position: absolute;
  max-width: 62%;
  padding: clamp(8px, 1.1vw, 12px) clamp(10px, 1.2vw, 14px);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.36);
  color: #f8fafc;
  font-family: inherit;
}

.store-popup-text h2 {
  margin: 0;
  font-size: clamp(15px, 2.1vw, 28px);
  line-height: 1.2;
}

.store-popup-text p {
  margin: 6px 0 0;
  font-size: clamp(13px, 1.8vw, 22px);
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.92);
}

/* Smooth screen transitions */
#screen{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* two background layers */
.bg-layer{
  position: absolute;
  inset: 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain; /* matcher fit-rect følelsen */
  opacity: 0;
  transition: opacity 260ms ease;
  will-change: opacity;
  z-index: 1;
}

/* keep UI above backgrounds */
#video, #hotspots{
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* ===== PRODUCTION HARDENING START ===== */
/* Prevent text selection, dragging, and unwanted interactions */
html, body, * {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Prevent pinch-zoom, no double-tap zoom */
html {
  touch-action: manipulation !important;
  overscroll-behavior: none !important;
}

/* Disable zoom on input focus (mobile) */
input, textarea, select {
  font-size: 16px;
  -webkit-user-select: text;
  user-select: text;
}

/* Kill unwanted visual feedback */
* {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* Prevent scroll on body/html */
body {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  overscroll-behavior: none;
}

/* Ensure no accidental scrolling on hotspots/menu */
.hotspot, .hotspots, #menuScreen {
  -webkit-overflow-scrolling: none;
}

/* ===== PRODUCTION HARDENING END ===== */