/* ================= Waku: pause/options drawer LAYOUT ================= *
 * Round 21, Fase 1: "desacopla... sin cambiar nada visible" split every
 * rule specifically about the DRAWER's own layout (as opposed to shared
 * game chrome like .pause-fab, or self-contained popups that merely live
 * inside the drawer like the abilities codex) out of styles/pause.css and
 * into this file -- see styles/pause.css's header comment for what stayed
 * behind and why.
 *
 * Round 21, Fase 4: full rewrite of the layout itself ("dos columnas: a la
 * izquierda Reanudar/Niveles/Reiniciar/Inicio, a la derecha sonido, señoría,
 * un grupo 'Más' y un <details> 'Avanzado'") -- see index.html's markup
 * comment just above #optionsDrawer for the new structure. Same IDs, same
 * shared/global classes (.btn, .btn.secondary, .options-row, .hint,
 * .side-panel, .debug-panel, .lore-text, .seniority-badge...) as before, so
 * nothing here can be styled any differently just by existing outside this
 * file; only the NEW wk-pause-* wrapper classes are new. Every selector
 * still starts with #optionsDrawer per tools/guard.py's scope check.
 */
#optionsDrawer{
  position:absolute; inset:0; z-index:9;
  background:var(--wk-bg, #140e08);
  color:var(--wk-text, #fff5ec);
  display:flex; flex-direction:column;
  align-items:center;
  /* the drawer's own content (sound/volume controls etc.) must clear the
     cutout on every edge, not just the top -- this is the actual fix for
     "no se ven los controles de volumen" in landscape on a Dynamic
     Island device, where the cutout reports as a left/right inset */
  padding:calc(16px + env(safe-area-inset-top,0px)) calc(16px + env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) calc(16px + env(safe-area-inset-left,0px));
  overflow-y:auto;
}
#optionsDrawer[hidden]{ display:none; }

/* ---- shared skeleton (all profiles): a column that centers/caps its own
   width -- phone.css/tablet.css/desktop.css only adjust that cap and the
   2-column split below, not this base structure ---- */
#optionsDrawer .wk-pause{
  width:100%;
  max-width: var(--wk-pause-max, 720px);
  display:flex; flex-direction:column;
  flex:1;
  min-height:0;
}
#optionsDrawer .wk-pause-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:16px; flex-shrink:0;
}
#optionsDrawer .wk-pause-head strong{ font-family:'Fredoka','Nunito',sans-serif; font-size:18px; }

#optionsDrawer .wk-pause-body{
  display:grid;
  grid-template-columns: var(--wk-pause-cols, 1fr 1.3fr);
  gap: 24px;
  align-items:start;
}
#optionsDrawer .wk-pause-col{ display:flex; flex-direction:column; gap:10px; min-width:0; }

/* left column: the four "do something to the run" actions, biggest/most
   likely tap first -- Reanudar leads and gets the clay CTA treatment like
   the portada's Jugar button, the rest are plain secondary buttons */
#optionsDrawer .wk-pause-resume{
  background:var(--wk-clay, #b5502e); color:var(--wk-text, #fff5ec);
  font-size:16px;
}
#optionsDrawer .wk-pause-resume:hover{ background:var(--wk-clay-pressed, #8a3a20); }
#optionsDrawer .wk-pause-col-main .btn{ width:100%; justify-content:center; }

/* right column groups */
#optionsDrawer .wk-pause-group{ display:flex; flex-direction:column; }
#optionsDrawer .options-section-label{
  font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
  opacity:0.65; font-weight:700; margin:0 0 8px;
  color:var(--wk-text-muted, rgba(255,245,236,0.72));
}
#optionsDrawer .options-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
#optionsDrawer .seniority-badge{
  margin:0; font-size:13px; font-weight:800;
  color:var(--wk-gold, #ffd24a); letter-spacing:0.02em;
}

#optionsDrawer #soundToggle, #optionsDrawer #debugToggle, #optionsDrawer #musicToggle, #optionsDrawer #volumeToggle{
  border:1.5px solid var(--wk-line, rgba(255,255,255,0.35));
  background:transparent;
  color:var(--wk-text, #fff);
  border-radius:999px;
  width:38px; height:38px;
  font-size:16px;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
/* #homeBtn moved into the left column and grew a text label (Round 21,
   Fase 4: "icono + 'Inicio' para legibilidad") -- it now shares the plain
   secondary-button treatment of its column-mates instead of the small round
   icon-only look the other toggles above keep */
#optionsDrawer #homeBtn{ width:100%; justify-content:center; }

/* extra highlight on top of the protected .btn.mode-active rule (index.html,
   untouched) -- purely additive, scoped to this drawer, so the toggle still
   reads clearly against the new gold/clay palette */
#optionsDrawer #randomModeBtn.mode-active{
  border:1.5px solid var(--wk-gold-line, rgba(255,210,74,0.55));
}

#optionsDrawer .volume-panel{
  position:relative;
}
#optionsDrawer .volume-pop{
  position:absolute; top:44px; left:0; z-index:5;
  background:var(--wk-surface-raised, #2a1d10); color:var(--wk-text, #fff5ec);
  border:1px solid var(--wk-line, rgba(255,255,255,0.16)); border-radius:12px;
  padding:12px 14px; width:200px;
  box-shadow:0 10px 24px -10px rgba(0,0,0,0.5);
  display:flex; flex-direction:column; gap:10px;
}
#optionsDrawer .volume-pop[hidden]{ display:none; }
#optionsDrawer .volume-row{ display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--wk-text-muted, rgba(255,245,236,0.72)); font-weight:700; }
#optionsDrawer .volume-row input[type=range]{ width:100%; }

/* ---- "Avanzado": a native <details> (Round 21, Fase 4) -- no JS/listener
   changes, the browser's own toggle behavior is enough. Styled to look like
   the rest of the drawer instead of the default disclosure triangle. ---- */
#optionsDrawer .wk-pause-advanced{
  border:1px solid var(--wk-line, rgba(255,255,255,0.16));
  border-radius:12px;
  padding:10px 14px;
  background:rgba(255,255,255,0.03);
}
#optionsDrawer .wk-pause-advanced summary{
  cursor:pointer;
  font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
  font-weight:700; color:var(--wk-text-muted, rgba(255,245,236,0.72));
  list-style:none;
}
#optionsDrawer .wk-pause-advanced summary::-webkit-details-marker{ display:none; }
#optionsDrawer .wk-pause-advanced[open] summary{ margin-bottom:10px; }
#optionsDrawer .wk-pause-advanced:focus-within{ border-color:var(--wk-gold-line, rgba(255,210,74,0.55)); }

#optionsDrawer .debug-panel{
  width:100%;
  background:rgba(255,255,255,0.06);
  border:1px solid var(--wk-line, rgba(255,255,255,0.16));
  border-radius:12px;
  padding:10px 14px;
  margin-top:14px;
}
#optionsDrawer .debug-panel[hidden]{display:none;}
#optionsDrawer #debugLog{
  font-family:'SF Mono', 'Consolas', monospace;
  font-size:11px;
  line-height:1.5;
  max-height:160px;
  overflow-y:auto;
  color:rgba(255,255,255,0.7);
  white-space:pre-wrap;
}
#optionsDrawer #debugLog .warn{ color:#ff8a6b; font-weight:700; }

/* ---- lore / story section (inside the options drawer) ---- */
#optionsDrawer .lore-text{
  width:100%;
  background:rgba(255,255,255,0.06); border:1px solid var(--wk-line, rgba(255,255,255,0.16)); border-radius:12px;
  padding:14px 16px; font-size:13px; line-height:1.6; color:var(--wk-text-muted, rgba(255,245,236,0.8));
  margin-top:14px;
}
#optionsDrawer .lore-text[hidden]{ display:none; }
#optionsDrawer .lore-text p{ margin:0 0 10px; }
#optionsDrawer .lore-text p:last-child{ margin-bottom:0; }

/* #hint / .side-panel (#reviewPanel) / .debug-panel / .lore-text all live
   below the two columns, full width -- they're written into by the main
   script (or, for .side-panel, styled already/unchanged in pause.css) and
   only show up conditionally, so they don't need a column of their own */
#optionsDrawer > .wk-pause > .hint{ margin-top:14px; }
#optionsDrawer .side-panel{ margin-top:14px; }

#optionsDrawer .options-footer{
  font-size:11px;
  color:var(--wk-text-muted, rgba(255,245,236,0.5));
  text-align:center;
  margin-top:auto;
  padding-top:16px;
  flex-shrink:0;
}
