:root {
  --bg: #f4f4f1;
  --fg: #111111;
  --muted: #666666;
  --node-size: 108px;
  --node-size-secondary: 82px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: var(--bg);
}

.board {
  position: relative;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  cursor: grab;
}

.board.dragging {
  cursor: grabbing;
}

.canvas {
  position: absolute;
  width: 2600px;
  height: 1800px;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.node {
  position: absolute;
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.16s ease;
}

.node:hover {
  transform: scale(1.06);
}

.node img,
.node svg {
  width: var(--node-size);
  height: var(--node-size);
  display: block;
}

.node span {
  font-size: 14px;
  letter-spacing: 0.04em;
  text-align: center;
}

.logo-node {
  left: 1180px;
  top: 760px;
  width: 360px;
}

.logo-node img {
  width: 320px;
  height: auto;
  display: block;
}

.secondary-node img,
.secondary-node svg {
  width: var(--node-size-secondary);
  height: var(--node-size-secondary);
}

.secondary-node span {
  font-size: 13px;
  color: var(--muted);
}

/* Zoom-Controls */
.zoom-controls {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 50;
  display: flex;
  gap: 6px;
}

.zoom-controls button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: #111;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px !important;
  line-height: 1;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Edit-Controls links unten */
.edit-controls {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  gap: 10px;
}

.edit-controls button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #111;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  padding: 6px 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

/* JSON-Ausgabefeld über den Edit-Buttons */
.layout-output {
  position: fixed;
  left: 18px;
  bottom: 58px;
  z-index: 60;
  width: 320px;
  height: 220px;
  display: none;
  padding: 10px;
  border: 1px solid #111;
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.4;
  resize: none;
}

.edit-mode .node.editable {
  cursor: move;
}

.edit-mode .node.active {
  opacity: 0.75;
}

/* Desktop / größere Laptops */
@media (max-width: 1400px) {
  :root {
    --node-size: 102px;
    --node-size-secondary: 80px;
  }

  .node {
    width: 144px;
  }

  .logo-node {
    width: 340px;
  }

  .logo-node img {
    width: 300px;
  }
}

/* Tablet quer */
@media (max-width: 1200px) and (orientation: landscape) {
  :root {
    --node-size: 94px;
    --node-size-secondary: 76px;
  }

  .node {
    width: 136px;
  }

  .node span {
    font-size: 13px;
  }

  .logo-node {
    width: 320px;
  }

  .logo-node img {
    width: 280px;
  }

  .zoom-controls {
    right: 12px;
    top: 12px;
    gap: 5px;
  }

  .zoom-controls button {
    width: 14px;
    height: 14px;
    font-size: 10px !important;
  }
}

/* Tablet hoch */
@media (max-width: 1200px) and (orientation: portrait) {
  :root {
    --node-size: 90px;
    --node-size-secondary: 72px;
  }

  .node {
    width: 132px;
  }

  .node span {
    font-size: 12px;
  }

  .logo-node {
    width: 320px;
  }

  .logo-node img {
    width: 290px;
  }

  .zoom-controls {
    right: 10px;
    top: 10px;
    gap: 4px;
  }

  .zoom-controls button {
    width: 12px;
    height: 12px;
    font-size: 9px !important;
  }
}

/* Smartphone */
@media (max-width: 700px) {
  :root {
    --node-size: 74px;
    --node-size-secondary: 62px;
  }

  .node {
    width: 112px;
  }

  .node span {
    font-size: 11px;
  }

  .logo-node {
    width: 240px;
  }

  .logo-node img {
    width: 210px;
  }

  .zoom-controls {
    right: 8px;
    top: 8px;
    gap: 4px;
  }

  .zoom-controls button {
    width: 12px;
    height: 12px;
    font-size: 8px !important;
  }

  .edit-controls {
    left: 10px;
    bottom: 10px;
    gap: 6px;
  }

  .edit-controls button {
    font-size: 11px;
    padding: 5px 8px;
  }

  .layout-output {
    left: 10px;
    bottom: 44px;
    width: calc(100vw - 20px);
    height: 180px;
    font-size: 10px;
  }
}