/* ===========================================================
   Rainbow Dash · Sticker Wall guestbook
   Visitors slap sticky notes on the Cloudominium wall:
   pastel notes, handwriting, and a crayon doodle drawn right
   on the note. Owner mode (unlocked via ?owner=…) adds a red
   X per note plus a batch-select toolbar.
   Backed by Liveblocks — see guestbook.js.
   =========================================================== */

.gw {
  padding: 14px 14px 24px;
  border: 2px solid #74b6ec;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 3px, transparent 3px 90px),
    linear-gradient(180deg, #7fb9ee, #5d9bdd);
  box-shadow: 0 4px 14px var(--shadow), inset 0 0 0 2px rgba(140, 190, 244, .4);
}

.gw-head { text-align: center; margin: 6px 0 16px; }
.gw-head h2 {
  font-family: "Permanent Marker", cursive;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 0 rgba(20, 60, 130, .4);
  transform: rotate(-1.4deg);
}
.gw-head h2 b { color: #ffe65b; }
.gw-head p { font-family: "Reenie Beanie", cursive; font-size: 22px; color: #d7ecff; margin-top: 4px; }

/* ===========================================================
   THE GIANT STICKY-NOTE FORM
   =========================================================== */
.gw-form {
  position: relative;
  width: min(680px, 100%);
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  background: #fff9c9;
  border-radius: 4px 4px 26px 4px;
  box-shadow: 0 8px 18px rgba(10, 40, 90, .35);
  transform: rotate(-.8deg);
  padding: 16px 16px 14px;
}
.gw-form::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 120px;
  height: 24px;
  background: rgba(140, 220, 255, .6);
  border-left: 1px dashed rgba(255, 255, 255, .8);
  border-right: 1px dashed rgba(255, 255, 255, .8);
}
.gw-form label { display: block; font-family: "Reenie Beanie", cursive; font-size: 19px; color: #8a6d1d; margin-bottom: 2px; }
.gw-form input[type="text"],
.gw-form textarea {
  width: 100%;
  border: none;
  border-bottom: 2px dashed #d9c565;
  border-radius: 0;
  background: transparent;
  font-family: "Gochi Hand", cursive;
  font-size: 17px;
  color: #4a3d10;
  padding: 3px 2px;
}
.gw-form input:focus, .gw-form textarea:focus { outline: none; border-bottom-color: #2f5fb8; }
.gw-form textarea { min-height: 84px; resize: vertical; }
.gw-form__fields { display: grid; gap: 10px; align-content: start; padding-right: 16px; }
/* bot honeypot: invisible to humans, tempting to scripts */
.gw-web { position: absolute; left: -4000px; top: 0; width: 10px; opacity: 0; pointer-events: none; }

.gw-btn {
  justify-self: start;
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  background: #2f5fb8;
  color: #fff;
  font-family: "Permanent Marker", cursive;
  font-size: 16px;
  box-shadow: 0 3px 0 #1c3d7e;
  transform: rotate(-1deg);
}
.gw-btn:hover { filter: brightness(1.1); }
.gw-btn:disabled { opacity: .55; cursor: default; }
.gw-form__status { font-family: "Reenie Beanie", cursive; font-size: 18px; color: #7c6716; min-height: 20px; }
.gw-form__status.is-ok { color: #3c7a2e; }
.gw-form__status.is-err { color: #b8404e; }

/* doodle pad */
.gw-pad { border-left: 2px dashed #d9c565; padding-left: 14px; display: grid; gap: 7px; align-content: start; }
.gw-pad > b { font-family: "Reenie Beanie", cursive; font-size: 20px; color: #8a6d1d; font-weight: 400; }
.gw-pad canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #fffdf0;
  border: 2px solid #e5d78a;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
}
.gw-crayons { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.gw-crayons button.cray {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 1px 2px rgba(90, 70, 0, .4);
}
.gw-crayons button.cray.on { outline: 2px solid #2f5fb8; outline-offset: 1px; }
.gw-crayons button.tool {
  font-family: "Reenie Beanie", cursive;
  font-size: 16px;
  color: #8a6d1d;
  background: transparent;
  border: none;
  padding: 0 4px;
  margin-left: 2px;
}
.gw-crayons button.tool.on, .gw-crayons button.tool:hover { color: #2f5fb8; text-decoration: underline; }

/* ===========================================================
   OWNER-MODE TOOLBAR
   =========================================================== */
.gw-admin[hidden] { display: none; }
.gw-admin {
  position: relative;
  width: min(880px, 100%);
  margin: 0 auto 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(20, 30, 70, .55);
  border: 2px dashed #ff8fd3;
  border-radius: 12px;
}
.gw-admin__tag { font-family: "Press Start 2P", monospace; font-size: 7.5px; color: #fff; background: #d62aa0; border-radius: 999px; padding: 4px 9px; }
.gw-admin button {
  padding: 5px 12px;
  border: 2px solid #ff8fd3;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #b0286e;
  font-weight: 700;
  font-size: 12px;
}
.gw-admin button:hover { background: #ffe1f2; }
.gw-admin button:disabled { opacity: .5; cursor: default; }
.gw-admin .danger { border-color: #ff5b6e; color: #c22333; }
.gw-admin .count { margin-left: auto; font-size: 11.5px; color: #ffd1ec; }

/* connection line */
.gw-conn { text-align: center; font-family: "Reenie Beanie", cursive; font-size: 19px; color: #cfe6ff; margin: 0 0 14px; }
.gw-conn.is-live { color: #b5f3c3; }
.gw-conn.is-err { color: #ffc4cb; }

/* ===========================================================
   THE WALL OF NOTES
   =========================================================== */
.gw-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px 14px;
  align-items: start;
}
.gw-empty { grid-column: 1 / -1; text-align: center; font-family: "Reenie Beanie", cursive; font-size: 24px; color: #d7ecff; padding: 30px 0; }

.gw-note {
  position: relative;
  padding: 12px 13px 14px;
  border-radius: 3px 3px 18px 3px;
  box-shadow: 0 6px 12px rgba(10, 40, 90, .35);
}
.gw-note::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 22px;
  width: 58px;
  height: 16px;
  transform: rotate(-2.5deg);
  background: rgba(140, 220, 255, .55);
  border-left: 1px dashed rgba(255, 255, 255, .7);
  border-right: 1px dashed rgba(255, 255, 255, .7);
}
.gw-note--y { background: #fff9c9; }
.gw-note--p { background: #ffe3f0; }
.gw-note--b { background: #e0f3ff; }
.gw-note--g { background: #e6f8dd; }
.gw-note--v { background: #efe6ff; }
.gw-note:nth-child(odd) { transform: rotate(-1.6deg); }
.gw-note:nth-child(even) { transform: rotate(1.8deg); }
.gw-note:nth-child(3n) { transform: rotate(-.6deg); }

.gw-note__name { font-family: "Permanent Marker", cursive; font-size: 15.5px; color: #26428c; overflow-wrap: anywhere; }
.gw-note__date { font-family: "Reenie Beanie", cursive; font-size: 15px; color: #7a7a9c; margin-left: 5px; }
.gw-note__msg { font-family: "Gochi Hand", cursive; font-size: 15.5px; line-height: 1.35; color: #333a55; margin-top: 5px; overflow-wrap: anywhere; white-space: pre-line; }
.gw-note__doodle { margin-top: 8px; background: rgba(255, 255, 255, .75); border-radius: 6px; display: grid; place-items: center; padding: 4px; }
.gw-note__doodle img { display: block; width: 100%; max-width: 180px; height: auto; }

/* owner controls on notes (hidden until body.gw-owner) */
.gw-note__x, .gw-note__check { display: none; }
body.gw-owner .gw-note__x {
  display: grid;
  place-items: center;
  position: absolute;
  top: -10px;
  right: -8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: #ff5b6e;
  color: #fff;
  border: 2px solid #fff;
  font-weight: 900;
  font-size: 12px;
  box-shadow: 0 2px 5px rgba(120, 20, 30, .5);
}
body.gw-owner .gw-note__x:hover { background: #d8283c; }
body.gw-owner .gw-note__check {
  display: grid;
  place-items: center;
  position: absolute;
  bottom: -8px;
  right: 10px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 5px;
  border: 2px solid #d62aa0;
  background: #fff;
  color: #d62aa0;
  font-size: 12px;
  font-weight: 900;
}
.gw-note--sel { outline: 3px dashed #ff63c8; outline-offset: 3px; }

@media (max-width: 760px) {
  .gw-form { grid-template-columns: 1fr; }
  .gw-form__fields { padding-right: 0; }
  .gw-pad { border-left: none; padding-left: 0; border-top: 2px dashed #d9c565; padding-top: 10px; margin-top: 4px; }
}
