:root {
  --bg:#f6fbf8;
  --fg:#0b1220;
  --muted:#6b7280;
  --ring:#e5e7eb;
  --card:#ffffff;
}

* {
  box-sizing:border-box;
}
    #openPopup {
      position: fixed; /* stays in the corner */
      top: 12px;
      left: 12px;
      font-family: sans-serif;
      font-size: 14px;
      text-decoration: underline;
      cursor: pointer;
      z-index: 1001;
    }

    /* Fullscreen overlay (hidden by default) */
    #popupOverlay {
      display: none;               /* start closed */
      position: fixed;
      z-index: 10000;
      inset: 0;                    /* top:0; right:0; bottom:0; left:0 */
      background: rgba(0,0,0,0.4);
      justify-content: center;     /* center horizontally */
      align-items: center;         /* center vertically */
    }

    /* Centered popup box */
    .popupBox {
      background: #fff;
      padding: 16px 20px;
      border-radius: 10px;
      max-width: 420px;
      width: calc(100% - 40px);
      font-family: sans-serif;
      box-shadow: 0 6px 18px rgba(0,0,0,0.25);
      text-align: center;
    }

    .closeBtn {
      margin-top: 12px;
      padding: 8px 14px;
      border: 0;
      border-radius: 6px;
      cursor: pointer;
    }
body {
  margin: 0;
  background: var(--bg) url("../img/TweedeKamerVerdeling.jpg") no-repeat center center fixed;
  background-size: cover;   /* ensures it always fills the viewport */
  color: var(--fg);
  font: 16px/1.45 system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.stage {
  position:relative;
  min-height:100vh;
  display:grid;
  justify-content:center; /* center horizontally */
  align-items:flex-end;
  padding:32px;
}


.center {
  width:min(620px, 92vw);
  aspect-ratio:3/1;
  background:var(--card);
  border:2px solid var(--ring);
  border-radius:20px;
  box-shadow:0 12px 40px rgba(0,0,0,.08);
  padding:16px;
  display:flex;
  flex-direction:column;
}

h1 {
  font-size:18px;
  margin:0 0 8px 0;
}

textarea {
  flex:1;
  resize:none;
  border:1px solid var(--ring);
  border-radius:12px;
  padding:12px;
}

.row {
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:10px;
}

button {
  padding:10px 14px;
  border:0;
  border-radius:12px;
  background:#111827;
  color:#fff;
  cursor:pointer;
}

button[disabled] {
  opacity:.65;
  cursor:not-allowed;
}

.small {
  font-size:12px;
  color:var(--muted);
}

/* ----------------------------------- */
/* Party nodes */
/* ----------------------------------- */

/* PC/Desktop styles (default) */
.nodeWrap {
  position:absolute;
  transform:translate(-50%,-50%);
  text-align:left;
  transition: left 280ms ease; /* smooth reposition */
}

.start-btn{
  position:fixed;
  top:calc(env(safe-area-inset-top) + 8px);
  left:50%;
  transform:translateX(-50%);
  z-index:1000;

  display:inline-block;
  padding:10px 14px;
  border-radius:8px;
  background:#1f71ff;
  color:#fff !important;
  text-decoration:none !important;
  font-weight:600;
  line-height:1;
}


/* Mobile styles */
@media (max-width: 600px) {
  body {
  margin: 0;
  background: var(--bg) url("../img/TweedeKamerVerdeling.jpg") no-repeat center center fixed;
  background-size: cover;   /* ensures it always fills the viewport */
  color: var(--fg);
  font: 10px/1.45 system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  }
  .nodeWrap {
    position: static !important;
    margin: 8px 0 0 0 !important;
    width: auto !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    display: flex;
    align-items: center;
    flex-direction: row;
  }
    /* You can use transform or flexbox for row alignment if needed */
  
  .stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    justify-content: flex-start; /* Add this line */
    min-height: 100vh;  
    padding-top: calc(env(safe-area-inset-top) + 56px)
  }
  .stage .node {
    width: 32px !important;
    height: 32px !important;
    border-width: 2px !important;
  }

  .center {
    order: 0;
    z-index: 2;
    background: #fff;
    position: relative;
    margin-bottom: 16px;
    max-height: 200px;
  }
  .center textarea {
  width: 100%;
  max-width: 400px;
  min-width: 180px;
  min-height: 48px;
  max-height: 120px;
  font-size: 1em;
  margin: 0 auto 1em auto;
  display: block;
  resize: vertical;
  }
  .bubble {
    margin-top: 0;
    margin-left: 10px; /* Space between logo and bubble */
    width: min(70vw, 220px);
    min-width: 120px;
    display: none;
  }
  button {
  padding:10px 8px;
  border:0;
  border-radius:8px;
  background:#111827;
  color:#fff;
  cursor:pointer;
  font-size: 8px;
  }

  button[disabled] {
    opacity:.65;
    cursor:not-allowed;
  }


}

.node {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  background: #fff;
  border: 4px solid var(--ring);
  display: grid;
  place-items: center;
  font-weight:700;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  overflow: hidden; /* clip image corners */
}

.node img {
  width: 90%;
  height: 90%;
  object-fit: contain; /* fills without stretching */
  display: block;
}

.bubble {
  margin-top:6px;
  width:min(180px, 62vw);
  display:none;
}

.card {
  position:relative;
  background:#fff;
  border:1px solid var(--ring);
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
  padding:10px;
}

.tip {
  position:absolute;
  left:22px;
  top:-6px;
  width:15px;
  height:15px;
  background:#fff;
  border-left:1px solid var(--ring);
  border-top:1px solid var(--ring);
  transform:rotate(45deg);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#f9fafb;
  border:1px solid var(--ring);
  border-radius:8px;
  padding:6px;
  white-space:pre-wrap;
  font-size:12px;
}

.rowSm {
  display:flex;
  gap:8px;
  align-items:center;
}

.status {
  font-size:12px;
  color:var(--muted);
}

.ok {
  color:#0c6b34;
}

.err {
  color:#b42318;
}

.spinner {
  width:12px;
  height:12px;
  border-radius:999px;
  border:2px solid #cbd5e1;
  border-top-color:#111827;
  animation:spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform:rotate(360deg);
  }
}

.modal {
  position: fixed; z-index: 9999; left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: #fff; padding: 2em; border-radius: 8px; max-width: 500px; width: 90%;
  position: relative;
}
.close {
  position: absolute; right: 1em; top: 1em; font-size: 2em; cursor: pointer;
}

/* ----------------------------------- */
/* Toast */
/* ----------------------------------- */
.toast {
  position:fixed;
  right:12px;
  bottom:12px;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.2);
  font-size:13px;
  max-width:min(480px, 90vw);
}
