@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Grotesk:wght@400;600&display=swap");

:root {
  --bg: #050711;
  --bg-panel: #0d1020;
  --bg-panel-soft: #13162b;
  --accent: #ff5f1f;
  --accent-soft: #ff9b4a;
  --accent-alt: #14f3ff;
  --text-main: #f5f5ff;
  --text-muted: #a4a7c4;
  --error: #ff3366;
  --good: #32ff8b;
  --border-soft: #26293f;

  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-strong: 0 0 40px rgba(0, 0, 0, 0.8);
  --shadow-soft: 0 0 20px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #141630 0, #050711 55%, #000 100%);
  color: var(--text-main);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page {
  width: 100%;
  max-width: 1200px;
  margin: 10px;
  padding: 10px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* HEADER */

.title-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #161931, #0a0c18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  text-transform: uppercase;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.title-left {
  color: var(--accent-soft);
}

.title-center {
  text-align: center;
  color: var(--text-main);
}

.title-right {
  text-align: right;
  color: var(--accent-alt);
}

/* LAYOUT */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .screen {
    order: -1;
  }
}

/* SCREEN */

.screen {
  background: radial-gradient(circle at top, #262a50 0, #0b0c16 60%);
  border-radius: var(--radius-lg);
  padding: 12px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid rgba(20, 243, 255, 0.4);
  box-shadow: 0 0 25px rgba(20, 243, 255, 0.3);
  background: #000;
  aspect-ratio: 16 / 9;
}

/* Scanlines */

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0,
    rgba(0, 0, 0, 0.15) 2px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
  opacity: 0.5;
}

#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) contrast(1.1);
}

/* Subtitles */

.subtitles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4%;
  padding: 10px 18px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.35),
    transparent
  );
  display: flex;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.subtitle-line {
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  color: var(--accent-alt);
  text-shadow:
    0 0 6px rgba(20, 243, 255, 0.6),
    0 0 18px rgba(0, 0, 0, 0.9);
}

.subtitle-cursor {
  display: inline-block;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
  color: var(--accent-alt);
  animation: cursor-blink 1s steps(1, end) infinite;
}

@keyframes cursor-blink {
  0%,
  50% {
    opacity: 1;
  }
  50.1%,
  100% {
    opacity: 0;
  }
}

/* Status bar */

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  align-items: center;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 8px 10px 0;
  color: var(--text-muted);
}

.status-bar span {
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(2, 4, 12, 0.7);
  border: 1px solid rgba(153, 160, 214, 0.3);
}

/* SIDE PANEL */

.side-panel {
  background: linear-gradient(145deg, #101326, #050712);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-block {
  background: radial-gradient(circle at top left, #262b5a 0, #13162b 45%, #050712 100%);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  position: relative;
}

.panel-block h2 {
  margin: 0 0 8px;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-soft);
}

/* Buttons */

.button {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 999px;
  border: none;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.1s ease,
    opacity 0.1s ease;
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}

.button.primary {
  background: radial-gradient(circle at top, #ff9b4a 0, #ff5f1f 40%, #ff2f1f 100%);
  color: #120400;
  box-shadow:
    0 0 25px rgba(255, 95, 31, 0.7),
    0 0 2px rgba(0, 0, 0, 0.8);
}

.button.secondary {
  background: radial-gradient(circle at top, #1c2d46 0, #111a2b 60%, #060913 100%);
  color: var(--accent-alt);
  box-shadow:
    0 0 16px rgba(20, 243, 255, 0.35),
    0 0 2px rgba(0, 0, 0, 0.8);
}

.button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.9);
}

/* Form / select */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.field span {
  color: var(--text-muted);
}

select {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 10, 20, 0.9);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
}

/* Stats */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.stat {
  background: rgba(5, 7, 18, 0.9);
  border-radius: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(155, 160, 219, 0.25);
}

.stat-label {
  display: block;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 13px;
  color: var(--good);
}

/* Hint */

.hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* Log */

.log-block {
  max-height: 260px;
  overflow: hidden;
}

.log {
  max-height: 190px;
  overflow-y: auto;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 11px;
  padding-right: 4px;
}

.log-entry {
  padding: 3px 4px;
  margin-bottom: 2px;
  border-left: 2px solid rgba(255, 95, 31, 0.7);
  background: rgba(5, 7, 18, 0.8);
}

.log-entry span {
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 6px;
}

/* FOOTER */

.footer {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px;
}
