* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1020;
  font-family: system-ui, -apple-system, sans-serif;
}

#gl, #fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

#gl { z-index: 0; }
#fx { z-index: 1; }

/* The card is a direct child of <canvas layoutsubtree>: it gets layout and
   hit-testing but no native paint. Its transform is synced each frame to the
   matrix returned by drawElementImage() so clicks land where pixels are. */
#card {
  position: absolute;
  top: 0;
  left: 0;
  width: 330px;
  padding: 22px 24px 24px;
  border-radius: 14px;
  border: 1px solid rgba(160, 190, 255, 0.35);
  background: linear-gradient(160deg, rgba(24, 32, 58, 0.92), rgba(13, 18, 36, 0.94));
  color: #dfe7ff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

#card h1 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: 0.3px;
}

#card .sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #93a3c8;
}

#card code {
  font-size: 11.5px;
  color: #9fd0ff;
}

#card label {
  display: block;
  margin: 12px 0 5px;
  font-size: 12px;
  color: #aab8dc;
}

#card input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(160, 190, 255, 0.3);
  background: rgba(8, 12, 26, 0.85);
  color: #eaf1ff;
  font-size: 14px;
  outline: none;
}

#card input[type="text"]:focus {
  border-color: #6ea8ff;
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.2);
}

#card input[type="range"] {
  width: 100%;
  accent-color: #6ea8ff;
}

#card button {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #5b8dff, #3d63d8);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#card button:hover { filter: brightness(1.15); }
#card button:active { transform: translateY(1px); }

/* Fallback host: card is re-parented here when drawElementImage is missing */
#fallback-slot {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#fallback-slot #card { pointer-events: auto; }

#banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 200, 120, 0.4);
  background: rgba(40, 30, 12, 0.9);
  color: #ffd9a0;
  font-size: 12.5px;
}

#banner code { color: #ffeccd; }
