/* Paleta aplicada */
: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-match: #4caf50;
}

* {
    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: 20px;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
}

.logo {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.1));
}

.title {
    color: var(--principal-violeta);
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.difficulty-btn {
    background: var(--principal-celeste);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(94, 192, 207, 0.3);
    min-height: 44px;
}

.difficulty-btn:hover {
    background: #4AA8B6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 192, 207, 0.4);
}

.difficulty-btn.active {
    background: var(--secundario-oscuro);
    transform: scale(1.05);
}

.stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat {
    background: var(--principal-blanco);
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 120px;
}

.stat-label {
    color: var(--secundario-oscuro);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-value {
    color: var(--principal-celeste);
    font-size: 1.8rem;
    font-weight: bold;
}

.game-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
    max-width: 100%;
    overflow: hidden;
}

.grid {
    display: grid;
    gap: 8px;
    justify-content: center;
    margin: 0 auto;
    max-width: fit-content;
}

.grid.size-8 {
    grid-template-columns: repeat(8, 1fr);
}

.grid.size-10 {
    grid-template-columns: repeat(10, 1fr);
}

.grid.size-12 {
    grid-template-columns: repeat(12, 1fr);
}

.cell {
    width: 50px;
    height: 50px;
    background: white;
    color: var(--secundario-oscuro);
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cell:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(94, 192, 207, 0.25);
}

.cell.selected {
    background: var(--principal-celeste);
    color: white;
    transform: scale(1.1);
}

.cell.found {
    background: var(--verde-match);
    color: white;
    cursor: default;
}

.cell.hover {
    background: var(--principal-violeta);
    color: white;
    transform: scale(1.05);
}

.words-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 30px;
    max-width: 100%;
}

.words-title {
    color: var(--secundario-oscuro);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    color: var(--secundario-oscuro);
    font-size: 1.1rem;
    font-weight: bold;
}

.word {
    padding: 8px 16px;
    background: var(--principal-blanco);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.word.found {
    background: var(--verde-match);
    color: white;
    transform: scale(1.05);
}

.reset-btn {
    background: var(--accent-naranja);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 112, 67, 0.3);
    min-height: 44px;
}

.reset-btn:hover {
    background: var(--accent-naranja-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 112, 67, 0.4);
}

.victory-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000;
    display: none;
    max-width: 90vw;
    width: 400px;
}

.victory-message.show {
    display: block;
    animation: victoryPop 0.5s ease-out;
}

@keyframes victoryPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.victory-title {
    color: var(--verde-match);
    font-size: 2rem;
    margin-bottom: 15px;
    font-family: 'Gotham Rounded', 'Nunito Sans', sans-serif;
}

.victory-stats {
    color: var(--secundario-oscuro);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: #004F66;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    z-index: 100;
}

footer p {
    margin: 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive Design - Mobile First Approach */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .game-container {
        padding: 25px;
    }

    .cell {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    footer {
        bottom: 15px;
        right: 15px;
        font-size: 0.8rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .title {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .logo {
        width: 120px;
        margin-bottom: 15px;
    }

    .controls {
        gap: 12px;
        margin-bottom: 15px;
    }

    .difficulty-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .stats {
        gap: 20px;
        margin-bottom: 25px;
    }

    .stat {
        padding: 12px 20px;
        min-width: 100px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .game-container {
        padding: 20px;
    }

    .cell {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .words-container {
        padding: 20px;
    }

    .reset-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    footer {
        bottom: 15px;
        right: 15px;
        font-size: 0.8rem;
    }
}

/* Mobile phones */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .header {
        margin-bottom: 20px;
    }

    .title {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }

    .logo {
        width: 100px;
        margin-bottom: 12px;
    }

    .controls {
        gap: 8px;
        margin-bottom: 12px;
    }

    .difficulty-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        border-radius: 20px;
    }

    .stats {
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat {
        padding: 10px 15px;
        min-width: 80px;
        border-radius: 15px;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .game-container {
        padding: 15px;
        border-radius: 15px;
    }

    .cell {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .words-container {
        padding: 15px;
        border-radius: 15px;
    }

    .words-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .words-list {
        gap: 10px;
        font-size: 1rem;
    }

    .word {
        padding: 6px 12px;
        border-radius: 12px;
    }

    .reset-btn {
        margin-top: 20px;
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: 20px;
    }

    .victory-message {
        padding: 20px;
        border-radius: 15px;
        width: 90vw;
        max-width: 350px;
    }

    .victory-title {
        font-size: 1.6rem;
    }

    .victory-stats {
        font-size: 1rem;
    }

    footer {
        bottom: 10px;
        right: 10px;
        font-size: 0.75rem;
    }

    footer p {
        padding: 6px 10px;
        border-radius: 12px;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .title {
        font-size: 1.6rem;
    }

    .logo {
        width: 80px;
    }

    .controls {
        flex-direction: row;
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .difficulty-btn {
        width: auto;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .stats {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .stat {
        width: auto;
        min-width: 70px;
        padding: 8px 12px;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .words-list {
        gap: 8px;
        font-size: 0.9rem;
    }

    .word {
        padding: 5px 10px;
        border-radius: 10px;
    }

    .victory-message {
        padding: 15px;
        width: 95vw;
    }

    .victory-title {
        font-size: 1.4rem;
    }

    footer {
        bottom: 10px;
        right: 10px;
        font-size: 0.75rem;
    }

    footer p {
        padding: 6px 10px;
        border-radius: 12px;
    }
}

/* Extra small mobile phones */
@media (max-width: 360px) {
    .title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .logo {
        width: 70px;
        margin-bottom: 10px;
    }

    .controls {
        gap: 4px;
    }

    .difficulty-btn {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .stats {
        gap: 6px;
    }

    .stat {
        min-width: 60px;
        padding: 6px 10px;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .cell {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .words-list {
        gap: 6px;
        font-size: 0.8rem;
    }

    .word {
        padding: 4px 8px;
        border-radius: 8px;
    }

    .reset-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }


    .grid {
        gap: 6px;
    }

    footer {
        bottom: 8px;
        right: 8px;
        font-size: 0.7rem;
    }

    footer p {
        padding: 5px 8px;
        border-radius: 10px;
    }
}

/* Very small mobile phones */
@media (max-width: 320px) {
    .title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .logo {
        width: 60px;
        margin-bottom: 8px;
    }

    .controls {
        gap: 3px;
    }

    .difficulty-btn {
        min-width: 60px;
        padding: 5px 8px;
        font-size: 0.65rem;
    }

    .stats {
        gap: 4px;
    }

    .stat {
        min-width: 50px;
        padding: 5px 8px;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .cell {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }

    .words-list {
        gap: 4px;
        font-size: 0.75rem;
    }

    .word {
        padding: 3px 6px;
        border-radius: 6px;
    }

    .reset-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    footer {
        bottom: 5px;
        right: 5px;
        font-size: 0.65rem;
    }

    footer p {
        padding: 4px 6px;
        border-radius: 8px;
    }
}

/* Modal de instrucciones móviles */
.mobile-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.mobile-instructions-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 20px;
}

.modal-content h3 {
    color: var(--secundario-oscuro);
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.modal-content p {
    color: var(--secundario-gris);
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-close-btn {
    background: var(--principal-celeste);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(94, 192, 207, 0.3);
    min-height: 44px;
}

.modal-close-btn:hover {
    background: #4AA8B6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 192, 207, 0.4);
}

/* Responsive para el modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        width: 320px;
    }

    .modal-content h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .modal-content p {
        font-size: 1rem;
        margin-bottom: 18px;
    }

    .modal-close-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: 18px;
        width: 300px;
    }

    .modal-content h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .modal-content p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .modal-close-btn {
        padding: 8px 18px;
        font-size: 0.85rem;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }

    .header {
        margin-bottom: 15px;
    }

    .title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .logo {
        width: 60px;
        margin-bottom: 8px;
    }

    .controls {
        margin-bottom: 8px;
    }

    .stats {
        margin-bottom: 15px;
    }

    .cell {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }

    .words-list {
        gap: 4px;
        font-size: 0.75rem;
    }

    .reset-btn {
        margin-top: 15px;
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* —— Desktop (≥1160px): tablero | palabras —— */


@media (min-width: 3800px) {
    html {
        font-size: 2.3rem;
    }

    /* ↑ base */

    /* Más ancho útil para tablero y lateral */
    .ws-layout {
        grid-template-columns: minmax(0, 2200px) 680px;
        /* tablero | palabras */
        column-gap: 40px;
    }

    /* Alinear columna izquierda más ancha */
    .stats,
    .game-container,
    .bottom-buttons {
        max-width: 2200px;
        /* antes 2000/1600 */
    }

    /* Título y stats más grandes */
    .title {
        margin-left: 950px;
        width: 900px;
    }

    .stat {
        min-width: 420px;
        padding: 48px 72px;
        border-radius: 36px;
    }

    .stat-label {
        font-size: 2.1rem;
    }

    .stat-value {
        font-size: 3.6rem;
    }

    /* Tablero grande y cómodo */
    .game-container {
        padding: 84px;
    }

    .grid {
        gap: 24px;
        justify-content: center;
    }

    .cell {
        width: 124px;
        height: 124px;
        font-size: 2.8rem;
        border-radius: 22px;
    }

    /* Lateral (palabras) más presente */
    .words-container {
        padding: 56px;
    }

    .words-title {
        font-size: 3rem;
        margin-bottom: 28px;
    }

    .words-list {
        gap: 24px;
        font-size: 2.1rem;
    }

    .word {
        padding: 18px 30px;
        border-radius: 26px;
    }

    /* Botones inferiores más protagonistas */
    .reset-btn {
        padding: 34px 72px;
        font-size: 2.3rem;
        min-height: 120px;
        border-radius: 36px;
        font-weight: 900;
    }
}


/* Mostrar el modal en cualquier tamaño cuando tenga la clase .open */
.mobile-instructions-modal.open {
    display: flex !important;
    /* pisa cualquier media query previa */
}

/* Desktop (≥1024px): tamaño cómodo del modal */
@media (min-width: 1024px) {
    .mobile-instructions-modal .modal-content {
        width: 720px;
        padding: 40px;
        border-radius: 28px;
    }

    .mobile-instructions-modal h3 {
        font-size: 2.2rem;
        margin-bottom: 16px;
    }

    .mobile-instructions-modal p {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .mobile-instructions-modal .modal-close-btn {
        padding: 16px 28px;
        font-size: 1.6rem;
        border-radius: 24px;
    }
}

/* 4K / 3800px+: estilo TV grande */
@media (min-width: 3800px) {
    .mobile-instructions-modal .modal-content {
        width: 1200px;
        padding: 80px;
        border-radius: 32px;
    }

    .mobile-instructions-modal h3 {
        font-size: 3rem;
        margin-bottom: 18px;
    }

    .mobile-instructions-modal p {
        font-size: 2rem;
        margin-bottom: 28px;
    }

    .mobile-instructions-modal .modal-close-btn {
        padding: 22px 36px;
        font-size: 1.8rem;
        min-height: 96px;
        border-radius: 32px;
    }
}

/* TV táctil vertical 1200×3800: centrado, letras grandes y sin desborde */
@media (max-width: 2160px) and (min-height: 3800px){
    /* Pantalla completa, sin scroll raro */
    html, body{ height: 100dvh; overflow: hidden; }
    body{ padding: 0; }
  
    /* Zonas: header ↑ / contenido ↕ / footer ↓ */
    .ws-layout{
      min-height: 100dvh; width: 100%;
      display: flex; flex-direction: column;
      align-items: center; justify-content: space-between;
      padding: 3vh 0 2vh; gap: 0;
    }
  
    /* Título bien grande */
    .title{
      font-size: clamp(3.2rem, 4.2vh, 7.2rem);
      line-height: 1.1; text-align: center;
      margin: 1vh 0 2.4vh;
    }
  
    /* Palabras a encontrar: más ancho y tipografía mayor */
    .words-container{
      width: min(92vw, 1300px);
      margin: 0 auto 2.2vh;
      padding: 3.2vh 3vw;
      border-radius: 28px;
    }
    .words-title{ font-size: clamp(1.8rem, 2.6vh, 4.4rem); }
    .words-list { gap: 2vh; font-size: clamp(1.4rem, 2.2vh, 3.6rem); }
  
    /* Stats compactas y legibles */
    .stats{
      width: min(92vw, 1300px);
      margin: 0 auto 2.2vh; gap: 2.6vh; justify-content: center;
    }
    .stat{ padding: 2.6vh 2.8vw; border-radius: 24px; }
    .stat-label{ font-size: clamp(1.2rem, 2vh, 3.4rem); }
    .stat-value{ font-size: clamp(1.8rem, 3vh, 4.6rem); }

    #status-message{
      font-size: clamp(2.2rem, 3.5vh, 5.2rem);
    }
  
    /* ---------- TABLERO (clave) ---------- */
    .game-container{
      width: 100%;
      display: flex; justify-content: center; align-items: center;
      padding: 2vh 2vw; margin: 0 auto 2.2vh; border-radius: 28px;
    }
  
    .grid{
      /* Tablero MUCHO más grande.
         - 96vw: casi todo el ancho
         - 82vh: alto grande sin pisar footer/botones
         - 1700px: techo razonable para 4K vertical */
      --board-max: min(96vw, 1700px, 82vh);
      width: var(--board-max);
      height: var(--board-max);           /* cuadrado */
      margin: 0 auto;
      display: grid;
      place-content: center;
      gap: clamp(14px, 2vh, 36px);        /* más separación entre celdas */
      /* Si tu sopa es N×N, fijalo aquí. Ej: 14 columnas:
         grid-template-columns: repeat(14, 1fr); */
    }
  
    .cell{
      /* NUNCA fijes width en px; dejá que la grilla reparta el espacio */
      aspect-ratio: 1 / 1;
      width: 100%; height: auto;
      display: grid; place-items: center;
      border-radius: 20px; line-height: 1;
  
      /* Letras grandes de verdad */
      font-size: clamp(2.6rem, 4.4vh, 5.6rem);
    }
  
    /* Botones grandes y cómodos */
    .bottom-buttons{
      display: flex; flex-direction: column; align-items: center;
      gap: 1.8vh; margin: 0 auto 1vh;
      padding-bottom: 200px;
    }
    .reset-btn, .back-btn, .primary-btn{
      min-width: min(82vw, 720px);
      min-height: clamp(72px, 5.6vh, 140px);
      font-size: clamp(1.6rem, 2.4vh, 3.8rem);
      padding: 1.8vh 2.2vw; border-radius: 22px;
    }

    .reset-btn {
      z-index: 1;
      padding: 1.0vh 0;
    }
  
    /* Footer fijo abajo, discreto */
    footer{
      position: fixed; right: 2vw; bottom: 2vh; z-index: 10;
      font-size: clamp(.9rem, 1.6vh, 3.4rem);
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      max-width: 1200px;
      margin: 0 auto;
      flex-direction: row-reverse;
    }
    footer p{ padding: 1.2vh 1.4vw; border-radius: 14px; }
  
    .watermark{ position: fixed; left: 2vw; bottom: 2vh; z-index: 10; }
    .watermark-logo{ height: clamp(28px, 4.2vh, 4.2vh); }
  
    /* ---------- Modal grande y legible ---------- */
    .mobile-instructions-modal{
      position: fixed; inset: 0; z-index: 9999;
      display: none;                           /* base: oculto */
      align-items: center; justify-content: center;
      padding: 4vh 4vw;
      background: rgba(0,0,0,.35);
      backdrop-filter: blur(2px);
    }
    .mobile-instructions-modal.active{ display: flex; }
  
    .mobile-instructions-modal .modal-content{
      width: min(92vw, 1400px);
      max-width: 1400px;
      padding: 5vh 4vw;
      border-radius: 32px;
      box-shadow: 0 24px 80px rgba(0,0,0,.22);
      text-align: center;
    }
    .mobile-instructions-modal h3{
      font-size: clamp(2.6rem, 4vh, 5.2rem);
      line-height: 1.12; margin: 0 0 2.2vh;
    }
    .mobile-instructions-modal p{
      font-size: clamp(1.8rem, 3vh, 3.2rem);
      margin: 0 0 2.8vh;
    }
    .mobile-instructions-modal .modal-close-btn{
      font-size: clamp(1.6rem, 2.6vh, 3.2rem);
      padding: 1.8vh 2.8vw;
      min-height: clamp(72px, 5.8vh, 140px);
      border-radius: 22px; cursor: pointer;
    }

    /* ---------- Modal de victoria adaptado para pantalla vertical grande ---------- */
    .victory-message {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: white;
      padding: 6vh 4vw;
      border-radius: 40px;
      box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
      text-align: center;
      z-index: 1000;
      display: none;
      width: 90vw;
      max-width: 1800px;
    }

    .victory-message.show {
      display: block;
      animation: victoryPop 0.6s ease-out;
    }

    @keyframes victoryPop {
      0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0;
      }
      100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
      }
    }

    .victory-title {
      color: var(--verde-match);
      font-size: clamp(4.5rem, 6vw, 7rem);
      margin-bottom: 4vh;
      font-weight: 900;
      font-family: 'Gotham Rounded', 'Nunito Sans', sans-serif;
    }

    .victory-stats {
      color: var(--secundario-oscuro);
      font-size: clamp(2.8rem, 4vw, 5rem);
      margin-bottom: 3vh;
      line-height: 1.3;
    }
  }
  

  /* ====== 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));
    }
  }