:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #1c2024;
  --panel-strong: #242a30;
  --text: #f5f2eb;
  --muted: #aeb7bb;
  --line: #384048;
  --accent: #45c7a3;
  --accent-strong: #22a884;
  --danger: #f05d5e;
  --danger-strong: #d9494a;
  --warning: #f0b84f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(69, 199, 163, 0.13), transparent 32rem),
    linear-gradient(135deg, #111315 0%, #16191c 55%, #101214 100%);
  color: var(--text);
}

button,
select,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.recorder-panel {
  width: min(1120px, 100%);
  display: grid;
  gap: 18px;
}

.topbar,
.controls,
.result {
  background: rgba(28, 32, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 1.1rem;
  line-height: 1.25;
}

.status-pill {
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
}

.status-dot,
.recording-badge span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(69, 199, 163, 0.12);
}

.status-pill.recording .status-dot,
.recording-badge span {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(240, 93, 94, 0.16);
}

.preview-wrap {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #171a1e;
  background-size: 38px 38px;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0b0d0f;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--text);
  font-size: clamp(1.35rem, 4vw, 2.25rem);
}

.screen-icon {
  width: 92px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(69, 199, 163, 0.18), rgba(240, 184, 79, 0.1));
}

.screen-icon span {
  width: 36px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  transform: translateY(40px);
}

.recording-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(12, 13, 15, 0.84);
  color: #fff;
  font-weight: 800;
}

.controls {
  display: grid;
  grid-template-columns: minmax(92px, 0.35fr) 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
}

.timer {
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #101214;
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 800;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
.download {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

button:hover:not(:disabled),
.download:hover {
  border-color: rgba(255, 255, 255, 0.32);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06130f;
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.danger {
  background: rgba(240, 93, 94, 0.15);
  border-color: rgba(240, 93, 94, 0.55);
  color: #ffd9d9;
}

.danger:hover:not(:disabled) {
  background: var(--danger-strong);
  border-color: var(--danger-strong);
  color: #fff;
}

.button-icon {
  width: 1.1em;
  text-align: center;
  line-height: 1;
}

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

.check-option,
.field-option {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-weight: 700;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

select {
  color: var(--text);
  background: #101214;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
}

.result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.download {
  background: var(--warning);
  border-color: var(--warning);
  color: #171005;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
    place-items: start center;
  }

  .topbar,
  .result {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    width: fit-content;
  }

  .preview-wrap {
    min-height: 300px;
  }

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

  .button-row,
  .options,
  .result-actions {
    justify-content: stretch;
  }

  .button-row > *,
  .result-actions > * {
    flex: 1 1 130px;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 2.25rem;
  }

  .preview-wrap {
    min-height: 240px;
  }

  .options {
    align-items: stretch;
    flex-direction: column;
  }

  .field-option {
    justify-content: space-between;
  }
}
