@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #0b0618;
  --ink-soft: #10091f;
  --panel: rgba(19, 12, 37, 0.78);
  --panel-strong: rgba(20, 12, 39, 0.94);
  --line: rgba(203, 177, 255, 0.15);
  --line-strong: rgba(214, 191, 255, 0.27);
  --text: #fff9ff;
  --muted: #b9aecb;
  --purple: #8d39f6;
  --purple-light: #bc88ff;
  --orange: #ff7a00;
  --orange-hot: #ff4d17;
  --gold: #ffd166;
  --mint: #b4ffd0;
  --font-main: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --shadow-deep: 0 24px 70px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background-color: var(--ink);
  background-image: linear-gradient(180deg, rgba(11, 6, 24, 0.56), rgba(11, 6, 24, 0.91) 42%, #0b0618 100%), url('../img/background.png');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 8% 12%, rgba(133, 47, 255, 0.16), transparent 34%), radial-gradient(ellipse at 92% 31%, rgba(255, 106, 0, 0.11), transparent 29%);
  content: '';
  pointer-events: none;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.site-container { width: min(100% - 40px, 1320px); margin-inline: auto; }
.dg-app-header { border-bottom-color: rgba(228, 211, 255, .11); }
.dg-app-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(100% - 40px, 1320px); min-height: 68px; margin-inline: auto; padding-block: 8px; }
.dg-app-brand { display: inline-flex; flex: 0 1 auto; align-items: center; min-width: 0; }
.dg-app-brand img { display: block; width: min(190px, 28vw); max-height: 42px; object-fit: contain; filter: drop-shadow(0 3px 12px rgba(97, 207, 230, .1)); }
.dg-app-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.dg-app-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid rgba(223, 203, 255, .2); border-radius: 999px; padding: 8px 14px; color: #e8ddf3; font-size: .74rem; font-weight: 700; text-decoration: none; transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease; }
.dg-app-link:hover { transform: translateY(-1px); border-color: rgba(255, 186, 116, .62); color: #fff; }
.dg-app-games { border-color: transparent; }
.dg-app-profile { border-color: rgba(255, 186, 116, .42); color: #ffd2a2; }
.dg-app-register { border-color: rgba(255, 184, 85, .5); background: linear-gradient(118deg, #ff9d16, #f3441e); color: #fff; }
.dg-app-register:hover { background: linear-gradient(118deg, #ffad32, #ff5931); color: #fff; }
.dg-app-user { max-width: 180px; overflow: hidden; color: #a99ab5; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.skip-link { position: fixed; z-index: 5000; top: 10px; left: 10px; transform: translateY(-160%); border-radius: 10px; padding: 10px 14px; background: #fff; color: #12091e; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }

/* Sticky product header */
.site-header { position: sticky; z-index: 1000; top: 0; border-bottom: 1px solid rgba(228, 211, 255, 0.11); background: rgba(11, 6, 24, 0.82); box-shadow: 0 10px 36px rgba(0, 0, 0, 0.15); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease; }
.mascaritas-navbar { min-height: 76px; padding-block: 10px; transition: min-height .25s ease, padding .25s ease; }
.mascaritas-navbar > .site-container { align-items: center; }
.mascaritas-brand { display: inline-flex; flex: 0 0 auto; align-items: center; min-width: 0; min-height: 48px; margin: 0; padding-block: 4px; }
.brand-logo { display: block; width: clamp(160px, 17vw, 214px); height: auto; filter: drop-shadow(0 4px 15px rgba(155, 50, 255, 0.15)); transition: width .25s ease, filter .25s ease; }
.site-header.is-compact .mascaritas-navbar { min-height: 64px; padding-block: 6px; }
.site-header.is-compact .brand-logo { width: clamp(154px, 15vw, 192px); }
.site-header.is-compact .dg-app-brand img { width: min(170px, 25vw); max-height: 38px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border: 1px solid transparent; border-radius: 999px; padding: 12px 22px; font-size: .9rem; font-weight: 800; letter-spacing: .025em; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; cursor: pointer; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0) scale(.985); }
.button:disabled { cursor: not-allowed; opacity: .45; filter: saturate(.55); }
.button-primary, .button-download { border-color: rgba(255, 184, 85, .5); background: linear-gradient(118deg, #ff9d16 0%, #ff6a00 50%, #f3441e 100%); box-shadow: 0 12px 32px rgba(255, 93, 14, .27), inset 0 1px 0 rgba(255,255,255,.3); color: #fff; }
.button-primary:hover:not(:disabled), .button-download:hover:not(:disabled) { box-shadow: 0 16px 36px rgba(255, 93, 14, .42), inset 0 1px 0 rgba(255,255,255,.35); color: #fff; }
.button-small { min-height: 42px; padding: 10px 17px; font-size: .82rem; }
.button-header { white-space: nowrap; }
.button-quiet, .button-secondary { border-color: rgba(210, 185, 255, .26); background: rgba(25, 13, 47, .64); color: #f6edff; }
.button-quiet:hover, .button-secondary:hover { border-color: rgba(186, 136, 255, .68); background: rgba(77, 36, 132, .45); color: #fff; }

/* Hero / Halloween visual identity */
.hero-section { position: relative; min-height: min(730px, calc(100svh - 76px)); display: flex; align-items: center; overflow: hidden; padding-block: clamp(74px, 10vw, 126px) clamp(92px, 12vw, 146px); }
.hero-content { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr); align-items: center; gap: clamp(30px, 6vw, 80px); }
.hero-copy { max-width: 590px; }
.hero-copy h1, .section-heading h2, .showcase-copy h2, .closing-content h2 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.055em; }
.hero-copy h1 { max-width: 700px; font-size: clamp(3.2rem, 7.1vw, 6.5rem); line-height: .99; }
.hero-copy h1 span { color: #ff983d; text-shadow: 0 5px 30px rgba(255, 90, 0, .22); }
.hero-copy > p { max-width: 460px; margin: 25px 0 27px; color: #d0c3db; font-size: clamp(1rem, 1.4vw, 1.14rem); line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-proof { display: flex; align-items: center; gap: 9px; margin-top: 23px; color: #b7a8c7; font-size: .78rem; }
.hero-proof i { color: #b890ff; }
.hero-art { position: relative; min-height: 440px; display: grid; place-items: center; isolation: isolate; }
.hero-art-halo { position: absolute; z-index: -1; width: min(78%, 480px); aspect-ratio: 1; border: 1px solid rgba(192, 139, 255, .27); border-radius: 50%; background: radial-gradient(circle at 50% 55%, rgba(255, 105, 0, .16), rgba(108, 39, 197, .16) 48%, transparent 70%); box-shadow: 0 0 100px rgba(125, 55, 246, .17), inset 0 0 50px rgba(140, 53, 255, .14); }
.hero-art::before, .hero-art::after { position: absolute; z-index: -1; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; content: ''; transform: rotate(-20deg); }
.hero-art::before { width: 94%; height: 57%; }
.hero-art::after { width: 106%; height: 72%; border-color: rgba(255, 135, 40, .13); transform: rotate(21deg); }
.hero-mask-slot { position: absolute; z-index: 1; width: min(50%, 265px); will-change: transform; }
.hero-mask-slot-1 { z-index: 2; top: 50%; left: 50%; width: min(55%, 286px); translate: -50% -47%; }
.hero-mask-slot-2 { top: 1%; left: 0; width: min(33%, 178px); opacity: .89; }
.hero-mask-slot-3 { right: 5%; bottom: 6%; width: min(37%, 200px); opacity: .88; }
.hero-mask { display: block; width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 28px 34px rgba(0,0,0,.5)); animation: mask-float 5.5s ease-in-out infinite; }
.hero-mask-2 { animation-delay: -1.7s; }
.hero-mask-3 { animation-delay: -3.2s; }
.hero-bottom-glow { position: absolute; right: -20%; bottom: -75px; left: -20%; height: 145px; background: linear-gradient(90deg, transparent, rgba(128, 47, 255, .14), rgba(255, 103, 0, .12), transparent); filter: blur(25px); }
@keyframes mask-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -11px; } }

/* Editor workflow */
.section-shell { padding-block: clamp(66px, 8vw, 112px); }
.editor-section { position: relative; background: linear-gradient(180deg, rgba(10, 6, 21, .68), rgba(11, 6, 24, .83)); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 30px; }
.section-heading h2 { font-size: clamp(2.25rem, 4.8vw, 3.6rem); letter-spacing: -.045em; }
.section-heading p { margin: 9px 0 0; color: var(--muted); }
.workflow-steps { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; color: #90849e; white-space: nowrap; }
.workflow-step { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700; }
.workflow-step b { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(226, 208, 255, .2); border-radius: 50%; color: #9c8caa; font-size: .64rem; }
.workflow-step.active { color: #ffd7ac; }
.workflow-step.active b { border-color: var(--orange); background: rgba(255, 122, 0, .17); color: #ffb76c; box-shadow: 0 0 17px rgba(255, 122, 0, .2); }
.workflow-line { width: clamp(10px, 2vw, 27px); height: 1px; background: rgba(226, 208, 255, .16); }
.editor-layout { display: grid; grid-template-columns: minmax(245px, .78fr) minmax(0, 1.55fr); grid-template-rows: auto auto; grid-template-areas: 'side stage' 'side download'; align-items: start; gap: 14px; }
.editor-main { grid-area: stage; min-width: 0; }
.editor-sidebar { grid-area: side; display: grid; gap: 14px; min-width: 0; }
.canvas-card, .side-panel { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg, rgba(28, 17, 48, .88), rgba(12, 9, 25, .91)); box-shadow: var(--shadow-deep); }
.canvas-card { overflow: hidden; }
.canvas-card-topline { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 12px 17px; border-bottom: 1px solid rgba(255,255,255,.07); color: #c5b7d4; font-size: .67rem; font-weight: 800; letter-spacing: .12em; }
.canvas-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #9affbd; box-shadow: 0 0 12px rgba(154,255,189,.6); }
.canvas-topline-note { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #988ba4; font-size: .65rem; font-weight: 500; letter-spacing: 0; }
.canvas-topline-note i { color: #bd95ff; }
.empty-state { min-height: 438px; display: grid; place-items: center; border: 1px dashed transparent; border-radius: 14px; padding: clamp(22px, 5vw, 52px); background: radial-gradient(ellipse at 50% 43%, rgba(126, 52, 205, .19), transparent 56%), rgba(8, 6, 19, .52); transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.empty-state-inner { width: min(100%, 430px); display: flex; flex-direction: column; align-items: center; text-align: center; outline: none; }
.empty-state.drag-over { border-color: var(--orange); background: radial-gradient(ellipse at 50% 43%, rgba(255, 122, 0, .2), transparent 62%), rgba(255, 111, 0, .08); box-shadow: inset 0 0 0 3px rgba(255, 122, 0, .12), 0 0 30px rgba(255, 110, 0, .12); }
.empty-state.drag-over .empty-state-inner { transform: scale(1.015); }
.empty-state.drag-over .empty-icon { border-color: var(--orange); background: rgba(255, 122, 0, .17); box-shadow: 0 0 32px rgba(255,122,0,.24); }
.empty-state.drag-over h3 { color: #ffe0bc; }
.empty-icon { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid rgba(196, 163, 255, .31); border-radius: 23px; background: rgba(89, 47, 137, .23); color: #e1c9ff; font-size: 1.7rem; box-shadow: 0 16px 40px rgba(0,0,0,.22); transition: all .22s ease; }
.empty-step { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; color: #ffbc72; font-size: .67rem; font-weight: 800; letter-spacing: .14em; }
.empty-step span { color: #91849d; }
.empty-state h3 { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem, 2.4vw, 1.65rem); font-weight: 700; }
.empty-state p { max-width: 340px; margin: 10px 0 19px; color: #a99db6; font-size: .87rem; line-height: 1.6; }
.file-hint { display: block; margin-top: 10px; color: #81758f; font-size: .68rem; }
.drop-hint { margin-top: 24px; color: #988aa4; font-size: .72rem; }
.drop-hint i { margin-right: 5px; color: #c599ff; }
.canvas-stage-wrap { display: grid; justify-items: center; padding: clamp(12px, 2.5vw, 28px); background: radial-gradient(ellipse at 50% 38%, rgba(73, 30, 112, .28), transparent 58%), rgba(6, 6, 16, .74); }
.canvas-stage { position: relative; width: min(100%, 760px); aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid rgba(222, 201, 255, .24); border-radius: 15px; background: #090712; box-shadow: 0 18px 46px rgba(0,0,0,.45); touch-action: none; }
.canvas-stage.mask-drag-over { outline: 3px solid var(--orange); outline-offset: -4px; box-shadow: 0 0 0 4px rgba(255, 122, 0, .24), 0 0 36px rgba(255, 122, 0, .32), 0 18px 46px rgba(0,0,0,.45); }
.canvas-stage.mask-drag-over::after { position: absolute; z-index: 5; inset: 9px; display: grid; place-items: center; border: 2px dashed rgba(255, 180, 93, .95); border-radius: 11px; padding: 18px; background: rgba(255, 106, 0, .2); color: #fff7ec; content: 'Suelta aquí para agregar la mascarita'; font-size: clamp(.82rem, 2vw, 1.1rem); font-weight: 800; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.8); backdrop-filter: blur(2px); pointer-events: none; }
.canvas-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#compositionCanvas { z-index: 1; }
#interactionCanvas { z-index: 2; cursor: default; touch-action: none; }
#interactionCanvas[data-cursor-mode="grab"], #interactionCanvas[data-cursor-mode="photo"] { cursor: grab; }
#interactionCanvas[data-cursor-mode="grabbing"] { cursor: grabbing; }
#interactionCanvas[data-cursor-mode="ew-resize"] { cursor: ew-resize; }
#interactionCanvas[data-cursor-mode="ns-resize"] { cursor: ns-resize; }
#interactionCanvas[data-cursor-mode="nwse-resize"] { cursor: nwse-resize; }
#interactionCanvas[data-cursor-mode="nesw-resize"] { cursor: nesw-resize; }
#interactionCanvas[data-cursor-mode="rotate"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M25 13a10 10 0 0 0-18-4' fill='none' stroke='%23ff8726' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M7 4v6h6M7 19a10 10 0 0 0 18 4' fill='none' stroke='%23ff8726' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M25 28v-6h-6' fill='none' stroke='%23ff8726' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 16 16, crosshair; }
#interactionCanvas:focus-visible { outline-offset: -4px; }
.canvas-stage-empty { position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; background: rgba(8, 5, 17, .8); color: #c9b8dc; text-align: center; }
.canvas-stage-empty i { font-size: 2rem; color: #b38bff; }
.canvas-stage-empty span { font-size: .85rem; }
.stage-caption { width: min(100%, 760px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; padding-top: 12px; color: #95889f; font-size: .68rem; line-height: 1.5; }
.stage-caption i { margin-right: 6px; color: #c994ff; }
.stage-hint-mobile { display: none; }
.mask-floating-controls { position: absolute; z-index: 4; top: 50%; right: 11px; display: grid; justify-items: center; gap: 4px; transform: translateY(-50%); border: 1px solid rgba(221, 201, 249, .2); border-radius: 14px; padding: 5px; background: rgba(12, 8, 23, .72); box-shadow: 0 8px 24px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(13px); -webkit-backdrop-filter: blur(13px); }
.mask-control-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; padding: 0; background: rgba(255,255,255,.035); color: #e9ddf6; font-size: .7rem; transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease; cursor: pointer; }
.mask-control-button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255, 173, 94, .42); background: rgba(255, 116, 26, .14); color: #ffc27b; }
.mask-control-button:active:not(:disabled) { transform: scale(.94); }
.mask-control-button:disabled { opacity: .38; cursor: not-allowed; }
.mask-control-divider { width: 18px; height: 1px; margin: 1px 0; background: rgba(221, 201, 249, .18); }
.crop-aspect-control { display: block; min-width: 0; margin-bottom: 19px; }
.crop-aspect-control > span { display: block; margin-bottom: 6px; color: #a99cb4; font-size: .67rem; font-weight: 700; }
.crop-aspect-control select { width: 100%; min-height: 40px; border: 1px solid rgba(205, 181, 232, .2); border-radius: 9px; padding: 7px 30px 7px 10px; background: #171023; color: #f1e9f8; font: inherit; font-size: .74rem; }
.photo-upload-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.photo-upload-heading h3 { margin: 0; font-family: var(--font-display); font-size: .93rem; font-weight: 700; }
.photo-upload-heading p { margin: 3px 0 0; color: #93859e; font-size: .7rem; }
.canvas-card-footer { padding: 13px 18px 15px; border-top: 1px solid rgba(255,255,255,.06); color: #9a8eaa; font-size: .71rem; }
.canvas-card-footer i { margin-right: 6px; color: var(--gold); }

/* Tools / panels */
.side-panel { padding: 19px; }
.panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-step { flex: 0 0 33px; width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid rgba(255, 147, 43, .42); border-radius: 50%; background: rgba(255, 106, 0, .11); color: #ffb367; font-family: var(--font-display); font-size: .73rem; font-weight: 700; }
.panel-heading h3 { margin: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.panel-heading p { margin: 3px 0 0; color: #93859e; font-size: .73rem; }
.photo-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 168px; border: 1px dashed rgba(194, 159, 246, .38); border-radius: 15px; padding: 16px; background: rgba(8, 6, 18, .4); text-align: center; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; cursor: pointer; }
.photo-dropzone.drag-over { border-color: var(--orange); background: rgba(255, 111, 0, .08); box-shadow: 0 0 30px rgba(255, 110, 0, .12); }
.photo-dropzone > i { margin-bottom: 9px; color: #c18cff; font-size: 1.5rem; }
.dropzone-title { color: #f7efff; font-size: .82rem; font-weight: 700; }
.dropzone-subtitle { margin: 3px 0 10px; color: #93869f; font-size: .7rem; }
.button-secondary { min-height: 38px; padding: 9px 16px; font-size: .72rem; }
.upload-message { margin-top: 10px; border-radius: 10px; padding: 9px 11px; background: rgba(255, 77, 65, .12); color: #ffb1aa; font-size: .72rem; line-height: 1.5; }
.upload-message.success { background: rgba(86, 221, 145, .1); color: #a9f6c4; }
.privacy-chip { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; color: #8f849a; font-size: .68rem; line-height: 1.5; }
.privacy-chip i { margin-top: 2px; color: #bd97ec; }
.masks-panel { scroll-margin-top: 96px; }
.mask-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.mask-card-wrap { position: relative; min-width: 0; }
.mask-card { display: block; width: 100%; min-width: 0; border: 1px solid rgba(210, 188, 239, .16); border-radius: 13px; padding: 6px; background: rgba(7, 6, 18, .56); color: #cfc0dc; text-align: center; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; cursor: grab; }
.mask-card:active { cursor: grabbing; }
.mask-card.is-dragging { opacity: .42; }
.mask-card:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(193, 139, 255, .65); background: rgba(73, 31, 106, .36); }
.mask-card:disabled { cursor: not-allowed; opacity: .42; }
.mask-card.selected { border-color: var(--orange); background: rgba(255, 104, 0, .1); box-shadow: 0 0 19px rgba(255, 106, 0, .22), inset 0 0 0 1px rgba(255, 106, 0, .2); }
.mask-card-add { position: absolute; z-index: 2; top: 11px; left: 11px; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; padding: 0; background: rgba(33, 16, 53, .9); color: #fff; font-size: .62rem; box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.mask-card-add:hover:not(:disabled) { transform: scale(1.1); border-color: #ffc17f; background: var(--orange); }
.mask-card-add:disabled { opacity: .42; cursor: not-allowed; }
.mask-card-image { position: relative; display: grid; aspect-ratio: 1 / .88; place-items: center; overflow: hidden; border-radius: 9px; background: radial-gradient(circle at 50% 45%, rgba(105, 63, 144, .33), rgba(11, 7, 22, .42) 74%); }
.mask-card-image img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 5px; transition: transform .22s ease; }

/* Protección de arte: evita arrastre y "guardar imagen" sobre los diseños originales.
   js/img-guard.js cubre contextmenu/dragstart; esto cubre selección y arrastre nativo. */
.mask-card-image img,
.showcase-gallery-window img,
.brand-logo,
.site-footer img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.canvas-stage canvas,
#resultPreview,
#downloadPreview {
  -webkit-user-drag: auto;
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
}
.mask-card:not(:disabled):hover .mask-card-image img { transform: scale(1.06); }
.mask-selected-check { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; background: rgba(11, 6, 24, .7); color: transparent; font-size: .58rem; transition: all .18s ease; }
.mask-card.selected .mask-selected-check { border-color: #ff9a31; background: var(--orange); color: #fff; box-shadow: 0 0 13px rgba(255, 115, 0, .55); }
.mask-card-label { display: block; overflow: hidden; padding: 7px 2px 3px; color: #d5c9df; font-size: .64rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mask-card.selected .mask-card-label { color: #ffd6a6; }
.mask-layers-manager { margin-bottom: 14px; border: 1px solid rgba(210, 188, 239, .14); border-radius: 13px; padding: 10px; background: rgba(7, 6, 18, .42); }
.mask-layers-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #cfc0dc; font-size: .67rem; font-weight: 800; }
.mask-layers-heading span:last-child { color: #a99bb8; font-weight: 600; }
.mask-layer-reorder-hint { margin: -2px 0 8px; color: #91859a; font-size: .61rem; line-height: 1.4; }
.mask-layer-reorder-hint i { margin-inline: 2px; color: #ffb45d; }
.mask-layer-list { display: grid; gap: 6px; }
.mask-layer-row { display: grid; grid-template-columns: 23px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 5px; min-width: 0; border: 1px solid rgba(210, 188, 239, .11); border-radius: 10px; padding: 4px; background: rgba(255,255,255,.025); }
.mask-layer-row.is-selected { border-color: rgba(255, 154, 49, .58); background: rgba(255, 104, 0, .08); }
.mask-layer-row.is-dragging { opacity: .72; border-color: var(--orange); background: rgba(255, 106, 0, .18); box-shadow: 0 0 18px rgba(255, 106, 0, .24); cursor: grabbing; transform: scale(.985); }
.mask-layer-row.is-dragging * { cursor: grabbing !important; }
.mask-layer-row.drop-before { border-top: 2px solid var(--orange); }
.mask-layer-row.drop-after { border-bottom: 2px solid var(--orange); }
.mask-layer-drag-handle { grid-column: 1; grid-row: 1 / span 2; width: 23px; height: 100%; min-height: 39px; display: grid; place-items: center; border: 0; border-radius: 7px; padding: 0; background: transparent; color: #a99bb8; cursor: grab; touch-action: none; }
.mask-layer-drag-handle:hover { color: #ffc17f; }
.mask-layer-drag-handle:active { color: #ffc17f; cursor: grabbing; }
.mask-layer-drag-handle:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.mask-layer-select { grid-column: 2; grid-row: 1; display: flex; width: 100%; min-width: 0; align-items: center; gap: 9px; border: 0; border-radius: 7px; padding: 3px 5px; background: transparent; color: #ded2e9; text-align: left; font: inherit; font-size: .68rem; font-weight: 700; cursor: pointer; }
.mask-layer-select img { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 7px; padding: 3px; background: rgba(105, 63, 144, .2); object-fit: contain; }
.mask-layer-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mask-layer-row.is-selected .mask-layer-select { color: #ffd6a6; }
.mask-layer-actions { grid-column: 2; grid-row: 2; display: flex; justify-content: flex-end; gap: 3px; }
.mask-layer-action { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 7px; padding: 0; background: rgba(255,255,255,.045); color: #d8c9e5; font-size: .62rem; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.mask-layer-action:hover { border-color: rgba(193, 139, 255, .48); background: rgba(105, 63, 144, .24); color: #fff; }
.mask-layer-action:disabled { opacity: .35; cursor: not-allowed; }
.mask-layer-delete:hover { border-color: rgba(255, 112, 112, .45); background: rgba(225, 52, 52, .16); color: #ffaaaa; }
.mask-panel-hint { display: flex; gap: 7px; margin: 13px 0 0; color: #91859a; font-size: .67rem; line-height: 1.45; }
.mask-panel-hint i { margin-top: 1px; color: #ffd166; }
.mask-empty-message { grid-column: 1 / -1; margin: 0; color: #baadca; font-size: .75rem; line-height: 1.6; }
.mask-empty-message code { color: #ffc17f; }
.download-dock { grid-area: download; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 1px solid rgba(255, 153, 61, .26); border-radius: 17px; padding: 15px; background: linear-gradient(120deg, rgba(55, 22, 46, .82), rgba(26, 14, 37, .92)); box-shadow: 0 14px 34px rgba(0,0,0,.25); }
.download-note { display: inline-flex; align-items: center; gap: 7px; color: #e8d9ee; font-size: .74rem; font-weight: 700; }
.download-note i { color: var(--gold); }
.button-download { width: min(100%, 440px); min-height: 54px; font-size: .84rem; letter-spacing: .055em; }
.download-label-mobile { display: none; }
.download-subnote { color: #95889e; font-size: .64rem; }

/* Product showcase and conversion close */
.mask-showcase { position: relative; overflow: hidden; border-block: 1px solid rgba(207, 183, 246, .09); background: linear-gradient(100deg, rgba(17, 9, 33, .9), rgba(35, 13, 51, .74)); }
.showcase-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .72fr); align-items: center; gap: 35px; }
.showcase-copy { max-width: 650px; }
.hero-product-logo { display: block; width: min(180px, 48vw); max-height: 66px; margin-bottom: 18px; object-fit: contain; object-position: left center; filter: drop-shadow(0 5px 16px rgba(166, 105, 214, .18)); }
.showcase-copy h2 { font-size: clamp(2.35rem, 5vw, 4.4rem); line-height: 1.02; }
.showcase-copy p { max-width: 500px; margin: 18px 0 22px; color: #b6a9c5; line-height: 1.7; }
.showcase-gallery { width: min(100%, 520px); justify-self: center; }
.showcase-gallery-window { position: relative; isolation: isolate; width: 100%; aspect-ratio: 1 / 1; min-height: 300px; overflow: hidden; background: radial-gradient(ellipse at 50% 43%, rgba(85, 39, 130, .25), transparent 70%); touch-action: pan-y; user-select: none; cursor: grab; }
.showcase-gallery-window:active { cursor: grabbing; }
.showcase-gallery-window:focus-visible { outline-offset: 5px; }
.showcase-gallery-window::before { position: absolute; z-index: 0; inset: 21%; border: 1px solid rgba(177, 120, 255, .38); border-radius: 50%; background: radial-gradient(circle, rgba(255, 107, 0, .11), rgba(125, 54, 220, .19) 60%, transparent 74%); box-shadow: 0 0 80px rgba(107, 44, 205, .2); content: ''; pointer-events: none; }
.showcase-slide { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px 24px 52px; opacity: 0; transform: translateX(26px) scale(.96); transition: opacity .3s ease, transform .35s ease; pointer-events: none; }
.showcase-slide.is-active { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.showcase-slide img { display: block; width: min(94%, 390px); height: min(88%, 368px); object-fit: contain; filter: drop-shadow(0 24px 26px rgba(0,0,0,.45)); animation: mask-float 6s ease-in-out infinite; pointer-events: none; }
.showcase-slide figcaption { position: absolute; bottom: 20px; left: 50%; color: #ddcbed; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; transform: translateX(-50%); }
.showcase-spark { position: absolute; z-index: 2; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); pointer-events: none; }
.showcase-spark-one { top: 19%; right: 17%; }
.showcase-spark-two { bottom: 23%; left: 12%; width: 6px; height: 6px; background: #ae7aff; box-shadow: 0 0 13px #ae7aff; }
.showcase-empty { position: relative; z-index: 1; display: grid; min-height: 300px; margin: 0; place-items: center; color: var(--muted); text-align: center; }
.showcase-gallery-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.showcase-gallery-arrow { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(210, 185, 255, .25); border-radius: 50%; background: rgba(25, 13, 47, .7); color: #f6edff; transition: border-color .2s ease, background .2s ease, transform .2s ease; cursor: pointer; }
.showcase-gallery-arrow:hover { transform: translateY(-2px); border-color: rgba(255, 147, 43, .55); background: rgba(255, 111, 0, .15); }
.showcase-gallery-arrow:focus-visible, .showcase-gallery-dot:focus-visible { outline-offset: 3px; }
.showcase-gallery-counter { min-width: 62px; color: #cbbbd8; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-align: center; }
.showcase-gallery-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.showcase-gallery-dot { width: 34px; height: 34px; display: grid; place-items: center; border: 0; padding: 0; background: transparent; cursor: pointer; }
.showcase-gallery-dot::before { width: 7px; height: 7px; border-radius: 50%; background: rgba(215, 194, 239, .4); content: ''; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.showcase-gallery-dot.is-active::before { transform: scale(1.35); background: #ff9a3d; box-shadow: 0 0 12px rgba(255, 138, 42, .6); }
.closing-cta { position: relative; overflow: hidden; padding-block: clamp(70px, 9vw, 118px); background: radial-gradient(ellipse at 50% 0%, rgba(255, 101, 0, .19), transparent 48%), linear-gradient(180deg, rgba(17, 8, 27, .95), rgba(9, 6, 19, .98)); text-align: center; }
.closing-cta::before { position: absolute; top: -160px; left: 50%; width: 550px; height: 300px; border: 1px solid rgba(255, 160, 70, .12); border-radius: 50%; content: ''; transform: translateX(-50%); }
.closing-content { position: relative; display: grid; justify-items: center; }
.closing-kicker { margin-bottom: 15px; color: #ffbd7a; font-size: .7rem; font-weight: 800; letter-spacing: .16em; }
.closing-content h2 { margin: 0 0 26px; font-size: clamp(2.7rem, 6.2vw, 5.3rem); line-height: 1; }
.closing-content h2 span { color: #ff9432; }
.creator-auth-gate { max-width: 720px; margin: 0 auto; padding: clamp(24px, 5vw, 48px); text-align: center; }
.creator-auth-gate .gate-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 16px; place-items: center; border: 1px solid rgba(255, 186, 116, .45); border-radius: 18px; background: rgba(255, 186, 116, .1); color: #ffba74; font-size: 1.35rem; }
.creator-auth-gate h2 { margin-bottom: 10px; font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 2.6rem); }
.creator-auth-gate p { max-width: 510px; margin: 0 auto 20px; color: #b6a9c5; font-size: .84rem; line-height: 1.65; }
.creator-auth-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.creator-auth-actions .dg-app-link { min-height: 44px; padding-inline: 18px; }

@media (min-width: 768px) {
  .editor-layout.has-photo .photo-panel { padding: 15px; }
  .editor-layout.has-photo .photo-panel > .panel-heading { margin-bottom: 10px; }
  .editor-layout.has-photo .crop-aspect-control { margin-bottom: 12px; }
  .editor-layout.has-photo .photo-upload-heading,
  .editor-layout.has-photo .privacy-chip { display: none; }
  .editor-layout.has-photo .photo-dropzone { min-height: 0; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 12px; text-align: left; }
  .editor-layout.has-photo .photo-dropzone > i,
  .editor-layout.has-photo .photo-dropzone .dropzone-subtitle,
  .editor-layout.has-photo .photo-dropzone .file-hint { display: none; }
  .editor-layout.has-photo .dropzone-title { flex: 1; font-size: .74rem; text-align: left; }
  .editor-layout.has-photo .upload-trigger { min-height: 34px; padding: 8px 10px; font-size: .66rem; }
}

@media (min-width: 992px) {
  /* El panel lateral se desplaza con la página, que ya es lo que hace el
     usuario. Antes llevaba max-height + overflow-y y eso generaba un segundo
     scroll anidado dentro del editor. El lienzo y el dock de descarga quedan en
     flujo normal para conservar su alineación entre sí. */
  .editor-layout.has-photo .editor-sidebar { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .editor-layout.has-photo .editor-main { position: static; }
}

/* Footer and local policy dialogs */
.site-footer { border-top: 1px solid rgba(223, 203, 255, .12); padding-block: 48px 20px; background: rgba(8, 5, 17, .92); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); padding-bottom: 37px; text-align: center; }
.footer-brand-column { display: flex; flex-direction: column; align-items: center; }
.footer-brand-column > p { max-width: 320px; margin: 15px 0 0; color: #9e92aa; font-size: .78rem; line-height: 1.7; }
.footer-mascaritas-logo img { display: block; width: min(205px, 58vw); height: auto; }
.footer-platform-signoff { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid rgba(223, 203, 255, .09); color: #8d8299; font-size: .7rem; letter-spacing: .04em; }
.footer-platform-brand { display: inline-flex; align-items: center; }
.footer-platform-brand img { display: block; width: min(154px, 42vw); height: auto; opacity: .9; }
.footer-platform-link { color: #ffba74; font-weight: 600; text-decoration: none; }
.footer-platform-link:hover { color: #ffd9a8; text-decoration: underline; }
.footer-bottomline { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(223, 203, 255, .09); padding-top: 17px; color: #786e82; font-size: .65rem; }

@media (max-width: 991.98px) {
  .hero-content { grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 20px; }
  .hero-art { min-height: 360px; }
  .editor-layout { grid-template-columns: minmax(210px, .75fr) minmax(0, 1.35fr); gap: 13px; }
  .side-panel { padding: 15px; }
  .mask-grid { gap: 7px; }
  .mask-card { padding: 5px; }
}

@media (max-width: 767.98px) {
  html { scroll-padding-top: 72px; }
  .site-container { width: min(100% - 28px, 620px); }
  .dg-app-nav { width: min(100% - 28px, 620px); flex-wrap: wrap; gap: 6px; padding-block: 8px; }
  .dg-app-brand { flex: 0 0 100%; }
  .dg-app-brand img { width: min(165px, 45vw); max-height: 36px; }
  .dg-app-actions { width: 100%; justify-content: flex-end; gap: 4px; }
  .dg-app-link { min-height: 34px; padding: 6px 9px; font-size: .66rem; }
  .dg-app-user { display: none; }
  .mascaritas-navbar { min-height: 66px; padding-block: 8px; }
  .mascaritas-navbar > .site-container { flex-wrap: nowrap; gap: 10px; }
  .mascaritas-brand { min-width: 0; }
  .brand-logo { width: min(160px, 44vw); }
  .button-header { min-height: 40px; padding: 8px 12px; font-size: .68rem; gap: 6px; }
  .site-header.is-compact .mascaritas-navbar { min-height: 58px; padding-block: 5px; }
  .site-header.is-compact .brand-logo { width: min(146px, 42vw); }
  .hero-section { min-height: 0; padding: 61px 0 66px; }
  .hero-content { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .hero-copy { position: relative; z-index: 2; }
  .hero-copy h1 { font-size: clamp(3rem, 13vw, 5rem); }
  .hero-copy > p { max-width: 360px; margin: 17px 0 19px; font-size: .91rem; }
  .hero-actions { gap: 8px; }
  .hero-actions .button { min-height: 45px; padding: 10px 14px; font-size: .72rem; }
  .hero-proof { margin-top: 14px; font-size: .68rem; }
  .hero-art { min-height: clamp(230px, 66vw, 360px); margin: 0 9px; }
  .hero-mask-slot { width: 47%; }
  .hero-mask-slot-1 { width: 54%; }
  .hero-mask-slot-2 { top: 0; left: 0; width: 30%; }
  .hero-mask-slot-3 { right: 6%; bottom: 1%; width: 34%; }
  .section-shell { padding-block: 56px; }
  .section-heading { display: block; margin-bottom: 19px; }
  .section-heading h2 { font-size: 2.25rem; }
  .section-heading p { font-size: .82rem; }
  .workflow-steps { justify-content: space-between; gap: 4px; overflow-x: auto; margin-top: 19px; padding: 0 0 5px; }
  .workflow-step { gap: 4px; font-size: .59rem; }
  .workflow-step b { width: 23px; height: 23px; font-size: .56rem; }
  .workflow-line { flex: 1 0 8px; width: auto; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'photo' 'stage' 'masks' 'download'; gap: 13px; }
  .editor-main { width: 100%; }
  .editor-sidebar { display: contents; }
  .photo-panel { grid-area: photo; }
  .masks-panel { grid-area: masks; }
  .download-dock { width: 100%; }
  .canvas-card { width: 100%; border-radius: 16px; }
  .canvas-card-topline { min-height: 41px; padding: 10px 12px; font-size: .6rem; }
  .canvas-topline-note { font-size: .58rem; }
  .empty-state { min-height: 320px; padding: 22px; }
  .empty-icon { width: 62px; height: 62px; margin-bottom: 15px; border-radius: 19px; font-size: 1.4rem; }
  .empty-state h3 { font-size: 1.2rem; }
  .empty-state p { font-size: .78rem; }
  .drop-hint { margin-top: 15px; }
  .canvas-stage-wrap { padding: 8px; }
  .canvas-stage { width: 100%; border-radius: 11px; }
  .stage-caption { grid-template-columns: minmax(0, 1fr) auto; padding: 9px 3px 0; font-size: .59rem; }
  .stage-hint-desktop { display: none; }
  .stage-hint-mobile { display: block; grid-column: 1 / -1; }
  .mask-floating-controls { right: 7px; gap: 3px; border-radius: 12px; padding: 4px; }
  .mask-control-button { width: 29px; height: 29px; border-radius: 8px; font-size: .64rem; }
  .mask-control-divider { width: 15px; }
  .canvas-card-footer { padding: 10px 12px; font-size: .62rem; }
  .editor-sidebar > * { width: 100%; }
  .photo-panel { padding: 14px; }
  .crop-aspect-control { margin-bottom: 16px; }
  .photo-upload-heading { margin-bottom: 10px; }
  .photo-dropzone { min-height: 132px; }
  .mask-grid { display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: rgba(174, 127, 228, .45) transparent; }
  .mask-card-wrap { flex: 0 0 98px; scroll-snap-align: start; }
  .mask-card-image { aspect-ratio: 1 / .9; }
  .mask-card-label { font-size: .61rem; }
  .mask-card-add { top: 9px; left: 9px; }
  .mask-layer-select { gap: 7px; font-size: .64rem; }
  .mask-layer-select img { width: 30px; height: 30px; }
  .download-dock { position: static; padding: 10px; border-radius: 15px; background: rgba(20, 10, 30, .94); }
  .download-note, .download-subnote { display: none; }
  .button-download { min-height: 48px; width: 100%; font-size: .74rem; }
  .download-label-desktop { display: none; }
  .download-label-mobile { display: inline; }
  .showcase-content { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .showcase-copy h2 { font-size: 2.65rem; }
  .showcase-copy p { font-size: .86rem; }
  .showcase-gallery { width: min(100%, 420px); margin: 16px auto 0; }
  .showcase-gallery-window { min-height: 0; }
  .showcase-slide { padding: 20px 20px 48px; }
  .showcase-slide img { width: 92%; height: 86%; }
  .showcase-gallery-controls { margin-top: 12px; }
  .closing-content h2 { font-size: clamp(2.7rem, 12vw, 4.3rem); }
  .footer-grid { padding-bottom: 28px; }
  .footer-bottomline { flex-direction: column; gap: 6px; font-size: .61rem; }
}

@media (max-width: 380px) {
  .site-container { width: calc(100% - 22px); }
  .dg-app-nav { width: calc(100% - 22px); }
  .dg-app-link { padding-inline: 7px; font-size: .62rem; }
  .hero-actions .button-primary { padding-inline: 12px; }
  .hero-actions .button-quiet { padding-inline: 10px; }
  .workflow-step { font-size: .54rem; }
  .workflow-step b { width: 21px; height: 21px; }
  .mask-card-wrap { flex-basis: 90px; }
  .mascaritas-navbar > .site-container { gap: 8px; }
  .brand-logo { width: min(124px, 38vw); }
  .site-header.is-compact .brand-logo { width: min(118px, 36vw); }
  .button-header { padding: 8px 10px; font-size: .62rem; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
