/* Dimensión Marta · Foto o Caos · Estilos del minijuego.
   Mobile first, sin dependencias externas y con la paleta del sitio. */

:root {
  --foto-ink: #24162d;
  --foto-muted: #6b5a76;
  --foto-paper: #fffdf8;
  --foto-gold: #ffc93c;
  --foto-pink: #ff5fbb;
  --foto-blue: #49dff5;
  --foto-lilac: #b98cff;
  --foto-dark: #1a0c2b;
  --foto-radius: 22px;
  --foto-shadow: 0 22px 54px rgba(45, 24, 62, 0.22);
}

body.foto-caos-page,
body.foto-caos-embed {
  margin: 0;
  min-height: 100vh;
  color: var(--foto-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 242, 130, 0.8), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(142, 223, 255, 0.6), transparent 28%),
    radial-gradient(circle at 16% 88%, rgba(255, 166, 219, 0.45), transparent 30%),
    linear-gradient(155deg, #fffaf0 0%, #ffeaf7 48%, #eaf7ff 100%);
  overflow-x: hidden;
}

body.foto-caos-embed { padding: 0; }

.foto-game-shell {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 10px 12px 24px;
  box-sizing: border-box;
}

.foto-game {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ------------------------------------------------------------- marcador */
.foto-topbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(42, 20, 54, 0.1);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(60, 30, 80, 0.12);
}

.foto-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  line-height: 1.1;
  color: var(--foto-muted);
  text-align: center;
}

.foto-stat strong {
  font-size: 17px;
  color: var(--foto-ink);
}

.foto-sound {
  border: 0;
  background: rgba(42, 20, 54, 0.08);
  border-radius: 12px;
  padding: 0 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.foto-sound.is-off { opacity: 0.55; }

/* -------------------------------------------------------------- escenario */
.foto-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--foto-radius);
  overflow: hidden;
  background: #150a26;
  box-shadow: var(--foto-shadow);
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
}

.foto-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.foto-viewfinder {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border-radius: 14px;
}

.foto-viewfinder span {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 6px;
}

.foto-viewfinder span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.foto-viewfinder span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.foto-viewfinder span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.foto-viewfinder span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.foto-scene-tag {
  position: absolute;
  top: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(26, 12, 43, 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.foto-scene-tag::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff4f81;
  animation: fotoRec 1.4s infinite;
}

@keyframes fotoRec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.foto-bars {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 60px;
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.foto-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.foto-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.12s linear;
}

.foto-bar.chaos i { background: linear-gradient(90deg, var(--foto-blue), var(--foto-pink)); }
.foto-bar.time i { background: linear-gradient(90deg, #fff2a8, var(--foto-gold)); }

.foto-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(26, 12, 43, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.foto-hint.is-visible { opacity: 1; }

.foto-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.foto-flash.is-on { animation: fotoFlash 0.42s ease-out; }

@keyframes fotoFlash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------- pantallas */
.foto-screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  background: rgba(20, 9, 34, 0.55);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.foto-screen.is-visible { display: flex; }

/* La hoja de resultado deja ver la foto congelada: sin desenfoque encima. */
.foto-screen.is-sheet {
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(20, 9, 34, 0) 30%, rgba(20, 9, 34, 0.55) 62%);
  backdrop-filter: none;
}

.foto-panel {
  width: 100%;
  max-width: 420px;
  background: var(--foto-paper);
  border-radius: 20px;
  padding: 16px;
  box-sizing: border-box;
  box-shadow: 0 18px 44px rgba(20, 9, 34, 0.35);
  text-align: center;
}

.foto-panel h1,
.foto-panel h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  line-height: 1.15;
}

.foto-panel p { margin: 0 0 8px; font-size: 14px; color: var(--foto-muted); }

.foto-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--foto-pink);
}

.foto-rules-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.foto-rules-list li {
  background: rgba(73, 223, 245, 0.16);
  border-radius: 10px;
  padding: 7px 10px;
}

.foto-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.foto-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.12s ease;
}

.foto-button:active { transform: scale(0.97); }
.foto-button.primary { background: linear-gradient(120deg, var(--foto-pink), var(--foto-lilac)); color: #fff; }
.foto-button.secondary { background: rgba(42, 20, 54, 0.08); color: var(--foto-ink); }
.foto-button.dark { background: var(--foto-dark); color: #fff; }
.foto-button.ghost { background: transparent; color: var(--foto-ink); border: 2px solid rgba(42, 20, 54, 0.15); }

/* ------------------------------------------------------------- resultado */
.foto-result-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.foto-rarity {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e7e0ee;
  color: #4a3a56;
}

.foto-rarity.is-rare { background: #cdefff; color: #0b5c76; }
.foto-rarity.is-epic { background: #e5d4ff; color: #4a1f8f; }
.foto-rarity.is-legendary { background: linear-gradient(120deg, #ffd76b, #ff9ad5); color: #4d2a00; }

.foto-stars { font-size: 18px; color: var(--foto-gold); letter-spacing: 2px; }

.foto-score-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.foto-score-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(42, 20, 54, 0.05);
}

.foto-score-list strong { color: #1f8a4c; }

.foto-panel p.foto-total {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  margin: 6px 0 0;
  color: var(--foto-ink);
}

/* La hoja de resultado no debe tapar la fotografía: panel compacto. */
.foto-screen.is-sheet .foto-panel {
  padding: 12px 14px 14px;
  border-radius: 20px 20px 14px 14px;
}

.foto-screen.is-sheet .foto-panel h2 { font-size: 21px; margin: 2px 0 4px; }
.foto-screen.is-sheet .foto-score-list { margin: 8px 0 0; gap: 3px; font-size: 12.5px; }
.foto-screen.is-sheet .foto-score-list li { padding: 4px 9px; }

/* -------------------------------------------------------------- director */
.foto-rule {
  display: block;
  width: 100%;
  text-align: left;
  border: 2px solid rgba(42, 20, 54, 0.1);
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.foto-rule strong { display: block; font-size: 15px; }
.foto-rule span { display: block; font-size: 12.5px; color: var(--foto-muted); }
.foto-rule:hover { border-color: var(--foto-pink); }

.foto-rule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  min-height: 0;
}

.foto-rule-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(185, 140, 255, 0.22);
  color: #4a1f8f;
}

/* ----------------------------------------------------------------- álbum */
.foto-album-panel { max-width: 460px; text-align: center; }

.foto-album-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.foto-album-stats div {
  background: rgba(73, 223, 245, 0.14);
  border-radius: 12px;
  padding: 7px 4px;
  font-size: 11px;
  color: var(--foto-muted);
}

.foto-album-stats strong { display: block; font-size: 18px; color: var(--foto-ink); }

.foto-album-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 10px 0;
}

.foto-thumb {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  border: 2px solid transparent;
  position: relative;
}

.foto-thumb img { display: block; width: 100%; height: auto; }
.foto-thumb.is-rare { border-color: #49dff5; }
.foto-thumb.is-epic { border-color: #b98cff; }
.foto-thumb.is-legendary { border-color: var(--foto-gold); }

.foto-thumb figcaption {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(20, 9, 34, 0.62);
  color: #fff;
  font-size: 9px;
  padding: 1px 2px;
  line-height: 1.1;
}

.foto-thumb figcaption strong { display: block; font-size: 11px; }
.foto-thumb figcaption span { display: none; }
.foto-thumb-empty { display: block; padding-top: 125%; background: #ddd; }

.foto-card {
  margin: 8px auto;
  max-width: 240px;
}

.foto-card-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(20, 9, 34, 0.28);
}

.foto-frames {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0;
}

.foto-frame {
  border: 2px solid rgba(42, 20, 54, 0.12);
  border-radius: 12px;
  padding: 6px 10px;
  background: var(--frame-paper, #fff);
  cursor: pointer;
  font-size: 11px;
  text-transform: capitalize;
  color: var(--frame-ink, #2a1b33);
  min-width: 62px;
}

.foto-frame strong { display: block; font-size: 12px; }
.foto-frame span { font-size: 10px; opacity: 0.7; }
.foto-frame.is-active { border-color: var(--frame-accent, var(--foto-pink)); box-shadow: 0 0 0 3px rgba(255, 95, 187, 0.18); }
.foto-frame.is-locked { opacity: 0.55; }

.foto-daily-note {
  font-size: 11.5px;
  color: var(--foto-muted);
  margin: 6px 0 0;
}

/* ------------------------------------------------------------------ toast */
.foto-toast {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(10px);
  background: var(--foto-dark);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.foto-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------ página con contenido */
.foto-site-header,
.foto-site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.foto-brand { font-weight: 800; color: var(--foto-ink); text-decoration: none; }
.foto-site-header nav { display: flex; gap: 12px; flex-wrap: wrap; }
.foto-site-header a,
.foto-site-footer a { color: var(--foto-ink); text-decoration: none; }
.foto-site-header a:hover,
.foto-site-footer a:hover { text-decoration: underline; }

.foto-page-main { max-width: 900px; margin: 0 auto; padding: 0 18px 40px; }

.foto-page-hero {
  display: grid;
  gap: 10px;
  padding: 18px 0 10px;
}

.foto-page-hero h1 { margin: 0; font-size: clamp(28px, 7vw, 42px); line-height: 1.06; }
.foto-summary { margin: 0; font-size: 16px; color: var(--foto-muted); max-width: 60ch; }
.foto-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.foto-content-section {
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--foto-radius);
  padding: 18px;
  margin: 16px 0;
  box-shadow: 0 12px 30px rgba(60, 30, 80, 0.1);
}

.foto-content-section h2 { margin-top: 0; font-size: 22px; }
.foto-content-section li { margin-bottom: 6px; }
.foto-content-section p { color: #40304a; }

.foto-faq h3 { margin-bottom: 4px; font-size: 16px; }
.foto-faq p { margin-top: 0; }

.foto-link-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

@media (min-width: 720px) {
  .foto-game-shell { padding-top: 16px; }
  .foto-stat { font-size: 12px; }
  .foto-stat strong { font-size: 19px; }
  .foto-panel { max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  .foto-flash.is-on { animation-duration: 0.05s; }
  .foto-scene-tag::before { animation: none; }
  .foto-button { transition: none; }
}
