@font-face {
  font-family: 'RockSaltCustom';
  src: url('fonts/RockSalt.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* =========================
   Base / reset
   ========================= */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0b0b0b; /* fallback behind board */
  color: #ddd;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden; /* critical: prevents normal page scrolling */
}

/* =========================
   HUD (fixed overlay)
   ========================= */
#hud {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  z-index: 9999;
  pointer-events: none; /* HUD won't block board interactions except buttons */
}

#hud .hud-left {
  pointer-events: none;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 12px;
  opacity: 0.9;
}

.hint {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.7;
}

#hud .hud-right {
  display: flex;
  gap: 8px;
  pointer-events: auto; /* buttons should be clickable */
}

.hud-btn {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eee;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.hud-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

/* =========================
   Viewport / World
   ========================= */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden; /* hides off-screen world */
  cursor: grab;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,0.04), transparent 45%),
    #050505;
}

#viewport.dragging {
  cursor: grabbing;
}

/*
  The world is transformed by JS using translate + scale.
  We set transform-origin to 0 0 so coordinates are simple.
*/
#world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;

  /* Big "virtual canvas". You can increase if you want. */
  width: 6000px;
  height: 4000px;

  /* subtle dust/grain overlay vibe */
  background-image:
    radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 120px 120px;
  background-position: 0 0;
}

/* =========================
   Connections SVG layer
   ========================= */
#connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.conn-line {
  stroke: #b01212; /* deep red */
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.9;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6));
}

.conn-line.small {
  stroke-width: 4;
  opacity: 0.85;
}

/* =========================
   Nodes / Polaroids
   ========================= */
#nodes {
  position: absolute;
  inset: 0;
}

/*
  Polaroid container:
  - absolute placed by JS (left/top in world coords)
  - rotated by JS (CSS transform)
*/
.polaroid {
  position: absolute;
  width: 260px; /* default size; can override per node */
  user-select: none;
  cursor: pointer;
  transform-origin: 50% 30%;
  transition: transform 0.12s ease, filter 0.12s ease;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.55));
}

.polaroid:hover {
  filter: drop-shadow(0 14px 14px rgba(0,0,0,0.75));
}

.polaroid a {
  text-decoration: none;
  color: inherit;
}

/*
  The "paper" frame:
  - thick white border
  - extra bottom padding for that polaroid caption area
*/
.polaroid-frame {
  background: #eee;
  padding: 16px 16px 42px 16px; /* extra bottom space */
  border-radius: 4px;
  position: relative;
}

/* A little grime texture using gradients (cheap but effective). */
.polaroid-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 70%, rgba(0,0,0,0.10), transparent 40%),
    radial-gradient(circle at 70% 85%, rgba(0,0,0,0.08), transparent 50%),
    radial-gradient(circle at 60% 20%, rgba(255,255,255,0.12), transparent 45%);
  mix-blend-mode: multiply;
  opacity: 0.35;
  pointer-events: none;
}

/* The photo image area */
.polaroid-img {
  display: block;
  width: 100%;
  height: 220px;           /* default crop height */
  object-fit: cover;       /* crops nicely */
  border-radius: 2px;
  background: #111;
}

/* Caption text (optional) */
.polaroid-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;

  font-family: 'RockSaltCustom', cursive;
  font-size: 16px;
  letter-spacing: 0.04em;

  color: rgba(15, 15, 15, 0.85);

  transform: rotate(-2deg); /* slight natural tilt */
}


/* optional: small “pin” indicator */
.polaroid-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
}
