/* FormyDog v92 · visual progression by level. Visual-only: never transforms the Phaser canvas. */
:root{
  --fd-stage-accent:#1987e8;
  --fd-stage-accent-2:#36c88a;
  --fd-stage-soft:rgba(25,135,232,.10);
  --fd-stage-soft-2:rgba(54,200,138,.10);
  --fd-stage-ink:#12334f;
}

html[data-fd-level-theme="patio"]{
  --fd-stage-accent:#197fd3;
  --fd-stage-accent-2:#35bd83;
  --fd-stage-soft:rgba(25,127,211,.11);
  --fd-stage-soft-2:rgba(53,189,131,.11);
}
html[data-fd-level-theme="parque"]{
  --fd-stage-accent:#168d7f;
  --fd-stage-accent-2:#54bd72;
  --fd-stage-soft:rgba(22,141,127,.11);
  --fd-stage-soft-2:rgba(84,189,114,.11);
}
html[data-fd-level-theme="playa"]{
  --fd-stage-accent:#147dca;
  --fd-stage-accent-2:#46bce5;
  --fd-stage-soft:rgba(20,125,202,.11);
  --fd-stage-soft-2:rgba(70,188,229,.12);
}
html[data-fd-level-theme="bosque"]{
  --fd-stage-accent:#277f55;
  --fd-stage-accent-2:#52b86e;
  --fd-stage-soft:rgba(39,127,85,.11);
  --fd-stage-soft-2:rgba(82,184,110,.11);
}
html[data-fd-level-theme="noche"]{
  --fd-stage-accent:#585fcf;
  --fd-stage-accent-2:#8678e9;
  --fd-stage-soft:rgba(88,95,207,.11);
  --fd-stage-soft-2:rgba(134,120,233,.11);
}
html[data-fd-level-theme="festival"]{
  --fd-stage-accent:#7655cf;
  --fd-stage-accent-2:#2fa7c6;
  --fd-stage-soft:rgba(118,85,207,.11);
  --fd-stage-soft-2:rgba(47,167,198,.11);
}

html[data-fd-level-theme] body{
  background:
    radial-gradient(circle at 13% 8%,var(--fd-stage-soft),transparent 29rem),
    radial-gradient(circle at 88% 16%,var(--fd-stage-soft-2),transparent 27rem),
    #fff;
}

html[data-fd-level-theme] .topbar,
html[data-fd-level-theme] .side{
  border-color:color-mix(in srgb,var(--fd-stage-accent) 18%,#dfe9f2);
}

html[data-fd-level-theme] #fdLevelChip{
  border-color:color-mix(in srgb,var(--fd-stage-accent) 45%,#d9e6f0)!important;
  box-shadow:0 8px 24px var(--fd-stage-soft)!important;
}
html[data-fd-level-theme] #fdLevelChip b{
  color:var(--fd-stage-accent)!important;
}

/* The header already owns the actual level number. Avoid repeating NIVEL x in Objetivo. */
.goals .side-title small{display:none!important}

.fd-level-stage-v92{
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  margin:0 0 12px;
  padding:11px 12px;
  border:1px solid color-mix(in srgb,var(--fd-stage-accent) 24%,#dfe9f2);
  border-radius:16px;
  background:linear-gradient(135deg,#fff 0%,var(--fd-stage-soft) 100%);
  box-shadow:0 8px 22px rgba(27,65,94,.07);
  color:var(--fd-stage-ink);
}
.fd-level-stage-v92::after{
  content:"";
  position:absolute;
  width:72px;
  height:72px;
  right:-34px;
  top:-38px;
  border-radius:50%;
  background:var(--fd-stage-soft-2);
  pointer-events:none;
}
.fd-stage-copy-v92{min-width:0;position:relative;z-index:1}
.fd-stage-copy-v92 span{
  display:block;
  margin-bottom:2px;
  font-size:9px;
  line-height:1.1;
  font-weight:900;
  letter-spacing:.11em;
  color:var(--fd-stage-accent);
}
.fd-stage-copy-v92 b{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
  line-height:1.15;
  font-weight:900;
}
.fd-stage-copy-v92 small{
  display:block;
  margin-top:3px;
  font-size:9px;
  line-height:1.25;
  font-weight:700;
  opacity:.68;
}
.fd-stage-paws-v92{
  display:flex;
  gap:4px;
  position:relative;
  z-index:1;
}
.fd-stage-paws-v92 i{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#dfe8ef;
  box-shadow:inset 0 0 0 1px rgba(25,55,78,.05);
}
.fd-stage-paws-v92 i.is-done{
  background:linear-gradient(135deg,var(--fd-stage-accent),var(--fd-stage-accent-2));
  box-shadow:0 2px 7px var(--fd-stage-soft);
}

html[data-fd-level-theme] .goal-box,
html[data-fd-level-theme] .moves-box,
html[data-fd-level-theme] .progress-row{
  border-color:color-mix(in srgb,var(--fd-stage-accent) 16%,#e2eaf0)!important;
}
html[data-fd-level-theme] .progress-track>i,
html[data-fd-level-theme] #progressBar{
  background:linear-gradient(90deg,var(--fd-stage-accent),var(--fd-stage-accent-2))!important;
}
html[data-fd-level-theme] .status-dot{
  background:var(--fd-stage-accent-2)!important;
  box-shadow:0 0 0 5px var(--fd-stage-soft-2)!important;
}

html[data-fd-level-theme] .board-shell{
  border-color:color-mix(in srgb,var(--fd-stage-accent) 24%,#dce7ef)!important;
  box-shadow:0 18px 48px rgba(24,62,91,.10),0 0 0 1px var(--fd-stage-soft)!important;
}
html[data-fd-level-theme] .board-shell::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  z-index:0;
  box-shadow:inset 0 0 34px var(--fd-stage-soft);
}
html[data-fd-level-theme] #gameMount{position:relative;z-index:1}

.fd-level-intro-v92{
  position:fixed;
  left:50%;
  top:max(18px,env(safe-area-inset-top));
  z-index:9999;
  min-width:min(310px,calc(100vw - 28px));
  max-width:420px;
  padding:12px 16px;
  border:1px solid color-mix(in srgb,var(--fd-stage-accent) 30%,#dce7ef);
  border-radius:18px;
  background:rgba(255,255,255,.96);
  box-shadow:0 16px 45px rgba(17,49,74,.17);
  text-align:center;
  pointer-events:none;
  opacity:0;
  transform:translate(-50%,-10px);
  transition:opacity .22s ease,transform .22s ease;
  backdrop-filter:blur(12px);
}
.fd-level-intro-v92.is-show{opacity:1;transform:translate(-50%,0)}
.fd-level-intro-v92 span{
  display:block;
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
  color:var(--fd-stage-accent);
}
.fd-level-intro-v92 b{
  display:block;
  margin:2px 0;
  font-size:17px;
  line-height:1.15;
  color:#17364f;
}
.fd-level-intro-v92 small{font-size:10px;font-weight:800;color:#62788a}

@media (max-width:760px){
  .fd-level-stage-v92{padding:8px 10px;margin-bottom:8px;border-radius:13px}
  .fd-stage-copy-v92 b{font-size:12px}
  .fd-stage-copy-v92 small{display:none}
  .fd-stage-paws-v92{gap:3px}
  .fd-stage-paws-v92 i{width:7px;height:7px}
  .fd-level-intro-v92{top:max(10px,env(safe-area-inset-top));padding:10px 13px;border-radius:15px}
}

@media (max-width:520px){
  /* v52 fixes the goal row at 50px with exactly two grid cells. Keep stage identity
     out of normal grid flow so it can never push MOVIMIENTOS into a hidden second row. */
  html[data-fd-level-theme] body .app{
    background:
      radial-gradient(circle at 50% 18%,var(--fd-stage-soft-2),transparent 34%),
      linear-gradient(180deg,color-mix(in srgb,var(--fd-stage-accent) 68%,#0a5795) 0%,#073c72 50%,#062b57 100%)!important;
  }
  html body .app>.game-layout>.goals{
    position:relative!important;
    overflow:visible!important;
  }
  html body .app>.game-layout>.goals>.fd-level-stage-v92{
    position:absolute!important;
    top:-11px!important;
    left:8px!important;
    z-index:12!important;
    width:auto!important;
    max-width:calc(100% - 16px)!important;
    height:14px!important;
    min-height:14px!important;
    margin:0!important;
    padding:2px 6px!important;
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    border-radius:999px!important;
    overflow:hidden!important;
    background:rgba(255,255,255,.96)!important;
    box-shadow:0 2px 7px rgba(4,44,77,.12)!important;
  }
  html body .app>.game-layout>.goals>.fd-level-stage-v92::after{display:none!important}
  .fd-level-stage-v92 .fd-stage-copy-v92{display:block!important;min-width:0!important}
  .fd-level-stage-v92 .fd-stage-copy-v92 span,
  .fd-level-stage-v92 .fd-stage-copy-v92 small{display:none!important}
  .fd-level-stage-v92 .fd-stage-copy-v92 b{
    max-width:118px!important;
    font-size:5.2px!important;
    line-height:1!important;
    letter-spacing:.02em!important;
  }
  .fd-level-stage-v92 .fd-stage-paws-v92{gap:2px!important;flex:0 0 auto!important}
  .fd-level-stage-v92 .fd-stage-paws-v92 i{width:4px!important;height:4px!important}
  .fd-level-intro-v92{min-width:min(280px,calc(100vw - 24px));padding:9px 12px}
  .fd-level-intro-v92 b{font-size:14px}
  .fd-level-intro-v92 small{font-size:8px}
}

@media (prefers-reduced-motion:reduce){
  .fd-level-intro-v92{transition:none!important}
}
