/* AIA SYSTEMS — Retro Platformer */
:root {
  --sky: #5c94fc;
  --sky-2: #6aa3ff;
  --ground: #e2733a;
  --ground-dark: #a8521e;
  --brick: #c84c0c;
  --brick-dark: #6b1c00;
  --coin: #fbd000;
  --coin-dark: #c89000;
  --grass: #4ca80c;
  --grass-dark: #1a7a00;
  --pipe: #00a800;
  --pipe-dark: #006800;
  --question: #f8b800;
  --question-dark: #b87000;
  --cloud: #ffffff;
  --text: #ffffff;
  --text-dark: #202020;
  --shadow: #000000;
}

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

html, body {
  font-family: 'Press Start 2P', monospace;
  background: var(--sky);
  color: var(--text);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

body {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 16 16'><rect x='2' y='2' width='2' height='2' fill='white' stroke='black' stroke-width='0.5'/><rect x='4' y='4' width='2' height='2' fill='white' stroke='black' stroke-width='0.5'/><rect x='6' y='6' width='2' height='2' fill='white' stroke='black' stroke-width='0.5'/></svg>") 4 4, auto;
}

::selection { background: var(--coin); color: var(--text-dark); }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(0,0,0,0.85);
  border-bottom: 4px solid #000;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 1px;
  gap: 16px;
}
.hud__group { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.hud__item { display: flex; flex-direction: column; gap: 4px; }
.hud__label { color: #a0a0a0; font-size: 9px; }
.hud__value { color: var(--text); font-size: 12px; }
.hud__value--coin { color: var(--coin); }
.hud__value--coin::before {
  content: '';
  display: inline-block;
  width: 10px; height: 12px;
  background: var(--coin);
  box-shadow:
    -2px 0 0 var(--coin), 2px 0 0 var(--coin),
    0 -2px 0 var(--coin-dark), 0 2px 0 var(--coin-dark),
    -1px -1px 0 var(--coin-dark), 1px 1px 0 var(--coin-dark);
  margin-right: 6px;
  vertical-align: middle;
  animation: coinSpin 0.8s steps(2) infinite;
}
@keyframes coinSpin {
  0% { transform: scaleX(1); }
  50% { transform: scaleX(0.3); }
}
.hud__nav { display: flex; gap: 12px; flex-wrap: wrap; }
.hud__nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 10px;
  padding: 6px 10px;
  border: 2px solid transparent;
  transition: none;
}
.hud__nav a:hover {
  background: var(--coin);
  color: var(--text-dark);
  border-color: #000;
}

@media (max-width: 760px) {
  .hud__nav { display: none; }
  .hud__group { gap: 14px; }
}

/* ---------- World ---------- */
.world {
  margin-top: 56px;
  position: relative;
  background:
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 100%);
  overflow: hidden;
}

/* Parallax clouds layer */
.clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.cloud {
  position: absolute;
  background: var(--cloud);
  width: 96px; height: 32px;
  border-radius: 32px;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: var(--cloud);
  border-radius: 50%;
}
.cloud::before { width: 40px; height: 40px; top: -20px; left: 16px; }
.cloud::after { width: 32px; height: 32px; top: -16px; left: 56px; }

.hill {
  position: absolute;
  bottom: 100px;
  width: 280px; height: 100px;
  background: var(--grass-dark);
  border-radius: 140px 140px 0 0;
  z-index: 1;
  pointer-events: none;
}
.hill::after {
  content: '';
  position: absolute;
  top: 30px; left: 50px;
  width: 60px; height: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
}
.hill--small {
  width: 180px; height: 70px;
  border-radius: 90px 90px 0 0;
}

.bush {
  position: absolute;
  bottom: 100px;
  width: 96px; height: 32px;
  background: var(--grass);
  border-radius: 24px;
  z-index: 2;
}
.bush::before {
  content: '';
  position: absolute;
  background: var(--grass);
  width: 40px; height: 40px;
  top: -20px; left: 16px;
  border-radius: 50%;
}
.bush::after {
  content: '';
  position: absolute;
  background: var(--grass);
  width: 32px; height: 32px;
  top: -16px; left: 56px;
  border-radius: 50%;
}

/* Ground */
.ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background:
    repeating-linear-gradient(0deg, var(--ground-dark) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(90deg, var(--ground) 0 32px, var(--ground-dark) 32px 34px),
    var(--ground);
  border-top: 4px solid #000;
  z-index: 3;
}
.ground::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 24px;
  background:
    repeating-linear-gradient(90deg, var(--grass) 0 16px, var(--grass-dark) 16px 20px, var(--grass) 20px 32px);
  border-bottom: 4px solid #000;
}

/* ---------- Title screen (Level 1-1) ---------- */
.level-title {
  position: relative;
  height: 100vh;
  min-height: 640px;
  z-index: 2;
}
.title-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  text-align: center;
  z-index: 6;
  width: 100%;
  padding: 0 20px;
}
.title-tag {
  font-size: 12px;
  color: var(--text);
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 24px;
  letter-spacing: 2px;
}
.title-main {
  font-size: clamp(36px, 9vw, 88px);
  color: var(--text);
  text-shadow:
    4px 4px 0 #000,
    8px 8px 0 var(--brick-dark);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: 2px;
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  position: relative;
  z-index: 6;
}
.title-main .accent {
  color: var(--coin);
  text-shadow:
    4px 4px 0 #000,
    8px 8px 0 var(--brick-dark);
}
.title-sub {
  font-size: clamp(11px, 1.6vw, 14px);
  color: var(--text);
  text-shadow: 2px 2px 0 #000;
  margin-top: 24px;
  line-height: 1.8;
  letter-spacing: 1px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.title-press {
  font-size: 11px;
  color: var(--coin);
  text-shadow: 2px 2px 0 #000;
  margin-top: 40px;
  animation: blink 1.2s steps(2) infinite;
  letter-spacing: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.title-castle {
  position: absolute;
  bottom: 100px;
  right: 8%;
  z-index: 3;
}

/* Pixel character — Plumber-esque pixel hero */
.hero-char {
  position: absolute;
  bottom: 100px;
  left: 12%;
  z-index: 4;
  width: 64px;
  height: 96px;
  animation: heroIdle 0.6s steps(2) infinite;
}
@keyframes heroIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes heroJump {
  0% { transform: translateY(0); }
  50% { transform: translateY(-180px); }
  100% { transform: translateY(0); }
}
.hero-char.is-jumping { animation: heroJump 0.7s ease-out; }

/* Walking critter — site-wide fixed-position companion */
.critter {
  position: fixed;
  bottom: 12px;
  left: 0;
  z-index: 90;
  animation: critterWalk 28s linear infinite, critterBob 0.5s steps(2) infinite;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.4));
}
.critter:hover { filter: brightness(1.15) drop-shadow(2px 2px 0 rgba(0,0,0,0.4)); }
@keyframes critterWalk {
  0%   { left: -60px; transform: scaleX(1); }
  48%  { left: calc(100vw - 20px); transform: scaleX(1); }
  50%  { left: calc(100vw - 20px); transform: scaleX(-1); }
  98%  { left: -60px; transform: scaleX(-1); }
  100% { left: -60px; transform: scaleX(1); }
}
@keyframes critterBob {
  0%, 100% { margin-bottom: 0; }
  50%      { margin-bottom: 4px; }
}
.critter.is-stomped {
  animation: critterStomp 0.5s ease-out forwards !important;
}
@keyframes critterStomp {
  0% { transform: scaleY(1); }
  40% { transform: scaleY(0.4); }
  100% { transform: scaleY(0.4) translateY(40px); opacity: 0; }
}

/* ---------- Level zones ---------- */
.level {
  position: relative;
  padding: 100px 0 0;
  min-height: 720px;
  z-index: 2;
}
.level-banner {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-bottom: 60px;
  padding: 0 20px;
}
.level-banner__small {
  font-size: 11px;
  color: var(--coin);
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.level-banner__title {
  font-size: clamp(24px, 5vw, 44px);
  color: var(--text);
  text-shadow: 3px 3px 0 #000, 6px 6px 0 var(--brick-dark);
  letter-spacing: 2px;
}

.level-content {
  position: relative;
  z-index: 4;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 200px;
}

/* ---------- Question Blocks (services) ---------- */
.q-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  position: relative;
}
.q-block {
  position: relative;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.q-block__brick {
  width: 96px;
  height: 96px;
  background: var(--question);
  border: 4px solid #000;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
  text-shadow: 3px 3px 0 #000;
  box-shadow:
    inset -8px -8px 0 var(--question-dark),
    inset 8px 8px 0 #ffd870;
  transition: transform 0.1s;
  user-select: none;
}
.q-block__brick::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid #000;
  pointer-events: none;
}
.q-block__brick:hover { transform: translateY(-2px); }
.q-block.is-hit .q-block__brick {
  background: #888;
  box-shadow: inset -8px -8px 0 #444, inset 8px 8px 0 #aaa;
  animation: blockHit 0.3s ease-out;
}
@keyframes blockHit {
  0% { transform: translateY(0); }
  30% { transform: translateY(-16px); }
  100% { transform: translateY(0); }
}
.q-block__brick::after { content: '?'; }
.q-block.is-hit .q-block__brick::after { content: ''; }

.q-block__panel {
  margin-top: 28px;
  background: #fff;
  color: var(--text-dark);
  border: 4px solid #000;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 6px 6px 0 #000;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  font-family: 'Press Start 2P', monospace;
}
.q-block.is-hit .q-block__panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.q-block__num {
  font-size: 9px;
  color: var(--brick);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.q-block__title {
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 14px;
  line-height: 1.3;
  letter-spacing: 1px;
}
.q-block__desc {
  font-size: 9px;
  color: #404040;
  line-height: 1.7;
  letter-spacing: 0.5px;
  font-family: 'VT323', monospace;
  font-size: 16px;
}
.q-block__hint {
  margin-top: 12px;
  font-size: 8px;
  color: #888;
  letter-spacing: 1px;
}

/* ---------- Coin (counter) ---------- */
.floating-coin {
  display: inline-block;
  width: 16px; height: 18px;
  background: var(--coin);
  box-shadow:
    -3px 0 0 var(--coin), 3px 0 0 var(--coin),
    0 -3px 0 var(--coin-dark), 0 3px 0 var(--coin-dark);
  vertical-align: middle;
}

/* ---------- Bricks (about) ---------- */
.brick-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border: 4px solid #000;
  background: var(--brick);
}
.brick-cell {
  padding: 28px 24px;
  border-right: 4px solid #000;
  border-bottom: 4px solid #000;
  background:
    repeating-linear-gradient(90deg, var(--brick-dark) 0 4px, transparent 4px 60px),
    repeating-linear-gradient(0deg, var(--brick-dark) 0 4px, transparent 4px 30px),
    var(--brick);
  color: var(--text);
  position: relative;
}
.brick-cell:last-child { border-right: 0; }
.brick-cell__n {
  font-size: 9px;
  color: var(--coin);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.brick-cell__title {
  font-size: 13px;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 14px;
  line-height: 1.3;
  letter-spacing: 1px;
}
.brick-cell__body {
  font-family: 'VT323', monospace;
  font-size: 18px;
  line-height: 1.5;
  text-shadow: 1px 1px 0 #000;
}

/* ---------- Pipes (process) ---------- */
.pipes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  align-items: end;
}
.pipe {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pipe__top {
  width: 140px;
  height: 36px;
  background: var(--pipe);
  border: 4px solid #000;
  box-shadow: inset -8px -8px 0 var(--pipe-dark), inset 8px 4px 0 #5cdc5c;
  position: relative;
  z-index: 2;
}
.pipe__body {
  width: 120px;
  background: var(--pipe);
  border: 4px solid #000;
  border-top: 0;
  box-shadow: inset -10px 0 0 var(--pipe-dark), inset 8px 0 0 #5cdc5c;
  padding: 24px 16px;
  text-align: center;
  min-height: 220px;
  width: 100%;
  max-width: 280px;
}
.pipe__num {
  font-size: 10px;
  color: var(--coin);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 14px;
  letter-spacing: 1px;
}
.pipe__title {
  font-size: 12px;
  color: var(--text);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 14px;
  letter-spacing: 1px;
  line-height: 1.3;
}
.pipe__body p {
  font-family: 'VT323', monospace;
  font-size: 17px;
  line-height: 1.4;
  color: #d8ffd8;
  text-shadow: 1px 1px 0 #000;
}

/* ---------- Stats (score panel) ---------- */
.score-panel {
  background: #000;
  border: 4px solid var(--coin);
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  box-shadow: 8px 8px 0 var(--brick-dark);
}
.score-cell { text-align: center; }
.score-cell__k {
  font-size: clamp(22px, 3vw, 36px);
  color: var(--coin);
  text-shadow: 3px 3px 0 var(--brick-dark);
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.score-cell__l {
  font-size: 9px;
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1.4;
}

/* ---------- Contact (flag pole) ---------- */
.endgame {
  position: relative;
  min-height: 600px;
  padding: 80px 0 200px;
}
.flagpole {
  position: absolute;
  right: 12%;
  bottom: 100px;
  width: 8px;
  height: 360px;
  background: #c0c0c0;
  border: 2px solid #000;
  z-index: 4;
}
.flagpole::before {
  content: '';
  position: absolute;
  top: -16px; left: -8px;
  width: 24px; height: 24px;
  background: var(--coin);
  border-radius: 50%;
  border: 2px solid #000;
}
.flag {
  position: absolute;
  left: 8px;
  top: 20px;
  width: 0; height: 0;
  border-left: 60px solid var(--brick);
  border-top: 30px solid transparent;
  border-bottom: 30px solid transparent;
  filter: drop-shadow(2px 2px 0 #000);
  animation: flagWave 1s steps(2) infinite;
}
@keyframes flagWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.contact-card {
  background: #fff;
  color: var(--text-dark);
  border: 4px solid #000;
  padding: 32px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 8px 8px 0 #000;
  position: relative;
  z-index: 5;
}
.contact-card__header {
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.contact-card__sub {
  font-family: 'VT323', monospace;
  font-size: 18px;
  margin-bottom: 24px;
  color: #404040;
}
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form input,
.contact-form textarea {
  font-family: 'VT323', monospace;
  font-size: 18px;
  padding: 12px 14px;
  border: 3px solid #000;
  background: #f0f0f0;
  outline: none;
  resize: none;
  color: var(--text-dark);
}
.contact-form input:focus,
.contact-form textarea:focus { background: #fff; border-color: var(--brick); }
.contact-form label {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dark);
  margin-bottom: -6px;
}
.contact-form button {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 14px 18px;
  background: var(--brick);
  color: #fff;
  border: 3px solid #000;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 4px 4px 0 #000;
  transition: none;
  margin-top: 8px;
}
.contact-form button:hover { background: var(--coin); color: var(--text-dark); }
.contact-form button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.contact-form .sent {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--grass-dark);
  letter-spacing: 1px;
  display: none;
  margin-top: 8px;
}
.contact-form.is-sent .sent { display: block; }
.contact-card__email {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 3px dashed #000;
  font-family: 'VT323', monospace;
  font-size: 18px;
  text-align: center;
}
.contact-card__email a { color: var(--brick); }

/* ---------- Footer ---------- */
.site-footer {
  background: #000;
  border-top: 4px solid var(--brick);
  padding: 24px 20px;
  text-align: center;
  font-size: 10px;
  color: var(--text);
  letter-spacing: 1px;
  position: relative;
  z-index: 10;
}
.site-footer .heart { color: var(--brick); }

/* ---------- Coin pickups (decorative inline) ---------- */
.coin-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0 60px;
}
.coin-pickup {
  width: 24px; height: 28px;
  background: var(--coin);
  box-shadow:
    -4px 0 0 var(--coin), 4px 0 0 var(--coin),
    0 -4px 0 var(--coin-dark), 0 4px 0 var(--coin-dark);
  animation: coinSpin 0.8s steps(2) infinite;
}

/* ---------- Section header banner ---------- */
.banner-blocks {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 24px;
}
.banner-blocks span {
  width: 24px; height: 24px;
  background: var(--brick);
  border: 2px solid #000;
  box-shadow: inset -4px -4px 0 var(--brick-dark);
}

/* ---------- Power-up callout ---------- */
.power-up {
  background: #000;
  border: 4px solid var(--coin);
  padding: 28px 32px;
  margin: 60px auto;
  max-width: 760px;
  text-align: center;
  position: relative;
  box-shadow: 6px 6px 0 var(--brick-dark);
}
.power-up__pre {
  font-size: 9px;
  color: var(--coin);
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.power-up__msg {
  font-size: clamp(13px, 1.8vw, 18px);
  color: var(--text);
  text-shadow: 2px 2px 0 #000;
  line-height: 1.6;
  letter-spacing: 1px;
}

/* ---------- Pixel TV (bottom-right talking head) ---------- */
.pixel-tv {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 95;
  width: 220px;
  font-family: 'Press Start 2P', monospace;
  user-select: none;
}
.pixel-tv__set {
  background: #2a2a2a;
  border: 4px solid #000;
  border-radius: 6px 6px 14px 14px;
  padding: 8px 10px 14px;
  box-shadow: 4px 4px 0 #000, inset -3px -3px 0 #1a1a1a, inset 3px 3px 0 #4a4a4a;
  position: relative;
}
.pixel-tv__antenna {
  position: absolute;
  top: -22px; left: 50%;
  width: 60px;
  height: 22px;
  transform: translateX(-50%);
}
.pixel-tv__antenna::before, .pixel-tv__antenna::after {
  content: '';
  position: absolute;
  top: 0;
  width: 3px; height: 22px;
  background: #000;
  transform-origin: bottom;
}
.pixel-tv__antenna::before { left: 14px; transform: rotate(-25deg); }
.pixel-tv__antenna::after { right: 14px; transform: rotate(25deg); }

.pixel-tv__screen {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #5c94fc;
  border: 3px solid #000;
  position: relative;
  overflow: hidden;
  image-rendering: pixelated;
}
.pixel-tv__screen::after {
  /* scanlines */
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.pixel-tv__screen.is-static { background: #888; }
.pixel-tv__screen.is-static::before {
  content: 'NO SIGNAL';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  z-index: 2;
}

.pixel-tv__face {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.pixel-tv__base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 0;
  font-size: 7px;
  color: #aaa;
  letter-spacing: 1px;
}
.pixel-tv__led {
  width: 6px; height: 6px;
  background: #ff3030;
  border: 1px solid #000;
  border-radius: 50%;
  box-shadow: 0 0 4px #ff3030;
  animation: tvLed 1.2s steps(2) infinite;
}
@keyframes tvLed { 50% { opacity: 0.3; } }

/* Thought bubble */
.pixel-tv__bubble {
  position: relative;
  margin-bottom: 10px;
  background: #fff;
  border: 3px solid #000;
  padding: 10px 12px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  line-height: 1.2;
  color: #202020;
  min-height: 56px;
  box-shadow: 3px 3px 0 #000;
}
.pixel-tv__bubble::before, .pixel-tv__bubble::after {
  content: '';
  position: absolute;
  background: #fff;
  border: 3px solid #000;
  border-radius: 50%;
}
.pixel-tv__bubble::before {
  width: 16px; height: 16px;
  bottom: -18px; right: 28px;
}
.pixel-tv__bubble::after {
  width: 8px; height: 8px;
  bottom: -28px; right: 22px;
}
.pixel-tv__caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: #202020;
  vertical-align: middle;
  animation: tvBlink 0.6s steps(2) infinite;
  margin-left: 2px;
}
@keyframes tvBlink { 50% { opacity: 0; } }

@media (max-width: 600px) {
  .pixel-tv { width: 170px; right: 8px; bottom: 8px; }
  .pixel-tv__bubble { font-size: 14px; min-height: 48px; }
}
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s; }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   Chatbot TV extensions
   ═══════════════════════════════════════════════════════════════ */

/* Expand TV width for chat */
.pixel-tv { width: 280px; }

/* ── Chat log ───────────────────────────────────────────────── */
.pixel-tv__chat {
  background: #0e0e0e;
  border: 3px solid #000;
  border-bottom: none;
  padding: 6px;
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--brick) #222;
}
.pixel-tv__chat::-webkit-scrollbar { width: 4px; }
.pixel-tv__chat::-webkit-scrollbar-track { background: #222; }
.pixel-tv__chat::-webkit-scrollbar-thumb { background: var(--brick); }

/* ── Message bubbles ────────────────────────────────────────── */
.tv-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tv-msg--user  { align-items: flex-end; }
.tv-msg--ai,
.tv-msg--welcome { align-items: flex-start; }

.tv-msg__role {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #666;
  letter-spacing: 1px;
}
.tv-msg__text {
  font-family: 'VT323', monospace;
  font-size: 15px;
  line-height: 1.3;
  padding: 5px 7px;
  border: 2px solid #000;
  max-width: 96%;
  word-break: break-word;
  white-space: pre-wrap;
}
.tv-msg--user    .tv-msg__text { background: var(--coin);  color: var(--text-dark); }
.tv-msg--ai      .tv-msg__text { background: #fff;         color: var(--text-dark); }
.tv-msg--welcome .tv-msg__text {
  background: #0e1e0e;
  color: #6ddb6d;
  border-color: var(--grass-dark);
  font-size: 13px;
}
.tv-msg__hint {
  font-family: 'VT323', monospace;
  font-size: 12px;
  color: #4a8a4a;
  margin-top: 3px;
  padding: 0 2px;
  font-style: italic;
}

/* Thinking dots */
.tv-msg__dots span {
  display: inline-block;
  animation: dotBounce 0.7s steps(2) infinite;
}
.tv-msg__dots span:nth-child(2) { animation-delay: 0.18s; }
.tv-msg__dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotBounce {
  0%, 100% { transform: translateY(0);    opacity: 1;   }
  50%       { transform: translateY(-4px); opacity: 0.3; }
}

/* ── Input area ─────────────────────────────────────────────── */
.pixel-tv__input-area {
  background: #181818;
  border: 3px solid #000;
  border-top: none;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pixel-tv__input-row {
  display: flex;
  gap: 3px;
}
.pixel-tv__input {
  flex: 1;
  min-width: 0;
  font-family: 'VT323', monospace;
  font-size: 16px;
  padding: 4px 6px;
  background: #272727;
  color: #fff;
  border: 2px solid #555;
  outline: none;
}
.pixel-tv__input:focus { border-color: var(--coin); }
.pixel-tv__input::placeholder { color: #555; font-size: 12px; }

.pixel-tv__btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 4px 5px;
  background: #303030;
  color: #aaa;
  border: 2px solid #555;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0;
}
.pixel-tv__btn:hover { background: #484848; color: #fff; }
.pixel-tv__btn--send {
  background: var(--brick);
  color: #fff;
  border-color: #000;
}
.pixel-tv__btn--send:hover { background: var(--coin); color: var(--text-dark); }
.pixel-tv__btn.is-active {
  background: var(--grass);
  color: #fff;
  border-color: #000;
  animation: blink 0.5s steps(2) infinite;
}
.pixel-tv__btn:disabled { opacity: 0.35; cursor: not-allowed; }

.pixel-tv__controls {
  display: flex;
  gap: 4px;
}
.pixel-tv__ctrl {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  padding: 3px 5px;
  background: #202020;
  color: #777;
  border: 2px solid #444;
  cursor: pointer;
  flex: 1;
  letter-spacing: 0;
  text-align: center;
}
.pixel-tv__ctrl:hover { background: #303030; color: #bbb; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pixel-tv { width: 210px; right: 6px; bottom: 6px; }
  .pixel-tv__chat { max-height: 140px; }
  .pixel-tv__input { font-size: 14px; }
  .tv-msg__text { font-size: 13px; }
}
