/* Bloques — base: colores, tipografía, escenario, marco de teléfono en computadora, botones, hojas (sheets), avisos
   y visor. Todo bajo html.bloques (prototipo aislado). Tres paletas pastel (html[data-palette]: rosa, azul, neutra);
   texto en tinta oscura sobre crema (contraste ≥ 4.5:1) y botón principal con texto blanco (≥ 4.5:1). */
.bloques {
  --ink: #3A2B36; --ink-2: #66525F; --cream: #FFFBF3; --cream-2: #FFF1E2; --line: #F0DECF;
  --primary: #C93A72; --primary-2: #A52C5D; --on-primary: #FFFFFF;
  --accent: #F49AB9; --accent-soft: #FFE3EC; --accent-ink: #8E2452;
  --room-1: #FFE9EF; --room-2: #F8CCD9; --frame: #F2B8CB;
  --shadow: 0 12px 34px rgba(58, 43, 54, .22);
  --radius: 24px;
  --font-d: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-b: "Nunito", "Fredoka", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
.bloques[data-palette="azul"] { --primary: #2D6CB0; --primary-2: #22568F; --accent: #7FB8EC; --accent-soft: #DCEEFC; --accent-ink: #1E4E80; --room-1: #EAF4FD; --room-2: #CFE3F6; --frame: #A9CDEF; }
.bloques[data-palette="neutra"] { --primary: #2F7E63; --primary-2: #24644E; --accent: #9BDBBE; --accent-soft: #E3F5EA; --accent-ink: #235C47; --room-1: #F6F9EC; --room-2: #E2EED5; --frame: #C6E3BF; }
.bloques *, .bloques *::before, .bloques *::after { box-sizing: border-box; }
.bloques body { height: 100%; overflow: hidden; color: var(--ink); font: 400 16px/1.45 var(--font-b); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
/* ---------- escritorio: el cuarto de juegos, difuminado, alrededor del teléfono ---------- */
.bloques .room { position: fixed; inset: 0; z-index: 0; overflow: hidden; background:
  radial-gradient(38% 30% at 22% 28%, rgba(255, 255, 255, .7), transparent 70%),
  linear-gradient(180deg, var(--room-1) 0%, var(--room-2) 58%, #E9C9A4 58.5%, #DDB98F 100%); }
.bloques .room::before { /* cubitos y peluches desenfocados en el piso */
  content: ""; position: absolute; left: -5%; right: -5%; top: 46%; height: 34%;
  background-image: radial-gradient(ellipse 7% 30% at 10% 70%, rgba(214, 170, 120, .9), transparent 70%), radial-gradient(ellipse 5% 20% at 86% 64%, rgba(255, 210, 120, .85), transparent 70%),
    linear-gradient(var(--accent), var(--accent)), linear-gradient(#F9C97C, #F9C97C), linear-gradient(#9CC8F2, #9CC8F2), linear-gradient(#B9A6E8, #B9A6E8);
  background-size: auto, auto, 5% 14%, 4.5% 13%, 5% 14%, 4% 12%;
  background-position: 0 0, 0 0, 18% 82%, 25% 80%, 74% 84%, 80% 82%;
  background-repeat: no-repeat;
  filter: blur(8px); opacity: .85; }
.bloques .app { position: fixed; inset: 0; z-index: 1; overflow: hidden; isolation: isolate; transition: opacity .5s ease; }
/* (mismo marco de teléfono que los demás diseños: Caja Musical, El Nido, Misión Estrella…) */
@media (min-width: 560px) and (min-height: 560px) {
  .bloques .app { inset: auto; left: 50%; top: 50%; width: min(430px, 100vw - 32px); height: min(932px, 100dvh - 40px); transform: translate(-50%, -50%);
    border-radius: 36px; box-shadow: 0 0 0 10px #FFF8F0, 0 0 0 12px var(--frame), 0 30px 80px rgba(80, 50, 60, .3), 0 0 90px rgba(255, 220, 190, .25); }
}
.bloques.is-showcase .app { inset: 0 !important; width: auto !important; height: auto !important; transform: none !important; border-radius: 0 !important; box-shadow: none !important; }
.bloques .stage { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, var(--room-1), var(--room-2) 60%, #E7C9A6); }
.bloques .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.bloques .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bloques.is-ready .poster { animation: bl-fade-out .5s ease .2s forwards; }
@keyframes bl-fade-out { to { opacity: 0; visibility: hidden; } }
.bloques .veil { position: absolute; inset: 0; background: var(--cream); opacity: 0; pointer-events: none; transition: opacity .22s ease; z-index: 3; }
.bloques .veil.is-on { opacity: 1; }
.bloques .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bloques .noscript { position: fixed; inset: auto 16px 16px; padding: 16px; border-radius: 16px; background: var(--cream); color: var(--ink); }
.bloques .ui { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.bloques .ui > * { pointer-events: auto; }
.bloques button { font: inherit; color: inherit; }
.bloques :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* (sólo para generar la imagen OG: ?showcase=1&still=1&og=1) */
.bloques .og-title { position: absolute; left: 0; right: 0; top: 30px; z-index: 4; text-align: center; color: #FFFFFF; text-shadow: 0 4px 0 var(--primary-2), 0 8px 26px rgba(70, 30, 50, .4); pointer-events: none; }
.bloques .og-title p { margin: 0; font: 700 40px/1 var(--font-d); }
.bloques .og-title strong { display: block; margin-top: 6px; font: 700 78px/1 var(--font-d); }

/* ---------- botones ---------- */
.bloques .gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 2px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink); font: 700 16px/1.1 var(--font-d); text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 rgba(58, 43, 54, .12); transition: transform .12s ease, box-shadow .12s ease, background .2s; }
.bloques .gbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(58, 43, 54, .12); }
.bloques .gbtn.is-primary { border-color: transparent; background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 0 var(--primary-2), 0 8px 18px rgba(58, 43, 54, .2); }
.bloques .gbtn.is-primary:active { box-shadow: 0 1px 0 var(--primary-2); }
.bloques .gbtn.is-soft { background: rgba(255, 251, 243, .75); }
.bloques .gbtn.is-big { min-height: 54px; font-size: 18px; padding: 0 24px; }
.bloques .gbtn.is-small { min-height: 44px; font-size: 15px; }
.bloques .gbtn[disabled] { opacity: .5; cursor: default; }
.bloques .round-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 251, 243, .94); color: var(--ink); cursor: pointer; box-shadow: 0 4px 14px rgba(58, 43, 54, .2); }
.bloques .round-btn[disabled] { opacity: .4; cursor: default; }

/* ---------- hojas (confirmación, información) ---------- */
.bloques .sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(58, 43, 54, 0); pointer-events: auto; transition: background .35s ease; }
.bloques .sheet.is-on { background: rgba(58, 43, 54, .2); }
.bloques .sheet.is-rsvp.is-on { background: rgba(58, 43, 54, 0); } /* (el cubo 3D se ve arriba) */
.bloques .sheet-panel { display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(78dvh, 720px); border-radius: var(--radius) var(--radius) 0 0; background: var(--cream); box-shadow: var(--shadow); transform: translateY(105%); transition: transform .38s cubic-bezier(.2, .9, .25, 1.05); overflow: hidden; padding-bottom: var(--safe-b); }
.bloques .sheet.is-on .sheet-panel { transform: none; }
.bloques .sheet.is-rsvp .sheet-panel { max-height: min(60dvh, 620px); }
.bloques .sheet.is-details .sheet-panel { max-height: 92dvh; }
.bloques .sh-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 8px 20px; border-bottom: 1px solid var(--line); }
.bloques .sh-head > div:first-child, .bloques .sh-titles { flex: 1; min-width: 0; }
.bloques .sh-head.is-sticky { flex-wrap: wrap; }
.bloques .sh-head .chips { flex-basis: 100%; }
.bloques .kick { margin: 0; font: 700 20px/1.2 var(--font-d); color: var(--ink); }
.bloques .sub { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.bloques .sh-titles h2 { margin: 2px 0 0; font: 700 24px/1.15 var(--font-d); }
.bloques .sh-body, .bloques .rv-body { flex: 1; overflow: auto; padding: 12px 20px 16px; overscroll-behavior: contain; }
.bloques .sh-bar { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--cream); }
.bloques .sh-bar .dead { margin: 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.bloques .c-close { flex: none; width: 44px; height: 44px; box-shadow: none; background: var(--cream-2); }
.rm.bloques .sheet-panel { transition: opacity .2s ease; transform: none; opacity: 0; }
.rm.bloques .sheet.is-on .sheet-panel { opacity: 1; }

/* ---------- avisos ---------- */
.bloques .toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 74px); z-index: 40; max-width: min(92vw, 400px); padding: 12px 18px; border-radius: 18px; background: var(--cream); color: var(--ink); font: 700 16px/1.3 var(--font-d); text-align: center; box-shadow: var(--shadow); transform: translate(-50%, -12px); opacity: 0; transition: opacity .3s ease, transform .3s ease; pointer-events: none; }
.bloques .toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.bloques .notice { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(58, 43, 54, .42); opacity: 0; transition: opacity .25s ease; pointer-events: auto; }
.bloques .notice.is-on { opacity: 1; }
.bloques .notice-card { width: min(380px, 100%); padding: 22px 20px 18px; border-radius: var(--radius); background: var(--cream); text-align: center; box-shadow: var(--shadow); }
.bloques .notice-card h2 { margin: 8px 0 6px; font: 700 22px/1.2 var(--font-d); }
.bloques .notice-card p { margin: 0 0 10px; color: var(--ink-2); }
.bloques .notice-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #DDF4E4; color: #24704A; }
.bloques .notice-msg { margin: 0 0 14px; padding: 12px; border-radius: 14px; background: #fff; text-align: left; white-space: pre-wrap; font: 600 14px/1.45 var(--font-b); color: var(--ink); max-height: 30dvh; overflow: auto; }
.bloques .notice-card .gbtn { width: 100%; }

/* ---------- visor de fotos ---------- */
.bloques .viewer { position: fixed; inset: 0; z-index: 45; background: rgba(44, 32, 40, .94); opacity: 0; transition: opacity .25s ease; pointer-events: auto; transform: translateY(var(--drag, 0)); }
.bloques .viewer.is-on { opacity: 1; }
.bloques .v-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.bloques .v-track::-webkit-scrollbar { display: none; }
.bloques .v-slide { flex: 0 0 100%; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 64px 16px 72px; scroll-snap-align: center; }
.bloques .v-frame { max-width: 100%; max-height: calc(100% - 40px); padding: 10px; border-radius: 12px; background: linear-gradient(135deg, #E2B47A, #C98F52); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.bloques .v-frame img { display: block; max-width: min(92vw, 720px); max-height: calc(100dvh - 190px); border-radius: 6px; object-fit: contain; }
.bloques .v-slide figcaption { color: var(--cream); font: 700 18px/1.2 var(--font-d); }
.bloques .v-count { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 22px); margin: 0; transform: translateX(-50%); color: var(--cream); font-weight: 700; }
.bloques .v-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.bloques .v-prev { left: 12px; } .bloques .v-next { right: 12px; }
.bloques .v-close { position: absolute; top: calc(var(--safe-t) + 12px); right: 12px; }

/* ---------- dentro del marco de escritorio: las alturas que en el celular son de la pantalla son del marco ---------- */
@media (min-width: 560px) and (min-height: 560px) {
  .bloques .sheet-panel { max-height: min(78%, 720px); }
  .bloques .sheet.is-rsvp .sheet-panel { max-height: min(60%, 620px); }
  .bloques .sheet.is-details .sheet-panel { max-height: 92%; }
  .bloques .notice-msg { max-height: 30%; }
  .bloques .v-frame img { max-width: calc(min(430px, 100vw - 32px) - 64px); max-height: calc(min(932px, 100dvh - 40px) - 190px); }
}
