/* ==========================================================================
   Tema común · English · IE 3092 Kumamoto-I
   Una sola hoja de estilos para TODAS las páginas (menú, vocabulario, juegos).
   Para cambiar colores o tipografía del sitio completo, editar solo las
   variables de :root.
   ========================================================================== */

:root {
  /* Tipografía */
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;

  /* Colores base */
  --bg: #fff9f0;
  --surface: #ffffff;
  --ink: #43352b;
  --ink-2: #6f6054;
  --line: #ecdfcd;

  /* Marca */
  --brand: #277a74;
  --brand-dark: #1d5f5a;
  --brand-soft: #d8f0ea;

  /* Paleta infantil (fondo / borde) — se reparte entre las tarjetas */
  --c1-bg: #ffe4d2; --c1-edge: #f0b48f;   /* durazno */
  --c2-bg: #d8f0e4; --c2-edge: #94cfb4;   /* menta   */
  --c3-bg: #dcebfb; --c3-edge: #93bfec;   /* cielo   */
  --c4-bg: #fff3c4; --c4-edge: #e6cb6b;   /* limón   */
  --c5-bg: #e8def8; --c5-edge: #b7a1e3;   /* lila    */
  --c6-bg: #ffdde3; --c6-edge: #ee9fb0;   /* rosa    */

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 6px 18px rgba(67, 53, 43, .08);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-head { font-family: var(--font-head); font-weight: 600; letter-spacing: .005em; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

:focus-visible { outline: 3px solid #f2a65a; outline-offset: 3px; border-radius: 8px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 2000;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 10px;
}
.skip-link:focus { left: 8px; color: #fff; }

main { flex: 1 0 auto; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(67, 53, 43, .06);
}
.site-header::after {
  content: ''; display: block; height: 6px;
  background: linear-gradient(90deg,
    var(--c1-edge) 0 16.66%, var(--c4-edge) 0 33.33%, var(--c2-edge) 0 50%,
    var(--c3-edge) 0 66.66%, var(--c5-edge) 0 83.33%, var(--c6-edge) 0 100%);
}
.site-header .navbar { padding: .55rem 0; }

.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { height: 46px; width: auto; display: block; }
.brand-text { line-height: 1.1; }
.brand-text strong { font-family: var(--font-head); font-size: 1.35rem; font-weight: 600; display: block; }
.brand-text small { color: var(--ink-2); font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }

.site-header .nav-link {
  color: var(--ink); font-weight: 700; border-radius: 999px; padding: .45rem 1rem !important;
}
.site-header .nav-link:hover { background: var(--c4-bg); color: var(--ink); }
.site-header .nav-link.active,
.site-header .nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }

.site-header .dropdown-menu {
  border: 2px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft); padding: .5rem; min-width: 15rem;
}
.site-header .dropdown-item {
  border-radius: 12px; padding: .5rem .75rem; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: .65rem;
}
.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus { background: var(--c4-bg); color: var(--ink); }
.site-header .dropdown-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.site-header .dropdown-item i { width: 1.2rem; text-align: center; color: var(--brand); }

.navbar-toggler { border: 2px solid var(--line); border-radius: 12px; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(242, 166, 90, .45); }

/* ---------- Encabezado de página (hero) ---------- */
.page-hero {
  --tint: var(--c1-bg); --edge: var(--c1-edge);
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.65) 0 70px, transparent 71px),
    radial-gradient(circle at 88% 70%, rgba(255,255,255,.55) 0 95px, transparent 96px),
    var(--tint);
  border-bottom: 3px dashed var(--edge);
  padding: 2rem 0 1.75rem;
}
.hero-inner { display: flex; align-items: center; gap: 1.25rem; }
.hero-icon {
  flex: 0 0 auto; width: 76px; height: 76px; border-radius: 26px;
  background: #fff; border: 3px solid var(--edge);
  box-shadow: 0 6px 0 var(--edge);
  display: grid; place-items: center; font-size: 2.1rem; color: var(--ink);
}
.hero-text h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.7rem); margin: 0; line-height: 1.1; }
.hero-text .hero-es { font-family: var(--font-head); color: var(--ink-2); font-size: 1.15rem; margin: .15rem 0 0; }
.hero-text p.hero-desc { margin: .5rem 0 0; color: var(--ink-2); max-width: 46rem; font-weight: 600; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; border: 2px solid var(--edge, var(--line)); border-radius: 999px;
  padding: .25rem .8rem; font-weight: 800; font-size: .85rem; color: var(--ink);
}

.breadcrumbs { font-size: .85rem; font-weight: 700; margin-bottom: .6rem; color: var(--ink-2); }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs a:hover { color: var(--brand-dark); text-decoration: underline; }
.breadcrumbs span[aria-hidden] { margin: 0 .35rem; opacity: .6; }

/* ---------- Contenido ---------- */
.content { padding: 2.25rem 0 1rem; }

.section-head { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.25rem; }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.section-head::after { content: ''; flex: 1; border-top: 3px dotted var(--line); }
.section-head .dot {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); border: 2px solid #a8d8d0;
}

/* ---------- Tarjetas infantiles (vocabulario) ---------- */
.card-grid {
  display: grid; gap: 1.35rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.kid-card {
  --bg-c: var(--c1-bg); --edge-c: var(--c1-edge);
  position: relative; appearance: none; font: inherit; color: var(--ink); text-align: center;
  background: var(--bg-c);
  border: 3px solid var(--edge-c);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 0 var(--edge-c);
  min-height: 176px; width: 100%;
  padding: 1.6rem 1rem 1.2rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .65rem;
  cursor: pointer; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.kid-card:nth-child(6n+1) { --bg-c: var(--c1-bg); --edge-c: var(--c1-edge); }
.kid-card:nth-child(6n+2) { --bg-c: var(--c2-bg); --edge-c: var(--c2-edge); }
.kid-card:nth-child(6n+3) { --bg-c: var(--c3-bg); --edge-c: var(--c3-edge); }
.kid-card:nth-child(6n+4) { --bg-c: var(--c4-bg); --edge-c: var(--c4-edge); }
.kid-card:nth-child(6n+5) { --bg-c: var(--c5-bg); --edge-c: var(--c5-edge); }
.kid-card:nth-child(6n+6) { --bg-c: var(--c6-bg); --edge-c: var(--c6-edge); }

/* Lunares decorativos */
.kid-card::before, .kid-card::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.55); pointer-events: none;
}
.kid-card::before { width: 74px; height: 74px; left: -22px; bottom: -26px; }
.kid-card::after  { width: 38px; height: 38px; right: 30px; bottom: 14px; }

.kid-card:hover { transform: translateY(-5px); box-shadow: 0 13px 0 var(--edge-c); }
.kid-card:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--edge-c); }

.kid-card .sound {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; border: 2px solid var(--edge-c); color: var(--ink);
  display: grid; place-items: center; font-size: .95rem;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.kid-card:hover .sound { transform: scale(1.1); }

.kid-card .word-en {
  font-family: var(--font-head); font-weight: 600; font-size: clamp(1.55rem, 1.2rem + 1vw, 2.15rem);
  line-height: 1.1; word-break: break-word; position: relative; z-index: 1;
}
.kid-card .word-es {
  background: #fff; border: 2px solid var(--edge-c); border-radius: 999px;
  padding: .15rem .85rem; font-weight: 800; font-size: .95rem; color: var(--ink-2); position: relative; z-index: 1;
}

.kid-card.playing { animation: kc-pulse .9s ease-in-out infinite; box-shadow: 0 8px 0 var(--edge-c), 0 0 0 5px rgba(255,255,255,.9), 0 0 0 8px var(--edge-c); }
.kid-card.playing .sound { background: var(--brand); color: #fff; border-color: var(--brand-dark); animation: kc-bounce .6s ease-in-out infinite; }
.kid-card.error .sound { background: #fde0e0; color: #b24545; border-color: #e8a0a0; }
.kid-card .tip {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2;
  background: #b24545; color: #fff; font-size: .75rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap;
}

@keyframes kc-pulse  { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes kc-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- Tarjetas del menú ---------- */
.topic-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.topic-card {
  --bg-c: var(--c1-bg); --edge-c: var(--c1-edge);
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem;
  background: var(--bg-c); border: 3px solid var(--edge-c); border-radius: var(--radius-lg);
  box-shadow: 0 8px 0 var(--edge-c);
  padding: 1.5rem 1.15rem 1.4rem; color: var(--ink); height: 100%;
  transition: transform .15s ease, box-shadow .15s ease; overflow: hidden;
}
.topic-card::before {
  content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,.5); right: -26px; top: -30px;
}
.topic-card:hover { color: var(--ink); transform: translateY(-5px); box-shadow: 0 13px 0 var(--edge-c); }
.topic-card:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--edge-c); }
.topic-card:nth-child(6n+2) { --bg-c: var(--c2-bg); --edge-c: var(--c2-edge); }
.topic-card:nth-child(6n+3) { --bg-c: var(--c3-bg); --edge-c: var(--c3-edge); }
.topic-card:nth-child(6n+4) { --bg-c: var(--c4-bg); --edge-c: var(--c4-edge); }
.topic-card:nth-child(6n+5) { --bg-c: var(--c5-bg); --edge-c: var(--c5-edge); }
.topic-card:nth-child(6n+6) { --bg-c: var(--c6-bg); --edge-c: var(--c6-edge); }

.topic-icon {
  width: 72px; height: 72px; border-radius: 24px; background: #fff; border: 3px solid var(--edge-c);
  display: grid; place-items: center; font-size: 2rem; margin-bottom: .35rem; position: relative; z-index: 1;
}
.topic-card h3 { font-size: 1.45rem; margin: 0; position: relative; z-index: 1; }
.topic-card .es { font-weight: 800; color: var(--ink-2); margin: 0; position: relative; z-index: 1; }
.topic-card .desc { font-size: .9rem; color: var(--ink-2); font-weight: 600; margin: .35rem 0 .85rem; position: relative; z-index: 1; }
.topic-card .go {
  margin-top: auto; background: #fff; border: 2px solid var(--edge-c); border-radius: 999px;
  padding: .3rem 1rem; font-weight: 800; font-size: .9rem; position: relative; z-index: 1;
}

/* ---------- Botones ---------- */
.btn-kid {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  background: var(--c1-bg); color: var(--ink); font-weight: 800; font-family: var(--font-body);
  border: 3px solid var(--c1-edge); border-radius: 999px; padding: .55rem 1.35rem;
  box-shadow: 0 5px 0 var(--c1-edge); transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.btn-kid:hover { color: var(--ink); background: #ffd9bf; transform: translateY(2px); box-shadow: 0 3px 0 var(--c1-edge); }
.btn-kid:active { transform: translateY(5px); box-shadow: 0 0 0 var(--c1-edge); }
.btn-kid.is-brand { background: var(--brand); color: #fff; border-color: var(--brand-dark); box-shadow: 0 5px 0 var(--brand-dark); }
.btn-kid.is-brand:hover { background: #2b8a83; color: #fff; box-shadow: 0 3px 0 var(--brand-dark); }
.btn-kid.is-mint { background: var(--c2-bg); border-color: var(--c2-edge); box-shadow: 0 5px 0 var(--c2-edge); }
.btn-kid.is-mint:hover { background: #c6e9d8; box-shadow: 0 3px 0 var(--c2-edge); }

/* ---------- Navegación anterior / siguiente ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 2.75rem 0 1rem; }
.pager .btn-kid { max-width: 100%; }
.pager .spacer { width: 0; }

/* ---------- Pie de página ---------- */
.site-footer {
  flex-shrink: 0; margin-top: 3rem; background: #eaf3ec; border-top: 3px dashed #b9d3bf; color: #3f5546;
  padding: 1.75rem 0 1.25rem;
}
.site-footer a { color: #2d5c4a; font-weight: 700; }
.site-footer .foot-brand { display: flex; align-items: center; gap: .75rem; }
.site-footer .foot-brand img { height: 44px; }
.site-footer .foot-brand strong { font-family: var(--font-head); font-size: 1.1rem; color: var(--ink); display: block; line-height: 1.15; }
.site-footer small { color: #56705e; font-weight: 700; }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; justify-content: flex-end; }
.site-footer .copy { border-top: 2px solid #cfe0d3; margin-top: 1.1rem; padding-top: .9rem; font-size: .85rem; text-align: center; font-weight: 700; }
@media (max-width: 767.98px) { .site-footer .foot-links { justify-content: flex-start; margin-top: .75rem; } }

/* ==========================================================================
   Juegos de relacionar (VerbMatch y modo aleatorio)
   ========================================================================== */
.game-wrap { max-width: 760px; margin: 0 auto; }

.game-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.stat-pill {
  display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 2px solid var(--c1-edge);
  border-radius: 999px; padding: .3rem .95rem; font-weight: 800; box-shadow: 0 4px 0 var(--c1-edge);
}
.stat-pill i { color: var(--brand); }
.stat-pill .num { font-variant-numeric: tabular-nums; }
.stat-pill i { margin-right: .1rem; }

.progress-wrap { margin-bottom: 1rem; text-align: center; }
.progress-label { font-size: .85rem; font-weight: 800; color: var(--ink-2); margin-bottom: .4rem; }
.progress-bar-outer { background: #fff; border-radius: 999px; height: 16px; overflow: hidden; border: 3px solid var(--c1-edge); }
.progress-bar-inner {
  height: 100%; background: repeating-linear-gradient(45deg, #5cb99f 0 12px, #7accb4 12px 24px);
  border-radius: 999px; transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.streak-display { text-align: center; min-height: 28px; margin-bottom: .75rem; font-weight: 800; color: #9a6a3f; }
.good-badge { display: inline-block; background: var(--c4-bg); border: 2px solid var(--c4-edge); border-radius: 999px; padding: 0 .6rem; font-size: .8rem; font-weight: 800; }
.instruction { text-align: center; color: var(--ink-2); font-weight: 700; margin-bottom: 1.25rem; }

.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.column-label {
  text-align: center; font-family: var(--font-head); font-size: .9rem; letter-spacing: .08em; font-weight: 600;
  margin: 0 auto .75rem; padding: .2rem 1rem; border-radius: 999px; width: max-content; border: 2px solid;
}
.col-en .column-label { background: var(--c3-bg); border-color: var(--c3-edge); }
.col-es .column-label { background: var(--c6-bg); border-color: var(--c6-edge); }
.card-list { display: flex; flex-direction: column; gap: .8rem; }

.card-item {
  background: #fff; border: 3px solid var(--c1-edge); border-radius: 20px; box-shadow: 0 6px 0 var(--c1-edge);
  padding: .8rem .75rem; min-height: 58px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 800; font-size: 1rem; line-height: 1.25; color: var(--ink);
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.col-en .card-item { border-color: var(--c3-edge); box-shadow: 0 6px 0 var(--c3-edge); background: var(--c3-bg); }
.col-es .card-item { border-color: var(--c6-edge); box-shadow: 0 6px 0 var(--c6-edge); background: var(--c6-bg); }
.card-item:hover:not(.matched):not(.wrong) { transform: translateY(-3px); }
.card-item:active:not(.matched) { transform: translateY(4px); box-shadow: 0 2px 0 var(--c1-edge); }
.card-item.active { background: var(--c4-bg) !important; border-color: #d9a93a !important; box-shadow: 0 6px 0 #d9a93a, 0 0 0 4px rgba(217,169,58,.25) !important; transform: translateY(-2px); }
.card-item.matched {
  background: #d9f2e1 !important; border-color: #7cc596 !important; box-shadow: 0 6px 0 #7cc596 !important;
  color: #2f6e48; cursor: default; animation: matchPop .4s ease;
}
.card-item.wrong { background: #ffe0e0 !important; border-color: #e58d8d !important; box-shadow: 0 6px 0 #e58d8d !important; color: #a23c3c; animation: shake .5s ease; }
.card-item.new-card { animation: slideIn .4s ease backwards; }

@keyframes matchPop { 50% { transform: scale(1.07); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(18px); } }

/* Mensaje de error */
.reset-flash {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1500;
  background: #e07878; color: #fff; font-family: var(--font-head); font-size: 1.4rem; text-align: center;
  padding: 1.1rem 2rem; border-radius: 26px; box-shadow: 0 8px 0 #b95858; pointer-events: none;
  animation: flashIn .3s ease; max-width: 90vw;
}
@keyframes flashIn { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }

/* Pantalla de victoria */
.win-overlay { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(255, 249, 240, .93); align-items: center; justify-content: center; }
.win-overlay.show { display: flex; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.win-box {
  background: #fff; border: 3px solid var(--c1-edge); border-radius: 32px; padding: 2.25rem 2rem; text-align: center;
  max-width: 400px; width: 90%; box-shadow: 0 14px 0 var(--c1-edge), 0 18px 30px rgba(0,0,0,.08);
  animation: winBounce .6s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes winBounce { from { transform: scale(.5); opacity: 0; } }
.win-trophy { font-size: 4rem; margin-bottom: .5rem; }
.win-title { font-family: var(--font-head); font-size: 2.2rem; margin-bottom: .25rem; }
.win-subtitle { color: var(--ink-2); font-weight: 700; margin-bottom: 1.25rem; }
.win-stats { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.6rem; }
.win-stat { background: var(--c4-bg); border: 2px solid var(--c4-edge); border-radius: 18px; padding: .6rem 1.1rem; }
.win-stat-val { font-family: var(--font-head); font-size: 1.7rem; display: block; line-height: 1.2; }
.win-stat-lbl { font-size: .72rem; font-weight: 800; color: var(--ink-2); letter-spacing: .08em; text-transform: uppercase; }

.confetti-piece { position: fixed; top: -20px; pointer-events: none; z-index: 2100; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* Modal de Bootstrap con el mismo estilo */
.modal-content { border: 3px solid var(--c1-edge); border-radius: 28px; box-shadow: 0 12px 0 var(--c1-edge); background: #fff; }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-family: var(--font-head); }

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-chips { justify-content: center; }
  .breadcrumbs { text-align: center; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .kid-card { min-height: 150px; padding: 1.4rem .6rem 1rem; }
  .kid-card .sound { width: 32px; height: 32px; top: 8px; right: 8px; font-size: .8rem; }
  .game-grid { gap: .6rem; }
  .card-item { font-size: .88rem; padding: .65rem .4rem; }
  .pager .btn-kid { width: 100%; justify-content: center; }
}

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