* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #0284c7;
  --ok: #4ade80;
  --err: #f87171;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.code-display {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

button {
  background: var(--accent-dark);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}

button:hover {
  background: var(--accent);
}

button:disabled {
  background: var(--border);
  cursor: default;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-top: 12px;
}

button.secondary:hover {
  border-color: var(--muted);
  color: var(--text);
}

.status {
  margin-top: 20px;
  font-size: 0.95rem;
  color: var(--muted);
  min-height: 1.4em;
}

.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

input.code-input {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 14px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
  outline: none;
}

input.code-input:focus {
  border-color: var(--accent);
}

video#preview {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 20px;
  background: black;
}

.hidden {
  display: none !important;
}

/* Viewer-Vollbildansicht */
.viewer-stage {
  position: fixed;
  inset: 0;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-stage video {
  max-width: 100%;
  max-height: 100%;
}

.viewer-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  font-size: 0.9rem;
  z-index: 10;
  transition: opacity 0.3s;
}

.viewer-bar.faded {
  opacity: 0;
  pointer-events: none;
}

.viewer-bar .spacer { flex: 1; }

.viewer-bar button {
  width: auto;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.badge {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
