:root {
  --bg: #0e0c0a;
  --paper: #f4efe7;
  --ink: #1a1714;
  --accent: #c2a36b;
  --danger: #d8694a;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
}

body { overflow: hidden; }

/* ===== Screens ===== */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen.visible { display: flex; }

/* ===== Welcome / Done ===== */
.welcome-inner {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}

.film-badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 22px;
}

h1 {
  font-size: 34px;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#date-sub, .cam-couple {
  color: var(--accent);
  letter-spacing: 4px;
  font-size: 14px;
  margin: 0 0 22px;
}

.lede { font-size: 16px; line-height: 1.5; color: #d9d2c6; margin: 0 0 26px; }
.lede strong { color: var(--paper); }

.name-label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: #b3aa9b;
  margin: 0 0 6px 2px;
}

#guest-name {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  border: 1px solid #3a342c;
  background: #181511;
  color: var(--paper);
  border-radius: var(--radius);
  margin-bottom: 20px;
  outline: none;
}
#guest-name:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-primary:active { transform: scale(0.98); }

.hint { font-size: 13px; color: #8c8479; margin: 16px 0 0; }
.hint.error { color: var(--danger); }
.hidden { display: none; }

/* ===== Sprach-Umschalter ===== */
.lang-toggle {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.lang-toggle button {
  background: rgba(255,255,255,0.06);
  color: #b3aa9b;
  border: 1px solid #3a342c;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.lang-toggle button.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ===== Camera ===== */
#screen-camera { background: #000; }

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
}
.cam-couple { margin: 0; font-size: 13px; }
.cam-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 16px;
  background: rgba(0,0,0,0.45);
  padding: 5px 12px;
  border-radius: 20px;
}

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
.flash.fire { animation: flash 0.32s ease-out; }
@keyframes flash {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

.cam-controls {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
}

.btn-shutter {
  justify-self: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid rgba(255,255,255,0.45);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
  cursor: pointer;
}
.btn-shutter:active { transform: scale(0.92); }
.btn-shutter:disabled { opacity: 0.4; }

.btn-round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.btn-round.small { justify-self: start; }

.thumb-slot {
  position: relative;
  justify-self: end;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.45);
}
.thumb-slot img { width: 100%; height: 100%; object-fit: cover; display: none; }
.thumb-slot img.show { display: block; }

.frames-left {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.frames-left b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.frames-left i {
  font-size: 8px;
  font-style: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #e7e0d4;
  margin-top: 1px;
}

.upload-status {
  position: absolute;
  bottom: calc(118px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  z-index: 3;
  text-align: center;
  font-size: 13px;
  color: #e7e0d4;
  min-height: 18px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.upload-status .err { color: var(--danger); }
