/* Shared stage system for upgraded Marktic scenes: Meltwater palette + grain on background only */
:root{
  --st-a:#4f9fbd; --st-b:#8fd2c8; --st-c:#c2f7e2; --st-d:#a6dccd;
  --sh-1:#c8ffe9; --sh-2:#5aa9c2; --sh-3:#7fd3c3;
  --ink:#111226; --ink2:#4a5068; --ink3:#7d8396; --line:#e6ebf1;
  --mk:#5ce1a0; --mk-ink:#0f6e4c; --ok:#d1fae5; --ok-ink:#047857;
  --ease:cubic-bezier(.23,1,.32,1); --ease-io:cubic-bezier(.77,0,.175,1); --spring:cubic-bezier(.34,1.56,.64,1);
  --serif:"Source Serif 4",Georgia,serif; --sans:"Inter",system-ui,sans-serif;
}
.frame{position:relative;width:100%;aspect-ratio:1200/660;border-radius:28px;overflow:hidden;isolation:isolate;container-type:inline-size}
.frame .stage{position:absolute;left:0;top:0;width:1200px;height:660px;transform-origin:0 0;font-family:var(--sans);color:var(--ink)}
.bg{position:absolute;inset:-120px;z-index:-3;background:linear-gradient(140deg,var(--st-a),var(--st-b) 43%,var(--st-c) 75%,var(--st-d));filter:blur(40px)}
.bg i{position:absolute;border-radius:50%;filter:blur(30px);animation:drift 26s ease-in-out infinite alternate}
.bg i:nth-child(1){background:var(--sh-1);width:70%;height:60%;left:-10%;top:30%}
.bg i:nth-child(2){background:var(--sh-2);width:60%;height:55%;right:-15%;top:-15%;animation-direction:alternate-reverse}
.bg i:nth-child(3){background:var(--sh-3);width:70%;height:35%;left:20%;bottom:-10%}
@keyframes drift{to{transform:translate(6%,-5%) scale(1.08)}}
/* Grain: always on, on every stage gradient regardless of palette. Two layers:
   an overlay layer (lifts and darkens, so it reads on light mint and on deep blue)
   plus a faint multiply layer for the dark specks seen in the reference. Never on cards. */
.grain{position:absolute;inset:0;z-index:-2;pointer-events:none;opacity:.95;mix-blend-mode:overlay;background-size:160px 160px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.6' intercept='-.3'/%3E%3CfeFuncG type='linear' slope='1.6' intercept='-.3'/%3E%3CfeFuncB type='linear' slope='1.6' intercept='-.3'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E")}
.grain::after{content:"";position:absolute;inset:0;opacity:.32;mix-blend-mode:multiply;background-size:120px 120px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='h' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1  0 0 0 0 .12  0 0 0 0 .2  0 0 0 1.1 -.35'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23h)'/%3E%3C/svg%3E")}
/* cards: crisp, no grain */
.card{position:absolute;background:#fff;border-radius:18px;box-shadow:0 1px 0 #fff inset,0 0 0 1px #10304212,0 18px 40px -18px #12404d40,0 4px 10px -4px #12404d14}
.mk{width:28px;height:28px;border-radius:8px;background:var(--mk);display:grid;place-items:center;flex:0 0 auto}
.mk svg{width:17px;height:17px}
.pill{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;font-size:11.5px;font-weight:500;white-space:nowrap}
.pill.ok{background:var(--ok);color:var(--ok-ink)}.pill.blue{background:#e6edff;color:#3550a8}.pill.amber{background:#fff1d6;color:#9a5b00}.pill.grey{background:#eef1f5;color:#5b6274}
.ctrls{position:absolute;right:16px;bottom:16px;z-index:40;display:flex;gap:8px}
.ctrls button{width:34px;height:34px;border-radius:50%;border:0;background:#ffffffd9;color:var(--ink);box-shadow:0 2px 8px #0f2a3a26;cursor:pointer;font-size:13px;display:grid;place-items:center;transition:transform .15s var(--ease)}
.ctrls button:active{transform:scale(.92)}
.note{position:absolute;left:22px;bottom:20px;z-index:30;font-size:11.5px;color:#0f3b47b3}
@media (prefers-reduced-motion:reduce){.bg i{animation:none}}

.frame .stage,.frame .stage *,.frame .stage *::before,.frame .stage *::after{box-sizing:border-box}

/* ---------- Phone: every scene switches to a 400:540 portrait stage (same as Create and publish mobile) ---------- */
@media (max-width:0px){
  .frame,.frame.f43,.frame.f185,.frame.f233,#Bf{aspect-ratio:400/540!important;border-radius:22px;max-width:none}
  .frame .stage,.frame .stage.s43,.frame .stage.s185,.frame .stage.s233,#A,#B,#C{width:400px!important;height:540px!important}
  .ctrls{right:10px!important;bottom:10px!important}
  .ctrls button{width:30px;height:30px}
  .note{display:none}
}
