:root {
  --bg: #09090b;
  --surface: #141418;
  --surface-hover: #1e1e24;
  --surface-active: #2a2a33;
  --border: rgba(255, 255, 255, 0.09);
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #e1306c;
  --accent-soft: rgba(225, 48, 108, 0.16);
  --danger: #f87171;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}

.hidden {
  display: none !important;
}

/* Lock Screen */
.lock-screen {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 10%, rgba(225, 48, 108, 0.14), transparent 55%),
    var(--bg);
}

.lock-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-emblem {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.25);
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin: 6px 0 22px;
  font-size: 0.9rem;
  color: var(--muted);
}

.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  min-height: 22px;
  margin-bottom: 12px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.pin-dot.filled {
  background: var(--text);
  border-color: var(--text);
  transform: scale(1.1);
}

.pin-dots.shake {
  animation: shake 0.35s ease;
}

.pin-dots.shake .pin-dot {
  border-color: var(--danger);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.status-msg {
  min-height: 20px;
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--danger);
}

.status-msg.info {
  color: var(--muted);
}

.numpad {
  width: 100%;
  max-width: 286px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.num-btn {
  appearance: none;
  height: 68px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, background-color 0.12s ease;
}

.num-btn:hover {
  background: var(--surface-hover);
}

.num-btn:active {
  background: var(--surface-active);
  transform: scale(0.94);
}

.num-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.num-btn.action-btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 1.15rem;
}

.num-btn.action-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

/* Viewer Screen */
.viewer-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  background: #000;
}

.browser-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.control-pill {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.control-pill.collapsed .pill-actions {
  display: none;
}

.pill-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn:active {
  transform: scale(0.95);
}

.pill-toggle {
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
}

.pill-lock {
  background: rgba(225, 48, 108, 0.88);
  color: #fff;
}

/* Privacy Curtain */
.privacy-curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(9, 9, 11, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.curtain-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
}

@media (max-height: 620px) {
  .num-btn {
    height: 56px;
  }
  .numpad {
    gap: 10px;
  }
  .brand-emblem {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
  }
}
