/*--ACT 01--*/
h3.subtitle{
    margin-bottom: 0.5em;
    font-weight: 600;
}
.container-act {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    width: 100%;
    margin: auto;
}

.targets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.target {
    background: #fff;
    border: 2px dashed #bbb;
    border-radius: 10px;
    min-height: 90px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: border-color .2s, background .2s;
}
.target.correct { border-style: solid; border-color: var(--success-color); background: #e8f5e9; }
.target.wrong { border-style: solid; border-color: var(--error); background: #fdecea; }
.target.correct.questionr {outline: 4px solid var(--primary-color);border-style: solid; border-color: var(--primary-color); background: var(--primary-color);color:#fff; }

.pieces {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.piece {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 12px;
    cursor: grab;
    user-select: none;
}
.piece:active { cursor: grabbing; }
.piece.question { background: #e3f2fd; }
.piece.answer { background: #fff3e0; }

/*-- ACT 02--*/
.game {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.deck-area {
  display: flex;
  align-items: center;
  gap: 24px;
}

.deck {
  position: relative;
  width: 150px;
  height: 200px;
  cursor: pointer;
}

.deck-card {
  position: absolute;
  inset: 0;
  background-image: url(../assets/imagenes/naipe-dorso02.png);
  background-size: 100% 100%;
  border-radius: 12px;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.271);
}

.deck-card:nth-child(1) { transform: translate(6px, 6px); }
.deck-card:nth-child(2) { transform: translate(3px, 3px); }

.hint-card {
  position: relative;
  width: 140px;
  height: 200px;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform .6s;
}

.hint-card.flip {
  transform: rotateY(180deg);
}

.hint-front,
.hint-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  font-weight: bold;
}

.hint-front {
  background-image: url(../assets/imagenes/naipe-frente.png);
  background-size: 100% 100%;
  font-size: 32px;
}

.hint-back {
  background: #fff;
  color: #000;
  transform: rotateY(180deg);
  font-size: 14px;
}

.answers {
  position: relative;
  width: 380px;
  height: 300px;
  padding-left: 200px;
  top: -40px;
}

.answer-card {
  position: absolute;
  width: 180px;
  height: 260px;
  background-image: url(../assets/imagenes/naipe-frente.png);
  background-size: 100% 100%;
  border-radius: 14px;
  border: 2px solid #ddd;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  transform:
    rotate(var(--rot))
    translateX(var(--x))
    translateY(0)
    scale(0.7);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.v-hidden{
  visibility: hidden;
}
.answer-card:hover {
  transform:
    rotate(var(--rot))
    translateX(var(--x))
    translateY(-18px)
    scale(0.75);
  z-index: 10;
}
.masks {
    display: flex;
    justify-content: center;
}

/* TARJETA */
.card {
    width: 200px;
    height: 260px;
    cursor: pointer;
    transform:scale(0.8);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);

    clip-path: polygon(
        0% 0%,
        100% 0%,
        100% 70%,
        50% 100%,
        0% 70%
    );
}

.card-front {
    background: #a48262;
    color: #fff;
    font-size: 60px;
}

.card-back {
    background: #fff;
    transform: rotateY(180deg);
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.card-back button {
    padding: 6px 14px;
    border: none;
    background: #222;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}
.question{
  font-weight: 600;
  font-size: 1.1em;
}
.correct {
    outline: 4px solid var(--success-color);
}

.incorrect {
    outline: 4px solid var(--error);
}

#gameAct04 {
    padding-top: 30px;
    border-radius: 10px;
    text-align: center;
    margin-top: 130px;
    display:flex;
    align-items:flex-start;
}
.game-info{
    width: 50%;
    text-align: center;
}
.palm-container {
    position: relative;
    width: 300px;
    margin: 0 auto 20px;
}

.palm {
    width: 150px;
    border-radius: 10px;
    border: 4px solid transparent;
    transition: border 0.3s;
}

.palm.correct {
    border-color: var(--success-color);
}

.palm.wrong {
    border-color: var(--error);
}

.leaves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.leaf {
    position: absolute;
    width: 200px;
    cursor: pointer;
}

.leaf[data-index="1"] { top: -140px; left: -60px; }
.leaf[data-index="2"] { top: -18px; left: -60px; }
.leaf[data-index="3"] { top: -140px; right: -60px; }
.leaf[data-index="4"] { top: -18px; right: -60px; }

.option-box {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    background: var(--light-color);
    display: none;
}

.option-box button {
    margin-top: 10px;
    padding: 6px 12px;
    cursor: pointer;
}
.scroll {
    position: absolute;
    top: 80px;
    left: 240px;
    width: 240px;
    height: 280px;
    background-image: url("../assets/imagenes/pergamino.png");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    padding: 50px 18px;
    box-sizing: border-box;
}
.questionAct05 {
    text-align: center;
    font-weight: bold;
    min-height: 90px;
    font-size: 0.9em;
}
.answer-zone {
    margin-top: auto;
    border: 2px dashed rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 6px;
    text-align: center;
}

.answer-zone .label {
    font-size: 12px;
    margin-bottom: 6px;
}

.answer-slot {
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.feather {
    position: absolute;
    width: 150px;
    height: 100px;
    background-image: url("../assets/imagenes/pluma01.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feather span {
    font-size: 13px;
    padding: 0 10px;
    text-align: center;
    pointer-events: none;
    position: relative;
    left: 50px;
    top: 50px;
}

.feather.dragging {
    opacity: 0.75;
    cursor: grabbing;
}

.feather.wrong {
    filter: drop-shadow(0 0 3px var(--error));
    animation: shake 0.35s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-6px); }
    100% { transform: translateX(0); }
}
#gameAct05 {
    position: relative;
    width: 650px;
    height: 450px;
    margin: auto;
    margin-bottom: 20px;
}
.btn.btn-small{
  font-size: 0.7em;
}
.question{
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 0.5em;
    padding: 0.2em;
}
.question.questionAct05{
    background-color: transparent;
    font-size: 0.9em;
}
.piece {
  touch-action: none;
  cursor: grab;
}

.piece.dragging {
  opacity: 0;
}

.drag-clone {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
.feather {
  touch-action: none;
}
.container-act{
    margin-bottom: 0.5em;
}

@media (max-width: 768px) {
    .container-act { grid-template-columns: 1fr; }
    .targets, .pieces { grid-template-columns: 1fr; }
    .pieces{
        height: auto;
        margin-bottom: 1em;
    }
    .game {
        flex-direction: column;
    }
    .target{
        min-height: auto;
    }
    .answers {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding-left: 0;
        position: unset;
        margin: 1em 0;
    }
    .answer-card {
        position: initial;
        left: 0;
        width: 100%;
        height: 140px;
        transform: rotate(0deg) translateX(0) translateY(0) scale(1)!important;
        box-sizing: border-box;
    }
    .palm-container{
        text-align: center;
        transform: scale(0.7);
        margin-bottom: 0;
    }
    #gameAct04 {
        flex-direction: column;
        margin-top: 80px!important;
    }
    .game-info {
        width: 100%;
    }
    .option-box{
        margin-top: 0;
    }
    .masks{
        flex-direction: column;
    }
    .card{
        margin: 0;
        transform: scale(1);
        margin: 0.5em;
    }
    #gameAct05{
        width: 100%;
        height: 750px;
        text-align: center;
    }
    .scroll{
        top:0;
        left: unset;
    }
    .buttons{
        top: -450px;
        background: var(--light-color);
        position: relative;
        padding: 0.5em;
        border-radius: 0.5em;
        z-index: 100000;
        width: 100%;
    }
    #feedback-a05.correcto{
        padding: 0.3em;
        margin-bottom: 0.5em;
    }
}
@media screen and (max-width:1500px) {
    .texto-placa, .consigna, .question{
        font-size: 1em;
        margin-bottom: 0.5em;
    }
    .piece.question, .piece.answer{
        font-size: 0.9em;
    }
    .pieces{
        gap: 8px;
    }
    h3.subtitle{
        font-size: 0.9em;
    }
}
@media screen and (min-width:768px) and (max-width:1500px) {
    .texto-placa, .consigna, .question{
        font-size: 1em;
        margin-bottom: 0.5em;
    }
    .piece.question, .piece.answer{
        font-size: 0.9em;
    }
    .pieces{
        gap: 8px;
    }
    h3.subtitle{
        font-size: 0.9em;
    }
    .feather[data-index="2"], .feather[data-index="3"] { 
        top: 160px!important;
    }
    .scroll{
        top: 20px;
    }
    #gameAct05{
        height: 300px;
    }
}
@media  screen and (min-width:768px) {
    .orders{
        display: flex;
        flex-direction: column;
    }
    .buttons{
        order:2;
    }
    #gameAct05{
        order: 1;
    }
}
@media screen and (min-width:1600px){
    #gameAct05{
        height: 480px;
    }
    .scroll {
        padding: 42px 18px;
    }
}