:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  --bg: #0b1220;
  --card: #111827;
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --ok: #22c55e;
  --warn: #f97316;
}

* { box-sizing: border-box; }

.lang-switch {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.lang-switch button {
  min-height: 52px;
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
  background: #1e293b;
  color: #f8fafc;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ok);
  color: #052e16;
  box-shadow: inset 0 0 0 3px #f8fafc;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

h1, h2 { margin-top: 0; }

a { color: var(--ok); }

button, input, textarea {
  font: inherit;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  touch-action: manipulation;
}

input, textarea, select {
  width: 100%;
  background: #020617;
  color: var(--text);
  margin: 8px 0 16px;
}

button {
  border: 0;
  background: var(--ok);
  color: #052e16;
  font-weight: 800;
  cursor: pointer;
  margin: 4px 6px 4px 0;
}

button.secondary { background: #38bdf8; color: #082f49; }
button.danger { background: var(--warn); color: #431407; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

section, article {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.muted { color: var(--muted); }
.preview {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: 12px;
}

.status {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.tv-body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, #1e293b, transparent 45%),
    radial-gradient(circle at 80% 80%, #334155, transparent 40%),
    #020617;
}

.tv-body .lang-switch {
  position: fixed;
  left: 0;
  right: 0;
}

.tv-music {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: calc(8vh + 64px) 8vw 8vh;
}

.tv-overlay {
  position: fixed;
  top: 1.5vh;
  right: 1.5vw;
  width: 47vw;
  height: 47vh;
  border: 3px solid var(--ok);
  border-radius: 18px;
  overflow: hidden;
  background: #020617;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.tv-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.tv-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: max-content;
  height: max-content;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: #f8fafc;
  color: #0b1220;
  font: 800 1rem system-ui, sans-serif;
  cursor: pointer;
}

.tv-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  color: #f8fafc;
  font: 700 18px system-ui, sans-serif;
  text-shadow: 0 2px 8px #000;
}

.hidden { display: none; }

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gast-body {
  min-height: 100dvh;
}

.gast-main {
  max-width: 520px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.gast-preview {
  aspect-ratio: 3 / 4;
  max-height: min(58vh, 420px);
  object-fit: cover;
  background: #000;
}

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

.gast-actions button {
  flex: 1 1 140px;
  min-height: 48px;
  margin: 0;
}

.invite-code {
  font: 800 3.4rem/1.05 ui-monospace, Consolas, monospace;
  letter-spacing: 0.2em;
  margin: 8px 0 16px;
  color: #f8fafc;
}

.door-code {
  font: 800 2.4rem/1.1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  min-height: 72px;
}

.schicht-door .invite-code {
  font-size: clamp(2.8rem, 8vw, 4.2rem);
}

.technik {
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.favorite {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.home-main h1 {
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  line-height: 1.05;
}

.place-list {
  display: grid;
  gap: 14px;
}

.place-card {
  margin: 0;
  padding: 22px 18px;
}

.place-card h3 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
}

.place-city {
  margin: 0;
  color: var(--ok);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.place-card button {
  width: 100%;
  min-height: 56px;
  margin: 12px 0 0;
  font-size: 1.15rem;
}

.extra-actions button {
  flex: 1 1 100%;
  min-height: 56px;
  font-size: 1.15rem;
}

.staff-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.staff-pick button {
  min-height: 48px;
  background: #1e293b;
  color: #f8fafc;
}

.staff-pick button[aria-pressed="true"] {
  background: var(--ok);
  color: #052e16;
}

.tv-overlay.main-stage {
  top: 8vh;
  right: 8vw;
  left: 8vw;
  width: auto;
  height: 72vh;
}

#inviteQr {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 8px 0 16px;
  background: #fff;
  border-radius: 16px;
}

@media (max-width: 640px) {
  main {
    padding: 18px 14px 32px;
  }

  h1 {
    font-size: 1.6rem;
  }
}
