:root {
  --red-900: #7a0615;
  --red-800: #99081b;
  --red-700: #b80a22;
  --red-600: #d40b28;
  --red-500: #e41c37;
  --gold: #ffd166;
  --cream: #fff8f2;
  --ink: #2a2a2a;
  --muted: #ffffffcc;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #fff;
  background: radial-gradient(1200px 600px at 50% -200px, var(--red-600), var(--red-900));
  background-attachment: fixed;
}

.hero { padding: 32px 16px 12px; text-align: center; }
.hero .hero-content { max-width: 900px; margin: 0 auto; }
.site-logo { width: 120px; height: auto; display: block; margin: 0 auto 8px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.hero h1 { margin: 8px 0 8px; font-size: 2rem; letter-spacing: .3px; }
.hero h1.magic { font-family: 'Cinzel Decorative', serif; font-size: 2.4rem; text-shadow: 0 4px 18px rgba(0,0,0,.35); }
.hero p { margin: 0 auto; max-width: 640px; color: var(--muted); }
.badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 700;
  background: linear-gradient(90deg, var(--gold), #ffe69a); color: #7a3a00; box-shadow: var(--shadow);
}

.container { max-width: 980px; margin: 0 auto; padding: 16px; }
.card {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--ink); }
input[type="text"], input[type="file"] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(0,0,0,.2);
  background: #ffffff; color: var(--ink); outline: none;
}
input[type="text"]::placeholder { color: #6b7280; }
input[type="text"]:focus { border-color: var(--red-600); box-shadow: 0 0 0 3px rgba(228,28,55,.15); }

.grid-tipos {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.tipo-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 12px; border-radius: 14px; cursor: pointer; aspect-ratio: 1 / 1;
  border: 2px solid rgba(0,0,0,.10); background: #fafafa;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tipo-card:hover { transform: translateY(-2px); background: #f3f3f3; }
.tipo-card .icon { font-size: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.tipo-card .text { font-weight: 700; color: var(--ink); text-align: center; }
.tipo-card .tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.06); color: var(--ink); }
.tipo-card .check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 999px; background: #22c55e; color: #fff; display: none; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 4px 10px rgba(34,197,94,.45); }
.tipo-card.selected { border-color: #22c55e; box-shadow: 0 10px 22px rgba(34,197,94,.25); }
.tipo-card.selected .check { display: flex; }
.tipo-card.disabled { opacity: .5; cursor: not-allowed; }
.tipo-card.disabled:hover { transform: none; }

.actions { margin-top: 10px; text-align: center; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25);
  text-decoration: none; color: #fff; font-weight: 700; cursor: pointer; transition: transform .12s ease, background .2s ease;
}
.btn-primary { background: linear-gradient(180deg, var(--red-500), var(--red-700)); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { background: #f3f4f6; color: var(--ink); border-color: rgba(0,0,0,.08); }
.btn-secondary:hover { background: #e5e7eb; transform: translateY(-1px); }
.legend { margin: 10px 0 20px; font-size: 12px; color: #5a5a5a; }

.video { width: 100%; max-height: 70vh; border-radius: 12px; box-shadow: var(--shadow); background: #000; margin-top: 20px; }
.result-actions { margin-top: 12px; text-align: center; margin-bottom: 20px; }

.footer { text-align: center; color: var(--muted); padding: 18px; font-size: 12px; }

.hidden { display: none !important; }

.loading {
  position: fixed; inset: 0; display: grid; place-items: center; gap: 14px;
  background: rgba(10, 0, 0, .55); backdrop-filter: blur(4px); z-index: 50;
}
.spinner {
  width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress { width: min(480px, 90vw); height: 14px; border-radius: 999px; background: rgba(255,255,255,.2); position: relative; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold), #ffe69a); transition: width .2s ease; }
.progress-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 12px; color: #371c00; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.loading-tip { max-width: 420px; text-align: center; color: #fff; opacity: .9; font-size: 12px; }

/* Snow animation */
.snow::before, .snow::after {
  content: ""; position: fixed; inset: -50vh 0 0 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #ffffffcc 50%, rgba(255,255,255,0) 51%),
    radial-gradient(2px 2px at 40px 70px, #ffffffcc 50%, rgba(255,255,255,0) 51%),
    radial-gradient(3px 3px at 50px 160px, #ffffffb0 50%, rgba(255,255,255,0) 51%),
    radial-gradient(2px 2px at 90px 40px, #ffffffcc 50%, rgba(255,255,255,0) 51%),
    radial-gradient(3px 3px at 130px 80px, #ffffffb0 50%, rgba(255,255,255,0) 51%),
    radial-gradient(2px 2px at 160px 120px, #ffffffcc 50%, rgba(255,255,255,0) 51%);
  background-size: 200px 200px;
  animation: snow 10s linear infinite;
}
.snow::after { animation-duration: 14s; opacity: .6; filter: blur(1px); }
@keyframes snow { from { transform: translateY(-50vh); } to { transform: translateY(100vh); } }

/* Mobile-first adjustments */
@media (min-width: 720px) {
  .hero h1 { font-size: 2.4rem; }
  .grid-tipos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card { padding: 18px; }
}

/* Result overlay */
.result-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10,0,0,.7); backdrop-filter: blur(4px); padding: 12px; }
.result-overlay.hidden { display: none !important; }
.result-card { width: min(720px, 94vw); background: #fff; color: var(--ink); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.08); }
.result-card h2 { margin: 6px 0 10px; color: var(--ink); }
.offer { position: fixed; inset: 0; z-index: 65; display: grid; grid-template-rows: auto 1fr; background: rgba(10,0,0,.75); backdrop-filter: blur(4px); padding: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.offer.hidden { display: none !important; }
.offer-bar { position: sticky; top: 0; z-index: 70; min-height: 80px; padding: 10px 15px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--red-600); color: #fff; font-weight: 800; letter-spacing: .2px; white-space: normal; flex-wrap: wrap; margin-bottom: 20px; }
.offer-bar .off-pct { color: var(--gold); text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.offer-wrap { max-width: 980px; width: 100%; margin: 12px auto; padding: 0 12px; }
.offer-wrap h2 { color: var(--ink); margin: 24px 0 18px; }
.offer-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.offer-card { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 12px; }
.locked { position: relative; }
.lock-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); border-radius: 12px; color: #fff; text-align: center; }
.lock-icon { font-size: 36px; margin-bottom: 4px; text-shadow: 0 6px 18px rgba(0,0,0,.6); }
.lock-text { font-weight: 700; }
@media (min-width: 720px) {
  .offer-grid { grid-template-columns: 1fr 1fr; }
}
.overlay-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mini-title { font-size: 12px; color: #6b7280; margin: 4px 0; }
@media (min-width: 720px) {
  .overlay-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* Checkout modal */
.checkout-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(10,0,0,.6); backdrop-filter: blur(6px); padding: 12px; }
.checkout-modal.hidden { display: none !important; }
.checkout-dialog { width: min(960px, 90vw); height: min(900px, 90vh); background: #fff; border-radius: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
#checkout-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.checkout-close { position: absolute; top: 8px; right: 8px; border: none; border-radius: 999px; width: 36px; height: 36px; font-size: 16px; font-weight: 800; color: #fff; background: rgba(0,0,0,.45); cursor: pointer; box-shadow: var(--shadow); }

/* Buyer form */
.buyer-form { margin: 6px 0 10px; display: grid; gap: 8px; }
.buyer-form .row { display: grid; gap: 8px; }
.buyer-form .row.two { grid-template-columns: 1fr 1fr; }
.buyer-form input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,.2); background: #fff; color: var(--ink); }
.buyer-form input::placeholder { color: #6b7280; }


