/* ============================================
   MESS HALL — style.css
   Background: #fefff4
   Primary:    Adobe Typekit (acumin-pro-condensed)
   Secondary:  Montserrat
   Fonts:      ruddy (Adobe) / Montserrat (Google)
   Type scale: 1.6× from original — min 16px at 400px
   Grid:       12-col
     400px+  — 10px gap, margin = 1 col (~15px at 400px, scales up)
     834px+  — 15px gap, margin = 1 col (~56px at 834px)
     1440px+ — 20px gap, margin = 1 col (~100px at 1440px)
   Breaks:     400 / 834 / 1440
   ============================================ */

:root {
  --bg:      #fefff4;
  --black:   #000000;
  --orange:  #ff6d00;
  --yellow:  #ffbc00;
  --green:   #4dad2a;
  --blue:    #39a1ff;
  --purple:  #ab79db;
  --red:     #ef4136;
  --f1:      "ruddy", sans-serif;
  --f2:      "Montserrat", sans-serif;
  --g:       20px;
  /* SVG scale: 1× at 400px viewport → 2× at 1440px, hard-capped at 2× */
  --s:       clamp(1px, calc((640px + 100vw) / 1040), 2px);
}
@media (min-width: 834px)  { :root { --g: 15px; } }
@media (min-width: 1440px) { :root { --g: 20px; } }

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { background: var(--bg); color: var(--black); font-family: var(--f2); overflow-x: hidden; }
img   { display: block; }
button { cursor: pointer; font-family: var(--f1); }

/* Offset all content below the fixed nav bar */
main { padding-top: var(--hh, 64px); }

/* 1-column margin = (viewport - 10 gaps) / 12 */
.pad  { padding: 50px calc((100% - 10 * var(--g)) / 12); }

/* ============================================
   FLOATING DECO
   ============================================ */
.deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

/* ============================================
   SVG BUTTON
   SVG = background shape, text floats on top
   ============================================ */
.svgbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  transition: transform 0.15s;
}
.svgbtn:hover { transform: scale(1.04); }
.svgbtn__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}
.svgbtn__text {
  position: relative;
  z-index: 1;
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  color: var(--black);
  pointer-events: none;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  padding: 10px 20px;
  text-align: center;
  white-space: nowrap;
}

/* ============================================
   TOGGLE BUTTON
   Inline-SVG background, text overlay
   ============================================ */
.tgl-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.tgl-text {
  position: relative;
  z-index: 1;
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  color: var(--black);
  pointer-events: none;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  white-space: nowrap;
}

/* section title */
.section-title {
  font-family: var(--f1);
  font-size: clamp(32px, calc(var(--s) * 36), 63px);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  text-transform: lowercase;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: 36px 0 40px;
  min-height: 440px;
  isolation: isolate;
}

/* large burst — centered behind party button */
.hero__party-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}
.hero__burst-large { width: calc(260 * var(--s)); }

/* deco positions — squiggles/stars behind all content */
.deco-sq1   { width: calc(100 * var(--s)); top: calc(10 * var(--s));    right: calc(10 * var(--s));  z-index: 0; }
.deco-sq2   { width: calc(80 * var(--s));  top: calc(180 * var(--s));   right: calc(5 * var(--s));   z-index: 0; }
.deco-sq3   { width: calc(60 * var(--s));  bottom: calc(100 * var(--s)); left: calc(8 * var(--s));   z-index: 0; }
.deco-star1 { width: calc(22 * var(--s));  top: calc(70 * var(--s));    right: calc(60 * var(--s));  z-index: 0; }
.deco-star2 { width: calc(18 * var(--s));  bottom: calc(140 * var(--s)); left: calc(18 * var(--s));  z-index: 0; }

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

/* header row: burst — logo — burst */
.hero__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}

.hero__burst-left,
.hero__burst-right {
  position: relative;
  z-index: 0;
  width: calc(64 * var(--s));
  flex-shrink: 0;
  animation: snap-spin 7s linear infinite;
}
/* negative margin = half burst width → each burst slides halfway under the logo */
.hero__burst-left  { animation-delay: -1s; margin-right: calc(-32 * var(--s)); }
.hero__burst-right { animation-delay: -4s; transform-origin: center; margin-left: calc(-32 * var(--s)); }

/* logo */
.hero__logo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(280 * var(--s));
  animation: snap-logo 5s linear infinite;
}

.hero__tagline {
  font-family: var(--f1);
  font-size: clamp(18px, calc(var(--s) * 18), 31px);
  font-weight: 400;
  color: var(--black);
  line-height: 1.7;
}
.hero__body {
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 13), 21px);
  font-weight: 400;
  color: var(--black);
  line-height: 1.7;
}
.hero__body-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.hero__subtitle-wrap { text-align: left; }

.hero__right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
}

@media (min-width: 600px) {
  .hero__body-row {
    flex-direction: row;
    align-items: flex-start;
  }
  .hero__subtitle-wrap { flex: 1; }
}

.hero__wotd { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-right: calc(40 * var(--s)); }
.hero__wotd-label { width: calc(150 * var(--s)); }

.hero__wotd-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
}
.hero__wotd-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.hero__wotd-word {
  position: relative;
  z-index: 1;
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hero__party { display: flex; flex-direction: column; gap: 8px; align-items: center; position: relative; }
.hero__party-label {
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.06em;
}
#partyBtn[aria-pressed="true"] .party-btn-fill { fill: var(--green); }
.deco-note1 { width: calc(45 * var(--s)); top: calc(-5 * var(--s));  right: calc(20 * var(--s)); }
.deco-note2 { width: calc(55 * var(--s)); top: calc(25 * var(--s));  right: 0; }


/* ============================================
   ADLIBS
   ============================================ */
.adlibs { position: relative; overflow: hidden; }

.deco-ql { width: calc(40 * var(--s)); top: calc(30 * var(--s)); left: 0; }
.deco-qr { width: calc(40 * var(--s)); top: calc(60 * var(--s)); right: calc(4 * var(--s)); }

.adlibs__header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.adlibs__header-stickers { display: flex; gap: 4px; align-items: center; }
.adlibs__sticker { height: calc(40 * var(--s)); width: auto; }

.adlibs__instruct {
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 14), 23px);
  font-weight: 400;
  color: var(--black);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* topics row */

/* topic label pills */
.adlibs__topic-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.adlibs__tl {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s;
}
.adlibs__tl:hover { transform: scale(1.04); }
.adlibs__tl--active .toggle-fill,
.adlibs__tl:hover .toggle-fill { fill: var(--orange); }

/* form inputs */
.adlibs__form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.adlibs__input-row { display: flex; align-items: center; }
.adlibs__input-wrap {
  position: relative;
  width: calc(321.88 * var(--s));
  aspect-ratio: 321.88 / 46.01;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}
.adlibs__input-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}
.adlibs__input-prefix {
  position: relative;
  z-index: 1;
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 13), 21px);
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
  flex-shrink: 0;
}
.adlibs__input-wrap input {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 13), 21px);
  font-weight: 700;
  color: var(--blue);
  flex: 1;
  min-width: 0;
  padding: 0;
}
.adlibs__input-wrap input::placeholder {
  color: var(--black);
  font-weight: 400;
}

/* action row */
.adlibs__action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.adlibs__clear-btn {
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  background: none;
  border: none;
  text-decoration: underline;
  color: var(--black);
  padding: 0;
}
.adlibs__randomize { display: flex; align-items: center; gap: 8px; }
.adlibs__rand-burst {
  position: relative;
  width: calc(100 * var(--s));
  flex-shrink: 0;
}
.adlibs__rand-burst img { width: 100%; display: block; }
.adlibs__rand-burst span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  line-height: 1.3;
  pointer-events: none;
  padding: 20px;
}
.adlibs__reveal-btn { margin-bottom: 20px; }

/* result */
.adlibs__result {
  position: relative;
  border: 1.5px solid var(--black);
  border-radius: 4px;
  padding: 20px 16px;
  margin-bottom: 16px;
  display: none;
  background: var(--bg);
}
.adlibs__result-ql { position: absolute; width: calc(30 * var(--s)); top: calc(-15 * var(--s)); left: calc(10 * var(--s)); }
.adlibs__result-qr { position: absolute; width: calc(30 * var(--s)); bottom: calc(-15 * var(--s)); right: calc(10 * var(--s)); }
.adlibs__result-title {
  font-family: var(--f1);
  font-size: clamp(18px, calc(var(--s) * 18), 31px);
  font-weight: 400;
  margin-bottom: 10px;
}
.adlibs__result-text {
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 13), 21px);
  font-weight: 400;
  line-height: 1.8;
  color: var(--black);
}
.adlibs__result-text strong { color: var(--orange); font-weight: 700; }

.adlibs__save-btn { width: calc(240 * var(--s)); aspect-ratio: 321.88 / 46.01; margin-bottom: 24px; }

.adlibs__inspire {
  font-family: var(--f2);
  font-size: clamp(18px, calc(var(--s) * 18), 31px);
  font-weight: 400;
  color: var(--black);
  margin-bottom: 20px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
}
.adlibs__inspire img {
  height: clamp(32px, calc(var(--s) * 36), 63px);
  width: auto;
  flex-shrink: 0;
}
.adlibs__inspire img:last-child {
  margin-left: auto;
}

/* two-column layout */
.adlibs__layout { display: block; }
.adlibs__right  { margin-top: 24px; }

@media (min-width: 1200px) {
  .adlibs__layout { display: flex; align-items: flex-start; gap: 60px; }
  .adlibs__left   { flex: 0 0 calc(321.88 * var(--s)); min-width: 0; }
  .adlibs__right  { flex: 1; margin-top: 0; min-width: 0; overflow: visible; }
}

/* story cards */
.adlibs__cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 8px;
  width: 100vw;
  margin-left: calc(-1 * (100vw - 10 * var(--g)) / 12);
  padding-left: calc((100vw - 10 * var(--g)) / 12);
  padding-right: calc((100vw - 10 * var(--g)) / 12);
}
.adlibs__card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  width: calc(241.56 * var(--s));
  flex-shrink: 0;
  padding: 20px;
  border: 2px solid #000;
}
.adlibs__card--orange { background: #ff6d00; }
.adlibs__card--blue   { background: #39a1ff; }
.adlibs__card--purple { background: #ab79db; }

@media (min-width: 1200px) {
  .adlibs__inspire { margin-bottom: 15px; }
  .adlibs__cards {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
    overflow-y: visible;
    padding-bottom: 0;
    width: auto;
    margin-left: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .adlibs__card {
    width: auto;
  }
}
.adlibs__card-inner { }
.adlibs__card-topic {
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: #fefff4;
}
.adlibs__card-title {
  font-family: var(--f1);
  font-size: clamp(18px, calc(var(--s) * 18), 31px);
  font-weight: 400;
  margin-bottom: 8px;
  color: #fefff4;
}
.adlibs__card-text {
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 13), 21px);
  font-weight: 400;
  line-height: 1.6;
  color: #fefff4;
}
.adlibs__card-text strong { font-weight: 700; }

/* ============================================
   MUSIC BOX
   ============================================ */
.music { position: relative; overflow: hidden; }

.deco-mn1  { width: calc(55 * var(--s));  top: calc(10 * var(--s));    left: var(--g); }
.deco-mn2  { width: calc(65 * var(--s));  top: calc(10 * var(--s));    right: var(--g); }

.music__header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.music__icon   { width: calc(40 * var(--s)); }
.music__sub    { font-family: var(--f2); font-size: clamp(18px, calc(var(--s) * 18), 31px); font-weight: 400; color: var(--black); margin-bottom: 14px; }

.music__sounds-label {
  font-family: var(--f2);
  font-size: clamp(24px, calc(var(--s) * 28), 47px);
  font-weight: 500;
  text-transform: lowercase;
  margin-bottom: 8px;
}
.music__packs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.music__pack {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s;
}
.music__pack:hover { transform: scale(1.04); }
.music__pack--active .toggle-fill,
.music__pack:hover .toggle-fill { fill: var(--orange); }

/* grid */
.music__grid-scroll { overflow-x: auto; margin-bottom: 14px; }
.music__grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 360px;
  background: var(--yellow);
  border: 2px solid var(--black);
  border-radius: 4px;
  padding: 10px;
}
.music__row   { display: flex; gap: 3px; align-items: center; }
.music__rlbl  { font-family: var(--f1); font-size: clamp(16px, calc(var(--s) * 16), 27px); font-weight: 400; width: 18px; flex-shrink: 0; }
.note-cell    { width: 24px; height: 24px; border-radius: 3px; background: rgba(0,0,0,0.12); border: 1px solid rgba(0,0,0,0.2); cursor: pointer; flex-shrink: 0; transition: background 0.1s; }
.note-cell:hover:not(.on) { background: rgba(0,0,0,0.22); }
.note-cell.on { background: var(--black); }

.music__controls { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================
   QUICK DRAW
   ============================================ */
.draw { position: relative; }

.deco-drw1 { width: calc(90 * var(--s)); }
.deco-drw2 { width: calc(80 * var(--s)); }
.deco-drw3 { width: calc(70 * var(--s)); }

.draw__prompt-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.draw__prompt-left { flex: 1; }
.draw__headline {
  font-family: var(--f1);
  font-size: clamp(18px, calc(var(--s) * 18), 31px);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 10px;
}
.draw__headline span { font-size: clamp(16px, calc(var(--s) * 16), 27px); font-weight: 400; color: var(--black); }

.draw__art-block  { display: flex; flex-direction: column; gap: 6px; }
.draw__burst-wrap { position: relative; width: calc(110 * var(--s)); flex-shrink: 0; }
.draw__burst-wrap img  { width: 100%; }
.draw__burst-wrap span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  line-height: 1.3;
  pointer-events: none;
  padding: 20px;
}
.draw__prompt-btn {
  font-family: var(--f2);
  font-size: clamp(16px, calc(var(--s) * 13), 21px);
  font-weight: 400;
  background: none;
  border: none;
  color: var(--black);
  text-align: left;
  padding: 0;
}
.draw__prompt-btn span { color: var(--blue); font-weight: 600; cursor: pointer; }

/* tools */
.draw__tools { display: flex; gap: 6px; margin-bottom: 6px; }
.draw__tool  { background: none; border: none; padding: 0; transition: transform 0.15s; }
.draw__tool:hover  { transform: scale(1.05); }
.draw__tool img    { height: calc(36 * var(--s)); width: auto; }
.tool-on  { display: none; }
.tool-off { display: block; }
.draw__tool.active .tool-on  { display: block; }
.draw__tool.active .tool-off { display: none; }

/* colors */
.draw__colors-label {
  font-family: var(--f2);
  font-size: clamp(24px, calc(var(--s) * 28), 47px);
  font-weight: 500;
  text-transform: lowercase;
  margin-bottom: 6px;
}
.draw__color-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.color-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
}
.color-dot:hover  { transform: scale(1.15); }
.color-dot.active { border-color: var(--black); transform: scale(1.1); }

/* size */
.draw__size-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.draw__size-row input { accent-color: var(--orange); width: 120px; cursor: pointer; }
.draw__size-icons { display: flex; gap: 6px; align-items: center; }
.draw__size-dot { border-radius: 50%; background: var(--black); display: inline-block; }
.draw__size-dot--sm { width: 6px;  height: 6px;  }
.draw__size-dot--md { width: 12px; height: 12px; }
.draw__size-dot--lg { width: 20px; height: 20px; }

/* canvas */
.draw__canvas {
  display: block;
  width: 100%;
  border: 2px solid var(--black);
  border-radius: 4px;
  background: var(--bg);
  cursor: crosshair;
  margin-bottom: 10px;
}

/* canvas actions */
.draw__canvas-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.draw__icon-btn { background: none; border: none; padding: 0; transition: transform 0.15s; }
.draw__icon-btn:hover { transform: scale(1.08); }
.draw__icon-btn img { display: block; height: calc(36 * var(--s)); width: auto; }
.draw__clear-btn {
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  background: none;
  border: none;
  text-decoration: underline;
  color: var(--black);
  padding: 0;
}
.draw__save-btn { width: calc(240 * var(--s)); aspect-ratio: 321.88 / 46.01; margin-bottom: 16px; }

/* saved drawings gallery panel */
.draw__gallery { margin-bottom: 24px; }
.draw__gallery-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.draw__gallery-title { font-family: var(--f2); font-size: clamp(16px, calc(var(--s) * 13), 21px); font-weight: 700; color: var(--black); }
.draw__gallery-viewall { font-family: var(--f1); font-size: clamp(16px, calc(var(--s) * 16), 27px); font-weight: 400; color: var(--black); text-decoration: underline; }
.draw__gallery-viewall:hover { opacity: .65; }
.draw__gallery-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-thumb { width: 72px; height: 72px; object-fit: cover; border: 2px solid var(--black); border-radius: 3px; background: var(--bg); cursor: pointer; }
.dg-thumb:hover { transform: scale(1.06); }
.dg-more { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border: 2px dashed var(--black); border-radius: 3px; font-family: var(--f1); font-size: clamp(16px, calc(var(--s) * 14), 23px); color: var(--black); text-decoration: none; }
.dg-more:hover { background: rgba(0,0,0,.06); }

/* community */
.draw__community { margin-top: 8px; }
.draw__community-text {
  font-family: var(--f2);
  font-size: clamp(18px, calc(var(--s) * 18), 31px);
  font-weight: 400;
  color: var(--black);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.draw__community-sq { width: calc(50 * var(--s)); flex-shrink: 0; }
.community-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) { .community-cards { grid-template-columns: repeat(3, 1fr); gap: calc(50 * var(--s)); } }

.community-card { overflow: visible; padding: 20px; min-height: 120px; position: relative; border: 2px solid #000; }

.cc-drawing-wrap {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
.cc-drawing-wrap[data-drw="1"] ~ .cc-inner { padding-left: calc(45 * var(--s)); }
.cc-drawing-wrap[data-drw="2"] ~ .cc-inner { padding-left: calc(40 * var(--s)); }
.cc-drawing-wrap[data-drw="3"] ~ .cc-inner { padding-left: calc(35 * var(--s)); }

.community-card .cc-inner { position: relative; z-index: 1; }
.community-card .cc-text { font-family: var(--f2); font-size: clamp(16px, calc(var(--s) * 13), 21px); font-weight: 400; line-height: 1.5; color: #fefff4; }
.community-card .cc-author { font-family: var(--f1); font-size: clamp(16px, calc(var(--s) * 16), 27px); font-weight: 400; margin-top: 8px; color: #fefff4; }

/* ============================================
   BALL PIT
   ============================================ */
.ballpit { position: relative; overflow: visible; z-index: 51; }

.deco-bucket { width: calc(70 * var(--s)); bottom: calc(24 * var(--s)); right: var(--g); z-index: 3; }

/* Ball pit FABs — fixed, float above balls (z-index 50), below header (1000) */
.ballpit-fabs {
  position: fixed;
  bottom: 24px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 200;
}
.ballpit-fab .svgbtn__text {
  font-size: 16px;
  padding: 6px 12px;
  letter-spacing: 0;
}

.ballpit__canvas {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}
.ball-dot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  will-change: transform;
}

/* ============================================
   LIVE DRAWINGS + PARTY + TOAST
   ============================================ */
#liveCanvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 50;
  display: none;
}

#partyCanvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  display: none;
}
#toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fefff4;
  font-family: var(--f1);
  font-size: clamp(16px, calc(var(--s) * 16), 27px);
  font-weight: 400;
  padding: 10px 24px;
  border-radius: 999px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

/* ============================================
   TABLET 834+
   ============================================ */
@media (min-width: 834px) {
  .community-cards { grid-template-columns: repeat(3, 1fr); }
  .note-cell { width: 30px; height: 30px; }
  .music__grid { min-width: 480px; }
}

/* ============================================
   LAPTOP 1440+
   ============================================ */
@media (min-width: 1440px) {
  .note-cell { width: 36px; height: 36px; }
  .music__grid { min-width: 640px; }
  .draw__canvas { height: 440px; }
}

/* ============================================
   STOP-MOTION / POP-ART IDLE ANIMATIONS
   Each keyframe uses step-end so properties
   snap instantly — no interpolation.
   ============================================ */

@keyframes snap-wriggle {
  0%   { transform: rotate(0deg);                           animation-timing-function: step-end; }
  80%  { transform: rotate(-14deg) scaleX(1.06);            animation-timing-function: step-end; }
  84%  { transform: rotate(10deg) scaleX(0.95);             animation-timing-function: step-end; }
  88%  { transform: rotate(-5deg);                          animation-timing-function: step-end; }
  92%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@keyframes snap-bob {
  0%   { transform: translateY(0px) rotate(0deg);           animation-timing-function: step-end; }
  72%  { transform: translateY(-9px) rotate(-6deg);         animation-timing-function: step-end; }
  76%  { transform: translateY(-3px) rotate(4deg);          animation-timing-function: step-end; }
  80%  { transform: translateY(-7px) rotate(-2deg);         animation-timing-function: step-end; }
  84%  { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes snap-star {
  0%   { transform: rotate(0deg) scale(1);    filter: none;                                   animation-timing-function: step-end; }
  76%  { transform: rotate(72deg) scale(1.5); filter: drop-shadow(2px -2px 0 var(--yellow));  animation-timing-function: step-end; }
  80%  { transform: rotate(72deg) scale(0.8); filter: none;                                   animation-timing-function: step-end; }
  84%  { transform: rotate(144deg) scale(1.15); filter: drop-shadow(3px 2px 0 var(--orange)); animation-timing-function: step-end; }
  88%  { transform: rotate(0deg) scale(1);    filter: none; }
  100% { transform: rotate(0deg) scale(1);    filter: none; }
}

@keyframes snap-jitter {
  0%   { transform: translate(0, 0) rotate(0deg);           animation-timing-function: step-end; }
  88%  { transform: translate(-3px, -2px) rotate(-5deg);    animation-timing-function: step-end; }
  91%  { transform: translate(2px, 1px) rotate(4deg);       animation-timing-function: step-end; }
  94%  { transform: translate(-1px, 2px) rotate(-2deg);     animation-timing-function: step-end; }
  97%  { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes snap-pop {
  0%   { transform: scale(1) rotate(0deg);     filter: none;                                   animation-timing-function: step-end; }
  74%  { transform: scale(1.35) rotate(-9deg); filter: drop-shadow(3px 3px 0 #000);            animation-timing-function: step-end; }
  78%  { transform: scale(0.85) rotate(6deg);  filter: drop-shadow(-2px 2px 0 var(--orange));  animation-timing-function: step-end; }
  82%  { transform: scale(1.1) rotate(-2deg);  filter: none;                                   animation-timing-function: step-end; }
  86%  { transform: scale(1) rotate(0deg);     filter: none; }
  100% { transform: scale(1) rotate(0deg);     filter: none; }
}

@keyframes snap-bounce {
  0%   { transform: translateY(0px) scaleY(1);              animation-timing-function: step-end; }
  80%  { transform: translateY(-10px) scaleY(1.06);         animation-timing-function: step-end; }
  84%  { transform: translateY(0px) scaleY(0.88);           animation-timing-function: step-end; }
  88%  { transform: translateY(-5px) scaleY(1.03);          animation-timing-function: step-end; }
  92%  { transform: translateY(0px) scaleY(1); }
  100% { transform: translateY(0px) scaleY(1); }
}

@keyframes snap-tilt {
  0%   { transform: rotate(0deg);                           animation-timing-function: step-end; }
  84%  { transform: rotate(-12deg);                         animation-timing-function: step-end; }
  88%  { transform: rotate(9deg);                           animation-timing-function: step-end; }
  92%  { transform: rotate(-3deg);                          animation-timing-function: step-end; }
  96%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@keyframes snap-wiggle {
  0%   { transform: rotate(0deg) translateX(0);             animation-timing-function: step-end; }
  82%  { transform: rotate(-8deg) translateX(-3px);         animation-timing-function: step-end; }
  86%  { transform: rotate(7deg) translateX(2px);           animation-timing-function: step-end; }
  90%  { transform: rotate(-3deg) translateX(-1px);         animation-timing-function: step-end; }
  94%  { transform: rotate(0deg) translateX(0); }
  100% { transform: rotate(0deg) translateX(0); }
}

@keyframes snap-logo {
  0%   { transform: scale(1) rotate(0deg);        animation-timing-function: step-end; }
  82%  { transform: scale(1.04) rotate(-2deg);    animation-timing-function: step-end; }
  86%  { transform: scale(0.97) rotate(1.5deg);   animation-timing-function: step-end; }
  90%  { transform: scale(1.02) rotate(-0.5deg);  animation-timing-function: step-end; }
  94%  { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes snap-spin {
  0%   { transform: rotate(0deg);                           animation-timing-function: step-end; }
  88%  { transform: rotate(45deg);                          animation-timing-function: step-end; }
  94%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

/* hero squiggles */
.deco-sq1  { animation: snap-wriggle 3.5s linear infinite; animation-delay:  0s;    }
.deco-sq2  { animation: snap-wriggle 4.2s linear infinite; animation-delay: -1.2s;  }
.deco-sq3  { animation: snap-wriggle 3.8s linear infinite; animation-delay: -2.5s;  }

/* hero stars */
.deco-star1 { animation: snap-star 3.2s linear infinite; animation-delay: -0.4s; }
.deco-star2 { animation: snap-star 4.1s linear infinite; animation-delay: -1.8s; }

/* hero music notes */
.deco-note1 { animation: snap-bob 4s   linear infinite; animation-delay: -0.7s; }
.deco-note2 { animation: snap-bob 5.2s linear infinite; animation-delay: -2s;   }

/* hero color bursts */
.hero__burst-large { animation: snap-spin 9s linear infinite; animation-delay:  0s;  }
.hero__burst-small { animation: snap-spin 7s linear infinite; animation-delay: -3s;  }

/* adlibs section quotes */
.deco-ql { animation: snap-jitter 6.5s linear infinite; animation-delay: -0.3s; }
.deco-qr { animation: snap-jitter 6s   linear infinite; animation-delay: -3s;   }

/* adlibs result quotes */
.adlibs__result-ql { animation: snap-jitter 7s linear infinite; animation-delay: -1s;  }
.adlibs__result-qr { animation: snap-jitter 7s linear infinite; animation-delay: -4s;  }

/* adlibs stickers */
.adlibs__sticker--horse    { animation: snap-pop 4.5s linear infinite; animation-delay: -0.5s; }
.adlibs__sticker--poignant { animation: snap-pop 5.2s linear infinite; animation-delay: -2s;   }
.adlibs__sticker--hotdog   { animation: snap-pop 4.8s linear infinite; animation-delay: -3.5s; }

/* music section notes */
.deco-mn1 { animation: snap-bob 3.8s linear infinite; animation-delay: -0.2s; }
.deco-mn2 { animation: snap-bob 4.8s linear infinite; animation-delay: -1.5s; }

/* music header icon */
.music__icon { animation: snap-jitter 5.5s linear infinite; animation-delay: -1s; }

/* draw section decos */
.deco-drw1 { animation: snap-wiggle 5s   linear infinite; animation-delay:  0s;   }
.deco-drw2 { animation: snap-wiggle 4.2s linear infinite; animation-delay: -2.2s; }
.deco-drw3 { animation: snap-wiggle 6s   linear infinite; animation-delay: -1s;   }

/* draw community squiggle */
.draw__community-sq { animation: snap-wriggle 5s linear infinite; animation-delay: -2s; }

/* ball pit bucket */
.deco-bucket { animation: snap-tilt 5s linear infinite; animation-delay: -0.8s; }

/* scattered deco balls */
.deco-ball:nth-child(1) { animation: snap-bounce 3.2s linear infinite; animation-delay:  0s;   }
.deco-ball:nth-child(2) { animation: snap-bounce 4s   linear infinite; animation-delay: -0.6s; }
.deco-ball:nth-child(3) { animation: snap-bounce 3.6s linear infinite; animation-delay: -1.2s; }
.deco-ball:nth-child(4) { animation: snap-bounce 5s   linear infinite; animation-delay: -1.8s; }
.deco-ball:nth-child(5) { animation: snap-bounce 4.4s linear infinite; animation-delay: -2.4s; }


/* respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hero__logo,
  .hero__burst-left, .hero__burst-right,
  .deco-sq1, .deco-sq2, .deco-sq3,
  .deco-star1, .deco-star2,
  .deco-note1, .deco-note2,
  .hero__burst-large, .hero__burst-small,
  .deco-ql, .deco-qr,
  .adlibs__result-ql, .adlibs__result-qr,
  .adlibs__sticker--horse, .adlibs__sticker--poignant, .adlibs__sticker--hotdog,
  .deco-mn1, .deco-mn2,
  .music__icon,
  .deco-drw1, .deco-drw2, .deco-drw3,
  .draw__community-sq,
  .deco-bucket,
  .deco-ball { animation: none; }
}
