:root {
  --fg: #33ff5b;
  --bg: #050a05;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 8px) 8px env(safe-area-inset-bottom, 8px) 8px;
}

/* CRT bezel */
#bezel {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1100px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 40%, #141414, #050505 70%);
  border: 2px solid #1a1a1a;
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.9),
    0 0 0 8px #0c0c0c,
    0 0 0 10px #191919,
    0 30px 80px rgba(0,0,0,0.8),
    0 0 40px var(--fg);
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  cursor: text;
  /* subtle screen curvature illusion */
  filter: saturate(1.15) contrast(1.05);
}

/* screen breathing glow */
#bezel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 18px;
  box-shadow: inset 0 0 120px rgba(0,0,0,0.6);
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 0.9; }
  48% { opacity: 0.95; }
  50% { opacity: 0.8; }
  52% { opacity: 0.95; }
}

/* hidden input for mobile keyboard */
#hidden-input {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 2px;
  height: 2px;
  opacity: 0.01;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  outline: none;
  font-size: 16px; /* prevents iOS zoom */
}

/* controls */
#controls {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 10;
}
#controls button {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fg);
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--fg);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  text-shadow: 0 0 6px var(--fg);
  transition: background 0.15s, transform 0.1s;
}
#controls button:hover { background: rgba(51,255,91,0.15); }
#controls button:active { transform: scale(0.94); }

@media (max-width: 480px) {
  body { padding: 4px; }
  #bezel { border-radius: 14px; }
  #controls { top: 8px; right: 8px; }
  #controls button { font-size: 10px; padding: 5px 7px; }
}
</parameter>