:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  font: 16px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* Entrance: types "$ ssh liam.gl", flashes, then gives way to the frame */
.entrance {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #7dd3fc;
  font-size: 1.5rem;
  z-index: 20;
}

.entrance.hidden {
  display: none;
}

.entrance.flash {
  animation: entrance-flash 0.3s ease;
}

@keyframes entrance-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.15em;
  background: #7dd3fc;
  vertical-align: middle;
  animation: cursor-blink 1s steps(1) infinite;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* The terminal frame: full viewport, no chrome */
.frame {
  position: fixed;
  inset: 0;
  background: #000;
}

.frame.hidden {
  display: none;
}

.terminal {
  position: absolute;
  inset: 0;
}

/* xterm reserves a scrollbar gutter by default; the TUI scrolls itself */
.terminal .xterm-viewport {
  overflow-y: hidden !important;
}

.disconnected {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.55);
}

.disconnected.hidden {
  display: none;
}

.wifi-off {
  margin: 0;
  color: #ef4444;
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
  white-space: pre;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.35));
  animation: wifi-pulse 2s ease-in-out infinite;
}

@media (min-width: 640px) {
  .wifi-off { font-size: 14px; }
}

@keyframes wifi-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.status {
  position: fixed;
  bottom: 0.75em;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: rgba(224, 242, 254, 0.7);
  font-size: 0.85rem;
  pointer-events: none;
}

.keyboard-btn {
  position: fixed;
  bottom: 0.75em;
  right: 0.75em;
  z-index: 10;
  padding: 0.5em;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
}

.keyboard-btn.hidden {
  display: none;
}

.keyboard-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}
