/* Pantallas fuera de partida: ilustración aérea de fondo, menú editorial, Partida rápida y Modo Historia */

/* ---- ilustración aérea de fondo: desenfocada y oscurecida ---- */
#scene { position: fixed; inset: 0; z-index: 0; background: var(--grass-dark); display: none; overflow: hidden; }
#menuScene { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); pointer-events: none;
  filter: blur(18px) saturate(.9) brightness(.82); }
body[data-screen="menu"] #scene, body[data-screen="story"] #scene, body[data-screen="pve"] #scene,
body:not([data-screen]) #scene { display: block; }
#scene::after { content: ''; position: absolute; inset: 0; background: rgba(20,40,20,.18); }
body[data-screen="story"] #scene::after, body[data-screen="pve"] #scene::after { background: rgba(20,40,20,.34); }
#menuScreen, #storyScreen, #pveScreen { position: relative; z-index: 1; }

/* ---- menú principal: split editorial ---- */
#menuScreen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px 28px 76px; }
.mFrame {
  width: min(1180px, 100%); min-height: min(640px, calc(100vh - 110px));
  display: grid; grid-template-columns: 45% 1fr; gap: 14px;
  padding: 14px; border-radius: 22px;
  background-image: var(--grain); background-color: var(--cream);
  box-shadow: 0 30px 70px rgba(10,25,10,.35);
  animation: winPop .45s var(--ease-out);
}
.mContent {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  padding: 34px 32px 30px;
}
.mArt { position: relative; border-radius: 14px; overflow: hidden; min-height: 320px; }
.mArt svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mTitle {
  font-size: clamp(56px, 7.6vw, 108px); font-weight: 500; line-height: .88; letter-spacing: -.055em;
  text-transform: lowercase; color: var(--ink); user-select: none; margin-bottom: 34px;
}
.mTitle .l1, .mTitle .l2 { display: block; }
/* título propio: todo en verdes de césped ("chaotic" oscuro, "golf" en verde green) y bola naranja como punto */
.mTitle { color: var(--grass-dark); }
.mTitle .l2 { color: #7FA95A; }
.mTitle .l2::after { content: ''; display: inline-block; width: .17em; height: .17em; margin-left: .06em; border-radius: 50%; background: var(--accent); box-shadow: .04em .04em 0 var(--shadow); }
.mTitle .c-accent, .mTitle .c-navy, .mTitle .c-grass { color: inherit; }
.mActions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.mActions .mRow { display: flex; gap: 10px; flex-wrap: wrap; }
.mBtn { padding: 13px 22px; font-size: 15.5px; font-weight: 500; }
.mBtn.story { --b-bg: var(--ink); --b-fg: var(--cream); --b-line: var(--ink); box-shadow: 0 8px 20px rgba(20,40,20,.18); }
.mBtn.story:hover { background-color: #3a3a3a; }
.mBtn.story .i { transition: transform .2s var(--ease-out); }
.mBtn.story:hover .i { transform: translateX(3px); }
.mBtn.multi { --b-bg: transparent; --b-fg: var(--ink); --b-line: var(--ink-line); }
.mBtn.multi .i { color: var(--accent); }
.mTag { margin-top: 18px; font-size: 14px; color: var(--ink-soft); letter-spacing: .005em; }

/* barra inferior: sonido + herramientas, píldoras finas tipo navegación */
.mBottom { position: fixed; left: 100px; bottom: 14px; z-index: 65; display: flex; gap: 8px; }
.cornerBtn {
  height: 36px; padding: 0 14px; font-size: 12.5px;
  --b-bg: rgba(241,241,220,.92); --b-fg: var(--ink); --b-line: var(--cream-line); backdrop-filter: blur(4px);
}
.cornerBtn .i { color: var(--ink-soft); }
/* insignia del slot actual, esquina superior izquierda del creador de niveles */
#edSlotBadge {
  position: fixed; top: 12px; left: 14px; z-index: 66;
  font-size: 12px; font-weight: 500;
  background-image: var(--grain); background-color: var(--cream); color: var(--ink);
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--cream-line);
  pointer-events: none;
}

@media (max-width: 820px) {
  #menuScreen { padding: 14px 14px 70px; align-items: stretch; }
  .mFrame { grid-template-columns: 1fr; grid-template-rows: 42vh auto; min-height: 0; }
  .mArt { order: -1; min-height: 0; }
  .mContent { padding: 22px 16px 16px; }
  .mTitle { font-size: clamp(52px, 16vw, 84px); margin-bottom: 22px; }
  .mBottom { left: 98px; right: 10px; overflow-x: auto; }
  .cornerBtn { flex: 0 0 auto; }
}

/* ---- panel común de pantallas (volver) ---- */
.screenTop { position: fixed; top: 16px; left: 16px; z-index: 5; }
.screenTop .btn-light { --b-bg: rgba(241,241,220,.92); }

/* ---- Partida rápida ---- */
#pveScreen { display: none; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
#pveCard {
  background-image: var(--grain); background-color: var(--cream);
  border-radius: 20px; padding: 32px 32px 22px; width: min(500px, 94vw);
  box-shadow: 0 30px 70px rgba(10,25,10,.35);
  animation: winPop .3s var(--ease-out);
}
#pveCard h2 { font-size: 36px; font-weight: 500; line-height: 1; letter-spacing: -.045em; text-transform: lowercase; color: var(--ink); }
#pveCard h2::after { content: '.'; color: var(--accent); }
#pveCard .sub { font-size: 13.5px; color: var(--ink-soft); margin: 10px 0 8px; line-height: 1.45; }
#pveCard h4 { margin: 22px 0 10px; font-size: 10.5px; font-weight: 500; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .18em; }
.pveOpts { display: flex; gap: 10px; flex-wrap: wrap; }
.pveOpt {
  --b-bg: transparent; --b-fg: var(--ink); --b-line: var(--cream-line);
  flex-direction: column; gap: 5px; padding: 11px 12px 10px; border-radius: 14px; font-size: 13px;
}
.pveOpt:hover { background-color: rgba(163,193,115,.18); }
.pveOpt.sel { --b-bg: rgba(163,193,115,.35); --b-line: var(--ink); }
.pveOpt b { font-size: 14px; font-weight: 500; }
.pveOpt small { font-size: 11px; color: var(--ink-soft); }
.pveOpt.size { flex: 1; min-width: 112px; }
.pveOpt.opp { flex: 1; min-width: 70px; }
/* miniaturas de tablero: mini césped a franjas */
.optGrid { width: 42px; height: 42px; border-radius: 7px;
  background-image: var(--grain), repeating-linear-gradient(135deg, var(--grass-dark) 0 5px, var(--grass-mid) 5px 10px);
  box-shadow: 3px 3px 0 var(--shadow); position: relative; }
.optGrid::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.optGrid.s::after { background-image: linear-gradient(90deg, rgba(241,241,220,.55) 1px, transparent 1px), linear-gradient(rgba(241,241,220,.55) 1px, transparent 1px); background-size: 8.4px 8.4px; }
.optGrid.m::after { background-image: linear-gradient(90deg, rgba(241,241,220,.55) 1px, transparent 1px), linear-gradient(rgba(241,241,220,.55) 1px, transparent 1px); background-size: 6px 4.66px; }
.optGrid.l::after { background-image: linear-gradient(90deg, rgba(241,241,220,.55) 1px, transparent 1px), linear-gradient(rgba(241,241,220,.55) 1px, transparent 1px); background-size: 4.66px 3.8px; }
.optBots { display: flex; gap: 3px; height: 22px; align-items: center; }
.optBots i { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); box-shadow: 2px 2px 0 var(--shadow); opacity: .8; }
/* selector de color de bola: círculos planos con brillo sutil y sombra corta diagonal */
.pveColor {
  width: 42px; height: 42px; padding: 0; border-radius: 50%; border: none;
  box-shadow: 4px 4px 0 var(--shadow), inset -4px -4px 0 rgba(0,0,0,.1), inset 4px 4px 0 rgba(255,255,255,.2);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.pveColor:hover { transform: translateY(-2px); background-image: none; }
.pveColor.sel { box-shadow: 0 0 0 3px var(--cream), 0 0 0 4.5px var(--ink), 4px 4px 0 4px var(--shadow), inset -4px -4px 0 rgba(0,0,0,.1); }
.pveColor.sel::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 52% no-repeat;
}
#pvePlay { width: 100%; margin-top: 26px; padding: 14px; font-size: 16px; }
#pveBack { width: 100%; margin-top: 8px; }

/* ---- Modo Historia ---- */
#storyScreen { display: none; min-height: 100vh; flex-direction: column; align-items: center; padding: 8vh 20px 50px; }
.sTitle {
  font-size: clamp(44px, 7vw, 84px); font-weight: 500; letter-spacing: -.055em; line-height: .95;
  text-transform: lowercase; color: var(--cream); text-align: center; user-select: none;
}
.sTitle::after { content: '.'; color: var(--accent); }
.sSub { margin: 12px 0 4.5vh; color: rgba(241,241,220,.8); font-size: 15px; }
#lvlGrid { display: flex; flex-direction: column; gap: 20px; align-items: center; width: min(860px, 94vw); }
.lvlSection {
  width: 100%; background-image: var(--grain); background-color: var(--cream); border-radius: 20px; padding: 20px 22px 24px;
  box-shadow: 0 24px 60px rgba(10,25,10,.3);
}
.lvlSection h3 { margin: 0 0 16px; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-soft); }
.lvlRow { display: flex; flex-wrap: wrap; gap: 14px; }
.lvlCard {
  --b-bg: transparent; --b-fg: var(--ink); --b-line: var(--cream-line);
  position: relative; width: 170px; padding: 10px 10px 12px; border-radius: 16px;
  flex-direction: column; align-items: stretch; gap: 9px; text-align: left;
  animation: btnUp .35s var(--ease-out) backwards;
}
.lvlCard:hover { background-color: rgba(163,193,115,.18); transform: translateY(-2px); }
.lvlNum {
  position: absolute; top: 16px; left: 16px; z-index: 1; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
  background: var(--cream); color: var(--ink);
}
.lvlPreview {
  width: 100%; height: 118px; display: flex; align-items: center; justify-content: center;
  background-image: var(--grain); background-color: var(--grass-dark); border-radius: 10px; padding: 10px;
}
.lvlPreview svg { max-width: 100%; max-height: 100%; filter: drop-shadow(3px 3px 0 rgba(20,40,20,.25)); }
.lvlName { font-size: 15px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; padding: 0 4px; min-height: 2.3em; display: flex; align-items: center; }
.lvlState {
  align-self: flex-start; margin: 0 4px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--ink-line); color: var(--ink-soft);
}
.lvlState .i { width: 13px; height: 13px; }
.lvlCard.done .lvlState { background: var(--grass-dark); border-color: var(--grass-dark); color: var(--cream); }
.lvlCard.next { --b-line: var(--ink); }
.lvlCard.next .lvlState { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.noLevels { border: 1px dashed var(--cream-line); border-radius: 14px; padding: 18px 24px; font-size: 14px; color: var(--ink-soft); }

/* continuar la partida guardada: pasa a ser la acción principal del menú */
.mBtn.continue { --b-bg: var(--accent); --b-fg: #fff; --b-line: var(--accent); box-shadow: 0 8px 20px rgba(232,135,58,.3); text-align: left; padding-block: 8px; }
.mBtn.continue:hover { background-color: var(--accent-deep); border-color: var(--accent-deep); }
.mBtn.continue .i { transition: transform .2s var(--ease-out); }
.mBtn.continue:hover .i { transform: translateX(3px); }
.mBtn.continue .cTxt { display: flex; flex-direction: column; line-height: 1.15; }
.mBtn.continue small { font-size: 11.5px; font-weight: 400; opacity: .85; }
