body {
    background: linear-gradient(#eca0ff, #aab2ff, #eca0ff);
    height: 100vh;
}
p{
    margin: 0;
    padding: 0;
}
.eleccion {
    position: absolute;
    right: 48%;
    top: 14%;
    width: 20%;
    border-radius: 5rem;
}

.contenidoEleccion {
    position: relative;
    overflow: hidden;
    height: 60vh;
}

.texto1Retro {
    text-align: center;
    padding: 1rem;
}

.tablaPuntuacion {
    background-color: black;
    color: lawngreen;
    height: 60vh;
    padding: 5rem;
}

.trRetro {
    border: dashed 1px;
}

.text-center {
    text-align: center;
}

.margenes {
    padding: 2rem 10rem;
}

.preguntaFondo {
    background-color: #ffffff78;
    font-size: 1.5rem;
    padding: 1rem 2rem !important;
    border-radius: 2rem;
    margin: 1rem;
    padding: 5rem !important;
}
h2{
    font-size: 2rem;
}
.mt-1{
    margin-top: 1rem;
}
.eleccion {
    right: 48%;
    top: 14%;
    width: 21%;
}
.pensando{
    width: 60%;
}

.coinP{
    color: #f0d05e;
    font-size: 5rem;
    padding: 0;
    margin: 0;
}
.coraP {
    color: #e81224;
    font-size: 5rem;
    padding: 0;
    margin: 0;
  }

.coinEmoji{
    font-size: 4.2rem;
}
.coraEmoji {
    font-size: 4rem;
 
  }

  .cajaPregunta {
    display: grid;
    justify-content: center;
    height: 30vh;
    align-content: center;
    font-size: 1.4rem;
    margin: 1rem;
    background-color: #ffffff40;
    border-radius: 1rem;
    text-align: center;
    cursor: pointer;
  }
  .cajaPregunta a{
    color: black !important;
  }
  .cajaPregunta:hover{
    background-color:#a1a1ff !important;
  }
  
  .btnComenzar {
    display: grid;
    justify-content: center;
    height: 7vh;
    align-content: center;
    font-size: 1.4rem;
    margin: 1rem;
    background-color: #ffffff40;
    border-radius: 1rem;
    text-align: center;
    cursor: pointer;
    width: 100%;
  }
  .btnComenzar:hover {
    background-color:#a1a1ff !important;
  }
/* Media queries para dispositivos móviles */
@media screen and (max-width: 768px) {

    .margenes{
        padding: 15px!important;
        margin: 0!important;
    }
    .tablaPuntuacion{
        display: none;
        
    }
    .pensando{
        width: 107%;
    }
    .eleccion {
        right: 14%;
        top: 12%;
        width: 30%;
    }
    .btnmobile{
        display: inline-table;
    }

    .contenidoEleccion {
        height: auto;
    }

    .tablaPuntuacion {
        padding: 2rem;
    }

    .preguntaFondo {
        padding: 2rem;
    }
    .texto1Retro {
        text-align: center;
        padding: 1rem;
        font-size: 2rem;
      }
}

/* ---------- Simulador de dados (index.php) ---------- */

body.dados {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 2.4rem 1rem 3.5rem;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 214, 255, 0.9), transparent 42%),
        radial-gradient(circle at 85% 18%, rgba(205, 204, 255, 0.9), transparent 45%),
        linear-gradient(160deg, #f7e8ff 0%, #e6dcff 45%, #d7e2ff 78%, #ffe0f5 100%);
    background-attachment: fixed;
    color: #342648;
}

.dados-wrap {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.titulo-dados {
    margin: 0 0 0.2rem;
    font-size: clamp(2.3rem, 7vw, 3.2rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #35204f;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
}

.titulo-dados .titulo-emoji {
    display: inline-block;
    transform: rotate(-12deg);
}

.subtitulo-dados {
    margin: 0 auto 1.6rem;
    max-width: 46ch;
    font-size: 0.98rem;
    color: #6f6090;
}

.panel-dados {
    padding: 1.5rem 1.4rem 1.6rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 24px 60px -18px rgba(83, 48, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.control-dados {
    margin-bottom: 0.9rem;
}

.selector-label {
    display: block;
    margin-bottom: 0.55rem;
    color: #7a6a97;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.selector-dados {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px rgba(126, 94, 170, 0.14), 0 8px 20px -12px rgba(83, 48, 129, 0.5);
}

.count-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f4d7d;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.12s, box-shadow 0.18s;
}

.count-btn:hover:not(:disabled) {
    background: #efe6ff;
    transform: translateY(-1px);
}

.count-btn.active {
    background: linear-gradient(135deg, #8a5cff, #de5cd2);
    color: #fff;
    box-shadow: 0 8px 18px -4px rgba(138, 92, 255, 0.6);
}

.count-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.count-btn:focus-visible {
    outline: 2px solid #8a5cff;
    outline-offset: 2px;
}

#diceCanvas {
    display: block;
    width: 100%;
    margin: 0.4rem 0 0.1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.resultado {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #5a4779;
}

.resultado-label {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.resultado-num {
    font-size: 2.3rem;
    line-height: 1;
    font-weight: 800;
    color: #7b2ff7;
    text-shadow: 0 2px 12px rgba(123, 47, 247, 0.25);
}

.resultado-hint {
    max-width: 30ch;
    font-size: 0.92rem;
    font-weight: 600;
    color: #8a7aa6;
}

.desglose {
    min-height: 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #8878a6;
}

.btn.btn-lanzar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    height: 52px;
    line-height: 1;
    padding: 0 2.2rem;
    margin-top: 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #7b4dff, #c44fe0 55%, #ff6fae);
    box-shadow: 0 14px 30px -8px rgba(132, 67, 255, 0.65);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn.btn-lanzar:hover {
    background: linear-gradient(135deg, #8a60ff, #cf5ce8 55%, #ff80b9);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -8px rgba(132, 67, 255, 0.7);
}

.btn.btn-lanzar:active {
    transform: translateY(0) scale(0.98);
}

.btn.btn-lanzar:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    box-shadow: 0 8px 20px -10px rgba(132, 67, 255, 0.5);
}

.btn-icono {
    font-size: 1.2em;
    line-height: 1;
}

.historial {
    margin-top: 1.8rem;
    text-align: left;
}

.historial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.4rem;
    margin-bottom: 0.75rem;
}

.historial-titulo {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #4b3569;
}

.historial-titulo span {
    font-size: 1.05rem;
}

.btn-flat.btn-limpiar {
    height: 34px;
    line-height: 34px;
    padding: 0 0.9rem;
    border-radius: 999px;
    color: #8a5ad0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: none;
}

.btn-flat.btn-limpiar:hover {
    background: rgba(255, 255, 255, 0.65);
    color: #6f3fc4;
}

.btn-flat.btn-limpiar:disabled {
    opacity: 0.4;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.history-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 14px 30px -18px rgba(83, 48, 129, 0.55);
}

.history-card.latest {
    border-color: rgba(164, 107, 255, 0.55);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 34px -16px rgba(132, 67, 255, 0.45);
}

.history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9586ad;
}

.history-badge {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #8a5cff, #de5cd2);
    box-shadow: 0 4px 10px -3px rgba(138, 92, 255, 0.7);
    color: #fff;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}

.history-dice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.mini-dado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    width: 27px;
    height: 27px;
    padding: 2.5px;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 3px 8px -2px rgba(76, 44, 118, 0.35);
}

.mini-dado i {
    border-radius: 50%;
}

.mini-dado i.pip {
    background: radial-gradient(circle at 35% 30%, #ef4b67, #c8102e 75%);
}

.history-total {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7d6d99;
}

.history-total strong {
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 800;
    color: #7b2ff7;
}

.history-empty {
    grid-column: 1 / -1;
    padding: 1.2rem;
    border-radius: 18px;
    border: 1.5px dashed rgba(138, 92, 255, 0.3);
    background: rgba(255, 255, 255, 0.35);
    color: #8b7ba8;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

@media screen and (max-width: 560px) {
    body.dados {
        padding: 1.5rem 0.8rem 2.5rem;
    }

    .panel-dados {
        padding: 1.15rem 0.9rem 1.3rem;
        border-radius: 24px;
    }

    .titulo-dados {
        margin-top: 0.4rem;
    }

    .count-btn {
        width: 38px;
        height: 38px;
    }

    .btn.btn-lanzar {
        width: 100%;
        padding: 0 1rem;
    }

    .resultado-num {
        font-size: 2rem;
    }

    .history-list {
        grid-template-columns: 1fr;
    }
}
