/* ImbasAR — app AR (/c/) */
:root {
  --navy: #0F172A;
  --teal: #14B8A6;
  --gold: #D4A853;
  --offwhite: #FAFAF7;
  --accent: var(--teal);
  --font-head: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}
.theme-kad { --accent: var(--gold); }
.theme-bisnes { --accent: var(--teal); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--navy); color: var(--offwhite); font-family: var(--font-body); -webkit-text-size-adjust: 100%; }
body { overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--font-head); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 8px; }
#arVideo { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.wordmark { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; }
.wm-a { color: var(--navy); }
.wm-b { color: var(--teal); }
.wordmark--white .wm-a { color: #fff; }
.logo-img { height: 40px; width: auto; }

.btn { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 20px; border-radius: 999px; border: 2px solid transparent; font: 700 1.05rem/1.2 var(--font-head); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn:focus-visible, .chip:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--navy); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.chip { appearance: none; border: 0; background: rgba(15,23,42,.75); color: #fff; font: 600 .9rem var(--font-body); padding: 10px 14px; border-radius: 999px; min-height: 40px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Skrin penuh */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); overflow-y: auto; background: var(--navy); z-index: 30; }
.screen--center { align-items: center; justify-content: center; gap: 12px; }
.top { display: flex; justify-content: center; padding: 8px 0 12px; }
.start-body { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; max-width: 420px; width: 100%; margin: 0 auto; }
.start-poster { width: 100%; max-height: 34vh; object-fit: contain; border-radius: 14px; margin: 0 auto 20px; box-shadow: 0 0 0 2px var(--accent), 0 16px 40px rgba(0,0,0,.4); }
.eyebrow { font: 700 .75rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.start-body h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
.tagline { color: #CBD5E1; margin: 0; }
.actions { display: grid; gap: 12px; max-width: 420px; width: 100%; margin: 20px auto 0; }
.hint-small { font-size: .78rem; color: #94A3B8; text-align: center; margin: 4px 0 0; }
.inapp-warning { margin-top: 16px; font-size: .88rem; background: rgba(255,255,255,.08); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 8px; text-align: left; }

.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ralat */
.error-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 2px solid var(--accent); font: 800 1.6rem var(--font-head); color: var(--accent); }
.error-body { color: #CBD5E1; text-align: left; font-size: .95rem; line-height: 1.55; }
.error-body ol, .error-body ul { padding-left: 20px; margin: 8px 0; }
.error-body p { margin: 0 0 10px; }

/* Kontena AR (A-Frame + kamera) */
.ar-container { position: fixed; inset: 0; overflow: hidden; z-index: 1; background: #000; }
.ar-container a-scene { position: absolute; inset: 0; width: 100%; height: 100%; }

/* UI atas AR */
.ar-ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.ar-ui > * { pointer-events: auto; }
.ar-top { display: flex; justify-content: space-between; gap: 8px; }
.scan-hint { pointer-events: none; text-align: center; transition: opacity .25s; }
.scan-hint.is-hidden { opacity: 0; }
.scan-hint p { margin: 14px auto 0; display: table; background: rgba(15,23,42,.8); padding: 10px 16px; border-radius: 999px; font: 700 1rem var(--font-head); }
.scan-hint .scan-sub { margin-top: 8px; font: 500 .82rem var(--font-body); padding: 6px 12px; color: #CBD5E1; }
.scan-frame { position: relative; width: min(64vw, 280px); aspect-ratio: 3 / 4; margin: 0 auto; animation: pulse 1.8s ease-in-out infinite; }
.scan-frame i { position: absolute; width: 36px; height: 36px; border: 4px solid var(--accent); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
@keyframes pulse { 50% { transform: scale(.95); opacity: .7; } }
.ar-bottom { display: grid; gap: 10px; max-width: 420px; width: 100%; margin: 0 auto; }
.ar-bottom .btn-ghost { background: rgba(15,23,42,.7); }

/* Pemain biasa */
.player { position: fixed; inset: 0; z-index: 40; background: #020617; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.player-top h2 { font-size: 1.1rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-video { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 12px 0; }
.player-video video { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 12px; background: #000; }
.player-bottom { display: grid; gap: 10px; max-width: 420px; width: 100%; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) { .scan-frame, .spinner { animation: none; } }

/* Kad AR v2 — butang jemputan & skrin tamat video */
.btn-invite { box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.btn-xl { min-height: 60px; font-size: 1.12rem; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
.btn-rsvp-hud { animation: rise .35s ease-out; box-shadow: 0 10px 28px rgba(0,0,0,.45); }

/* Kad AR v3 — kilauan emas CSS di atas kanvas (0.6s → 1.2s) */
.shimmer { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.shimmer::before { content: ""; position: absolute; top: -50%; left: -60%; width: 60%; height: 200%; transform: rotate(20deg); opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(212,168,83,.0) 20%, rgba(244,214,140,.55) 50%, rgba(212,168,83,0) 80%, transparent); }
.shimmer.run::before { animation: sweep .6s ease-out forwards; }
.shimmer::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 55%, rgba(212,168,83,.35), transparent 55%); opacity: 0; }
.shimmer.run::after { animation: glow .6s ease-out forwards; }
@keyframes sweep { 0% { left: -60%; opacity: 1; } 100% { left: 120%; opacity: 1; } }
@keyframes glow { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }

/* Kad jemputan pada skrin */
.card-overlay { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: rgba(2,6,23,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow-y: auto; }
.invite-card { width: 100%; max-width: 400px; text-align: center; display: grid; gap: 8px; padding: 22px 18px 18px; border-radius: 22px; background: linear-gradient(180deg, #16213A, var(--navy)); border: 1.5px solid rgba(212,168,83,.7); box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 0 0 6px rgba(212,168,83,.08); animation: rise .4s ease-out; }
.invite-card .eyebrow { margin: 4px 0 0; }
.card-msg { margin: 0 0 6px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.08); font-weight: 600; font-size: .92rem; }
.card-figure { position: relative; margin: 0 auto; width: 62%; max-width: 220px; overflow: hidden; }
.card-figure img { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; display: block; filter: drop-shadow(0 10px 12px rgba(0,0,0,.45)); }
.card-figure::after { content: ""; position: absolute; top: -20%; left: -80%; width: 50%; height: 140%; transform: rotate(18deg); background: linear-gradient(90deg, transparent, rgba(244,214,140,.6), transparent); opacity: 0; }
.card-figure.run::after { animation: sweep .9s .3s ease-out forwards; }
.card-names { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 2rem; margin: 0; letter-spacing: 0; }
.card-when { margin: 0; color: #E2E8F0; font-weight: 600; }
.card-where { margin: 0 0 8px; color: #CBD5E1; font-size: .92rem; }
.card-row { display: flex; gap: 8px; }
.card-row .btn { flex: 1; min-height: 46px; font-size: .92rem; padding: 10px 12px; }
@media (prefers-reduced-motion: reduce) { .invite-card, .btn-rsvp-hud { animation: none; } .shimmer, .card-figure::after { display: none; } }
