:root {
  --bg: #0f172a;
  --card: #1e293b;
  --fg: #e2e8f0;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.card.wide {
  max-width: 960px;
}

h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.sub {
  margin: 0 0 24px;
  color: var(--muted);
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.code-row {
  display: flex;
  gap: 8px;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

input[type='text'] {
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--fg);
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.small {
  padding: 12px 14px;
  font-size: 0.9rem;
}

#start,
#stop {
  width: 100%;
  margin-top: 8px;
}

.status {
  margin: 14px 0 0;
  color: var(--muted);
  min-height: 1.2em;
}

video {
  width: 100%;
  margin-top: 16px;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}

.lang-switch button {
  display: flex;
  padding: 0;
  width: 32px;
  height: 22px;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: 0.55;
}

.lang-switch button:hover,
.lang-switch button[aria-pressed='true'] {
  opacity: 1;
}

.lang-switch button[aria-pressed='true'] {
  border-color: var(--accent);
}

.lang-switch svg {
  width: 100%;
  height: 100%;
}

.foot {
  margin: 24px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.foot a {
  color: var(--muted);
}
