* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0f1629;
  color: #e8eef7;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

header {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 50;
  background: rgba(15, 22, 41, 0.78);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  backdrop-filter: blur(4px);
}

h1 {
  font-size: 20px;
  color: #4ade80;
  letter-spacing: 3px;
  font-weight: 800;
  margin: 0;
}

.subtitle {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 2px;
}

.hud {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 28px;
  background: rgba(30, 41, 59, 0.85);
  padding: 10px 24px;
  border-radius: 12px;
  border: 1px solid #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.hud-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.hud-value {
  font-size: 22px;
  font-weight: bold;
  color: #4ade80;
  font-family: 'Courier New', monospace;
  margin-top: 4px;
}

.hud-value.warning {
  color: #f87171;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
  touch-action: none;
}

svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

.scene {
  cursor: default;
}

.scene.panning {
  cursor: pointer;
}

body.panning,
body.panning * {
  cursor: pointer !important;
}

.zoom-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zoom-toolbar button {
  background: rgba(30, 41, 59, 0.9);
  color: #e8eef7;
  border: 1px solid #475569;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  min-width: 34px;
  line-height: 1;
  font-family: 'Courier New', monospace;
  transition: background 0.15s, transform 0.1s;
}

.zoom-toolbar button:hover {
  background: rgba(74, 222, 128, 0.25);
  border-color: #4ade80;
}

.zoom-toolbar button:active {
  transform: scale(0.95);
}

.zoom-hint {
  position: absolute;
  bottom: 8px;
  left: 12px;
  z-index: 10;
  background: rgba(15, 22, 41, 0.75);
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  pointer-events: none;
}

.hotspot {
  cursor: default;
  transition: filter 0.15s;
}

.hotspot:hover {
  /*filter: brightness(1.18) drop-shadow(0 0 6px #fbbf24);*/
}

.hotspot.found {
  pointer-events: none;
  /*opacity: 0.55;*/
  filter: brightness(1.18) drop-shadow(0 0 2px #b31c1c);
}

.decoy {
  pointer-events: none;
}

.scene.over .hotspot {
  pointer-events: none;
  cursor: default;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1e293b;
  border-left: 4px solid #4ade80;
  padding: 14px 18px;
  border-radius: 8px;
  max-width: 360px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease, fadeOut 0.5s ease 3.5s forwards;
  z-index: 100;
}

.toast.bad {
  border-left-color: #f87171;
}

.toast-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 14px;
}

.toast-body {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(120%);
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #1e293b;
  padding: 36px;
  border-radius: 16px;
  max-width: 520px;
  width: 90%;
  border: 1px solid #334155;
  text-align: center;
}

.modal h2 {
  color: #4ade80;
  margin-bottom: 12px;
  font-size: 26px;
}

.modal h2.fail {
  color: #f87171;
}

.modal p {
  color: #cbd5e1;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal .stats {
  display: flex;
  justify-content: space-around;
  background: #0f1629;
  padding: 18px;
  border-radius: 10px;
  margin-bottom: 24px;
}

.modal .stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal .stats .n {
  font-size: 28px;
  font-weight: bold;
  color: #4ade80;
  font-family: 'Courier New', monospace;
}

.modal .stats .l {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 1px;
}

.modal-content.intro {
  max-width: 480px;
}

.intro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  text-align: left;
}

.intro-list li {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 12px 8px 28px;
  margin-bottom: 6px;
  background: #0f1629;
  border-left: 3px solid #4ade80;
  border-radius: 0 6px 6px 0;
  position: relative;
}

.intro-list li::before {
  content: "›";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #4ade80;
  font-weight: bold;
  font-size: 16px;
}

.intro-list strong {
  color: #e8eef7;
}

button {
  background: #4ade80;
  color: #0f1629;
  border: none;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s;
}

button:hover {
  transform: scale(1.05);
}

.instructions {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(15, 22, 41, 0.75);
  color: #94a3b8;
  font-size: 11px;
  text-align: center;
  max-width: 700px;
  line-height: 1.4;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #334155;
}

/* logo Dottor Marc cliccabile */
.brand-logo {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 50;
  display: block;
  background: rgba(15, 22, 41, 0.85);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  transition: transform 0.15s, box-shadow 0.15s;
}

.brand-logo:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand-logo img {
  display: block;
  height: 32px;
  width: auto;
  pointer-events: none;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  header {
    top: 8px;
    left: 8px;
    padding: 5px 10px;
  }
  h1 {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .subtitle {
    display: none;
  }

  .hud {
    top: auto;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    gap: 14px;
    padding: 6px 14px;
    border-radius: 10px;
  }
  .hud-item {
    min-width: 54px;
  }
  .hud-label {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .hud-value {
    font-size: 14px;
    margin-top: 2px;
  }

  .zoom-toolbar {
    top: 8px;
    right: 8px;
    gap: 3px;
  }
  .zoom-toolbar button {
    padding: 5px 8px;
    font-size: 13px;
    min-width: 28px;
  }

  .zoom-hint {
    display: none;
  }
  .instructions {
    display: none;
  }

  .toast {
    top: 56px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
    padding: 10px 14px;
  }
  .toast-title {
    font-size: 13px;
  }
  .toast-body {
    font-size: 12px;
  }

  .modal-content,
  .modal-content.intro {
    padding: 22px 18px;
    max-width: 92vw;
  }
  .modal h2 {
    font-size: 19px;
  }
  .modal p {
    font-size: 14px;
    margin-bottom: 18px;
  }
  .intro-list li {
    font-size: 13px;
    padding: 7px 10px 7px 24px;
  }

  .brand-logo {
    top: 8px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 4px 10px;
  }
  .brand-logo img {
    height: 22px;
  }
  .brand-logo:hover {
    transform: translateX(-50%) scale(1.04);
  }
}
