/* ═══════════════════════════════════════════════════════════════════════════
   RealityGames – Immersive Mystery PWA
   Dark, cinematic, thriller aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:          #0a0a0a;
  --bg-2:        #111111;
  --bg-3:        #161616;
  --surface:     #1e1e1e;
  --border:      #2a2a2a;
  --accent:      #c8a96e;
  --accent-dim:  #7a6540;
  --danger:      #c0392b;
  --safe:        #27ae60;
  --text:        #e8e0d0;
  --text-dim:    #9a9080;
  --text-muted:  #5a5550;
  --font:        'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 8px 32px rgba(0, 0, 0, 0.8);
  --transition:  0.25s ease;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ──────────────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10;
}

.screen.active {
  display: flex;
}

/* ── Login Screen ─────────────────────────────────────────────────────────── */
#screen-login {
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.login-container {
  width: 100%;
  max-width: 360px;
  padding: 2.5rem 2rem 3rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.logo {
  text-align: center;
}

.logo-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text);
  text-transform: uppercase;
}

.logo h1 span {
  color: var(--accent);
}

.logo .tagline {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

#login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field {
  width: 100%;
}

#login-form input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

#login-form input::placeholder {
  color: var(--text-muted);
}

#login-form input:focus {
  border-color: var(--accent-dim);
}

/* ── Primary Button ───────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0a0a;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  -webkit-appearance: none;
}

.btn-primary:active {
  background: var(--accent-dim);
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.error-msg {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.4);
  border-radius: var(--radius-sm);
  color: #e74c3c;
  font-size: 0.875rem;
  text-align: center;
}

/* ── Loading Screen ───────────────────────────────────────────────────────── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loading-container p {
  color: var(--text-dim);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Map Screen ───────────────────────────────────────────────────────────── */
#screen-game {
  padding: 0;
  justify-content: flex-start;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(200, 169, 110, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 10% 5%, rgba(200, 169, 110, 0.08) 0%, transparent 80%),
    linear-gradient(180deg, #0a0a0a 0%, #101010 50%, #141414 100%);
}

.phone-shell {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
}

.phone-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 0.95rem) 0.95rem 0.35rem;
  pointer-events: none;
}

.phone-topbar-brand {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: rgba(232, 224, 208, 0.76);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.phone-menu-toggle {
  pointer-events: auto;
  position: absolute;
  left: 0.95rem;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(200, 169, 110, 0.35);
  border-radius: 13px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.phone-menu-line {
  width: 18px;
  height: 2px;
  background: rgba(245, 245, 255, 0.9);
  border-radius: 999px;
}

.phone-main {
  position: absolute;
  inset: 0;
}

.phone-view {
  position: absolute;
  inset: 0;
}

.phone-menu-scrim {
  position: absolute;
  inset: 0;
  z-index: 64;
  background: rgba(2, 4, 12, 0.46);
  backdrop-filter: blur(2px);
}

.phone-sidepanel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(84vw, 330px);
  z-index: 65;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.98) 0%, rgba(12, 12, 12, 0.98) 100%),
    rgba(12, 12, 12, 0.98);
  border-right: 1px solid rgba(200, 169, 110, 0.22);
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
}

.phone-sidepanel.open {
  transform: translateX(0);
}

.phone-sidepanel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem 0.95rem;
  border-bottom: 1px solid rgba(200, 169, 110, 0.18);
}

.phone-sidepanel-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.phone-sidepanel-subtitle {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.phone-sidepanel-close {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}

.phone-sidepanel-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0.85rem 1rem;
}

.phone-sidepanel-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid rgba(200, 169, 110, 0.16);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
}

.phone-sidepanel-link:active {
  transform: scale(0.985);
}

.phone-sidepanel-link .rg-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.phone-sidepanel-link .rg-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  filter: brightness(0.7) saturate(0.62) hue-rotate(198deg);
}

.phone-home {
  position: relative;
  height: 100%;
  width: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: calc(env(safe-area-inset-top, 0px) + 4rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
  background:
    linear-gradient(180deg, rgba(14,14,14,0.86) 0%, rgba(18,18,18,0.93) 100%),
    radial-gradient(circle at 22% 9%, rgba(200,169,110,0.16), transparent 52%),
    radial-gradient(circle at 86% 6%, rgba(200,169,110,0.08), transparent 45%);
  overflow-y: auto;
}

.phone-home-header {
  text-align: center;
}

.phone-home-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.phone-home-subtitle {
  margin-top: 0.25rem;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.phone-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 0.9rem;
}

.phone-app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 118px;
  padding: 0.9rem 0.55rem;
  background: linear-gradient(180deg, rgba(37,37,37,0.92), rgba(28,28,28,0.94));
  border: 1px solid rgba(200,169,110,0.18);
  border-radius: 18px;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(0,0,0,0.45);
}

.phone-app-icon:active {
  transform: scale(0.97);
}

.phone-app-icon-glyph {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(200, 169, 110, 0.12);
  color: var(--accent);
}

.phone-app-icon-glyph svg {
  width: 24px;
  height: 24px;
  display: block;
}

.phone-app-icon-label {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.phone-mission-card {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(200,169,110,0.28);
  border-radius: 14px;
  padding: 0.9rem;
}

.phone-mission-card-title {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.phone-mission-card-text {
  font-size: 0.88rem;
  line-height: 1.45;
}

.phone-app-screen {
  position: relative;
  inset: auto;
  z-index: 30;
  height: 100%;
  background: rgba(10, 10, 10, 0.96);
  display: flex;
  flex-direction: column;
}

.phone-map-screen {
  background: #0a0c0f;
}

.phone-app-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: calc(env(safe-area-inset-top, 0px) + 4rem) 1rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.phone-app-back {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.phone-app-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.phone-list {
  overflow-y: auto;
  padding: 0.8rem 0.9rem calc(env(safe-area-inset-bottom, 0px) + 0.9rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.phone-list-item {
  background: var(--surface);
  border: 1px solid rgba(200,169,110,0.18);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
}

.phone-list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.phone-list-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.phone-list-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.phone-list-text {
  margin-top: 0.3rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.4;
}

.phone-list-empty {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Leaflet overrides for dark map */
.leaflet-tile {
  filter: invert(0.92) hue-rotate(190deg) saturate(0.7) brightness(0.85);
}

.leaflet-container {
  background: #0a0c0f;
}

/* Player marker */
.player-marker {
  background: transparent;
  border: none;
}

.player-dot {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 6px rgba(200, 169, 110, 0.2);
  animation: pulse-ring 2s ease-out infinite;
}

/* ── HUD ──────────────────────────────────────────────────────────────────── */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: env(safe-area-inset-top, 16px) 1rem 1rem;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.85), transparent);
  pointer-events: none;
}

#hud-mission-title {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

#hud-step-hint {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ── Status Bar ───────────────────────────────────────────────────────────── */
#status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.75rem 1rem calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
  background: linear-gradient(to top, rgba(10, 10, 10, 0.7), transparent);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  pointer-events: none;
}

.status-icon {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.status-icon {
  pointer-events: auto;
}

.status-icon .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.5s;
}

.status-icon .dot.active {
  background: var(--safe);
  box-shadow: 0 0 6px rgba(39, 174, 96, 0.6);
}

/* Tracker signal strength states */
.status-icon .dot.signal-strong {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(192, 57, 43, 0.7);
  animation: tracker-blink 1s ease-in-out infinite;
}

.status-icon .dot.signal-weak {
  background: #e67e22;
  box-shadow: 0 0 6px rgba(230, 126, 34, 0.5);
  animation: tracker-blink 0.6s ease-in-out infinite;
}

.status-icon .dot.signal-lost {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}

.status-icon .label.tracker-signal-label {
  color: var(--danger);
}

/* Sync status states */
.status-icon .dot.sync-pending {
  background: #e67e22;
  box-shadow: 0 0 6px rgba(230, 126, 34, 0.6);
  animation: tracker-blink 1.2s ease-in-out infinite;
}

.status-icon .dot.sync-stuck {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.8);
  animation: tracker-blink 0.5s ease-in-out infinite;
}

.status-icon .label.sync-status-label {
  color: #e67e22;
}

#sync-status.stuck .label.sync-status-label {
  color: var(--danger);
}

.status-icon .label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Overlays ─────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

.overlay.hidden {
  display: none;
}

.overlay.visible {
  display: flex;
}

/* ── Incoming Call ────────────────────────────────────────────────────────── */
#overlay-call {
  background: rgba(4, 8, 18, 0.95);
  flex-direction: column;
}

.call-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 20, 45, 0.78) 0%, rgba(6, 10, 24, 0.9) 100%),
    radial-gradient(ellipse at 50% 20%, rgba(118, 144, 196, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 24, 44, 0.5) 0%, transparent 60%);
  animation: call-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

.call-phone-screen {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  background:
    linear-gradient(180deg, rgba(56, 84, 131, 0.24) 0%, rgba(21, 33, 59, 0.45) 100%),
    rgba(12, 18, 34, 0.65);
  backdrop-filter: blur(8px);
}

.call-app-badge {
  align-self: center;
  margin-top: -0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(7, 12, 25, 0.6);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(238, 242, 255, 0.86);
}

.call-ui {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  min-height: min(78vh, 700px);
  padding: 1.8rem 2rem calc(env(safe-area-inset-bottom, 0px) + 2.1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.7rem;
}

.caller-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  margin-top: 1.4rem;
}

.caller-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(223, 232, 246, 0.1);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}

.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.65);
  animation: avatar-ring 1.5s ease-out infinite;
}

.caller-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-icon {
  font-size: 3.25rem;
  z-index: 1;
}

.caller-name {
  font-size: clamp(1.9rem, 4.8vw, 2.3rem);
  font-weight: 600;
  color: #f2f4fb;
  letter-spacing: 0.02em;
}

.caller-number {
  font-size: 1.06rem;
  color: rgba(220, 227, 242, 0.86);
  letter-spacing: 0.03em;
}

.caller-status {
  margin-top: 0.2rem;
  font-size: 1.05rem;
  color: rgba(220, 227, 242, 0.7);
  letter-spacing: 0.06em;
}

.call-actions {
  display: flex;
  width: 100%;
  max-width: 280px;
  justify-content: space-between;
  gap: 1.1rem;
  justify-content: center;
}

.call-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.84rem;
  color: rgba(228, 233, 246, 0.84);
  letter-spacing: 0.03em;
  font-weight: 600;
  text-transform: uppercase;
  min-width: 110px;
  white-space: nowrap;
  transition: transform 0.15s, color var(--transition);
  -webkit-appearance: none;
}

.call-btn:active {
  transform: scale(0.92);
}

.call-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.call-btn.decline .call-icon {
  background: var(--danger);
  box-shadow: 0 4px 20px rgba(192, 57, 43, 0.4);
}

.call-btn.accept .call-icon {
  background: #7ac84b;
  box-shadow: 0 10px 24px rgba(51, 166, 67, 0.48);
}

.call-btn.hang-up .call-icon {
  background: var(--danger);
  box-shadow: 0 4px 20px rgba(192, 57, 43, 0.4);
}

/* ── Active Call ──────────────────────────────────────────────────────────── */
#overlay-active-call {
  background: rgba(4, 8, 18, 0.95);
  flex-direction: column;
}

.active-call-ui {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  min-height: min(78vh, 700px);
  padding: 1.8rem 2rem calc(env(safe-area-inset-bottom, 0px) + 2.1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: center;
}

.caller-info--active {
  margin-top: 1rem;
}

.call-timer {
  font-size: 1.65rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(220, 227, 242, 0.86);
  letter-spacing: 0.1em;
}

.call-subtitle {
  font-size: 1rem;
  color: rgba(220, 227, 242, 0.62);
  letter-spacing: 0.08em;
}

.call-wave {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  margin: 0.55rem 0 0.15rem;
}

.wave-bar {
  width: 5px;
  border-radius: 2px;
  background: #f2cf87;
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s;    height: 14px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s;  height: 28px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s;  height: 40px; }
.wave-bar:nth-child(4) { animation-delay: 0.1s;  height: 28px; }
.wave-bar:nth-child(5) { animation-delay: 0s;    height: 14px; }

.call-btn.hang-up {
  min-width: 0;
  color: transparent;
}

.call-btn.hang-up .call-icon {
  width: 82px;
  height: 82px;
  font-size: 1.8rem;
}

/* ── Message Overlay ──────────────────────────────────────────────────────── */
#overlay-message {
  background: rgba(5, 5, 10, 0.9);
  padding: 1.5rem;
}

.message-ui {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: slide-up 0.3s ease-out;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.message-icon {
  font-size: 1.5rem;
  opacity: 0.7;
}

.message-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.message-sender {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.message-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  min-height: 3rem;
}

/* ── Mission Complete ─────────────────────────────────────────────────────── */
#overlay-complete {
  background: rgba(5, 5, 10, 0.97);
  flex-direction: column;
}

.complete-ui {
  width: 100%;
  max-width: 360px;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.complete-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--safe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 0 40px rgba(39, 174, 96, 0.3);
  animation: slide-up 0.5s ease-out;
}

.complete-ui h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.complete-ui p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 2000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: var(--shadow);
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast.hidden {
  display: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.incoming-message-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
  z-index: 2500;
  background: rgba(22, 22, 22, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transform: translateY(-12px);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}

.incoming-message-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.incoming-message-banner-icon {
  font-size: 1.2rem;
  opacity: 0.85;
}

.incoming-message-banner-body {
  min-width: 0;
  flex: 1;
}

.incoming-message-banner-sender {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.incoming-message-banner-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incoming-message-banner-open {
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  border-radius: 999px;
  padding: 0.32rem 0.66rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Debug Panel ──────────────────────────────────────────────────────────── */

.settings-icon {
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.settings-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Settings Modal ───────────────────────────────────────────────────────── */
#overlay-settings {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

#overlay-settings.hidden {
  display: none;
}

.settings-sheet {
  background: var(--surface, #1a1a1a);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 1.25rem 1.5rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
}

.settings-close-btn {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.settings-close-btn:hover {
  color: #fff;
}

.settings-user-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  color: var(--text, #eee);
  padding: 0.5rem 0;
}

.settings-user-icon {
  font-size: 1.4rem;
}

.settings-hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0.25rem 0;
}

.settings-action-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text, #eee);
  font-size: 1rem;
  text-align: left;
  padding: 0.85rem 1rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.settings-action-btn:hover {
  background: rgba(255,255,255,0.1);
}

.settings-action-btn--danger {
  border-color: rgba(192, 57, 43, 0.4);
  color: #ff6b6b;
}

.settings-action-btn--danger:hover {
  background: rgba(192, 57, 43, 0.15);
}

.settings-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #666);
  margin: -0.4rem 0 0;
  padding: 0 0.25rem;
}

/* ── Debug Panel ──────────────────────────────────────────────────────────── */
/* Only visible when the server grants debug_mode=1 for the logged-in user.   */
#debug-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #ff6b35;
  border-radius: 8px;
  min-width: 220px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #eee;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  user-select: none;
}

#debug-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #ff6b35;
  color: #000;
  font-weight: bold;
  border-radius: 7px 7px 0 0;
  cursor: default;
}

#debug-panel-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #000;
  line-height: 1;
  padding: 0 2px;
}

#debug-panel-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-btn {
  background: #2a2a2a;
  border: 1px solid #555;
  color: #eee;
  border-radius: 4px;
  padding: 5px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  transition: background 0.15s;
}

.debug-btn:hover {
  background: #3a3a3a;
  border-color: #ff6b35;
}

.debug-btn-danger {
  border-color: #c0392b;
  color: #ff6b6b;
}

.debug-btn-danger:hover {
  background: #3a1a1a;
  border-color: #e74c3c;
}

.debug-row {
  display: flex;
  gap: 4px;
}

.debug-row input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #eee;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12px;
  min-width: 0;
}

.debug-row input:focus {
  outline: none;
  border-color: #ff6b35;
}

.debug-hr {
  border: none;
  border-top: 1px solid #333;
  margin: 2px 0;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(200, 169, 110, 0.3); }
  50%       { opacity: 0.7; text-shadow: 0 0 40px rgba(200, 169, 110, 0.6); }
}

@keyframes pulse-ring {
  0%    { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0.4); }
  70%   { box-shadow: 0 0 0 14px rgba(200, 169, 110, 0); }
  100%  { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0); }
}

@keyframes avatar-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes call-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
  50%       { transform: scaleY(1);   opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-height: 600px) {
  .login-container {
    padding: 1.5rem 1.5rem;
    gap: 1.25rem;
  }
  .logo-icon { font-size: 2rem; }
  .logo h1   { font-size: 1.5rem; }
  .call-ui,
  .active-call-ui {
    min-height: auto;
    padding: 1.35rem 1.2rem calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
  }
  .caller-avatar {
    width: 90px;
    height: 90px;
  }
  .caller-name {
    font-size: 1.55rem;
  }
  .call-timer {
    font-size: 1.5rem;
  }
}

/* ── Code Input Overlay ───────────────────────────────────────────────────── */
.code-input-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  animation: slide-up 0.3s ease;
}

.code-input-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.code-input-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.code-input-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}

.code-input-hint {
  font-size: 0.875rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  min-height: 1.2em;
}

.code-input-field {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.5rem;
  letter-spacing: 0.25em;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.code-input-field:focus {
  border-color: var(--accent);
}

.code-input-error {
  font-size: 0.85rem;
  color: var(--danger);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Evidence Upload Overlay ─────────────────────────────────────────────── */

.evidence-upload-ui {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(92vw, 380px);
}

.evidence-upload-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.evidence-upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.evidence-upload-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}

.evidence-upload-hint {
  font-size: 0.875rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  min-height: 1.2em;
}

.evidence-file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  background: var(--bg-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.evidence-file-label:hover,
.evidence-file-label:focus-within {
  border-color: var(--accent);
  background: var(--bg-2);
}

.evidence-file-label-text {
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* Visually hide the native file input while keeping it accessible */
.evidence-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.evidence-upload-status {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.02em;
  min-height: 1.2em;
}

.evidence-upload-status.error {
  color: var(--danger);
}

/* ── Game Workflow Section (login screen) ────────────────────────────────── */
.workflow-section {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
}

.workflow-title {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}

.workflow-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* vertical connector line */
.workflow-steps::before {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 1.4rem;
  bottom: 1.4rem;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.6rem 0;
  position: relative;
  z-index: 1;
}

.workflow-step-icon {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
}

/* highlight the last step (complete) */
.workflow-steps li:last-child .workflow-step-icon {
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.35);
  color: var(--safe);
}

.workflow-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.3rem;
}

.workflow-step-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.workflow-step-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}


/* ── Secondary Button ────────────────────────────────────────────────────── */
.btn-secondary {
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  -webkit-appearance: none;
}

.btn-secondary:active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── External Website Overlay ───────────────────────────────────────────── */
.external-website-ui {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(92vw, 380px);
}

.external-website-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.external-website-icon {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.external-website-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}

.external-website-hint {
  font-size: 0.875rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  min-height: 1.2em;
}

.external-website-url {
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  text-align: center;
  word-break: break-all;
  letter-spacing: 0.01em;
}

/* The open link inherits btn-primary styles; ensure it renders as a block */
a.external-website-open {
  display: block;
  text-align: center;
  text-decoration: none;
}

/* ── Fake Tracker – Map Visuals ─────────────────────────────────────────── */

/* Blinking animation for the main tracker dot */
@keyframes tracker-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* Leaflet SVG path element for the tracker dot circle */
.tracker-dot path {
  animation: tracker-blink 1s ease-in-out infinite;
}

/* Ghost trailing-dot circles — no animation, styled via JS opacity */
.tracker-ghost path {
  transition: opacity 0.5s;
}

/* Label tooltip above the tracker dot */
.tracker-label {
  background: rgba(10, 10, 10, 0.85) !important;
  border: 1px solid #c0392b !important;
  border-radius: 4px !important;
  color: #e74c3c !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  padding: 2px 6px !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.tracker-label::before {
  display: none !important;
}

/* Map overlay: blue tint + subtle vignette when tracker is active */
#map.tracker-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at center,
      transparent 40%,
      rgba(0, 20, 60, 0.45) 100%
    );
  pointer-events: none;
  z-index: 400;
}

/* Slight blue tint over the whole map tile layer */
#map.tracker-overlay .leaflet-tile-pane {
  filter: hue-rotate(200deg) saturate(0.6) brightness(0.8);
}

/* ── Onboarding Screen ───────────────────────────────────────────────────── */
#screen-onboarding {
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.onboarding-container {
  gap: 1.5rem;
}

.onboarding-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.onboarding-fieldset {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.onboarding-legend {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 0.5rem;
}

.onboarding-optional {
  color: var(--text-dim);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.onboarding-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.onboarding-row .field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.onboarding-row .field label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.onboarding-row--distance {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.onboarding-row--distance input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.onboarding-row--distance input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#max-distance-output {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.onboarding-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.day-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.day-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: color var(--transition), border-color var(--transition);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ── Fingerprint Scanner ──────────────────────────────────────────────────── */
#overlay-fingerprint {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
}

.fingerprint-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 1.5rem 2.5rem;
  width: 100%;
  max-width: 360px;
  animation: slide-up 0.28s ease;
}

.fingerprint-header {
  text-align: center;
}

.fingerprint-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}

.fingerprint-subtitle {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

.fingerprint-scan-area {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-3);
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.fingerprint-scan-area.scanning {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(200, 169, 110, 0.35);
  animation: fp-pulse 1.5s infinite;
}

.fingerprint-scan-area.done {
  border-color: var(--safe);
  box-shadow: 0 0 24px rgba(39, 174, 96, 0.4);
}

.fingerprint-scan-area.failed {
  border-color: var(--danger);
  box-shadow: 0 0 24px rgba(192, 57, 43, 0.4);
}

.fingerprint-svg {
  width: 70%;
  height: 70%;
  color: var(--accent-dim);
  transition: color 0.4s;
}

.fingerprint-scan-area.scanning .fingerprint-svg { color: var(--accent); }
.fingerprint-scan-area.done    .fingerprint-svg { color: var(--safe); }
.fingerprint-scan-area.failed  .fingerprint-svg { color: var(--danger); }

/* Scan line sweeps top→bottom while scanning */
.fp-scanline {
  transform-origin: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.fingerprint-scan-area.scanning .fp-scanline {
  opacity: 1;
  animation: fp-scanline 1.8s linear infinite;
}

/* Corner brackets */
.fp-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fp-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-dim);
  border-style: solid;
  transition: border-color 0.4s;
}

.fingerprint-scan-area.scanning .fp-corner,
.fingerprint-scan-area.done    .fp-corner { border-color: var(--accent); }
.fingerprint-scan-area.failed  .fp-corner { border-color: var(--danger); }

.fp-corner--tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; border-radius: 2px 0 0 0; }
.fp-corner--tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; border-radius: 0 2px 0 0; }
.fp-corner--bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; border-radius: 0 0 0 2px; }
.fp-corner--br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; border-radius: 0 0 2px 0; }

.fingerprint-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-align: center;
  min-height: 1.2em;
}

.fingerprint-result {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  min-height: 1.4em;
}

.fingerprint-result--success { color: var(--safe); }
.fingerprint-result--failure { color: var(--danger); }

@keyframes fp-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(200, 169, 110, 0.25); }
  50%       { box-shadow: 0 0 36px rgba(200, 169, 110, 0.55); }
}

@keyframes fp-scanline {
  0%   { transform: translateY(-55px); }
  100% { transform: translateY(55px); }
}

