:root {
  --bg: #0d0d0d;
  --panel: rgba(0, 0, 0, 0.6);
  --accent: #1565c0;
  --ok: #8bff8b;
  --warn: #ffe082;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  transform-origin: center center;
  transition: transform 0.15s ease;
}

#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Ekran startowy */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 32px;
  background: var(--bg);
}

.screen h1 { font-size: 32px; letter-spacing: 1px; }
.screen p { max-width: 28rem; line-height: 1.5; color: #ddd; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 22rem;
}
.btn-primary:active { filter: brightness(0.9); }

.error { color: #ff6b6b; font-size: 14px; }

/* Dolny panel */
#panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status { font-size: 14px; font-weight: 600; }
.status.searching { color: var(--warn); }
.status.locked { color: var(--ok); }
.status.frozen { color: var(--warn); }

.line { font-size: 20px; }
#detected { font-weight: 600; }

.result { font-size: 38px; font-weight: 800; }
#result { color: #fff; }

.zoom-row {
  display: flex;
  gap: 8px;
}
.zoom-btn {
  flex: 1 1 0;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.zoom-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}
