/* ──────────────────────────────────────────────────────────────────
   The Barn Wall — collaborative doodlin' canvas
   ────────────────────────────────────────────────────────────────── */

.app-view--wall[hidden] { display: none; }
.app-view--wall { display: block; color: var(--ink); }

/* ── Banner: hand-painted barn sign ──────────────────────────── */
.archive-banner--wall {
  height: 190px;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 212, 128, .35) 0 22%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #b97e44 0%, #7d4b1c 100%);
  border-radius: 5px;
  box-shadow: 0 3px 6px var(--shadow);
  position: relative;
  overflow: hidden;
}
.archive-banner--wall::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.wall-sign {
  position: absolute;
  inset: 26px 80px 26px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 30px;
  text-align: center;
  color: #fff4d4;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255, 240, 200, .12), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #8d5226, #4d2a10);
  border: 4px solid #2c1808;
  border-top-color: #d3a558;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 3px rgba(255, 220, 150, .12),
    0 8px 24px rgba(0, 0, 0, .5);
  transform: rotate(-.4deg);
}
.wall-sign .eyebrow {
  font-family: "Rye", Georgia, serif;
  font-size: 13px;
  letter-spacing: .28em;
  color: #f5d57c;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
}
.wall-sign h1 {
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 50px;
  color: #fff5cc;
  letter-spacing: .02em;
  line-height: 1;
  text-shadow:
    2px 3px 0 rgba(60, 22, 4, .85),
    0 0 12px rgba(255, 200, 120, .35);
  margin: 0;
}
.wall-sign::before,
.wall-sign::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  top: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe1a5 0 22%, #6b3e15 70%, #2a1208 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.wall-sign::before { left: 14px; }
.wall-sign::after  { right: 14px; }

/* ── Wood-plank stage that houses the canvas ─────────────────── */
.wall-stage {
  position: relative;
  margin-top: 14px;
  padding: 28px 28px 32px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.06) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #a8754a, #6c3f1a);
  border: 4px solid #2c1808;
  border-top-color: #c98a42;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 228, 180, .14),
    inset 0 -10px 18px rgba(0, 0, 0, .25),
    0 6px 14px rgba(0,0,0,.4);
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 18px;
  align-items: start;
}

/* ── Tool rail (left) ────────────────────────────────────────── */
.toolrail {
  padding: 12px 12px 14px;
  background:
    radial-gradient(circle at 14% 22%, rgba(127, 80, 31, .10) 0 1px, transparent 2px),
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .07) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #fff4d4, #edcf93);
  border: 3px solid #6b3e15;
  border-top-color: #c98a42;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .65),
    0 6px 14px rgba(0,0,0,.35);
  position: sticky;
  top: 14px;
}
.toolrail h3 {
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 12px;
  letter-spacing: .12em;
  color: #6b2c16;
  text-align: center;
  border-bottom: 1px dashed rgba(133, 84, 33, .55);
  padding-bottom: 3px;
  margin-bottom: 5px;
}
.toolrail__group { margin-bottom: 8px; }
.toolrail__group:last-child { margin-bottom: 0; }

.name-tag {
  width: 100%;
  padding: 8px 10px;
  font-family: "Kalam", cursive;
  font-size: 15px;
  color: #2f2115;
  background: #fff8de;
  border: 2px solid #b97836;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.name-tag:focus { outline: 2px solid var(--apple); outline-offset: 1px; }

.crayon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.crayon {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px solid #2a1208;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  background: var(--crayon);
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .35),
    0 2px 0 rgba(0,0,0,.3);
  transition: transform .15s ease;
}
.crayon:hover { transform: translateY(-2px); }
.crayon--active {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .55),
    0 0 0 2px var(--apple),
    0 4px 0 rgba(0,0,0,.4);
}
.crayon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.18) 0 1px, transparent 1px 4px);
  border-radius: 2px;
  pointer-events: none;
}

/* "Pick Any Color" button — wraps a hidden native color input. */
.crayon-custom {
  width: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  color: #2f2115;
  background: linear-gradient(180deg, #fff4d4, #e7c27e);
  border: 2px solid #6b3e15;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 0 rgba(0,0,0,.25);
}
.crayon-custom:hover { filter: brightness(1.06); }
.crayon-custom__swatch {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  border: 1px solid #2a1208;
  /* Rainbow default — overridden once a color is picked */
  background:
    conic-gradient(from 0deg, #a73620, #d96d35, #e8b34a, #6e933b, #4ba5a5, #5b2d8f, #a73620);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,250,226,.35);
}
.crayon-custom input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
}
.crayon-custom--active {
  color: #fff4d4;
  background: linear-gradient(180deg, #b04a23, #6b2014);
  border-color: #2a0c04;
}
.crayon-custom--active .crayon-custom__swatch { border-color: #fff4d4; }

/* Mini-toolbar variant — square, no label */
.crayon-custom--mini {
  width: 32px;
  height: 28px;
  padding: 0;
  margin-top: 0;
}
.crayon-custom--mini .crayon-custom__label { display: none; }
.crayon-custom--mini .crayon-custom__swatch {
  width: 18px;
  height: 18px;
}

.size-slider {
  width: 100%;
  accent-color: var(--apple);
}
.size-preview {
  display: grid;
  place-items: center;
  height: 22px;
  margin-top: 2px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  color: #5b3015;
}
.size-preview .dot {
  background: var(--crayon, #a73620);
  border-radius: 50%;
  margin-right: 6px;
  transition: width .15s ease, height .15s ease;
}

.tool-button {
  width: 100%;
  padding: 5px 8px;
  margin-top: 4px;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  color: #2f2115;
  background: linear-gradient(180deg, #fff4d4, #e7c27e);
  border: 2px solid #6b3e15;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 0 rgba(0,0,0,.25);
  letter-spacing: .04em;
}
.tool-button:hover { filter: brightness(1.07); }
.tool-button:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.tool-button--danger {
  color: #fff4d4;
  background: linear-gradient(180deg, #b04a23, #6b2014);
  border-color: #2a0c04;
}
.tool-button--eraser.is-active,
.tool-button--eyedropper.is-active,
.tool-button--bubble.is-active,
.tool-button--moderate.is-active {
  color: #fff4d4;
  background: linear-gradient(180deg, #6e933b, #3a5320);
  border-color: #2a3a18;
}

.toolrail__group--manager {
  display: none;
}
body.aj-wall-owner .toolrail__group--manager {
  display: block;
}
.manager-label {
  display: block;
  margin-top: 8px;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  color: #5b3015;
}
.manager-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 6px 7px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  color: #2f2115;
  background: #fffaf0;
  border: 1px solid #b97836;
  border-radius: 3px;
}

/* On-canvas speech-bubble input — appears at the click position */
.bubble-input {
  position: absolute;
  transform: translate(-50%, calc(-100% - 14px));
  pointer-events: auto;
  z-index: 8;
  animation: bubble-pop .2s ease-out;
}
.bubble-input input {
  width: 220px;
  padding: 7px 10px;
  font-family: "Kalam", cursive;
  font-size: 15px;
  color: var(--bubble-fg, #2f2115);
  background: var(--bubble-bg, #fff8de);
  border: 2px solid var(--bubble-edge, #6b3e15);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    0 6px 14px rgba(0,0,0,.4);
  outline: none;
}
.bubble-input input::placeholder { color: rgba(75, 44, 22, .55); }
.bubble-input::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--bubble-edge, #6b3e15);
}
.bubble-input::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--bubble-bg, #fff8de);
  z-index: 1;
}

.toolrail__hint {
  margin-top: 4px;
  font-family: "Kalam", cursive;
  font-size: 11px;
  color: #6c3018;
  text-align: center;
  line-height: 1.2;
}
.toolrail__hint kbd,
.shortcuts-list kbd {
  display: inline-block;
  padding: 0 5px;
  font-family: "Special Elite", monospace;
  font-size: 10px;
  line-height: 1.5;
  color: #2f2115;
  background: rgba(255, 247, 218, .75);
  border: 1px solid rgba(133, 84, 33, .55);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}

/* Cheat-sheet notecard — pinned below the folks list on the right rail. */
.wall-cheatsheet {
  position: relative;
  margin-top: 16px;
  padding: 14px 12px 12px;
  background:
    radial-gradient(circle at 14% 22%, rgba(127, 80, 31, .06) 0 1px, transparent 2px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.18  0 0 0 0 0.06  0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #fff8de, #f0d089);
  border: 2px dashed #b97836;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 226, .65),
    0 4px 8px rgba(0,0,0,.22);
  transform: rotate(-.5deg);
}
.wall-cheatsheet__tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 64px;
  height: 16px;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.06) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, rgba(255, 247, 218, .9), rgba(232, 196, 121, .9));
  border: 1px solid rgba(133, 84, 33, .65);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  opacity: .95;
}
.wall-cheatsheet h4 {
  font-family: "Rye", Georgia, serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .12em;
  color: #6b2c16;
  text-align: center;
  margin: 0 0 10px;
  text-shadow: 0 1px 0 rgba(255, 250, 226, .8);
}
.wall-cheatsheet dl {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-family: "Special Elite", monospace;
  font-size: 11.5px;
}
.wall-cheatsheet dt {
  margin: 0;
  text-align: right;
}
.wall-cheatsheet dd {
  margin: 0;
  color: #4b2c16;
  font-family: "Kalam", cursive;
  font-size: 13px;
  line-height: 1.1;
}
.wall-cheatsheet kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px 2px;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  color: #2f2115;
  background: linear-gradient(180deg, #fff8de 0%, #fff8de 55%, #e7c27e 100%);
  border: 1.5px solid #6b3e15;
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    0 2px 0 rgba(0,0,0,.25);
}
.wall-cheatsheet .kbd-row {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

/* Color history strip */
.color-history {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
  min-height: 20px;
}
.color-history:empty::before {
  content: "Recent picks'll show here.";
  font-family: "Kalam", cursive;
  font-size: 11px;
  color: #6c3018;
  opacity: .75;
}
.color-history .crayon {
  width: 18px;
  height: 18px;
  border-width: 1px;
}

/* Brush kit — compact 4-column grid */
.brush-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.brush {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  font-family: "Special Elite", monospace;
  font-size: 10px;
  color: #2f2115;
  background: linear-gradient(180deg, #fff4d4, #e7c27e);
  border: 2px solid #6b3e15;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 0 rgba(0,0,0,.2);
  letter-spacing: .02em;
}
.brush:hover { filter: brightness(1.06); }
.brush__icon {
  font-family: Georgia, serif;
  font-size: 13px;
  color: #6b2c16;
  line-height: 1;
}
.brush__name {
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0;
}
.brush--active {
  color: #fff4d4;
  background: linear-gradient(180deg, #b04a23, #6b2014);
  border-color: #2a0c04;
}
.brush--active .brush__icon { color: #fff4d4; }

/* Opacity sub-label */
.opacity-label {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 11px;
  color: #6b2c16;
  letter-spacing: .06em;
}
.opacity-label span {
  font-family: "Special Elite", monospace;
  color: #4b2c16;
}

/* Speech bubbles */
#wall-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.speech-bubble {
  position: absolute;
  transform: translate(-50%, calc(-100% - 28px));
  padding: 6px 10px 7px;
  font-family: "Kalam", cursive;
  font-size: 15px;
  line-height: 1.18;
  color: var(--bubble-fg, #2f2115);
  background: var(--bubble-bg, #fff8de);
  border: 2px solid var(--bubble-edge, #6b3e15);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 6px 14px rgba(0,0,0,.35);
  max-width: 240px;
  min-width: 60px;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  animation: bubble-pop .25s ease-out, bubble-fade .35s ease-in 4.6s forwards;
}
.speech-bubble__author {
  display: block;
  font-family: "Rye", Georgia, serif;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--bubble-edge, #6b3e15);
  opacity: .85;
  margin-bottom: 1px;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--bubble-edge, #6b3e15);
}
.speech-bubble::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--bubble-bg, #fff8de);
  z-index: 1;
}
@keyframes bubble-pop {
  from { opacity: 0; transform: translate(-50%, calc(-100% - 20px)) scale(.9); }
  to   { opacity: 1; transform: translate(-50%, calc(-100% - 28px)) scale(1); }
}
@keyframes bubble-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Owner-only buttons (wipe wall). Revealed when body.aj-wall-owner is set. */
#wall-clear,
#wall-delete-target,
#wall-delete-recent,
#wall-delete-last,
#wall-rollback-go,
#wall-mini-clear,
#wall-mini-delete-target,
#wall-mini-delete-recent,
#wall-mini-delete-last,
#wall-mini-rollback-time { display: none; }
body.aj-wall-owner #wall-clear { display: block; }
body.aj-wall-owner #wall-delete-target,
body.aj-wall-owner #wall-delete-recent,
body.aj-wall-owner #wall-delete-last,
body.aj-wall-owner #wall-rollback-go { display: block; }
body.aj-wall-owner #wall-mini-clear,
body.aj-wall-owner #wall-mini-delete-target,
body.aj-wall-owner #wall-mini-delete-recent,
body.aj-wall-owner #wall-mini-delete-last,
body.aj-wall-owner #wall-mini-rollback-time { display: inline-grid; }

/* ── The paper canvas (center) ───────────────────────────────── */
.wall-paper {
  position: relative;
  padding: 28px 22px 26px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.18  0 0 0 0 0.06  0 0 0 .055 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(circle at 10% 12%, rgba(127, 80, 31, .08) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 28%, rgba(127, 80, 31, .07) 0 2px, transparent 3px),
    linear-gradient(180deg, #fff5d3 0%, #f3dba6 100%);
  border: 2px solid #b97836;
  border-top-color: #fff8de;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .55),
    0 8px 16px rgba(0,0,0,.45);
}
.wall-paper::before,
.wall-paper::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 22px;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.06) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, rgba(255, 247, 218, .85), rgba(232, 196, 121, .85));
  border: 1px solid rgba(133, 84, 33, .65);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  opacity: .92;
}
.wall-paper::before { top: -8px; left: -16px; transform: rotate(-12deg); }
.wall-paper::after  { top: -8px; right: -16px; transform: rotate(12deg); }
.wall-paper .tape-bottom-left,
.wall-paper .tape-bottom-right {
  position: absolute;
  width: 60px; height: 22px;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.06) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, rgba(255, 247, 218, .85), rgba(232, 196, 121, .85));
  border: 1px solid rgba(133, 84, 33, .65);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  opacity: .92;
}
.wall-paper .tape-bottom-left  { bottom: -8px; left: -16px; transform: rotate(8deg); }
.wall-paper .tape-bottom-right { bottom: -8px; right: -16px; transform: rotate(-8deg); }

/* Outer letterbox container — fills more vertical room than 4:3 would allow. */
.canvas-wrap {
  position: relative;
  width: 100%;
  /* Grows with viewport, never gets too short, never blows out the page */
  height: clamp(620px, calc(100vh - 320px), 1000px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background:
    radial-gradient(circle at 14% 22%, rgba(127, 80, 31, .06) 0 1px, transparent 2px),
    rgba(232, 213, 169, .25);
  border-radius: 4px;
  overflow: hidden;
}
/* Inner drawing area — always 4:3, centered, scales to fit the wrap.
   width:100% gives it a size in flex; aspect-ratio derives the height from that.
   If the derived height would exceed the wrap, max-height clips and the box
   scales down proportionally to keep the 4:3 ratio. */
.canvas-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 100%;
  background:
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .04) 0 1px, transparent 1px 24px),
    #fffaf0;
  border: 1px dashed rgba(133, 84, 33, .35);
  border-radius: 2px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  flex-shrink: 0;
}
.canvas-wrap.is-erasing .canvas-stage { cursor: cell; }
.canvas-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* Live cursors of other users */
.ghost-cursor {
  position: absolute;
  width: 18px; height: 18px;
  transform: translate(-2px, -2px);
  pointer-events: none;
  z-index: 5;
}
.ghost-cursor svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.ghost-cursor__label {
  position: absolute;
  top: 16px; left: 14px;
  padding: 2px 7px;
  font-family: "Kalam", cursive;
  font-size: 12px;
  color: #fff4d4;
  background: var(--cur);
  border: 1px solid rgba(0,0,0,.5);
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

/* ── Right rail: roster ──────────────────────────────────────── */
.wall-roster {
  padding: 14px;
  background:
    radial-gradient(circle at 14% 22%, rgba(127, 80, 31, .10) 0 1px, transparent 2px),
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .07) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #fff4d4, #edcf93);
  border: 3px solid #6b3e15;
  border-top-color: #c98a42;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .65),
    0 6px 14px rgba(0,0,0,.35);
}
.wall-roster h3 {
  font-family: "Rye", Georgia, serif;
  font-size: 13px;
  letter-spacing: .12em;
  color: #6b2c16;
  text-align: center;
  border-bottom: 1px dashed rgba(133, 84, 33, .55);
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.roster-list li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: rgba(255, 247, 218, .45);
  border: 1px dashed rgba(133, 84, 33, .35);
  border-radius: 3px;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  color: #2f2115;
}
.roster-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cur, #a73620);
  border: 1px solid #2a1208;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.roster-list li.is-you { background: rgba(217, 109, 53, .15); }
.roster-list li.is-you::after {
  content: "you";
  font-family: "Kalam", cursive;
  font-size: 11px;
  color: var(--apple);
}

.wall-status {
  margin-top: 12px;
  padding: 6px 8px;
  text-align: center;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  color: #5b3015;
  background: rgba(255, 247, 218, .55);
  border: 1px dashed rgba(133, 84, 33, .55);
  border-radius: 2px;
  letter-spacing: .04em;
}
.wall-status.is-live { color: #2f5224; }
.wall-status.is-offline { color: #7c2f17; }

/* ── Wide mode ───────────────────────────────────────────────── */
.wall-stage.is-wide {
  grid-template-columns: 1fr;
  padding: 18px 18px 22px;
}
.wall-stage.is-wide .toolrail,
.wall-stage.is-wide .wall-roster {
  display: none;
}
.wall-stage.is-wide .wall-paper {
  padding: 22px 18px 22px;
}
.wall-stage.is-wide .canvas-wrap {
  height: calc(100vh - 280px);
  min-height: 560px;
  max-height: none;
}

/* Floating mini-toolbar */
.wall-mini-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  row-gap: 5px;
  padding: 8px 10px;
  background:
    radial-gradient(circle at 14% 22%, rgba(127, 80, 31, .10) 0 1px, transparent 2px),
    repeating-linear-gradient(0deg, rgba(133, 84, 33, .07) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #fff4d4, #edcf93);
  border: 3px solid #6b3e15;
  border-top-color: #c98a42;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .65),
    0 8px 18px rgba(0,0,0,.45);
  z-index: 10;
  max-width: calc(100% - 36px);
}
.wall-mini-toolbar[hidden] { display: none; }
.wall-mini-toolbar.is-dragging {
  opacity: .9;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 226, .65),
    0 16px 28px rgba(0,0,0,.55);
}
.wall-mini-grip {
  display: flex;
  align-items: center;
  padding: 0 4px 0 2px;
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: -2px;
  color: #6b3e15;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.wall-mini-grip:hover { color: #2a0c04; }
.wall-mini-toolbar.is-dragging .wall-mini-grip { cursor: grabbing; }
.wall-mini-crayons {
  display: flex;
  gap: 5px;
}
.wall-mini-crayons .crayon {
  width: 26px;
  height: 26px;
}
.wall-mini-sep {
  width: 1px;
  align-self: stretch;
  background: rgba(133, 84, 33, .45);
}
.wall-mini-size,
.wall-mini-opacity {
  width: 90px;
  accent-color: var(--apple);
}
.wall-mini-slider {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: Georgia, serif;
  font-size: 12px;
  color: #6b3e15;
}
.wall-mini-brushes {
  display: flex;
  gap: 3px;
}
.wall-mini-brushes .wall-mini-btn {
  min-width: 26px;
  padding: 0 4px;
  font-family: Georgia, serif;
  font-size: 14px;
}
.wall-mini-btn {
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  color: #2f2115;
  background: linear-gradient(180deg, #fff4d4, #e7c27e);
  border: 2px solid #6b3e15;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
  letter-spacing: .04em;
}
.wall-mini-btn:hover { filter: brightness(1.08); }
.wall-mini-btn.is-active {
  color: #fff4d4;
  background: linear-gradient(180deg, #6e933b, #3a5320);
  border-color: #2a3a18;
}
.wall-mini-btn--danger {
  color: #fff4d4;
  background: linear-gradient(180deg, #b04a23, #6b2014);
  border-color: #2a0c04;
}
.wall-mini-btn--moderate.is-active {
  color: #fff4d4;
  background: linear-gradient(180deg, #6e933b, #3a5320);
  border-color: #2a3a18;
}

.wall-mini-roster {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  font-family: "Kalam", cursive;
  font-size: 13px;
  color: #fff4d4;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #8d5226, #4d2a10);
  border: 2px solid #2c1808;
  border-top-color: #c98a42;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,.45);
  z-index: 10;
  cursor: default;
}
.wall-mini-roster[hidden] { display: none; }
.wall-mini-roster__count {
  font-family: "Rye", Georgia, serif;
  font-size: 15px;
  letter-spacing: .04em;
}
.wall-mini-roster__label { opacity: .85; }
.wall-mini-roster__list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  background:
    linear-gradient(180deg, #fff4d4, #edcf93);
  border: 2px solid #6b3e15;
  border-top-color: #c98a42;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(0,0,0,.45);
  color: #2f2115;
}
.wall-mini-roster:hover .wall-mini-roster__list,
.wall-mini-roster:focus-within .wall-mini-roster__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wall-mini-roster__list .mini-roster-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 8px;
  font-family: "Special Elite", monospace;
  font-size: 12.5px;
}
.wall-mini-roster__list .mini-roster-item .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid #2a1208;
  background: var(--cur, #a73620);
}

/* ── Fullscreen mode ─────────────────────────────────────────── */
:fullscreen .browser-titlebar,
:fullscreen .sidebar,
:fullscreen .archive-banner--wall,
:fullscreen .toolrail,
:fullscreen .wall-roster {
  display: none !important;
}
:fullscreen .browser-window,
:fullscreen .site-viewport,
:fullscreen .page,
:fullscreen .main-column,
:fullscreen .app-view--wall {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #2c1808;
}
:fullscreen .wall-stage {
  border-radius: 0;
  border: 0;
  padding: 12px;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
:fullscreen .wall-paper { padding: 14px; }
:fullscreen .canvas-wrap {
  height: calc(100vh - 80px);
  /* Let the floating toolbar be dragged below the canvas */
  overflow: visible;
}
