.scan-page { background: #0b1020; color: #fff; overflow: hidden; height: 100dvh; }
.scan-page .muted { color: #cbd5e1; }
.scan-page a { color: #c7d2fe; }
#ar { position: fixed; inset: 0; overflow: hidden; }
#ar video { object-fit: cover; }
.intro { position: fixed; inset: 0; overflow: auto; background: linear-gradient(160deg, var(--brand), var(--brand2, #0b1020) 70%); z-index: 5; padding-top: env(safe-area-inset-top); }
.intro[hidden] { display: none; }
.target-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.target-strip img { height: 130px; border-radius: 12px; border: 3px solid rgba(255,255,255,.85); background: #fff; flex: none; }

.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud[hidden] { display: none; }
.hud > * { pointer-events: auto; }
.scan-hint { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; pointer-events: none; text-align: center; }
.scan-hint[hidden] { display: none; }
.scan-hint p { background: rgba(0,0,0,.55); padding: 6px 14px; border-radius: 99px; margin: 0; }
.scan-frame { width: min(70vw, 320px); aspect-ratio: 1; border-radius: 24px; border: 3px solid rgba(255,255,255,.9); box-shadow: 0 0 0 100vmax rgba(0,0,0,.18); animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .7; } }
.hud-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 1.2rem; }
.hud-toast { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.7); padding: 8px 14px; border-radius: 99px; font-size: .9rem; pointer-events: none; }
.hud-toast[hidden] { display: none; }

.cards { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow: auto; pointer-events: none; }
.info-card { pointer-events: auto; position: relative; background: #fff; color: var(--ink); border-radius: 18px; padding: 16px 16px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: slideup .35s cubic-bezier(.2,1.3,.4,1); }
.info-card h3 { margin-right: 32px; }
.info-card p { margin-bottom: .6em; }
.card-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; padding: 0; border-radius: 99px; border: 0; background: #f1f5f9; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.quiz-opts { display: grid; gap: 8px; margin: 8px 0; }
.quiz-opt { justify-content: flex-start; text-align: left; }
.quiz-opt.right { background: #d1fae5; border-color: #10b981; opacity: 1; }
.quiz-opt.wrong { background: #fee2e2; border-color: #ef4444; opacity: 1; }
.quiz-result { font-weight: 600; margin: 0; }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 50; pointer-events: none; animation: fall 2s ease-in forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }

/* Tap to place: choose a model, clear everything */
.xr-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; max-width: 92vw; overflow-x: auto; padding: 6px; border-radius: 99px; background: rgba(0,0,0,.45); z-index: 2; }
.xr-pick { width: 54px; height: 54px; padding: 0; border-radius: 99px; overflow: hidden; border: 3px solid transparent; background: #fff; flex: none; }
.xr-pick.on { border-color: var(--brand, #4f46e5); }
.xr-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xr-clear { width: 44px; height: 44px; padding: 0; border-radius: 99px; border: 0; background: rgba(255,255,255,.9); flex: none; }
.cards:not(:empty) ~ .xr-bar { display: none; }

/* School home page */
.hero { background: var(--brand); color: #fff; padding: 36px 0 28px; }
.hero h1 { font-size: 1.9rem; }
.scan-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.scan-card:hover { border-color: var(--brand); }

/* Object mode */
#ar video.cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#ar canvas.cam-overlay { position: absolute; inset: 0; }
.meter { position: absolute; left: 12px; right: 68px; top: calc(14px + env(safe-area-inset-top)); background: rgba(0,0,0,.6); border-radius: 10px; padding: 6px 10px; font-size: .8rem; pointer-events: none; }
.card-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 8px; display: block; }
.floaty { position: fixed; bottom: -40px; z-index: 50; pointer-events: none; font-style: normal; animation: rise 2.8s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; } 15% { opacity: 1; } 100% { bottom: 85vh; opacity: 0; transform: translateX(var(--drift, 0)) rotate(25deg); } }

/* Place mode */
.place-list { display: grid; gap: 18px; }
.place-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 12px; }
.place-card .muted { color: var(--muted); }
.place-card .info-card { box-shadow: none; border: 1px solid var(--line); margin-top: 10px; animation: none; }
.place-viewer { width: 100%; height: 360px; background: #f1f5f9; border-radius: 12px; --poster-color: #f1f5f9; }
.place-ar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; }

/* School branding */
.school-logo { max-height: 56px; max-width: 60%; object-fit: contain; display: block; }
.intro .school-logo { background: rgba(255,255,255,.92); padding: 6px 10px; border-radius: 12px; }
.hero .school-logo { background: #fff; padding: 6px 10px; border-radius: 12px; margin-bottom: 12px; }
.intro-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.corner-btn { background: rgba(255,255,255,.18); color: #fff !important; padding: 6px 12px; border-radius: 99px; text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.hero .corner-btn { float: right; }
.hero { background: linear-gradient(135deg, var(--brand), var(--brand2, var(--brand))); }

/* Collect them all */
.hunt-pill { display: inline-block; background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .9rem; }
.hud .hunt-pill { position: absolute; left: 12px; top: calc(14px + env(safe-area-inset-top)); background: rgba(0,0,0,.6); pointer-events: none; }
.target-strip img.found { border-color: #34d399; }

/* Photo */
.hud-photo { position: absolute; right: 12px; top: calc(64px + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 1.2rem; padding: 0; }
.photo-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.85); display: grid; place-items: center; padding: 16px; }
.photo-sheet .inner { display: grid; gap: 10px; max-width: 520px; width: 100%; }
.photo-sheet img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; }
.photo-sheet .row { justify-content: center; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 59; pointer-events: none; animation: flash .35s ease-out forwards; }
@keyframes flash { to { opacity: 0; } }
.info-card .row { flex-wrap: wrap; }
.scan-page .btn, .scan-page .info-card a.btn { color: var(--ink); }
.scan-page .btn.primary { color: #fff; }
