/* ==== ALMA – estilo consistente con Word Search / Memory ==== */
:root {
  --principal-celeste: #5EC0CF;
  --principal-violeta: #9A8BC2;
  --principal-blanco: #F4F4F4;

  --secundario-oscuro: #004F66;
  --secundario-rosa: #C8A2C9;
  --secundario-gris: #4D4D4D;
  --secundario-lila: #E8E6FB;

  --accent-naranja: #ff7043;
  --accent-naranja-hover: #ff5722;
  --verde-ok: #37c36a;
  --rojo-err: #e76666;
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Gotham Rounded', 'Nunito Sans', sans-serif;
  background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  position: relative;
  color: var(--secundario-oscuro);
}

/* Header y título */
.header {
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
  max-width: 700px;
}

.title {
  color: #9A8BC2;
  font-size: 2rem;
  font-weight: 800;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 14px;
}

/* Stats más compactas */
.stats {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: nowrap;
}

.stat {
  background: var(--principal-blanco);
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-width: 100px;
  max-width: 160px;
  flex: 1 1 0;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--principal-celeste);
}

/* Tarjeta del juego */
.game-container {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  padding: 18px;
  margin-bottom: 18px;
  width: 100%;
  max-width: 400px;
}

.subtitle {
  text-align: center;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--secundario-oscuro);
}

/* Controles superiores (modo) */
.controls.top {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.size-btn {
  background: var(--principal-celeste);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(94, 192, 207, 0.3);
  min-height: 34px;
}

.size-btn:hover {
  background: #4AA8B6;
  transform: translateY(-2px);
}

.size-btn.active {
  background: #0b6b7f;
}

/* Grid de fichas más chico */
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(60px, 1fr));
  gap: 10px;
  justify-content: center;
  margin: 0 auto 10px;
  max-width: 600px;
}

.tile {
  background: #ffffff;
  color: var(--secundario-oscuro);
  border: 2px solid rgba(94, 192, 207, 0.45);
  border-radius: 12px;
  padding: 12px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.tile:hover {
  transform: translateY(-2px);
  background: #f4feff;
  border-color: var(--principal-celeste);
}

.tile.correct {
  background: var(--verde-ok);
  border-color: var(--verde-ok);
  color: #fff;
}

.tile.wrong {
  background: var(--rojo-err);
  border-color: var(--rojo-err);
  color: #fff;
}

.tile.disabled {
  pointer-events: none;
  opacity: .8;
}

/* Feedback */
.feedback {
  min-height: 22px;
  text-align: center;
  font-weight: 800;
  margin: 4px 0 2px;
  font-size: 0.95rem;
}

.feedback.ok {
  color: #188a4e;
}

.feedback.err {
  color: #a53e3e;
}

/* Botones inferiores más chicos */
.bottom-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.reset-btn {
  background: var(--accent-naranja);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 22px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all .25s ease;
  box-shadow: 0 3px 12px rgba(255, 112, 67, 0.3);
  min-height: 40px;
}

.reset-btn:hover {
  background: var(--accent-naranja-hover);
  transform: translateY(-2px);
}

/* Footer */
footer {
  position: fixed;
  bottom: 16px;
  right: 16px;
  color: #004F66;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.8;
  z-index: 100;
}

footer p {
  margin: 0;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.watermark-logo{ height: clamp(28px, 4.2vh, 4.2vh); }

/* Responsive */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, minmax(50px, 1fr));
  }

  .game-container {
    max-width: 400px;
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, minmax(50px, 1fr));
  }

  .game-container {
    max-width: 320px;
  }
}

@media (max-width: 640px) {
  .title {
    font-size: 1.8rem;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    min-width: 90px;
    padding: 10px 14px;
  }

  .grid {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
  }

  .tile {
    font-size: 1rem;
    padding: 8px;
    min-width: 0;
    min-height: 0;
  }

  .game-container {
    max-width: 260px;
  }
}

@media (max-width: 420px) {
  .title {
    font-size: 1.6rem;
  }

  .grid {
    grid-template-columns: repeat(4, minmax(30px, 1fr));
  }

  .tile {
    font-size: 0.95rem;
    padding: 6px;
    min-width: 0;
    min-height: 0;
  }

  .game-container {
    max-width: 230px;
  }
}

/* ---------- Responsive: PANTALLA GRANDE (≈52 pulgadas, 4K) ---------- */
@media (min-width: 3800px) {
  html {
    font-size: 2.1rem;
  }

  .header {
    max-width: 4200px;
    margin-bottom: 72px;
  }

  .title {
    font-size: 4.2rem;
    margin-bottom: 40px;
  }

  .stats {
    gap: 60px;
    margin-bottom: 48px;
  }

  .stat {
    min-width: 700px;
    padding: 40px 56px;
    border-radius: 32px;
  }

  .stat-label {
    font-size: 1.8rem;
    margin-bottom: 16px;
  }

  .stat-value {
    font-size: 3.2rem;
  }

  .game-container {
    padding: 72px;
    max-width: 2600px;
    border-radius: 38px;
  }

  .subtitle {
    font-size: 1.9rem;
    margin-bottom: 24px;
  }

  /* Controles de modo (arriba) */
  .controls.top {
    gap: 24px;
    margin-bottom: 36px;
  }

  .size-btn {
    padding: 26px 44px;
    font-size: 1.9rem;
    min-height: 96px;
    border-radius: 32px;
    font-weight: 900;
  }

  /* Grid y fichas */
  .grid {
    grid-template-columns: repeat(5, 200px);
    gap: 26px;
    justify-content: center;
    max-width: none;
    margin: 0 auto 24px;
  }

  .tile {
    font-size: 2.2rem;
    padding: 28px;
    min-height: 160px;
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  }

  .feedback {
    font-size: 2rem;
    min-height: 72px;
    margin-top: 20px;
  }

  /* Botones inferiores */
  .bottom-buttons {
    gap: 44px;
    margin-top: 56px;
  }

  .reset-btn {
    padding: 30px 64px;
    font-size: 2.1rem;
    min-height: 110px;
    border-radius: 34px;
    font-weight: 900;
  }

  footer {
    bottom: 48px;
    right: 48px;
    font-size: 1.6rem;
  }

  footer p {
    padding: 20px 150px;
    border-radius: 24px;
  }
}

/* ---------- Responsive: Pantalla vertical MUY grande (4K vertical) ---------- */
@media (max-width: 2160px) and (min-height: 3800px) {

  html {
    font-size: 1.8rem;
  }

  html,
  body {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }

  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2vh 2vw;
    min-height: 100dvh;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    gap: 2vh;
  }

  .header {
    width: 100%;
    max-width: 1800px;
    margin: 0;
    text-align: center;
    flex-shrink: 0;
  }

  .title {
    font-size: clamp(4rem, 6vw, 8rem);
    line-height: 1.1;
    margin: 0 0 2vh 0;
    color: #9A8BC2;
    font-weight: 800;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  }

  .stats {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 4vw;
    width: 100%;
    max-width: 1400px;
    margin: 2vh auto;
  }

  .stat {
    flex: 1;
    min-width: 1000px;
    padding: 3vh 2vw;
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .stat-label {
    font-size: clamp(2rem, 3.5vw, 4rem);
    margin-bottom: 1vh;
    font-weight: 700;
  }

  .stat-value {
    font-size: clamp(3rem, 5vw, 6rem);
    font-weight: 900;
    color: var(--principal-celeste);
  }

  .game-container {
    width: 100%;
    max-width: 1600px;
    margin: 0;
    padding: 4vh 4vw;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
  }

  .subtitle {
    font-size: clamp(2.5rem, 4vw, 5rem);
    margin-bottom: 3vh;
    text-align: center;
    font-weight: 700;
    color: var(--secundario-oscuro);
  }

  .controls.top {
    display: flex;
    flex-direction: row;
    gap: 4vw;
    margin-bottom: 4vh;
    width: 100%;
    justify-content: center;
  }

  .size-btn {
    padding: 2.5vh 4vw;
    font-size: clamp(2rem, 3.5vw, 4rem);
    min-height: clamp(80px, 8vh, 120px);
    border-radius: 28px;
    font-weight: 900;
    background: var(--principal-celeste);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(94, 192, 207, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .size-btn:hover {
    background: #4AA8B6;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(94, 192, 207, 0.4);
  }

  .size-btn.active {
    background: var(--principal-violeta);
    box-shadow: 0 4px 16px rgba(154, 139, 194, 0.3);
  }

  .grid {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 4vh auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(24px, 3vw, 40px);
    place-content: center;
  }

  .tile {
    aspect-ratio: 1 / 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    line-height: 1;
    font-size: clamp(3rem, 5vw, 6rem);
    padding: 0;
    background: #ffffff;
    border: 3px solid rgba(94, 192, 207, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-weight: 800;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--secundario-oscuro);
  }

  .tile:hover {
    transform: translateY(-4px);
    background: #f8feff;
    border-color: var(--principal-celeste);
    box-shadow: 0 6px 20px rgba(94, 192, 207, 0.2);
  }

  .tile.correct {
    background: var(--verde-ok);
    border-color: var(--verde-ok);
    color: #fff;
    transform: scale(1.05);
  }

  .tile.wrong {
    background: var(--rojo-err);
    border-color: var(--rojo-err);
    color: #fff;
  }

  .feedback {
    font-size: clamp(2.5rem, 4vw, 5rem);
    min-height: 5vh;
    margin-top: 3vh;
    text-align: center;
    font-weight: 800;
  }

  .feedback.ok {
    color: var(--verde-ok);
  }

  .feedback.err {
    color: var(--rojo-err);
  }

  .bottom-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    flex-shrink: 0;
    padding-bottom: 200px;
  }

  .reset-btn,
  .back-btn,
  .primary-btn {
    width: 100%;
    min-height: clamp(100px, 8vh, 140px);
    font-size: clamp(2.5rem, 4vw, 5rem);
    padding: 3vh 0;
    border-radius: 36px;
    font-weight: 900;
    background: var(--accent-naranja);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 112, 67, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .reset-btn {
    z-index: 1;
    padding: 1.0vh 0;
  }

  .reset-btn:hover,
  .back-btn:hover,
  .primary-btn:hover {
    background: var(--accent-naranja-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(255, 112, 67, 0.4);
  }

  footer {
    position: fixed;
    right: 4vw;
    bottom: 3vh;
    z-index: 10;
    width: auto;
    text-align: center;
    font-size: clamp(1.8rem, 2.5vw, 3rem);
    margin-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: row-reverse;
  }

  footer p {
    border-radius: 28px;
    line-height: 1;
    font-size: clamp(2rem, 2.8vw, 3.5rem);
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
  }
}

/* ====== Watermark de fondo ====== */
:root {
  --wm-size: 1100px;       /* tamaño de la marca */
  --wm-rotate: -22deg;     /* inclinación */
  --wm-opacity: 0.14;      /* transparencia */
}

body {
  position: relative; /* necesario para el pseudo-elemento */
}

body::before {
  content: "";
  position: fixed; /* fijo en pantalla */
  top: 12vh;
  left: calc(-0.25 * var(--wm-size)); /* lo empuja hacia la izquierda */
  width: var(--wm-size);
  height: var(--wm-size);
  background: url("../statics/img/flor.png") no-repeat center / contain;
  opacity: var(--wm-opacity);
  transform: rotate(var(--wm-rotate));
  pointer-events: none; /* no bloquea clicks */
  z-index: 0; /* al fondo */
}

.container,
footer {
  position: relative;
  z-index: 1; /* el contenido queda por encima */
}

/* Responsivo */
@media (max-width: 1024px) {
  :root { --wm-size: 780px; }
  body::before {
    top: 18vh;
    left: calc(-0.35 * var(--wm-size));
  }
}

@media (max-width: 600px) {
  :root { --wm-size: 560px; }
  body::before {
    top: 24vh;
    left: calc(-0.40 * var(--wm-size));
  }
}