/* =========================================================
   Blaze Bingo — "Daylight Edition"
   Same family as the CTC Member Hub, but the grid is the star
   ========================================================= */

:root{
  --cream: #FBF8F3;
  --cream-2: #F4EEE4;
  --paper: #FFFDF9;
  --ink: #1A1A2E;
  --ink-soft: #3A3A52;
  --ink-mute: #6B6B82;
  --hairline: rgba(26,26,46,0.10);
  --hairline-strong: rgba(26,26,46,0.18);

  --pink: #FF2D87;
  --ember: #FF6B3D;
  --gold: #FFB84D;
  --teal: #00C9B0;

  --grad-fire: linear-gradient(135deg, #FF2D87 0%, #FF6B3D 55%, #FFB84D 100%);
  --grad-fire-soft: linear-gradient(135deg, rgba(255,45,135,0.12), rgba(255,184,77,0.12));

  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;

  --shadow-soft: 0 2px 10px rgba(26,26,46,0.05), 0 8px 30px rgba(26,26,46,0.06);
  --shadow-pop: 0 4px 18px rgba(26,26,46,0.08), 0 20px 50px rgba(255,107,61,0.15);
  --shadow-stuck: 0 24px 60px rgba(26,26,46,0.18);

  --font-display: "Archivo Black", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-hand: "Permanent Marker", cursive;

  --bar-h: 68px;
}

/* -------- dark theme overrides -------- */
body[data-theme="dark"]{
  --cream:   #0B0B16;
  --cream-2: #13132A;
  --paper:   #181830;
  --ink:     #F4EEE4;
  --ink-soft:#C8C4D8;
  --ink-mute:#8A86A0;
  --hairline:        rgba(255,255,255,0.08);
  --hairline-strong: rgba(255,255,255,0.18);
  --shadow-soft: 0 2px 10px rgba(0,0,0,0.4), 0 8px 30px rgba(0,0,0,0.35);
  --shadow-pop:  0 4px 18px rgba(0,0,0,0.5), 0 20px 50px rgba(255,107,61,0.22);
  --shadow-stuck:0 24px 60px rgba(0,0,0,0.6);
}
body[data-theme="dark"]{
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255,107,61,0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255,45,135,0.18), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(0,201,176,0.12), transparent 60%),
    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='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
body[data-theme="dark"] .topbar{ background: rgba(11,11,22,0.78); }
body[data-theme="dark"] .square.free{ background: linear-gradient(135deg, #1f1f3d, #2a1e3d); }

#theme-toggle .icon-moon{ display: none; }
body[data-theme="dark"] #theme-toggle .icon-sun{ display: none; }
body[data-theme="dark"] #theme-toggle .icon-moon{ display: block; }

*,*::before,*::after{ box-sizing: border-box; margin: 0; padding: 0; }

html,body{
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body{
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(255,107,61,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255,45,135,0.10), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(0,201,176,0.08), transparent 60%),
    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='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.18 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed, fixed, fixed, fixed;
}

/* typography */
h1,h2,h3,h4{ font-family: var(--font-display); font-weight: 400; letter-spacing:-0.01em; line-height:1.05; }
h1{ font-size: clamp(2.4rem, 6.5vw, 4.5rem); }
h2{ font-size: clamp(1.5rem, 3vw, 2rem); }
h3{ font-size: 1.2rem; }
a{ color: inherit; }

.ink{ position:relative; display:inline-block; white-space:nowrap; }
.ink-fire{ color: var(--ember); }
.ink-teal{ color: var(--teal); }
.ink .underline{
  position:absolute; left:-4%; right:-4%; bottom:-0.12em; width:108%; height:0.34em;
  stroke: currentColor; stroke-width:5; fill:none; stroke-linecap:round;
  stroke-dasharray: 250; stroke-dashoffset: 250;
  animation: drawLine 1.4s ease-out 0.3s forwards;
}
@keyframes drawLine{ to{ stroke-dashoffset: 0; } }

/* -------- ambient ember canvas -------- */
#ember-canvas{
  position: fixed; inset:0; width:100%; height:100%;
  pointer-events:none; z-index: 0; opacity: 0.85;
}

/* -------- doodles -------- */
.doodle-layer{ position: fixed; inset:0; pointer-events:none; z-index:1; }
.doodle{ position:absolute; fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; opacity: 0.5; animation: bobble 6s ease-in-out infinite; }
.doodle-1{ top:  8%; left:  3%; width: 34px; height:34px; stroke: var(--pink);  animation-delay: -1.0s; }
.doodle-2{ top: 18%; right: 5%; width: 40px; height:40px; stroke: var(--gold);  animation-delay: -2.2s; }
.doodle-3{ top: 52%; left:  6%; width: 70px; height:35px; stroke: var(--teal);  animation-delay: -3.5s; }
.doodle-4{ top: 66%; right: 7%; width: 32px; height:42px; stroke: var(--ember); animation-delay: -0.5s; }
.doodle-5{ top: 38%; right:18%; width: 30px; height:30px; stroke: var(--pink);  animation-delay: -4.0s; }
.doodle-6{ top: 82%; left: 12%; width: 44px; height:44px; stroke: var(--teal);  animation-delay: -1.6s; }
.doodle-7{ top: 24%; left: 38%; width: 58px; height:22px; stroke: var(--ember); animation-delay: -2.8s; }
.doodle-8{ top: 74%; right:22%; width: 28px; height:28px; stroke: var(--gold);  animation-delay: -3.1s; }
@keyframes bobble{
  0%,100%{ transform: translateY(0) rotate(-4deg); }
  50%{ transform: translateY(-10px) rotate(6deg); }
}

/* -------- topbar -------- */
.topbar{
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(251,248,243,0.82);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.logo{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); }
.logo-mark{
  width:38px; height:38px; display:grid; place-items:center; color: var(--ember);
  background: var(--paper); border-radius: 12px; border:1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease;
}
.logo:hover .logo-mark{ transform: rotate(90deg); }
.logo-text{ font-family: var(--font-display); font-size: 1rem; }
.logo-dot{ color: var(--pink); margin: 0 2px; }

.back-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 10px 16px 10px 12px; border-radius: 12px;
  background: var(--paper); border: 1px solid var(--hairline);
  color: var(--ink); text-decoration: none;
  font: 600 0.88rem var(--font-body);
  box-shadow: var(--shadow-soft);
  transition: all 0.25s ease;
}
.back-btn:hover{ color: var(--ember); transform: translateX(-3px); }

.topbar-right{ margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn{
  width: 40px; height:40px; display:grid; place-items:center;
  background: var(--paper); border:1px solid var(--hairline); border-radius: 12px;
  color: var(--ink); cursor:pointer;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}
.icon-btn:hover{ transform: translateY(-2px); box-shadow: var(--shadow-pop); color: var(--ember); }

/* -------- main layout -------- */
main{ position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 0 clamp(18px, 3vw, 40px); }

/* -------- hero (archive) -------- */
.hero-archive{
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 56px);
  padding: clamp(40px, 7vw, 70px) 0 clamp(30px, 4vw, 40px);
  align-items: center;
}
@media (max-width: 860px){
  .hero-archive{ grid-template-columns: 1fr; gap: 28px; }
}
.hero-copy{ max-width: 52ch; }
.eyebrow{
  display:inline-flex; align-items:center; gap: 10px;
  font: 600 0.82rem var(--font-body); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
  padding: 8px 14px; background: var(--paper); border: 1px solid var(--hairline); border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}
.eyebrow-dot{ width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px rgba(255,107,61,0.2); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ box-shadow: 0 0 0 4px rgba(255,107,61,0.2); } 50%{ box-shadow: 0 0 0 8px rgba(255,107,61,0.08); } }
.hero-title{ margin-bottom: 22px; }
.hero-sub{ font-size: 1.1rem; color: var(--ink-soft); max-width: 52ch; }

.hero-featured{ display: flex; justify-content: flex-end; }
.hero-featured .month-card{
  max-width: 380px; width: 100%;
  transform: rotate(-1deg);
  box-shadow: var(--shadow-pop);
}
.hero-featured .month-card:hover{ transform: translateY(-5px) rotate(-1deg); }
.hero-featured .month-card .month-card-stripe{ height: 8px; }
.hero-featured .month-card .month-card-title{ font-size: 2rem; }
@media (max-width: 860px){
  .hero-featured{ justify-content: center; }
  .hero-featured .month-card{ max-width: 100%; transform: rotate(0); }
  .hero-featured .month-card:hover{ transform: translateY(-5px); }
}

/* -------- archive grid -------- */
.archive-section{ padding: 10px 0 80px; }
.section-head{ display:flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.section-head p{ color: var(--ink-mute); }

/* -------- past cards collapsible -------- */
.past-cards{
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.past-cards[open]{ box-shadow: var(--shadow-pop); }
.past-summary{
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  cursor: pointer;
  font: 700 1rem var(--font-body);
  color: var(--ink);
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}
.past-summary::-webkit-details-marker{ display: none; }
.past-summary:hover{ background: var(--cream); color: var(--ember); }
.past-chevron{ transition: transform 0.3s cubic-bezier(0.2,0.9,0.2,1); }
.past-cards[open] .past-chevron{ transform: rotate(180deg); }
.past-count{ margin-left: auto; color: var(--ink-mute); font: 600 0.82rem var(--font-body); }
.past-cards[open] .months-grid{ padding: 8px 22px 22px; }
.past-cards .months-grid{
  padding: 0 22px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
}
.past-cards[open] .months-grid{ max-height: 2000px; }

.months-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.month-card{
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2,0.9,0.2,1), box-shadow 0.35s ease, border-color 0.25s ease;
  display: flex; flex-direction: column;
}
.month-card:hover{ transform: translateY(-5px) rotate(-0.3deg); box-shadow: var(--shadow-pop); border-color: rgba(255,107,61,0.4); }
.month-card.coming{ opacity: 0.55; pointer-events: none; }
.month-card-stripe{ height: 6px; background: var(--grad-fire); }
.month-card.coming .month-card-stripe{ background: var(--hairline-strong); }
.month-card-body{ padding: 20px 22px 16px; flex: 1; }
.month-card-month{
  font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
}
.month-card-title{ font-family: var(--font-display); font-size: 1.8rem; margin-top: 2px; line-height: 1; }
.month-card-theme{
  display: inline-block;
  background: var(--grad-fire); color: #fff;
  font: 700 0.7rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 12px; border-radius: 999px;
  margin-top: 10px;
}
.month-card.coming .month-card-theme{ background: var(--hairline); color: var(--ink-mute); }
.month-card-blurb{ margin-top: 12px; font-size: 0.92rem; color: var(--ink-soft); }
.month-card-foot{
  padding: 12px 22px; border-top: 1px dashed var(--hairline);
  display:flex; align-items:center; justify-content:space-between;
  font: 700 0.85rem var(--font-body); color: var(--ember);
}
.month-card-foot svg{ transition: transform 0.2s ease; }
.month-card:hover .month-card-foot svg{ transform: translateX(4px); }
.badge-current{
  position: absolute; top: 16px; right: 16px;
  background: var(--grad-fire); color: #fff;
  font: 700 0.7rem var(--font-body); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(255,107,61,0.4);
}
.badge-soon{
  position: absolute; top: 16px; right: 16px;
  background: var(--paper); border: 1px solid var(--hairline-strong);
  color: var(--ink-mute);
  font: 700 0.7rem var(--font-body); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 11px; border-radius: 999px;
}

/* -------- card page hero -------- */
.card-main{ padding-top: clamp(20px, 4vw, 40px); padding-bottom: 80px; }
.card-hero{
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.month-label{
  font: 700 0.78rem var(--font-body); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute); margin-bottom: 6px;
}
.card-title{ font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1; }
.theme-badge{
  display: inline-block; margin-top: 10px;
  background: var(--grad-fire); color: #fff;
  font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 5px 14px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(255,107,61,0.3);
}

.progress-stats{ display:flex; gap: 10px; }
.stat-block{
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 12px 18px; text-align: center; min-width: 76px;
  box-shadow: var(--shadow-soft);
}
.stat-num{ font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--ink); }
.stat-lbl{ font: 600 0.7rem var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin-top: 4px; }

/* -------- action row -------- */
.action-row{ display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.pill-btn{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--hairline);
  color: var(--ink); cursor: pointer;
  font: 600 0.88rem var(--font-body);
  box-shadow: var(--shadow-soft);
  transition: all 0.25s ease;
}
.pill-btn:hover{ transform: translateY(-2px); box-shadow: var(--shadow-pop); color: var(--ember); border-color: var(--ember); }
.pill-reset{ margin-left: auto; width: 40px; padding: 10px; justify-content: center; }

/* -------- BINGO GRID (the star) -------- */
.bingo-wrap{ margin-bottom: 40px; }
.bingo-headers{
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.bingo-headers > div{
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  background: var(--grad-fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  padding: 6px 0;
}
.bingo-grid{
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.square{
  position: relative;
  min-height: 190px;
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 12px 32px;
  cursor: pointer;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s cubic-bezier(0.2,0.9,0.2,1), box-shadow 0.3s ease, border-color 0.25s ease;
}
.square:hover{
  transform: translateY(-4px) rotate(-0.6deg);
  box-shadow: var(--shadow-pop);
  border-color: rgba(255,107,61,0.5);
  z-index: 2;
}
.square-pos{
  display: flex; align-items: center; gap: 6px;
  font: 700 0.68rem var(--font-body); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.square-robot-icon{ font-size: 0.95rem; line-height: 1; }
.square-task{
  font: 500 0.78rem var(--font-body);
  color: var(--ink);
  line-height: 1.35;
  flex: 1;
  overflow: hidden;
  word-break: break-word;
}
.square-pts{
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 0.66rem var(--font-body); color: #fff;
}
.square-pts.pts-1{ background: var(--pink); }
.square-pts.pts-2{ background: var(--ember); }
.square-pts.pts-3{ background: var(--gold); color: #6B5200; }

/* robot square — pulsing ring */
.square.robot{
  border-color: rgba(255,107,61,0.4);
}
.square.robot::before{
  content: ""; position: absolute; inset: -2px;
  border-radius: 16px; border: 2px solid var(--ember);
  opacity: 0.5;
  animation: robotPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes robotPulse{
  0%,100%{ opacity: 0.35; transform: scale(1); }
  50%{ opacity: 0.7; transform: scale(1.02); }
}

/* done square */
.square.done{
  background: linear-gradient(180deg, rgba(255,107,61,0.08), var(--paper));
  border-color: rgba(255,107,61,0.4);
}
.square.done::after{
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad-fire);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 60%; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 4px 14px rgba(255,107,61,0.5);
}
.square.done .square-pts{ display: none; }
.square.done .square-task{ opacity: 0.6; }

/* free square — big flame */
.square.free{
  background: linear-gradient(135deg, #FFF4E1, #FFE0C7);
  border-color: rgba(255,107,61,0.3);
  align-items: center; justify-content: center;
  cursor: default;
}
.square.free .square-pos{ display: none; }
.square.free .square-task{ text-align: center; font: 700 0.8rem var(--font-hand); color: var(--ember); -webkit-line-clamp: 2; }
.square.free .square-icon{ font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 4px; }
.square.free .square-pts{ display: none; }
.square.free:hover{ transform: none; }

/* mobile grid adjustments */
@media (max-width: 640px){
  .bingo-grid{ gap: 6px; }
  .bingo-headers{ gap: 6px; }
  .square{ padding: 8px 6px 6px; border-radius: 10px; }
  .square-task{ font-size: 0.64rem; -webkit-line-clamp: 3; }
  .square-pts{ width: 16px; height: 16px; font-size: 0.58rem; }
}

/* legend */
.legend{
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center; margin-top: 24px;
  padding: 12px 18px; background: var(--paper);
  border: 1px solid var(--hairline); border-radius: 14px;
  font: 600 0.8rem var(--font-body); color: var(--ink-mute);
  box-shadow: var(--shadow-soft);
}
.legend-item{ display: inline-flex; align-items: center; gap: 6px; }
.legend .dot{ width: 10px; height: 10px; border-radius: 50%; }
.dot-pink{ background: var(--pink); }
.dot-ember{ background: var(--ember); }
.dot-gold{ background: var(--gold); }
.robot-mini{ font-size: 0.95rem; }

/* -------- drawers -------- */
.drawer{
  position: fixed; top:0; right:0; bottom:0;
  width: min(420px, 92vw);
  background: var(--paper);
  border-left: 1px solid var(--hairline);
  padding: 24px;
  transform: translateX(105%);
  transition: transform 0.45s cubic-bezier(0.2,0.9,0.2,1);
  z-index: 60;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-stuck);
  overflow-y: auto;
}
.drawer.drawer-wide{ width: min(560px, 94vw); }
.drawer.open{ transform: translateX(0); }
.drawer-head{
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--hairline); margin-bottom: 18px;
}
.drawer-head h3{ font-family: var(--font-display); font-size: 1.3rem; }
.drawer-body{ flex: 1; }
.drawer-intro{ color: var(--ink-soft); margin-bottom: 18px; font-size: 0.95rem; }

.how-list{ list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.how-list li{
  position: relative; padding-left: 44px;
  font-size: 0.92rem; color: var(--ink-soft);
  counter-increment: step;
}
.how-list li::before{
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad-fire); color: #fff;
  display: grid; place-items: center;
  font: 700 0.9rem var(--font-body);
  box-shadow: 0 4px 12px rgba(255,107,61,0.3);
}
.how-list strong{ color: var(--ink); }
.how-tip{
  margin-top: 20px; padding: 14px; background: var(--cream-2);
  border-radius: 10px; font-size: 0.85rem; color: var(--ink-soft);
  border-left: 3px solid var(--ember);
}

.swap-list{ list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: swap; }
.swap-list li{
  position: relative; padding: 14px 16px 14px 48px;
  background: var(--cream); border: 1px solid var(--hairline); border-radius: 12px;
  font-size: 0.88rem; color: var(--ink-soft);
  counter-increment: swap;
}
.swap-list li::before{
  content: counter(swap);
  position: absolute; left: 12px; top: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad-fire); color: #fff;
  display: grid; place-items: center;
  font: 700 0.78rem var(--font-body);
}

.prompts-list{ display: flex; flex-direction: column; gap: 18px; }
.prompt-card{
  background: var(--cream); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 18px 20px;
}
.prompt-label{ font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ember); margin-bottom: 4px; }
.prompt-title{ font-family: var(--font-display); font-size: 1.05rem; line-height: 1.2; margin-bottom: 10px; }
.prompt-body{
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 14px 16px; font: 500 0.82rem var(--font-body); color: var(--ink-soft);
  white-space: pre-wrap;
  max-height: 240px; overflow-y: auto;
  margin-bottom: 12px;
}
.prompt-copy{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 8px 14px; border-radius: 10px; border: 0;
  background: var(--grad-fire); color: #fff;
  font: 700 0.82rem var(--font-body); cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,107,61,0.3);
  transition: all 0.2s ease;
}
.prompt-copy:hover{ transform: translateY(-2px); }
.prompt-copy.copied{ background: var(--teal); }

.drawer-scrim{
  position: fixed; inset: 0; background: rgba(26,26,46,0.25); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease; z-index: 55;
}
.drawer-scrim.show{ opacity: 1; pointer-events: auto; }

/* -------- square popup -------- */
.square-popup{
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  background: rgba(26,26,46,0.45); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.square-popup.show{ opacity: 1; pointer-events: auto; }
.popup-inner{
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px 30px 24px;
  max-width: 460px; width: 100%;
  box-shadow: var(--shadow-stuck);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.square-popup.show .popup-inner{ transform: scale(1); }
.popup-head{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.popup-pos{
  font: 700 0.75rem var(--font-body); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute);
  padding: 5px 12px; background: var(--cream); border-radius: 999px;
}
.popup-task{ font-size: 1rem; color: var(--ink); line-height: 1.5; text-align: left; margin-bottom: 16px; }
.popup-meta{ display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.popup-pts{ display: inline-block; padding: 5px 12px; background: var(--grad-fire); color: #fff; border-radius: 999px; font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; }
.popup-robot{ display: inline-block; padding: 5px 12px; background: rgba(255,107,61,0.12); color: var(--ember); border: 1px solid rgba(255,107,61,0.3); border-radius: 999px; font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; }
.popup-mystery{ display: inline-block; padding: 5px 12px; background: rgba(0,201,176,0.12); color: #007a6b; border: 1px solid rgba(0,201,176,0.35); border-radius: 999px; font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; }

/* Proof block */
.popup-proof{
  background: var(--cream);
  border-left: 3px solid var(--ember);
  padding: 12px 14px; border-radius: 10px;
  margin-bottom: 18px;
}
.popup-proof-label{ font: 700 0.68rem var(--font-body); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ember); margin-bottom: 5px; }
.popup-proof-text{ font-size: 0.84rem; color: var(--ink-soft); line-height: 1.45; }

/* Mystery reveal block */
.popup-reveal{
  background: linear-gradient(180deg, rgba(0,201,176,0.08), var(--cream));
  border: 1.5px dashed rgba(0,201,176,0.45);
  padding: 14px 16px; border-radius: 10px;
  margin-bottom: 18px;
  animation: revealIn 0.5s cubic-bezier(0.2,0.9,0.2,1);
}
@keyframes revealIn{ from{ opacity: 0; transform: translateY(6px); } to{ opacity: 1; transform: translateY(0); } }
.popup-reveal-label{ font: 700 0.68rem var(--font-body); text-transform: uppercase; letter-spacing: 0.12em; color: #007a6b; margin-bottom: 5px; }
.popup-reveal-text{ font-size: 0.88rem; color: var(--ink); line-height: 1.5; }

.popup-actions{ display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }

/* Safety: hidden attribute must actually hide */
[hidden]{ display: none !important; }

/* Mystery square styling on the grid */
.square.mystery{
  border-style: dashed;
  border-color: rgba(0,201,176,0.45);
  background: linear-gradient(180deg, rgba(0,201,176,0.05), var(--paper));
}
.square.mystery .square-task{
  font-family: var(--font-hand);
  color: #007a6b;
  font-size: 1rem;
  text-align: center;
  display: flex; align-items: center; justify-content: center;
  -webkit-line-clamp: 1;
}

.btn{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px;
  font: 700 0.88rem var(--font-body); cursor: pointer; border: 0;
  transition: all 0.25s ease;
}
.btn-primary{
  background: var(--grad-fire); color: #fff;
  box-shadow: 0 8px 22px rgba(255,107,61,0.35);
}
.btn-primary:hover{ transform: translateY(-2px); }
.btn-primary.is-done{ background: var(--teal); box-shadow: 0 8px 22px rgba(0,201,176,0.35); }
.btn-ghost{
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover{ color: var(--ember); border-color: var(--ember); }

/* -------- prompt popup (opens over square popup) -------- */
.prompt-popup{
  position: fixed; inset: 0; z-index: 85;
  display: grid; place-items: center;
  background: rgba(26,26,46,0.65); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.prompt-popup.show{ opacity: 1; pointer-events: auto; }
.prompt-popup-inner{
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px 30px 24px;
  max-width: 620px; width: 100%;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-stuck);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.prompt-popup.show .prompt-popup-inner{ transform: scale(1); }
.prompt-popup-head{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px; }
.prompt-popup-label{
  font: 700 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ember);
  padding: 5px 12px; background: rgba(255,107,61,0.12); border-radius: 999px;
}
.prompt-popup-title{
  font-family: var(--font-display); font-size: 1.2rem; line-height: 1.2;
  margin-bottom: 14px;
}
.prompt-popup-body{
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 16px 18px;
  font: 500 0.9rem var(--font-body);
  color: var(--ink-soft);
  line-height: 1.55;
  white-space: pre-wrap;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  user-select: text;
}
.prompt-popup-actions{ display: flex; gap: 10px; flex-wrap: wrap; }
#prompt-popup-copy.copied{ background: var(--teal); box-shadow: 0 8px 22px rgba(0,201,176,0.35); }

/* -------- celebration -------- */
.celebration{
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(26,26,46,0.55); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.celebration.show{ opacity: 1; pointer-events: auto; }
.celebration-banner{
  background: var(--paper); padding: 40px 60px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-stuck);
  text-align: center;
  position: relative;
  transform: scale(0.7) rotate(-3deg);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebration.show .celebration-banner{ transform: scale(1) rotate(-2deg); }
.banner-marker{ font-family: var(--font-hand); font-size: clamp(2.4rem, 8vw, 4.5rem); color: var(--ember); display: block; }
.banner-sub{ font-size: 1.05rem; color: var(--ink-soft); }
.confetti-layer{ position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.confetti{
  position: absolute; width: 10px; height: 14px;
  top: 50%; left: 50%;
  border-radius: 2px;
  animation: confettiFly 1.5s ease-out forwards;
}
@keyframes confettiFly{
  from{ transform: translate(0,0) rotate(0); opacity: 1; }
  to{ transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; }
}

/* -------- footer -------- */
.foot{ padding: 40px 0 20px; text-align: center; border-top: 1px dashed var(--hairline); margin-top: 40px; }
.foot-signoff{ font-family: var(--font-hand); font-size: 1.6rem; color: var(--ember); margin-bottom: 4px; }
.foot-meta{ font-size: 0.82rem; color: var(--ink-mute); }

/* -------- reduced motion -------- */
body[data-motion="off"] *,
body[data-motion="off"] *::before,
body[data-motion="off"] *::after{
  animation: none !important;
  transition: none !important;
}
body[data-motion="off"] #ember-canvas{ display: none; }
body[data-motion="off"] .doodle-layer{ display: none; }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   PRINT STYLES — portrait letter, board fits on ONE page
   ========================================================= */
.print-view{ display: none; }

@media print{
  @page { size: letter portrait; margin: 0.4in; }

  html, body{
    background: #fff !important; color: #000 !important;
    margin: 0 !important; padding: 0 !important;
  }

  /* Hide everything by default during print */
  body > *{ display: none !important; }

  /* Then reveal only the relevant print view */
  body.printing-board .print-view-board,
  body.printing-prompts .print-view-prompts,
  body.printing-swaps .print-view-swaps{
    display: block !important;
  }

  .print-view{
    font-family: "Outfit", "Helvetica Neue", sans-serif;
    color: #000;
    padding: 0; margin: 0;
    width: 100%;
  }
  .print-view h1{ font-family: "Archivo Black", sans-serif; font-size: 17pt; margin: 0; line-height: 1; }
  .print-view h2{ font-family: "Archivo Black", sans-serif; font-size: 10pt; margin: 0; color: #555; font-weight: 400; letter-spacing: 0.02em; line-height: 1; }
  .print-view .print-head{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px; padding-bottom: 4px;
    border-bottom: 1.5px solid #000;
  }

  /* ---- BOARD — one portrait letter page ---- */
  .print-view-board{
    width: 7.7in;
    overflow: hidden;
  }
  .print-view-board .print-head{ height: 0.38in; margin-bottom: 3px; padding-bottom: 3px; }
  .print-grid{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 0.22in repeat(5, 1.87in);
    gap: 2px;
    width: 100%;
  }
  .print-col-head{
    font-family: "Archivo Black", sans-serif;
    font-size: 11pt;
    text-align: center;
    padding: 0;
    border-bottom: 1.5px solid #000;
    line-height: 1;
  }
  .print-cell{
    border: 1px solid #000;
    padding: 3px 5px 14px 5px;
    font-size: 8pt;
    line-height: 1.18;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    page-break-inside: avoid;
    break-inside: avoid;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  /* Dynamic sizing: short tasks get bigger font, long tasks stay tight */
  .print-cell.fs-lg{ font-size: 10pt; line-height: 1.28; }
  .print-cell.fs-md{ font-size: 9pt;  line-height: 1.22; }
  .print-cell.fs-sm{ font-size: 8pt;  line-height: 1.18; }
  .print-cell .pc-pos{
    font-weight: 700;
    font-size: 7pt;
    color: #555;
    letter-spacing: 0.05em;
    margin-bottom: 1px;
    line-height: 1;
  }
  .print-cell .pc-task{
    flex: 1;
    overflow: hidden;
  }
  .print-cell .pc-pts{
    position: absolute;
    bottom: 2px; right: 3px;
    font-size: 7pt;
    font-weight: 700;
    background: #000;
    color: #fff;
    border-radius: 50%;
    width: 13px; height: 13px;
    display: grid; place-items: center;
    line-height: 1;
  }
  .print-cell.free{
    background: #FFE0C7;
    font-weight: 700;
    text-align: center;
    justify-content: center;
    align-items: center;
    font-size: 12pt;
    font-family: "Archivo Black", sans-serif;
  }
  .print-cell.free .pc-pos,
  .print-cell.free .pc-pts{ display: none; }

  /* ---- PROMPTS — portrait, allowed to span multiple pages ---- */
  .print-view-prompts{ padding: 0; }
  .print-view-prompts .print-prompt{
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 18px;
    border: 1.2px solid #000;
    padding: 14px 16px;
    font-size: 10pt;
    line-height: 1.4;
  }
  .print-view-prompts .pp-label{
    font-weight: 700; font-size: 9pt;
    text-transform: uppercase; color: #666;
    letter-spacing: 0.08em;
  }
  .print-view-prompts .pp-title{
    font-family: "Archivo Black", sans-serif;
    font-size: 13pt;
    margin: 4px 0 10px;
  }
  .print-view-prompts .pp-body{ white-space: pre-wrap; }

  /* ---- SWAPS — portrait, one page ---- */
  .print-view-swaps{ padding: 0; }
  .print-view-swaps .print-swap{
    margin-bottom: 10px;
    padding: 10px 14px;
    border-left: 4px solid #000;
    font-size: 11pt;
    line-height: 1.4;
    page-break-inside: avoid;
  }
  .print-view-swaps .print-swap strong{
    font-family: "Archivo Black", sans-serif;
    margin-right: 6px;
  }
}

/* loading state */
.skeleton{ padding: 60px; text-align: center; color: var(--ink-mute); font: 600 1rem var(--font-body); }
.skeleton::after{ content:""; display:inline-block; width: 20px; height: 20px; border: 3px solid var(--hairline); border-top-color: var(--ember); border-radius: 50%; margin-left: 10px; vertical-align: middle; animation: spin 1s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }
