/* site.css — Surprise Studio v3. Home look is FROZEN (§6.1): glowing
   Codevx_Tashin banner, aurora background, Bengali title, 3 stat boxes,
   2-column glossy category grid, "Developer: Codevx_Tashin" footer.
   Builder / viewer / admin styles follow the same palette. */

/* Self-hosted fonts (spec §3.1): local woff2 only — Cinzel 700/800 and
   Hind Siliguri 400/700, Latin + Bengali subsets. Google Fonts CDN is
   blocked by our CSP (font-src 'self'), so the files live in /fonts/ and
   are served same-origin. The @font-face rules below only *declare* the
   faces; the browser downloads each subset on demand by unicode-range.
   The same six files are preloaded via FontFace in engine/text3d.js
   (loadFonts) before any 3D text texture is drawn. Fallbacks are the
   system stacks in --font-bn / --font-display below. */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/cinzel-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/cinzel-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hind Siliguri'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/hind-400-bengali.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: 'Hind Siliguri'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/hind-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hind Siliguri'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/hind-700-bengali.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: 'Hind Siliguri'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/hind-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --gold: #ffc857; --pink: #f472b6; --cyan: #67e8f9; --violet: #a78bfa;
  --bg: #07060f; --panel: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .14);
  --text: #f5f3ff; --muted: #b9b3d0;
  --font-bn: "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --font-display: "Cinzel", "Hind Siliguri", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-bn);
  min-height: 100vh; overflow-x: hidden;
}
a { color: var(--gold); }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---- aurora background (home) ---- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #1b1035 0%, #07060f 60%); }
.orb { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.orb-1 { background: #7c3aed; top: -20vmax; left: -10vmax; }
.orb-2 { background: #db2777; top: 10vmax; right: -18vmax; animation-delay: -8s; }
.orb-3 { background: #0891b2; bottom: -25vmax; left: 30vw; animation-delay: -16s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* ---- top banner ---- */
.top-banner { text-align: center; padding: 26px 16px 6px; }
.brand-glow {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 6vw, 44px);
  letter-spacing: .04em; color: #fff;
  text-shadow: 0 0 12px rgba(255, 200, 87, .9), 0 0 42px rgba(244, 114, 182, .75), 0 0 80px rgba(124, 58, 237, .6);
  animation: glowPulse 3.2s ease-in-out infinite alternate;
}
.brand-sub { display: block; margin-top: 4px; color: var(--muted); letter-spacing: .35em; text-transform: uppercase; font-size: 12px; }
@keyframes glowPulse { from { text-shadow: 0 0 10px rgba(255,200,87,.7), 0 0 34px rgba(244,114,182,.55); } to { text-shadow: 0 0 18px rgba(255,200,87,1), 0 0 60px rgba(244,114,182,.9), 0 0 110px rgba(124,58,237,.7); } }

/* ---- home ---- */
.home { max-width: 860px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; }
.welcome { font-size: clamp(40px, 9vw, 68px); margin: 14px 0 6px; font-weight: 700;
  background: linear-gradient(90deg, #fde68a, #f472b6, #67e8f9, #fde68a); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: 220% 0; } }
.subtitle { color: var(--muted); margin: 4px 0; font-size: 16px; line-height: 1.6; }
.sub-2 { font-size: 14px; }
.stats { display: flex; gap: 10px; justify-content: center; align-items: stretch; flex-wrap: wrap; margin: 22px 0 26px; }
.stat-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; min-width: 108px; backdrop-filter: blur(6px); }
.stat-num { display: block; font-size: 26px; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.admin-btn { align-self: center; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); text-decoration: none; font-weight: 700; background: rgba(255, 200, 87, .08); }
.admin-btn:hover { background: rgba(255, 200, 87, .2); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.cat-card {
  position: relative; display: block; padding: 20px 16px 18px; border-radius: 20px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.03) 55%, rgba(255,200,87,.10));
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cat-card:hover, .cat-card:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 24px rgba(244,114,182,.35); outline: none; }
.cat-badge { position: absolute; top: 10px; right: 12px; font-size: 12px; color: var(--gold); background: rgba(0,0,0,.45); border: 1px solid rgba(255,200,87,.4); padding: 2px 8px; border-radius: 999px; }
.cat-icon { font-size: 34px; display: block; margin-bottom: 8px; }
.cat-title { display: block; font-weight: 700; font-size: 17px; }
.cat-bn { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.my-link { margin-top: 24px; }
.footer { text-align: center; padding: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }

/* ---- generic pages ---- */
.page { max-width: 980px; margin: 0 auto; padding: 16px; }
.page h1 { font-size: 30px; margin: 8px 0; }
.page .back { color: var(--muted); text-decoration: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 14px 0; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--text); font-weight: 700; text-decoration: none; font-size: 15px; }
.btn-primary { background: linear-gradient(135deg, #f59e0b, #db2777); border: none; color: #fff; }
.btn-danger { background: #7f1d1d; border-color: #991b1b; color: #fecaca; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.error { color: #fca5a5; }
.muted { color: var(--muted); }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.4); color: var(--text); font-family: inherit; font-size: 15px; }
input[type="color"] { padding: 2px; height: 40px; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; border: 1px solid var(--line); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- builder ---- */
.builder { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .builder { grid-template-columns: 1fr 1fr; } }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; }
.thumb .mv { right: 26px; }
.meter { height: 10px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #f59e0b, #ef4444); width: 0; transition: width .3s; }
.preview-wrap { position: sticky; top: 12px; }
.preview-canvas { width: 100%; aspect-ratio: 9/16; max-height: 70vh; border-radius: 16px; background: #000; display: block; }
.preview-bar { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.step-scrub { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.step-scrub button { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); }
.step-scrub button.active { background: var(--gold); color: #111; font-weight: 700; }
.qr-preview { text-align: center; margin: 12px 0; }
.qr-canvas { max-width: 100%; border-radius: 12px; }
.qr-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qr-field { margin: 0; }
.manage-key { font-family: ui-monospace, monospace; background: rgba(0,0,0,.5); padding: 10px; border-radius: 10px; word-break: break-all; }

/* ---- viewer ---- */
.viewer { position: fixed; inset: 0; background: #000; }
.viewer canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.step-bar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 6px; }
.step-bar i { flex: 1; height: 4px; border-radius: 999px; background: rgba(255,255,255,.25); }
.step-bar i.done { background: var(--gold); }
.step-bar i.current { background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.8); }
.hud-btns { position: absolute; top: 26px; right: 12px; display: flex; gap: 8px; pointer-events: auto; }
.hud-btns button, .next-btn { pointer-events: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0,0,0,.55); color: #fff; font-size: 16px; }
.quality-badge { align-self: center; font-size: 11px; color: #fff; background: rgba(0,0,0,.55); border: 1px solid var(--line); padding: 4px 8px; border-radius: 999px; }
.next-btn { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); min-width: 220px; padding: 13px 22px; border-radius: 999px; border: none; background: linear-gradient(135deg, #f59e0b, #db2777); color: #fff; font-weight: 700; font-size: 16px; overflow: hidden; }
.next-btn .fill { position: absolute; inset: 0; background: rgba(255,255,255,.22); width: 0; }
.next-btn span { position: relative; }
.gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); pointer-events: auto; text-align: center; padding: 20px; }
.gate h2 { margin: 0; font-size: 30px; }
.gate .tap-btn { padding: 16px 34px; border-radius: 999px; border: none; font-size: 19px; font-weight: 800; background: linear-gradient(135deg, #f59e0b, #db2777); color: #fff; animation: tapPulse 1.6s ease-in-out infinite; }
@keyframes tapPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.replay-bar { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.lock-card { max-width: 420px; margin: 18vh auto 0; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- my / admin ---- */
.wish-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--panel); flex-wrap: wrap; }
.wish-row .meta { min-width: 200px; }
table.admin { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin th, table.admin td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 8px 0; }
.chart i { flex: 1; background: linear-gradient(180deg, var(--gold), #db2777); border-radius: 4px 4px 0 0; min-height: 2px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.kpi b { display: block; font-size: 26px; color: var(--gold); }
