/* ============================================================
   PAWSONA — style.css
============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure hidden attribute always removes element from layout */
[hidden] { display: none !important; }

/* ============================================================
   PLAY PAGE — draggable toys (113px = original 90px × 1.25)
============================================================ */
.play-toy {
  position: absolute;
  width: 113px;
  height: auto;
  cursor: grab;
  z-index: 60;
  filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.2));
  transition: filter 0.15s, transform 0.15s;
  user-select: none;
  -webkit-user-drag: none;
}
.play-toy:hover {
  filter: drop-shadow(2px 3px 10px rgba(0,0,0,0.3));
  transform: scale(1.06);
}
.play-toy.dragging {
  cursor: grabbing;
  transform: scale(1.1);
  filter: drop-shadow(3px 5px 14px rgba(0,0,0,0.35));
  transition: none;
}


:root {
  --cream:       #F5EFE4;
  --cream-dark:  #EDE4D3;
  --ink:         #2C1F0E;
  --ink-mid:     #6B4F2E;
  --orange:      #E07A35;
  --orange-dark: #C45E1A;
  --orange-pale: #FAE3CC;
  --white:       #FDFAF5;
  --border:      rgba(44,31,14,0.14);

  --font-display: 'Gochi Hand', cursive;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --nav-w:   96px;
  --nav-h:   0px;
  --panel-w: 420px;
  --tab-w:   36px;
}

html, body { height: 100%; }
body:not(.shelter-page) { overflow: hidden; }
body.shelter-page { overflow-y: auto; height: auto; min-height: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   SIDE NAV — vertical icon bar
============================================================ */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-w);
  background: transparent;
  border-right: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 0 1.5rem;
  gap: 0.75rem;
  z-index: 200;
}

/* Logo at very top — links to landing */
.side-nav-logo {
  display: block;
  width: 80px;
  height: auto;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: transform 0.15s;
}
.side-nav-logo img {
  width: 100%;
  height: auto;
  display: block;
}
.side-nav-logo:hover { transform: scale(1.06); }
.side-nav-icon {
  display: block;
  width: 72px;
  height: 72px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  overflow: visible;
}
.side-nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.side-nav-icon:hover { transform: scale(1.08); }
.side-nav-icon.active {
  transform: scale(1.05);
}
.side-nav-icon.active img {
  filter:
    drop-shadow( 2px  0   0 var(--orange))
    drop-shadow(-2px  0   0 var(--orange))
    drop-shadow( 0    2px 0 var(--orange))
    drop-shadow( 0   -2px 0 var(--orange))
    drop-shadow( 1.5px  1.5px 0 var(--orange))
    drop-shadow(-1.5px  1.5px 0 var(--orange))
    drop-shadow( 1.5px -1.5px 0 var(--orange))
    drop-shadow(-1.5px -1.5px 0 var(--orange));
}
.side-nav-icon.active::after { display: none; }
.side-nav-clear {
  margin-top: auto;
  font-size: 20px;
  color: var(--ink-mid);
  background: none;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  padding: 0.4rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.side-nav-clear:hover { opacity: 1; }

/* ============================================================
   (legacy top nav kept for safety, hidden)
============================================================ */
.top-nav, .shelter-nav { display: none; }
.btn-dev-clear:hover { opacity: 1; }

/* ============================================================
   PANEL TAB
============================================================ */
.panel-tab { display: none; }

.interactive-space {
  position: fixed;
  top: 0;
  left: var(--nav-w);
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 50; /* under the panel but above background */
}

/* ============================================================
   DRAWING PANEL
============================================================ */
.drawing-panel {
  position: fixed;
  top: 0;
  left: var(--nav-w);
  right: 0;
  bottom: 0;
  width: auto;
  background: var(--white);
  border-right: none;
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 100;
}
.drawing-panel.closed    { transform: translateX(-100%); }
.drawing-panel.fullscreen { left: var(--nav-w); }

/* Constrain the canvas + tools within a centred max width for readability */
#drawingPanelContent, #previewScreen {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* Empty play state */
.empty-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: auto;
}
.empty-play-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.empty-play-sub {
  font-family: var(--font-body);
  color: var(--ink-mid);
  margin: 0 0 1.4rem;
}
.empty-play-cta {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  text-decoration: none;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  transition: transform 0.15s, background 0.15s;
}
.empty-play-cta:hover {
  background: var(--orange-dark);
  transform: scale(1.05);
}

/* Hide legacy horizontal tools row (replaced by tools-column) */
.tools-row { display: none !important; }

/* ============================================================
   SLIDE PROGRESS BAR
============================================================ */
.slide-progress {
  height: 3px;
  background: var(--cream-dark);
  flex-shrink: 0;
}
.slide-progress-fill {
  height: 100%;
  background: var(--orange);
  transition: width 0.3s ease;
  width: 14.28%; /* 1/7 */
}

/* ============================================================
   SLIDE HEADER
============================================================ */
#drawingPanelContent {
  display: flex; flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem 1.5rem;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.slide-header { display: flex; flex-direction: column; gap: 0.2rem; }

.slide-title-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 0.5rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.8rem; color: var(--ink); line-height: 1.1;
}

.slide-header-actions {
  display: flex; align-items: center; gap: 0.5rem;
}

.slide-counter {
  font-size: 12px; color: var(--ink-mid); font-weight: 500;
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px;
}

.btn-fullscreen {
  background: var(--cream); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); width: 30px; height: 30px;
  font-size: 15px; cursor: pointer; color: var(--ink-mid);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.btn-fullscreen:hover { background: var(--cream-dark); color: var(--ink); }

.panel-subtitle { font-size: 12px; color: var(--ink-mid); line-height: 1.5; }

/* ============================================================
   CANVAS
============================================================ */
/* ============================================================
   CANVAS — soft, no harsh frame
============================================================ */
.canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  background: var(--cream);
  cursor: crosshair;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: none;
  overflow: hidden;
}
.canvas-wrap.preview-wrap { max-width: 320px; margin: 0 auto; }
.canvas-wrap canvas {
  display: block; width: 100%; height: 100%; touch-action: none;
}
.template-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  pointer-events: none; opacity: 0.22; transition: opacity 0.2s;
}
.template-overlay.hidden { opacity: 0; }

/* ============================================================
   DRAWING PANEL LAYOUT — canvas + 2-column tools
============================================================ */
#drawingPanelContent {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 1.5rem 2rem 1.5rem 1.5rem;
  gap: 1rem;
  overflow: hidden;
}

.canvas-tools-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* Two-column tool grid: col A (sizes + colours) | col B (tools) */
.tools-column {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1.5rem;
  align-items: start;
  flex-shrink: 0;
}

.tools-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.tool-divider {
  width: 50px;
  height: 1px;
  background: rgba(140, 110, 80, 0.18);
  margin: 0.2rem 0;
}

/* ── SIZE buttons: size.gif at three scales ── */
.size-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  transition: transform 0.15s, filter 0.15s;
}
.size-btn img {
  display: block;
  pointer-events: none;
}
.size-btn[data-size="4"]  img { width: 16px; }
.size-btn[data-size="10"] img { width: 26px; }
.size-btn[data-size="20"] img { width: 42px; }
.size-btn:hover { transform: scale(1.1); }
.size-btn.active {
  transform: scale(1.08);
}
.size-btn.active img {
  filter:
    drop-shadow( 1.5px  0   0 var(--orange))
    drop-shadow(-1.5px  0   0 var(--orange))
    drop-shadow( 0    1.5px 0 var(--orange))
    drop-shadow( 0   -1.5px 0 var(--orange))
    drop-shadow( 1.2px  1.2px 0 var(--orange))
    drop-shadow(-1.2px  1.2px 0 var(--orange))
    drop-shadow( 1.2px -1.2px 0 var(--orange))
    drop-shadow(-1.2px -1.2px 0 var(--orange));
}

/* ── PALETTE: size.gif as mask, colour as background ── */
.palette {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.palette-slot {
  position: relative;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s;
}
.palette-slot:hover { transform: scale(1.12); }
.palette-slot.active { transform: scale(1.15); }

/* Orange halo behind active slot (same blob shape) */
.palette-slot::before {
  content: '';
  position: absolute;
  inset: -4px;
  background: var(--orange);
  -webkit-mask: url('assets/size.gif') center/contain no-repeat;
          mask: url('assets/size.gif') center/contain no-repeat;
  opacity: 0;
  transition: opacity 0.15s;
}
.palette-slot.active::before { opacity: 1; }

/* The colour blob itself */
.palette-slot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c, #2c1f0e);
  -webkit-mask: url('assets/size.gif') center/contain no-repeat;
          mask: url('assets/size.gif') center/contain no-repeat;
}

/* Hidden colour input inside slot, triggered via dblclick */
.palette-slot input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
  border: none;
}

.palette-hint {
  font-size: 10px;
  color: var(--ink-mid);
  text-align: center;
  line-height: 1.2;
  margin: 0;
  opacity: 0.55;
  font-family: var(--font-body);
}

/* ── TOOL ICONS: raw images, no chrome ── */
.tool-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, filter 0.15s;
}
.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.tool-icon.flip-x img { transform: scaleX(-1); }
.tool-icon:hover { transform: scale(1.08); }
.tool-icon.active {
  transform: scale(1.08);
}
.tool-icon.active img {
  filter:
    drop-shadow( 2.5px  0   0 var(--orange))
    drop-shadow(-2.5px  0   0 var(--orange))
    drop-shadow( 0    2.5px 0 var(--orange))
    drop-shadow( 0   -2.5px 0 var(--orange))
    drop-shadow( 2px  2px 0 var(--orange))
    drop-shadow(-2px  2px 0 var(--orange))
    drop-shadow( 2px -2px 0 var(--orange))
    drop-shadow(-2px -2px 0 var(--orange));
}

/* Copy-last button — text-styled link */
.copy-last-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.1;
  text-align: center;
  transition: color 0.15s, transform 0.15s;
}
.copy-last-btn:hover {
  color: var(--orange);
  transform: scale(1.05);
}
.copy-last-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Slide nav row at bottom */
.slide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  flex-shrink: 0;
}
.slide-nav-left { display: flex; gap: 0.5rem; }

/* ============================================================
   WIGGLY EFFECT — applied to cat sprites
============================================================ */
.cat-sprite canvas,
.cat-card-canvas-wrap canvas {
  filter: url(#wigglyFilter);
}

/* ============================================================
   TOOLS
============================================================ */
.tools-row {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
}
.tool-group { display: flex; align-items: center; gap: 0.3rem; }
.tool-label { font-size: 11px; color: var(--ink-mid); white-space: nowrap; }

input[type="range"] { width: 65px; accent-color: var(--orange); cursor: pointer; }
input[type="color"] {
  width: 30px; height: 24px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; padding: 2px;
  background: var(--white);
}

.btn-tool {
  background: var(--white); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.28rem 0.65rem; font-family: var(--font-body); font-size: 12px;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.btn-tool:hover  { background: var(--cream-dark); }
.btn-tool.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Keyboard shortcut hint */
.shortcut-hint {
  font-size: 10px;
  color: var(--ink-mid);
  opacity: 0.5;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   SLIDE NAV BUTTONS
============================================================ */
.slide-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 0.25rem;
}

.btn-primary {
  background: var(--orange); color: var(--white); border: none;
  border-radius: var(--radius-md); padding: 0.5rem 1.2rem;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background 0.18s, transform 0.12s; flex-shrink: 0;
}
.btn-primary:hover  { background: var(--orange-dark); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   PREVIEW SCREEN
============================================================ */
#previewScreen {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.preview-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-shrink: 0;
}

/* Thumbnail strip — compact horizontal scroll */
.thumbnail-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-shrink: 0;
}

.thumb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.thumb-canvas {
  width: 52px; height: 52px; display: block;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  transition: border-color 0.15s;
}
.thumb-wrap:hover .thumb-canvas { border-color: var(--orange); }

.thumb-label {
  font-size: 9px; color: var(--ink-mid);
  text-align: center; white-space: nowrap;
}

.btn-redraw {
  font-size: 9px; background: none; border: none;
  color: var(--orange); cursor: pointer; padding: 0;
  font-family: var(--font-body);
}
.btn-redraw:hover { text-decoration: underline; }

/* Tail hint */
.tail-hint {
  font-size: 11px; color: var(--ink-mid); line-height: 1.45;
  padding: 0.45rem 0.65rem;
  background: var(--orange-pale);
  border: 1px solid var(--orange);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Submit row */
.submit-row {
  display: flex; gap: 0.5rem; align-items: center;
}
.cat-name-input {
  flex: 1; font-family: var(--font-display); font-size: 1rem;
  color: var(--ink); background: var(--cream);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem; outline: none; min-width: 0;
  transition: border-color 0.15s;
}
.cat-name-input:focus        { border-color: var(--orange); }
.cat-name-input::placeholder { color: var(--ink-mid); opacity: 0.55; }

.panel-note {
  font-size: 11px; color: var(--ink-mid); line-height: 1.5;
  padding: 0.55rem 0.7rem; background: var(--cream);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

/* ============================================================
   INTERACTIVE SPACE — legacy block, superseded above
============================================================ */
.reaction-layer { position: absolute; inset: 0; pointer-events: none; z-index: 10; }

/* ============================================================
   CAT ENTITIES
============================================================ */
.cat-entity {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: left 12s linear, top 12s linear;
}
.cat-entity canvas { width: 216px; height: 216px; display: block; transition: transform 0.3s; }
.cat-entity canvas { transform: scaleX(-1); } /* skeleton faces left, so flip by default to face right */
.cat-entity.facing-left canvas { transform: scaleX(1); }

.cat-entity-name {
  font-family: var(--font-display); font-size: 0.85rem;
  color: var(--ink-mid); white-space: nowrap; opacity: 0.7;
}

.cat-reaction {
  position: absolute; top: -1.8rem;
  font-family: var(--font-display); font-size: 1rem;
  color: var(--orange); white-space: nowrap;
  opacity: 0; pointer-events: none;
}
.cat-reaction.show { animation: floatUp 1.8s ease-out forwards; }
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-30px); }
}

/* ============================================================
   STAGE CONTROLS
============================================================ */
.stage-controls {
  display: none !important;
}


.btn-interact {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 0.4rem 1rem; font-family: var(--font-body); font-size: 13px;
  font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-interact:hover  { background: var(--cream-dark); border-color: var(--ink-mid); }
.btn-interact:active { transform: scale(0.96); }
.btn-interact.active { background: var(--orange-pale); border-color: var(--orange); color: var(--orange-dark); }

.webcam-pill {
  font-size: 11px; font-weight: 500; color: var(--orange-dark);
  background: var(--orange-pale); border: 1px solid var(--orange);
  border-radius: 20px; padding: 3px 10px; letter-spacing: 0.03em;
}

/* ============================================================
   SHELTER PAGE
============================================================ */
.shelter-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem; background: var(--white);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.shelter-back {
  font-size: 13px; font-weight: 500; color: var(--ink-mid);
  text-decoration: none; padding: 0.3rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.shelter-back:hover { background: var(--cream-dark); color: var(--ink); }

.shelter-header {
  max-width: 900px;
  margin: 2.5rem auto 1.75rem;
  padding: 0 2rem 0 calc(2rem + var(--nav-w));
}
.shelter-title { font-family: var(--font-display); font-size: 2.8rem; color: var(--ink); line-height: 1; margin-bottom: 0.3rem; }
.shelter-count { font-size: 14px; color: var(--ink-mid); }

.gallery-grid {
  max-width: 900px; margin: 0 auto;
  padding: 0 2rem 4rem calc(2rem + var(--nav-w));
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 1.1rem;
}
.gallery-empty {
  grid-column: 1/-1; display: flex; flex-direction: column;
  align-items: center; gap: 0.5rem; padding: 4rem 2rem;
  color: var(--ink-mid); font-size: 15px; text-align: center;
}
.empty-icon { font-size: 2.5rem; }

.cat-card {
  position: relative;
  background: var(--white);
  cursor: pointer;
  transition: transform 0.18s;
  border: 14px solid;
  border-image: url('assets/frame.gif') 80 round;
}
.cat-card:hover { transform: translateY(-3px); }
.cat-card-canvas-wrap {
  background: var(--cream); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center; padding: 0.65rem;
}
.cat-card-canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.cat-card-info { padding: 0.55rem 0.8rem 0.4rem; text-align: center; }
.cat-card-name { font-family: var(--font-display); font-size: 0.95rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-card-date { font-size: 11px; color: var(--ink-mid); margin-top: 1px; }

/* ============================================================
   ZOOM MODAL
============================================================ */
.zoom-modal-overlay {
  position: fixed; inset: 0; background: rgba(44,31,14,0.55);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  opacity: 0; transition: opacity 0.25s ease;
}
.zoom-modal-overlay.open { opacity: 1; }
.zoom-modal {
  position: relative;
  background: var(--white);
  padding: 2rem 2rem 1.75rem; max-width: 520px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  transform: scale(0.94); transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
  border: 18px solid;
  border-image: url('assets/frame.gif') 80 round;
}
.zoom-modal-overlay.open .zoom-modal { transform: scale(1); }
.zoom-modal-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 30px; height: 30px;
  font-size: 13px; cursor: pointer; color: var(--ink-mid);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.zoom-modal-close:hover { background: var(--cream-dark); }
.zoom-modal-canvas {
  width: 100%; max-width: 320px; height: auto; aspect-ratio: 1; display: block;
  border-radius: var(--radius-md); background: var(--cream); border: 1.5px solid var(--border);
}
.zoom-modal-name { font-family: var(--font-display); font-size: 2.2rem; color: var(--ink); text-align: center; }
.zoom-modal-date { font-size: 12px; color: var(--ink-mid); text-align: center; }

/* ============================================================
   PANEL FULLSCREEN
============================================================ */
.drawing-panel.fullscreen { width: 100vw; }
.drawing-panel.fullscreen .canvas-wrap { max-width: 580px; margin: 0 auto; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 680px) {
  :root { --panel-w: 100vw; }
  .drawing-panel { width: 100vw; border-right: none; bottom: auto; max-height: 85vh; }
  .interactive-space { left: 0 !important; top: calc(var(--nav-h) + 85vh); }
  .panel-tab { top: calc(var(--nav-h) + 85vh); left: 50%; transform: translateX(-50%); writing-mode: horizontal-tb; width: auto; padding: 0.4rem 1rem; border-radius: 0 0 var(--radius-md) var(--radius-md); }
}
/* ============================================================
   SWEAR SPEECH BUBBLES (tantrum)
============================================================ */
.swear-bubble {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 5px 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  animation: swearPop 1.1s ease-out forwards;
  box-shadow: 2px 2px 0 var(--ink);
  /* Tail of the speech bubble */
}
.swear-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.swear-bubble::before {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: white;
  z-index: 1;
}
@keyframes swearPop {
  0%   { opacity: 0; transform: translateX(calc(-50% + var(--ox, 0px))) translateY(var(--oy, 0px)) scale(0.4); }
  15%  { opacity: 1; transform: translateX(calc(-50% + var(--ox, 0px))) translateY(var(--oy, 0px)) scale(1.1); }
  30%  { transform: translateX(calc(-50% + var(--ox, 0px))) translateY(var(--oy, 0px)) scale(0.95); }
  50%  { opacity: 1; transform: translateX(calc(-50% + var(--ox, 0px))) translateY(var(--oy, 0px)) scale(1); }
  100% { opacity: 0; transform: translateX(calc(-50% + var(--ox, 0px))) translateY(calc(var(--oy, 0px) - 30px)) scale(0.8); }
}

/* Yelling state — cats enlarge and shake */
.cat-entity {
  transform-origin: bottom center;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.cat-entity.yelling {
  transform: scale(2.2);
  z-index: 80 !important;
}
.cat-entity.yelling canvas {
  animation: yellShake 0.18s ease-in-out infinite;
}
@keyframes yellShake {
  0%, 100% { transform: scaleX(-1) translateX(0); }
  25%       { transform: scaleX(-1) translateX(-4px); }
  75%       { transform: scaleX(-1) translateX(4px); }
}
.cat-entity.facing-left.yelling canvas {
  animation: yellShakeFl 0.18s ease-in-out infinite;
}
@keyframes yellShakeFl {
  0%, 100% { transform: scaleX(1) translateX(0); }
  25%       { transform: scaleX(1) translateX(-4px); }
  75%       { transform: scaleX(1) translateX(4px); }
}
/* ============================================================
   HAND-DRAWN WIGGLE EFFECT
   Applied to UI elements (borders, panels, buttons, text blocks)
   NEVER applied to img, video, canvas, gif elements
============================================================ */

/* Buttons */
.btn-primary,
.btn-tool,
.btn-interact,
.copy-last-btn,
.size-btn,
.landing-enter,
.landing-secondary,
.side-nav-clear,
.btn-fullscreen,
.btn-redraw,
.palette-slot {
  filter: url(#wiggleUI);
}

/* Panels and containers */
.drawing-panel,
.vn-dialogue,
.contract-paper,
.polaroid-card,
.gallery-card,
.zoom-modal,
.cat-name-input,
.submit-row,
.slide-progress,
.stage-controls,
.btn-interact,
.webcam-pill,
.canvas-wrap,
.tools-column,
.thumbnail-strip,
.thumb-wrap {
  filter: url(#wiggleUI);
}

/* Nav — only wiggle slide-nav (bottom bar), NOT side-nav container
   Reason: filter on a parent creates a stacking context that overrides
   child filters (kills the orange active icon outline) */
.slide-nav {
  filter: url(#wiggleUI);
}
/* Side-nav clear button wiggles independently */
.side-nav-clear {
  filter: url(#wiggleUI);
}

/* Text elements */
.panel-title,
.scene-title,
.scene-h2,
.shelter-title,
.scene-subtitle,
.vn-dialogue-name,
.vn-advance-hint,
.cat-entity-name,
.cat-reaction,
.swear-bubble,
.empty-play-title,
.hand-demo-label,
.polaroid-name,
.shelter-count {
  filter: url(#wiggleUI);
}

/* Explicitly EXCLUDE — never wiggle these.
   NOTE: no blanket `img` rule — it would override active icon outlines and claw cursor.
   Instead, target specific elements. */
video,
canvas,
.template-overlay,
.play-bg,
.vn-cat-overlay,
.cat-entity canvas,
.polaroid-photo canvas,
.vn-webcam-inner video,
#webcamFeed,
#vnVideo,
#catOverlay,
.hand-demo-gif,
.multi-visual-item img,
.side-nav-logo img,
.side-nav-icon:not(.active) img,
.play-toy,
.play-bg,
.vn-cat-overlay,
.vn-webcam-inner video {
  filter: none !important;
}

/* Active nav icon — restore orange outline (was killed by blanket img rule) */
.side-nav-icon.active img {
  filter:
    drop-shadow( 2px  0   0 var(--orange))
    drop-shadow(-2px  0   0 var(--orange))
    drop-shadow( 0    2px 0 var(--orange))
    drop-shadow( 0   -2px 0 var(--orange))
    drop-shadow( 1.5px  1.5px 0 var(--orange))
    drop-shadow(-1.5px  1.5px 0 var(--orange))
    drop-shadow( 1.5px -1.5px 0 var(--orange))
    drop-shadow(-1.5px -1.5px 0 var(--orange)) !important;
}

/* Claw cursors — restore black outline (set by JS, must not be overridden) */
#clawCursor,
#indexClaw {
  filter:
    drop-shadow(-2px -2px 0px #000)
    drop-shadow( 2px -2px 0px #000)
    drop-shadow(-2px  2px 0px #000)
    drop-shadow( 2px  2px 0px #000) !important;
}