/* Estilos compartidos por la portada y los dos juegos */
:root {
  --bg: #fdf6ec;
  --card: #ffffff;
  --ink: #2b2a33;
  --muted: #6b6878;
  --primary: #e8674a;
  --primary-ink: #ffffff;
  --secondary: #3f8f8a;
  --accent: #f4b942;
  --ok: #3c9d5d;
  --bad: #c9473a;
  --line: #eadfce;
  --shadow: 0 6px 20px rgba(60, 40, 20, 0.10);
  --radius: 22px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--secondary); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.back {
  text-decoration: none;
  font-weight: 800;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line);
}

.back:hover { color: var(--ink); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 900; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--line);
  padding: 24px;
}

.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.08s ease, filter 0.15s ease;
  min-height: 52px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.btn:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.btn.secondary { background: var(--secondary); }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn.big { font-size: 1.4rem; padding: 18px 36px; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

/* Fases: Inicio · Desarrollo · Cierre */
.phases {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.phases li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
}

.phases li.active { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.phases li.done { color: var(--ok); }

.progress {
  height: 12px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 20px;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--secondary);
  transition: width 0.3s ease;
}

.feedback { font-size: 1.4rem; font-weight: 900; min-height: 2em; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

/* Panel para la persona que guía la actividad */
details.guide {
  margin-top: 20px;
  background: #fffaf2;
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 12px 16px;
}

details.guide summary { font-weight: 800; cursor: pointer; }

table.results {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 1rem;
}

table.results th, table.results td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

table.results th { color: var(--muted); font-weight: 800; }

@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.pop { animation: pop 0.45s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .card { padding: 18px; }
  .btn.big { font-size: 1.2rem; padding: 16px 26px; }
}
