/* =========================
   TailTracker Scan – iOS style
   ========================= */

body.ttapp {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

/* Top bar */
.ttapp-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,.2));
  z-index: 10;
}

.ttapp-title {
  font-weight: 600;
  font-size: 15px;
  opacity: .95;
}

.ttapp-back,
.ttapp-ghost {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* Main scan area */
.ttscan {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* Camera stage */
.ttscan-stage {
  position: absolute;
  inset: 0;
}

.ttscan-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HUD overlay */
.ttscan-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Reticle */
.ttscan-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.7);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.25);
}

/* Hint text */
.ttscan-hint {
  position: absolute;
  bottom: 24%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  opacity: .9;
  background: rgba(0,0,0,.5);
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* Live detected text */
.ttscan-chip {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .4px;
  backdrop-filter: blur(6px);
}

/* Result card */
.ttscan-card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: env(safe-area-inset-bottom, 12px);
  background: rgba(18,18,18,.85);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
  backdrop-filter: blur(12px);
  z-index: 20;
  animation: slideUp .25s ease-out;
}

@keyframes slideUp {
  0%   { transform: translateY(28px) scale(.96); opacity: 0; }
  60%  { transform: translateY(-4px) scale(1.01); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}


.ttscan-card-top {
  display: flex;
  gap: 12px;
}

.ttscan-img {
  width: 84px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #222;
}

.ttscan-card-meta {
  flex: 1;
}

.ttscan-tail {
  font-size: 18px;
  font-weight: 700;
}

.ttscan-sub {
  font-size: 14px;
  opacity: .85;
  margin-top: 2px;
}

.ttscan-warn {
  font-size: 12px;
  margin-top: 4px;
  opacity: .9;
  color: #ffd166;
}

/* Actions */
.ttscan-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ttscan-select {
  flex: 1;
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
}

.ttscan-btn {
  flex: 1;
  border-radius: 14px;
  border: none;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.ttscan-btn.primary {
  background: #1e88ff;
  color: #fff;
}

.ttscan-btn:not(.primary) {
  background: #2a2a2a;
  color: #fff;
}

/* Footer text */
.ttscan-foot {
  margin-top: 10px;
  font-size: 12px;
  opacity: .8;
}

/* Toast */
.ttscan-toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.8);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  backdrop-filter: blur(6px);
  z-index: 30;
}

@keyframes scanPulse {
  0%   { box-shadow: 0 0 0 9999px rgba(0,0,0,.28); }
  50%  { box-shadow: 0 0 0 9999px rgba(0,0,0,.18); }
  100% { box-shadow: 0 0 0 9999px rgba(0,0,0,.28); }
}

.ttscan-reticle {
  animation: scanPulse 2.2s ease-in-out infinite;
}

@keyframes popIn {
  0%   { transform: translateX(-50%) scale(.85); opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.05); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); }
}

.ttscan-chip {
  animation: popIn .35s cubic-bezier(.22,1.2,.36,1);
  border: 1px solid rgba(255,255,255,.25);
}
