/* infinite fable cats — warm art-studio theme */

:root {
  --paper: #edf3df;
  --paper-2: #e2ecce;
  --card: #fbfdf2;
  --line: #d5e0ba;
  --line-2: #bfd09e;
  --text: #24311b;
  --dim: #75855e;
  --accent: #3d7a2f;
  --accent-2: #7fb069;
  --banana: #e8c445;
  --sage: #7bb26a;
  --live: #e5484d;
  --radius: 18px;
  --shadow: 0 2px 6px rgba(38, 58, 26, 0.07), 0 14px 34px rgba(38, 58, 26, 0.10);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 70% 42% at 50% -8%, rgba(127, 176, 105, 0.22), transparent),
    radial-gradient(ellipse 45% 32% at 6% 28%, rgba(61, 122, 47, 0.10), transparent),
    radial-gradient(ellipse 45% 32% at 96% 58%, rgba(232, 196, 69, 0.10), transparent),
    radial-gradient(ellipse 30% 22% at 80% 10%, rgba(61, 122, 47, 0.08), transparent);
  overflow-x: hidden;
}

h2 { font-family: 'Fraunces', serif; font-weight: 700; }

/* ---------------------------------------------------------- drifting doodles */

.drift { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.drift span {
  position: absolute; bottom: -60px; font-size: 26px; opacity: 0;
  animation-name: driftUp; animation-iteration-count: infinite; animation-timing-function: linear;
}
@keyframes driftUp {
  0% { transform: translateY(0) rotate(-8deg); opacity: 0; }
  8% { opacity: 0.12; }
  85% { opacity: 0.10; }
  100% { transform: translateY(-110vh) rotate(14deg); opacity: 0; }
}

/* ---------------------------------------------------------------- header */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  background: rgba(237, 243, 223, 0.97);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; display: block; box-shadow: var(--shadow); }
.brand-name {
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; letter-spacing: 0.2px;
}
.top-right { display: flex; align-items: center; gap: 12px; }

.btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; text-decoration: none;
  border-radius: 999px; padding: 8px 16px; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn.ghost { color: var(--text); border: 1.5px solid var(--line-2); background: var(--card); }
.btn.ghost:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.solid { color: #fff; background: var(--accent); border: 1.5px solid var(--accent); box-shadow: 0 6px 16px rgba(61, 122, 47, 0.3); }
.btn.solid:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(61, 122, 47, 0.4); }

.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500;
  color: var(--live); border: 1.5px solid rgba(229, 72, 77, 0.4);
  padding: 6px 13px; border-radius: 999px; letter-spacing: 2px;
  background: rgba(229, 72, 77, 0.07);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229,72,77,0.45);} 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(229,72,77,0);} }
.viewers { color: var(--dim); font-size: 13px; font-family: 'IBM Plex Mono', monospace; }
.viewers b { color: var(--text); }

/* blinking cat mark */
.cat-mark .eyes { transform-origin: 64px 64px; animation: blink 5.2s infinite; }
.cat-mark .ear-l { transform-origin: 40px 44px; animation: earTwitch 7s infinite; }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1); } 94%, 96% { transform: scaleY(0.15); } }
@keyframes earTwitch { 0%, 86%, 100% { transform: rotate(0deg); } 90% { transform: rotate(-9deg); } 94% { transform: rotate(3deg); } }

/* ---------------------------------------------------------------- ticker */

.ticker {
  overflow: hidden; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  background: var(--text); color: var(--paper);
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
  padding: 8px 0; position: relative; z-index: 5;
}
.ticker-track { display: inline-flex; align-items: center; gap: 26px; padding-left: 20px; animation: tick 38s linear infinite; }
.ticker-track i { color: var(--banana); font-style: normal; }
@keyframes tick { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- CA bar */

.ca-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--paper-2);
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; position: relative; z-index: 5;
}
.ca-label { color: var(--dim); text-transform: uppercase; letter-spacing: 1.5px; font-size: 11px; }
.ca-value { color: var(--text); word-break: break-all; }
.ca-copy {
  font-family: inherit; font-size: 11.5px; cursor: pointer; color: var(--text);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 10px;
}
.ca-copy:hover { border-color: var(--accent); }
.ca-link { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px;
  padding: 26px 28px; max-width: 1560px; margin: 0 auto;
  position: relative; z-index: 1;
}

/* ---------------------------------------------------------------- stage */

.stage-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px 10px;
}
.piece-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.piece-no {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent);
  border: 1.5px solid rgba(61, 122, 47, 0.35); background: rgba(127, 176, 105, 0.14);
  padding: 3px 10px; border-radius: 999px;
}
.piece-title { font-family: 'Caveat', cursive; font-size: 32px; font-weight: 700; line-height: 1; }
.badge {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 3px 10px; border-radius: 999px;
}
.brain-badge { color: #7b5cd6; background: rgba(123, 92, 214, 0.09); border: 1px solid rgba(123, 92, 214, 0.3); }
.req-badge { color: #3e7d33; background: rgba(123, 178, 106, 0.12); border: 1px solid rgba(123, 178, 106, 0.4); }
.elapsed { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--dim); }

.stage { position: relative; width: 100%; aspect-ratio: 1600 / 1000; background: #f7f2e9; border-block: 1px solid var(--line); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.break-veil {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(23, 37, 16, 0.8);
}
.break-veil.on { display: flex; }
.break-inner { text-align: center; color: #fdf8ee; position: relative; }
.walker { font-size: 44px; animation: walk 2.4s ease-in-out infinite alternate; display: inline-block; margin-bottom: 6px; }
@keyframes walk { 0% { transform: translateX(-46px) scaleX(1); } 49% { transform: translateX(46px) scaleX(1); } 50% { transform: translateX(46px) scaleX(-1); } 100% { transform: translateX(-46px) scaleX(-1); } }
.break-label { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; opacity: .75; }
.break-count { font-family: 'Fraunces', serif; font-size: 58px; font-weight: 700; line-height: 1.1; }

.hud { display: flex; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px;
}
.chip b { font-weight: 500; }
.chip-label { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; }
.tool-icon { font-size: 14px; }
.color-chip { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.18); background: #ccc; display: inline-block; }

/* ---------------------------------------------------------------- stats */

.stats-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); text-align: center;
  transition: transform .18s;
}
.stat:hover { transform: translateY(-2px); }
.stat-n { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 700; color: var(--accent); }
.stat-n .plus { color: var(--dim); font-size: 20px; }
.stat-l { font-size: 12.5px; color: var(--dim); margin-top: 3px; font-family: 'IBM Plex Mono', monospace; }

/* ---------------------------------------------------------------- side */

.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim);
}

.artist-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.artist-ava { width: 58px; height: 58px; border-radius: 16px; flex: none; box-shadow: var(--shadow); }
.artist-info { min-width: 0; }
.artist-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 21px; }
.artist-sub { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.artist-status {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--sage);
  border: 1px solid rgba(123, 178, 106, 0.4); background: rgba(123, 178, 106, 0.1);
  padding: 4px 10px; border-radius: 999px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: pulse 1.8s infinite; }

.chat-src { color: var(--dim); letter-spacing: 0; text-transform: none; }
.chat-src.live { color: var(--sage); }
.chat { height: 250px; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.chat-empty, .gallery-empty { color: var(--dim); font-size: 13px; padding: 14px 6px; line-height: 1.5; }
.chat-msg { font-size: 13.5px; line-height: 1.45; word-wrap: break-word; }
.chat-msg .cu { font-weight: 700; margin-right: 7px; font-size: 12.5px; }
.chat-msg.me { background: rgba(232, 196, 69, 0.2); border-radius: 10px; padding: 5px 9px; }
.chat-msg.me .cu { color: var(--accent); }
.chat-note { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.chat-note a { color: var(--accent); }

.feed { height: 300px; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 7px; }
.feed-item { font-size: 13px; line-height: 1.45; }
.feed-say { }
.feed-say .who { color: var(--accent); font-weight: 700; margin-right: 7px; font-size: 12.5px; }
.feed-sys { color: var(--dim); font-size: 12px; font-family: 'IBM Plex Mono', monospace; }
.feed-event { color: #7b5cd6; font-size: 12.5px; font-family: 'IBM Plex Mono', monospace; }

/* scrollbars */
.chat::-webkit-scrollbar, .feed::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb, .feed::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

/* ---------------------------------------------------------------- gallery */

.gallery-wrap { padding: 30px 28px 10px; max-width: 1560px; margin: 0 auto; position: relative; z-index: 1; }
.gallery-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.gallery-head h2 { font-size: 30px; }
.gallery-sub { color: var(--dim); font-size: 13.5px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }

.g-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 10px 6px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.g-card:nth-child(3n)   { transform: rotate(1.3deg); }
.g-card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.g-card:nth-child(3n+2) { transform: rotate(0.6deg); }
.g-card:hover { transform: rotate(0deg) translateY(-5px) scale(1.02); box-shadow: 0 8px 18px rgba(38,58,26,0.14), 0 22px 44px rgba(38,58,26,0.15); z-index: 2; }
.g-card::before {
  content: ''; position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 78px; height: 22px; background: rgba(232, 196, 69, 0.5); border-radius: 2px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.06);
}
.g-card canvas { width: 100%; display: block; border-radius: 3px; border: 1px solid var(--line); }
.g-info { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 4px; }
.g-title { font-family: 'Caveat', cursive; font-size: 22px; font-weight: 700; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-no { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--dim); flex: none; margin-left: 8px; }

/* ---------------------------------------------------------------- dna */

.dna { text-align: center; padding: 54px 28px 20px; max-width: 1000px; margin: 0 auto; position: relative; z-index: 1; }
.dna h2 { font-size: 32px; }
.dna-sub { color: var(--dim); margin-top: 8px; font-size: 14.5px; }
.dna-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 22px; }
.dna-chips i { color: var(--dim); font-style: normal; font-family: 'IBM Plex Mono', monospace; }
.gene {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: 999px;
  padding: 7px 14px; transition: transform .15s, border-color .15s;
}
.gene:hover { transform: translateY(-2px) rotate(-1deg); border-color: var(--accent); }
.dna-total { margin-top: 22px; font-size: 16px; color: var(--dim); }
.dna-total b { font-family: 'Fraunces', serif; color: var(--accent); font-size: 22px; }

/* ---------------------------------------------------------------- how */

.how { padding: 44px 28px 30px; max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.how h2 { font-size: 30px; text-align: center; margin-bottom: 26px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow); transition: transform .18s;
}
.how-card:hover { transform: translateY(-3px); }
.how-emoji { font-size: 30px; margin-bottom: 10px; }
.how-card h3 { font-family: 'Fraunces', serif; font-size: 17.5px; margin-bottom: 8px; }
.how-card p { color: var(--dim); font-size: 13.5px; line-height: 1.6; }

/* ---------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--line); margin-top: 34px; background: var(--paper-2); position: relative; z-index: 1; }
.foot-inner {
  max-width: 1560px; margin: 0 auto; padding: 20px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--dim);
}
.foot a { color: var(--accent); text-decoration: none; }
.foot-dim { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .stats-band { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 640px) {
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .layout, .gallery-wrap, .how, .dna { padding-left: 16px; padding-right: 16px; }
  .stats-band { grid-template-columns: 1fr; }
  .piece-title { font-size: 26px; }
  .viewers { display: none; }
}


/* ---------------------------------------------------------------- jungle deco */

.vines { position: fixed; top: 0; left: 0; right: 0; height: 0; pointer-events: none; z-index: 24; }
.vine {
  position: absolute; top: 0; width: 5px; border-radius: 0 0 4px 4px;
  background: linear-gradient(#2f5a26, #4e8a3f);
  transform-origin: top center;
  animation: sway 7s ease-in-out infinite alternate;
}
.vine::after {
  content: '🍃'; position: absolute; bottom: -14px; left: -8px; font-size: 18px;
  filter: hue-rotate(-8deg);
}
.vine i {
  position: absolute; left: -7px; font-size: 13px; font-style: normal;
}
@keyframes sway { 0% { transform: rotate(-3.5deg); } 100% { transform: rotate(3.5deg); } }

.corner-leaf { position: fixed; z-index: 0; pointer-events: none; opacity: 0.5; }
.corner-leaf svg { display: block; }
.corner-leaf.tl { top: -30px; left: -40px; transform: rotate(12deg); }
.corner-leaf.br { bottom: -30px; right: -40px; transform: rotate(190deg); }

@media (max-width: 900px) { .vine { display: none; } .corner-leaf { opacity: 0.28; } }
