:root {
  --spartan-green: #006b3f;
  --spartan-green-bright: #00a86b;
  --spartan-green-dark: #002f21;
  --spartan-gold: #d9b44a;
  --ink: #f4fff9;
  --muted: #a9c7ba;
  --panel: rgba(7, 25, 19, 0.78);
  --panel-border: rgba(154, 255, 210, 0.18);
  --key: rgba(255, 255, 255, 0.07);
  --key-border: rgba(255, 255, 255, 0.16);
  --tested-key: rgba(255, 255, 255, 0.92);
  --tested-ink: #063324;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(0, 168, 107, 0.32), transparent 36rem),
    linear-gradient(135deg, #04110d 0%, #071d15 48%, #00190f 100%);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(35px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-one {
  width: 24rem;
  height: 24rem;
  background: var(--spartan-green-bright);
  top: -8rem;
  right: 4rem;
}

.bg-glow-two {
  width: 20rem;
  height: 20rem;
  background: var(--spartan-gold);
  bottom: -10rem;
  left: 5rem;
  opacity: 0.18;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  color: var(--spartan-gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.gateway-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(0, 255, 160, 0.62);
  border-radius: 999px;
  padding: 8px 13px;
  background:
    linear-gradient(135deg, rgba(0, 168, 107, 0.20), rgba(0, 47, 33, 0.42)),
    rgba(255, 255, 255, 0.045);
  box-shadow:
    0 0 0 1px rgba(0, 255, 160, 0.10),
    0 0 24px rgba(0, 168, 107, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: color 160ms ease, text-shadow 160ms ease, transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.gateway-link::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--spartan-green-bright);
  box-shadow: 0 0 12px rgba(0, 255, 160, 0.9);
}

.gateway-link:hover {
  color: #ffe27a;
  border-color: rgba(217, 180, 74, 0.75);
  background:
    linear-gradient(135deg, rgba(217, 180, 74, 0.18), rgba(0, 168, 107, 0.32)),
    rgba(255, 255, 255, 0.065);
  box-shadow:
    0 0 0 1px rgba(217, 180, 74, 0.12),
    0 0 28px rgba(217, 180, 74, 0.30),
    0 0 34px rgba(0, 168, 107, 0.24);
  text-shadow: 0 0 18px rgba(217, 180, 74, 0.55);
  transform: translateY(-1px);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.status-card,
.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
  padding: 16px 18px;
  border-radius: 22px;
}

.status-card small,
.metric-card span,
.panel p,
.diagnostics span {
  color: var(--muted);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--spartan-gold);
  box-shadow: 0 0 0 6px rgba(217, 180, 74, 0.13);
}

.status-dot.active {
  background: var(--spartan-green-bright);
  box-shadow: 0 0 0 6px rgba(0, 168, 107, 0.18), 0 0 28px rgba(0, 168, 107, 0.8);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 18px;
  border-radius: 24px;
}

.metric-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  min-height: 1.18em;
  overflow: hidden;
  font-size: clamp(1.25rem, 2.1vw, 2rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  padding: 22px;
  border-radius: 28px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-bottom: 14px;
}

.panel-header p {
  margin-bottom: 0;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

#resetBtn {
  color: var(--ink);
  cursor: pointer;
  border: 1px solid rgba(217, 180, 74, 0.4);
  border-radius: 999px;
  padding: 11px 16px;
  background: linear-gradient(135deg, rgba(217, 180, 74, 0.22), rgba(0, 107, 63, 0.28));
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

#resetBtn:hover {
  border-color: var(--spartan-gold);
  transform: translateY(-1px);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.92rem;
  font-weight: 700;
}

.sound-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.32);
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.sound-toggle input:checked + .toggle-track {
  border-color: rgba(0, 255, 160, 0.55);
  background: rgba(0, 168, 107, 0.38);
}

.sound-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: var(--spartan-green-bright);
}

.sound-note {
  display: none;
}

.keyboard-typing-area {
  margin: 0 0 18px;
}

.keyboard-typing-area textarea {
  min-height: 86px;
}

.keyboard-scroll {
  overflow-x: auto;
  padding: 2px 2px 10px;
}

.keyboard {
  display: grid;
  gap: 12px;
  min-width: 1320px;
  user-select: none;
}

.keyboard-section {
  display: grid;
  gap: 8px;
}

.function-row,
.key-row {
  display: flex;
  gap: 8px;
}

.keyboard-body {
  display: grid;
  grid-template-columns: 14fr 3fr 4fr;
  gap: 14px;
  align-items: start;
}

.key-gap {
  width: 20px;
  flex: 0 0 20px;
}

.key {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  flex: 1 1 0;
  color: var(--ink);
  cursor: default;
  border: 1px solid var(--key-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    var(--key);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.18);
  line-height: 1.05;
  text-align: center;
  transition:
    transform 90ms ease,
    border-color 90ms ease,
    background 90ms ease,
    box-shadow 90ms ease,
    color 90ms ease;
}

.key small {
  color: currentColor;
  font-size: 0.62rem;
  opacity: 0.72;
}

.key::after {
  content: attr(data-count);
  position: absolute;
  right: 8px;
  bottom: 5px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.65rem;
}

.key.tested {
  color: var(--tested-ink);
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(219, 255, 238, 0.88)),
    var(--tested-key);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 22px rgba(255, 255, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.key.tested::after {
  color: rgba(0, 47, 33, 0.58);
}

.key.pressed {
  color: #ffffff;
  border-color: rgba(0, 255, 160, 0.9);
  background:
    radial-gradient(circle at top, rgba(0, 255, 160, 0.42), transparent 70%),
    linear-gradient(180deg, rgba(0, 168, 107, 0.96), rgba(0, 79, 47, 0.98));
  box-shadow:
    0 0 0 1px rgba(0, 255, 160, 0.28),
    0 0 26px rgba(0, 168, 107, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(2px) scale(0.985);
}

.key.hit {
  animation: keyPulse 260ms ease;
}

.key-wide {
  flex: 2.2;
}

.key-tab {
  flex: 1.5;
}

.key-caps {
  flex: 1.85;
}

.key-enter {
  flex: 2.25;
}

.key-shift {
  flex: 2.6;
}

.key-mod {
  flex: 1.25;
}

.key-space {
  flex: 6;
}

.nav-grid,
.arrow-grid,
.numpad-grid {
  display: grid;
  gap: 8px;
}

.nav-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 68px;
}

.arrow-grid {
  grid-template-columns: repeat(3, 1fr);
}

.numpad-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 52px;
}

.numpad-grid .key {
  min-width: 58px;
  min-height: 52px;
}

.key-tall {
  grid-row: span 2;
}

.key-zero {
  grid-column: span 2;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.pill {
  color: var(--spartan-gold);
  border: 1px solid rgba(217, 180, 74, 0.32);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(217, 180, 74, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.history {
  display: grid;
  align-content: start;
  max-height: 275px;
  overflow: auto;
  gap: 8px;
  padding-right: 4px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.history-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty {
  color: var(--muted);
  padding: 12px;
}

.diagnostics {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.diagnostics div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.diagnostics span,
.diagnostics strong {
  display: block;
}

.diagnostics strong {
  margin-top: 5px;
  word-break: break-word;
}

.test-input-label {
  display: block;
  color: var(--spartan-gold);
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  outline: none;
  padding: 14px;
  background: rgba(0, 0, 0, 0.22);
}

textarea:focus {
  border-color: rgba(0, 255, 160, 0.58);
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.14);
}

@keyframes keyPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@media (max-width: 1120px) {
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard {
    grid-template-columns: repeat(3, 1fr);
  }

  .lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1500px);
    padding: 24px 0;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    justify-content: flex-start;
  }

  .status-card {
    min-width: 0;
  }
}

.site-nav {
  display: flex;
  gap: 10px;
  margin: -6px 0 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink);
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.055);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  border-color: rgba(0, 255, 160, 0.55);
  background: rgba(0, 168, 107, 0.28);
  transform: translateY(-1px);
}

.media-dashboard {
  grid-template-columns: repeat(4, 1fr);
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.device-panel {
  min-height: 100%;
}

.permission-note-panel {
  margin-top: 16px;
}

.permission-note-panel p {
  margin-bottom: 0;
}

.device-select {
  width: 100%;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  outline: none;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.28);
  margin-bottom: 16px;
}

.device-select option {
  color: #06140f;
}

.left-controls {
  justify-content: flex-start;
  margin-top: 16px;
}

.utility-btn {
  color: var(--ink);
  cursor: pointer;
  border: 1px solid rgba(217, 180, 74, 0.4);
  border-radius: 999px;
  padding: 11px 16px;
  background: linear-gradient(135deg, rgba(217, 180, 74, 0.22), rgba(0, 107, 63, 0.28));
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.utility-btn:hover {
  border-color: var(--spartan-gold);
  transform: translateY(-1px);
}

.utility-btn.secondary {
  border-color: rgba(154, 255, 210, 0.18);
  background: rgba(255, 255, 255, 0.055);
}

.level-wrap {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.level-bar {
  height: 28px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#micLevelBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 168, 107, 0.9), rgba(217, 180, 74, 0.95));
  transition: width 80ms linear;
}

.level-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 8px;
}

.video-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at center, rgba(0, 168, 107, 0.16), transparent 65%),
    rgba(0, 0, 0, 0.32);
}

.video-frame video {
  display: none;
  width: 100%;
  max-height: 480px;
  background: #000;
}

.video-frame video.active {
  display: block;
}

.video-frame video.mirrored {
  transform: scaleX(-1);
}

.video-placeholder {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.mouse-pad,
.cps-click-zone {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--ink);
  border: 1px solid rgba(0, 255, 160, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at center, rgba(0, 168, 107, 0.24), transparent 70%),
    rgba(255, 255, 255, 0.045);
  text-align: center;
  cursor: crosshair;
  user-select: none;
}

.mouse-pad strong,
.cps-click-zone strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.mouse-pad span,
.cps-click-zone span {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.mouse-pad.active,
.cps-click-zone.active {
  border-color: rgba(0, 255, 160, 0.9);
  box-shadow: 0 0 32px rgba(0, 168, 107, 0.34);
}

.mouse-button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-top: 16px;
}

.mouse-button-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.mouse-button-card span,
.mouse-button-card strong {
  display: block;
}

.mouse-button-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mouse-button-card strong {
  margin-top: 6px;
  font-size: 1.45rem;
}

.mouse-button-card.active {
  color: var(--tested-ink);
  border-color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(219, 255, 238, 0.88));
}

.mouse-button-card.active span {
  color: rgba(0, 47, 33, 0.7);
}

.cps-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 16px;
}

.cps-start-btn {
  width: 100%;
  margin-bottom: 16px;
}

.cps-click-zone {
  min-height: 260px;
  cursor: pointer;
}

@media (max-width: 980px) {
  .device-grid,
  .media-dashboard {
    grid-template-columns: 1fr;
  }

  .mouse-button-grid,
  .cps-dashboard {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .mouse-button-grid,
  .cps-dashboard {
    grid-template-columns: 1fr;
  }
}

.playback-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.playback-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.playback-box strong {
  display: block;
  margin-top: 5px;
}

.playback-box audio {
  width: 100%;
}

.playback-box-prominent {
  margin-top: 18px;
  border-color: rgba(217, 180, 74, 0.34);
  background:
    radial-gradient(circle at top left, rgba(217, 180, 74, 0.10), transparent 45%),
    rgba(255, 255, 255, 0.055);
}

.playback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.playback-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.playback-download.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.playback-speed-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 14px;
  padding: 14px;
  border: 1px solid rgba(154, 255, 210, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.playback-speed-control label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.playback-speed-control input[type="range"] {
  width: 100%;
  accent-color: var(--spartan-green-bright);
}

.playback-speed-control strong {
  min-width: 58px;
  text-align: right;
  color: var(--spartan-gold);
}

.video-playback-box {
  margin-top: 18px;
}

.video-playback {
  display: block;
  width: 100%;
  max-height: 320px;
  border: 1px solid rgba(154, 255, 210, 0.14);
  border-radius: 16px;
  background: #000;
}

.video-playback:not([src]) {
  min-height: 120px;
}

.video-record-options {
  margin: 14px 0 0;
}

.video-audio-toggle {
  width: fit-content;
  border-color: rgba(0, 255, 160, 0.28);
  background:
    linear-gradient(135deg, rgba(0, 168, 107, 0.14), rgba(0, 47, 33, 0.24)),
    rgba(255, 255, 255, 0.045);
}

.playback-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

button.playback-download.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 560px) {
  .playback-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

.screen-capture-grid {
  align-items: start;
}

.screen-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.screen-toggle {
  flex: 1 1 230px;
  justify-content: flex-start;
}

.screen-help-box {
  color: var(--muted);
  border: 1px solid rgba(154, 255, 210, 0.14);
  border-radius: 16px;
  padding: 13px 14px;
  margin: 14px 0;
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.5;
}

.screen-help-box strong {
  color: var(--spartan-gold);
}

.screen-preview-frame,
.screen-playback-box video {
  min-height: 360px;
}

#screenPreview,
#screenPlayback {
  width: 100%;
  max-height: 540px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.34);
}

.screen-playback-box {
  height: 100%;
}

.screen-controls {
  margin-top: 16px;
}

.screen-audio-visualizer {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: 360px;
  padding: 28px;
  color: var(--ink);
  background:
    radial-gradient(circle at center, rgba(0, 168, 107, 0.22), transparent 54%),
    linear-gradient(135deg, rgba(0, 47, 33, 0.78), rgba(0, 11, 7, 0.92));
}

.screen-audio-visualizer.active {
  display: flex;
}

.screen-audio-ring {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(0, 255, 160, 0.48);
  border-radius: 999px;
  background: rgba(0, 168, 107, 0.10);
  box-shadow:
    0 0 0 8px rgba(0, 168, 107, 0.08),
    0 0 34px rgba(0, 168, 107, 0.36),
    inset 0 0 28px rgba(0, 168, 107, 0.18);
}

.screen-audio-ring span {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--spartan-green-bright);
  box-shadow: 0 0 24px rgba(0, 255, 160, 0.82);
  animation: audioPulse 1000ms ease-in-out infinite;
}

.screen-audio-visualizer strong {
  color: var(--spartan-gold);
  font-size: 1rem;
  text-align: center;
}

.screen-audio-meter {
  width: min(420px, 100%);
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(154, 255, 210, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}

.screen-audio-meter div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 168, 107, 0.82), rgba(217, 180, 74, 0.86));
  transition: width 80ms linear;
}

.screen-audio-visualizer small {
  max-width: 420px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

@keyframes audioPulse {
  0%, 100% {
    transform: scale(0.82);
    opacity: 0.68;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 1120px) {
  .screen-capture-grid {
    grid-template-columns: 1fr;
  }
}

.screen-playback-media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.34);
}

.screen-playback-media-frame #screenPlayback {
  display: block;
}

.screen-playback-audio-visualizer {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  position: absolute;
  inset: 0 0 54px;
  padding: 28px;
  pointer-events: none;
  color: var(--ink);
  background:
    radial-gradient(circle at center, rgba(0, 168, 107, 0.28), transparent 54%),
    linear-gradient(135deg, rgba(0, 47, 33, 0.78), rgba(0, 11, 7, 0.92));
}

.screen-playback-audio-visualizer.active {
  display: flex;
}

.screen-playback-media-frame.audio-only #screenPlayback {
  background: rgba(0, 0, 0, 0.34);
}

.screen-play-toggle {
  min-width: 82px;
  justify-content: center;
}

.screen-play-time {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.screen-scrub-slider {
  width: 100%;
  accent-color: var(--spartan-green-bright);
}

.screen-scrub-slider:disabled {
  opacity: 0.45;
}

@media (max-width: 720px) {
  .screen-custom-player {
    grid-template-columns: auto 1fr auto;
  }

  .screen-custom-player .screen-play-toggle {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

.screen-playback-box .screen-custom-player {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
}

.screen-playback-box .screen-play-toggle {
  min-width: 90px;
  justify-content: center;
}

.screen-playback-box .screen-play-time {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.screen-playback-box .screen-scrub-slider {
  width: 100%;
  accent-color: var(--spartan-green-bright);
}

.screen-playback-box .screen-scrub-slider:disabled {
  opacity: 0.45;
}

@media (max-width: 720px) {
  .screen-playback-box .screen-custom-player {
    grid-template-columns: auto 1fr auto;
  }

  .screen-playback-box .screen-play-toggle {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

.media-custom-player {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
}

.media-play-toggle {
  min-width: 90px;
  justify-content: center;
}

.media-play-time {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.media-scrub-slider {
  width: 100%;
  accent-color: var(--spartan-green-bright);
}

.media-scrub-slider:disabled {
  opacity: 0.45;
}

#micPlayback {
  display: none;
}

.video-playback {
  cursor: pointer;
}

@media (max-width: 720px) {
  .media-custom-player {
    grid-template-columns: auto 1fr auto;
  }

  .media-play-toggle {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

.speaker-dashboard {
  grid-template-columns: repeat(4, 1fr);
}

.speaker-test-grid {
  align-items: start;
}

.speaker-volume-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(154, 255, 210, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.speaker-volume-control input[type="range"] {
  width: 100%;
  accent-color: var(--spartan-green-bright);
}

.speaker-volume-control strong {
  color: var(--spartan-gold);
  min-width: 54px;
  text-align: right;
}

.speaker-warning-box {
  color: var(--muted);
  border: 1px solid rgba(217, 180, 74, 0.25);
  border-radius: 16px;
  padding: 13px 14px;
  margin: 14px 0;
  background: rgba(217, 180, 74, 0.08);
  line-height: 1.45;
}

.speaker-warning-box strong {
  color: var(--spartan-gold);
}

.speaker-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 16px;
}

.speaker-button-grid .utility-btn {
  justify-content: center;
  text-align: center;
}

.speaker-stop-btn {
  grid-column: 1 / -1;
  border-color: rgba(217, 180, 74, 0.55);
}

.speaker-visual-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(154, 255, 210, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at center, rgba(0, 168, 107, 0.18), transparent 65%),
    rgba(0, 0, 0, 0.18);
}

.speaker-rings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.speaker-ring {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.speaker-ring span {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  color: var(--muted);
  border: 1px solid rgba(154, 255, 210, 0.20);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  font-size: 2rem;
  font-weight: 900;
  transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.speaker-ring.active {
  border-color: rgba(0, 255, 160, 0.72);
  background:
    radial-gradient(circle at center, rgba(0, 168, 107, 0.28), transparent 64%),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 32px rgba(0, 168, 107, 0.30);
}

.speaker-ring.active span {
  color: #ffffff;
  border-color: rgba(0, 255, 160, 0.78);
  background: rgba(0, 168, 107, 0.34);
  box-shadow:
    0 0 0 8px rgba(0, 168, 107, 0.09),
    0 0 28px rgba(0, 168, 107, 0.55);
}

.speaker-output-meter {
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}

.speaker-output-meter div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 168, 107, 0.88), rgba(217, 180, 74, 0.92));
  transition: width 80ms linear;
}

.speaker-test-description {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.speaker-test-description strong {
  display: block;
  color: var(--spartan-gold);
  margin-bottom: 6px;
}

.speaker-test-description p {
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .speaker-dashboard,
  .speaker-test-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .speaker-button-grid,
  .speaker-rings {
    grid-template-columns: 1fr;
  }
}

.screen-playback-box .screen-custom-player {
  grid-template-columns: auto auto minmax(140px, 1fr) auto auto;
}

.screen-fullscreen-toggle {
  min-width: 116px;
  justify-content: center;
}

.screen-playback-media-frame:fullscreen {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  background: #000;
}

.screen-playback-media-frame:fullscreen #screenPlayback {
  width: 100vw;
  height: 100vh;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}

.screen-playback-media-frame:fullscreen .screen-playback-audio-visualizer {
  inset: 0;
}

@media (max-width: 720px) {
  .screen-playback-box .screen-custom-player {
    grid-template-columns: auto 1fr auto;
  }

  .screen-fullscreen-toggle {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

.screen-fullscreen-controls {
  display: none;
  align-items: center;
  gap: 12px;
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 13px 14px;
  border: 1px solid rgba(154, 255, 210, 0.24);
  border-radius: 18px;
  background: rgba(0, 20, 14, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(14px);
}

.screen-playback-media-frame:fullscreen .screen-fullscreen-controls {
  display: grid;
  grid-template-columns: auto auto minmax(160px, 1fr) auto auto;
}

.screen-fullscreen-play-toggle,
.screen-fullscreen-exit-toggle {
  min-width: 96px;
  justify-content: center;
}

.screen-playback-media-frame:fullscreen .screen-scrub-slider {
  width: 100%;
}

@media (max-width: 720px) {
  .screen-playback-media-frame:fullscreen .screen-fullscreen-controls {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: auto 1fr auto;
  }

  .screen-fullscreen-play-toggle,
  .screen-fullscreen-exit-toggle {
    grid-column: span 1;
    min-width: 86px;
  }
}

.speed-dashboard {
  grid-template-columns: repeat(4, 1fr);
}

.speed-test-grid {
  align-items: start;
}

.speed-controls {
  margin-top: 16px;
}

.speed-progress-stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.speed-progress-block {
  padding: 14px;
  border: 1px solid rgba(154, 255, 210, 0.14);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.speed-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.speed-progress-label strong {
  color: var(--spartan-gold);
}

.speed-progress-bar {
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(154, 255, 210, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}

.speed-progress-bar div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 168, 107, 0.88), rgba(217, 180, 74, 0.92));
  transition: width 120ms linear;
}

.speed-note-box {
  color: var(--muted);
  border: 1px solid rgba(217, 180, 74, 0.25);
  border-radius: 16px;
  padding: 13px 14px;
  margin-top: 16px;
  background: rgba(217, 180, 74, 0.08);
  line-height: 1.45;
}

.speed-note-box strong {
  color: var(--spartan-gold);
}

.network-info-grid {
  display: grid;
  gap: 10px;
}

.network-info-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.network-info-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.network-info-row strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

@media (max-width: 980px) {
  .speed-dashboard,
  .speed-test-grid {
    grid-template-columns: 1fr;
  }

  .network-info-row {
    grid-template-columns: 1fr;
  }
}
