@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/press-start-2p-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Silkscreen";
  src: url("fonts/silkscreen-latin-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Silkscreen";
  src: url("fonts/silkscreen-latin-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: block;
}

:root {
  --ink: #1a0d16;
  --plum: #2a1522;
  --goo: #cdebff;
  --goo2: #7fc4f0;
  --gooline: #0b4fc4;
  --tape: #f5c542;
  --cream: #f3d9b0;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #1c0f18;
}

body {
  color: var(--cream);
  font-family: "Silkscreen", monospace;
  user-select: none;
  -webkit-font-smoothing: none;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#bgClip {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#bg {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  pointer-events: none;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1376px;
  height: 768px;
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 2;
}

#shake {
  position: absolute;
  inset: 0;
  width: 1376px;
  height: 768px;
}

#stageGroup {
  position: absolute;
  inset: 0;
  width: 1376px;
  height: 768px;
  transform-origin: 688px 737px;
  will-change: transform;
}

.layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 1376px;
  height: 768px;
  image-rendering: pixelated;
  pointer-events: none;
}

#mic { z-index: 1; }
#llamaIdle, #llamaSpit { z-index: 2; }
#llamaSpit { visibility: hidden; }
#llamaIdle { animation: idleBob 1.2s steps(2, end) infinite; }

.spitting #llamaSpit {
  visibility: visible;
  transform: translateY(-4px);
}
.spitting #llamaIdle { visibility: hidden; }

@keyframes idleBob {
  0%, 49% { transform: translateY(0); }
  50%, 100% { transform: translateY(-2px); }
}

#gob {
  position: absolute;
  left: 722px;
  top: 268px;
  width: 70px;
  transform: translate(-50%, -50%);
  z-index: 9;
  pointer-events: none;
}
#gob img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  transform-origin: 50% 50%;
}

#splat {
  position: absolute;
  left: 390px;
  top: 320px;
  width: 520px;
  transform: translate(-50%, -50%);
  z-index: 8;
  pointer-events: none;
}
#splatImg {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  transform-origin: 50% 50%;
}

#splatWord {
  position: absolute;
  left: 360px;
  top: 250px;
  z-index: 9;
  color: var(--goo);
  font-family: "Press Start 2P", monospace;
  font-size: 50px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-8deg);
  text-shadow:
    4px 0 0 var(--gooline),
    -4px 0 0 var(--gooline),
    0 4px 0 var(--gooline),
    0 -4px 0 var(--gooline),
    4px 4px 0 var(--gooline),
    -4px 4px 0 var(--gooline),
    4px -4px 0 var(--gooline),
    -4px -4px 0 var(--gooline),
    8px 8px 0 var(--ink);
}

#ptooWord {
  position: absolute;
  left: 640px;
  top: 230px;
  z-index: 9;
  color: var(--goo);
  font-family: "Press Start 2P", monospace;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-4deg);
  text-shadow:
    3px 0 0 var(--gooline),
    -3px 0 0 var(--gooline),
    0 3px 0 var(--gooline),
    0 -3px 0 var(--gooline),
    3px 3px 0 var(--gooline),
    -3px 3px 0 var(--gooline),
    3px -3px 0 var(--gooline),
    -3px -3px 0 var(--gooline),
    5px 5px 0 var(--ink);
}

#spit {
  position: absolute;
  left: 1000px;
  top: 282px;
  width: 310px;
  height: 96px;
  z-index: 12;
  padding: 0;
  border: 4px solid var(--gooline);
  border-radius: 0;
  background: var(--goo);
  color: var(--ink);
  font-family: "Press Start 2P", monospace;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    inset 0 6px 0 #fff,
    inset 0 -8px 0 var(--goo2),
    8px 8px 0 var(--ink);
  image-rendering: pixelated;
  transition: transform 90ms steps(2, end), opacity 120ms linear, filter 120ms linear;
}
#spit:hover:not(:disabled) { transform: translateY(-2px); }
#spit:active:not(:disabled) { transform: translateY(4px); }
#spit:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 5px;
}
#spit:disabled {
  cursor: default;
  opacity: .62;
  filter: saturate(.72);
}
#spit.is-busy { pointer-events: none; }

#status {
  position: absolute;
  left: 1000px;
  top: 402px;
  width: 310px;
  z-index: 12;
  padding: 12px 14px;
  border: 4px solid #2b160c;
  background: #5a3320;
  color: var(--cream);
  box-shadow:
    inset 0 4px 0 #7a4a2e,
    6px 6px 0 var(--ink);
  pointer-events: none;
}
.status-line {
  font-size: 16px;
  line-height: 1.35;
  white-space: nowrap;
}
.status-bar {
  min-height: 1.35em;
  margin-top: 8px;
  color: var(--goo);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}
.status-count {
  margin-top: 8px;
  opacity: .85;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

#bars {
  position: absolute;
  left: 70px;
  top: 440px;
  width: 360px;
  z-index: 10;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
#bars.is-ready { pointer-events: auto; }

.bar {
  position: relative;
  display: block;
  width: 360px;
  height: 82px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #0b2f73;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: 50% 50%;
  transition: transform 90ms steps(2, end), opacity 120ms linear, filter 120ms linear;
}
.bar:hover:not(.is-disabled) { transform: translateY(-2px); }
.bar:active:not(.is-disabled) { transform: translateY(2px); }
.bar:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}
.bar.is-disabled {
  cursor: default;
  opacity: .52;
  filter: saturate(.35);
  pointer-events: none;
}
.bar-skin {
  position: absolute;
  inset: 0;
  background: url("assets/FX_bar.png") 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
  transform-origin: left center;
}
.bar-label {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  z-index: 1;
  font-family: "Press Start 2P", monospace;
  font-size: 20px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

#brand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  pointer-events: none;
  transform-origin: top left;
  white-space: nowrap;
}
.brand-k {
  margin: 0;
  color: var(--cream);
  font-family: "Press Start 2P", monospace;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 var(--ink);
}
.brand-l {
  margin-top: 10px;
  color: var(--goo);
  font-family: "Press Start 2P", monospace;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow:
    3px 0 0 var(--gooline),
    -3px 0 0 var(--gooline),
    0 3px 0 var(--gooline),
    0 -3px 0 var(--gooline),
    3px 3px 0 var(--gooline),
    -3px 3px 0 var(--gooline),
    3px -3px 0 var(--gooline),
    -3px -3px 0 var(--gooline),
    6px 6px 0 var(--ink);
}
.brand-chip {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 10px;
  background: var(--tape);
  color: var(--ink);
  font-family: "Press Start 2P", monospace;
  font-size: 15px;
  line-height: 1.1;
  box-shadow: 4px 4px 0 var(--ink);
}

#hdr {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: stretch;
  gap: 10px;
  transform-origin: top right;
  white-space: nowrap;
}
.hdr-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 3px solid var(--cream);
  background: rgba(26, 13, 22, .82);
  color: var(--cream);
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}
.hdr-item:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}
.hdr-item.is-disabled {
  opacity: .6;
  cursor: default;
  pointer-events: none;
}
.hdr-ca {
  min-width: 232px;
  gap: 10px;
  padding-right: 9px;
}
.hdr-ca.is-disabled { min-width: 0; }
.hdr-ca #headerCAText {
  display: inline-block;
  min-width: 1px;
}
.hdr-sub {
  display: inline-block;
  padding: 3px 5px;
  background: var(--cream);
  color: var(--ink);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1;
}
.hdr-snd { min-width: 86px; }

@media (prefers-reduced-motion: reduce) {
  #llamaIdle { animation: none; }
  #stageGroup { animation: none !important; }
  .bar, #spit { transition: none; }
}
