:root {
  --bg: #0a1628;
  --fg: #f8fafc;
  --muted: #94a3b8;
  --accent: #ffffff;
  --radius: 999px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  overscroll-behavior: none;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
}

.brand {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 28rem;
  color: #cbd5e1;
  margin: 0;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    transform 0.1s,
    background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: underline;
  padding: 0.25rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 26rem;
}

.card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  text-decoration: none;
  transition: background 0.2s;
}

.card-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.card-item strong {
  display: block;
  font-size: 0.95rem;
}

.card-item span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.card-item::after {
  content: "→";
  color: var(--muted);
  font-size: 1.1rem;
}

#screen-ar {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1;
}

#camera-feed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

#aframe-container {
  position: absolute;
  inset: 0;
  z-index: 2;
}

#aframe-container .a-canvas {
  background-color: transparent !important;
}

.ar-status {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}

.ar-unmute {
  position: fixed;
  left: 50%;
  bottom: 7rem;
  transform: translateX(-50%);
  background: #fff;
  color: #0f172a;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 10;
  display: none;
  cursor: pointer;
}

.ar-cta {
  position: fixed;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 2rem;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 10;
}



.fallback video {
  width: 100%;
  max-width: 28rem;
  border-radius: 2rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fallback-reason {
  font-size: 0.75rem;
  color: #fbbf24;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

.a-dialog-text,
.a-dialog-text-container {
  color: #0f172a !important;
}

/* ── Redirect toast (haut de l'écran) ── */
.redirect-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 15, 30, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(108, 99, 255, 0.3);
  transform: translateY(-100%);
  animation: toastSlideDown 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideDown {
  to { transform: translateY(0); }
}

.redirect-toast .toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  animation: iconPulse 1.2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.redirect-toast .toast-text {
  flex: 1;
  min-width: 0;
}

.redirect-toast .toast-text strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.redirect-toast .toast-text span {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.1rem;
}

.redirect-toast .toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6C63FF, #a78bfa);
  animation: progressFill 3s linear forwards;
}

@keyframes progressFill {
  to { width: 100%; }
}