body{
margin:0;
user-select:none;
display:flex;
justify-content:center;
align-items:center;
height:100vh;
overflow:hidden;
background:#eaeaea;
}

#tablero {
  position:relative;
  width:1280px;
  height:720px;
  transform-origin: center center;
}
#imagenTablero{

width:1280px;

height:720px;

display:block;

}

.fichaContenedor{
  position:absolute;
  width:19px;
  height:56px;
  cursor:pointer;
  z-index:60;
}
.fichaContenedor img{
  position:absolute;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  height:100%;
  width:auto;
  pointer-events:none;
}

/* posiciones iniciales de cada ficha */
#jugador1{ left:35px;  top:590px; }
#jugador2{ left:85px;  top:590px; }
#jugador3{ left:130px; top:590px; }
#jugador4{ left:190px; top:590px; }#casillas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;

  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);

  z-index: 2;

  pointer-events: none;
}
.casilla {
  border: 1px solid rgba(255,255,255,0.2);
}
.casillaReal{
position:absolute;
border:3px solid blue;
background:rgba(255,0,0,0.15);
display:flex;
justify-content:center;
align-items:center;
font-weight:bold;
font-size:18px;
color:white;
z-index:1;
opacity:0;
}

.horizontal{
width:75px;
height:55px;
}
.vertical{
width:55px;
height:75px;
}
.curva{
width:85px;
height:85px;
}
.especial31{
width:60px;
height:150px;
}

.casillaReal[data-color="verde"]{
  background: rgba(0, 255, 0, 0.5);
}
.casillaReal[data-color="naranja"]{
  background: rgba(255, 165, 0, 0.5);
}
.casillaReal[data-color="rojo"]{
  background: rgba(255, 0, 0, 0.5);
}
.casillaReal[data-color="meta"]{
  background: rgba(255, 255, 0, 0.5);
}

#contenedorDado{
  position:absolute;
  left:619px;
  top:291px;
  width:140px;
  height:60px;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:14px;
  z-index:50;
  transform-origin:center center;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.oculto{
  transform:scale(0);
  opacity:0;
  pointer-events:none;
}

#selectorNivel{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:#2c1810;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:20px;
  z-index:2000;
}
#selectorNivel h2{
  color:#fff;
  font-size:28px;
}
.btnNivel{
  width:220px;
  padding:16px;
  font-size:18px;
  font-weight:bold;
  color:#fff;
  background-color:#4a7ebb;
  border:2px solid #204060;
  border-radius:8px;
  cursor:pointer;
}
.btnNivel:hover{
  background-color:#5b92d6;
}
#tablero.oculto{
  display:none;
}

.fondoDado{
  position:absolute;
  top:-140px;
  left:-150px;
  width:440px;
  height:320px;
  background-image: url('imagenes/explosion.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index:-1;
}

#contenedorRuleta{
  position:absolute;
  left:619px;
  top:291px;
  width:140px;
  height:60px;
  z-index:50;
  transform-origin:center center;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

#contenedorResultadoIA{
  position:absolute;
  left:579px;
  top:241px;
  width:220px;
  height:140px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  z-index:55;
  transform-origin:center center;
  transition: transform 0.5s ease, opacity 0.5s ease;
  cursor:pointer;
}

.fondoResultadoIA{
  position:absolute;
  top:-90px;
  left:-110px;
  width:440px;
  height:320px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index:-1;
}

.textoResultadoIA{
  position:relative;
  width:100%;
  text-align:center;
  font-weight:bold;
  font-size:20px;
  color:#1a0000;
  padding:0 14px;
  box-sizing:border-box;
}


.subtextoResultadoIA{
  position:relative;
  width:100%;
  text-align:center;
  font-size:12px;
  color:#1a0000;
  padding:2px 14px 0;
  box-sizing:border-box;
}

#overlayModalIA{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.45);
  z-index:3000;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

#pergaminoModalIA{
  width:520px;
  max-height:80vh;
  background-image: url('imagenes/Pergamino.png');
  background-size:100% 100%;
  background-repeat:no-repeat;
  padding:60px 50px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow-y:auto;
}

#textoModalIA{
  font-size:18px;
  font-weight:bold;
  color:#1a0000;
  text-align:center;
  line-height:1.5;
}

.ventanaRuleta{
  width:140px;
  height:50px;
  overflow:hidden;
  position:relative;
  background:#fff;
  border:3px solid #204060;
  border-radius:8px;
  margin:0 auto;
}

.listaRuleta{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  display:flex;
  flex-direction:column;
}

.itemRuleta{
  height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
  font-size:13px;
  color:#1a0000;
  text-align:center;
  padding:0 6px;
  box-sizing:border-box;
}


.escenario{
  width:60px;
  height:60px;
  perspective:400px;
}
.cubo{
  width:60px;
  height:60px;
  position:relative;
  transform-style:preserve-3d;
  transition:transform 1.5s ease-out;
}
.cara{
  position:absolute;
  width:60px;
  height:60px;
  box-sizing:border-box;
  padding:8px;
  background:linear-gradient(135deg, #ffffff, #ededed);
  border:none;
  border-radius:8px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.2), 0 3px 6px rgba(0,0,0,0.35);
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
}
.cara1{ transform: translateZ(30px); }
.cara6{ transform: rotateY(180deg) translateZ(30px); }
.cara2{ transform: rotateY(90deg) translateZ(30px); }
.cara5{ transform: rotateY(-90deg) translateZ(30px); }
.cara3{ transform: rotateX(90deg) translateZ(30px); }
.cara4{ transform: rotateX(-90deg) translateZ(30px); }

.punto{
  width:10px;
  height:10px;
  background:#222;
  border-radius:50%;
  justify-self:center;
  align-self:center;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3), 0 1px 1px rgba(0,0,0,0.5);
}
.pos1{ grid-column:1; grid-row:1; }
.pos2{ grid-column:2; grid-row:1; }
.pos3{ grid-column:3; grid-row:1; }
.pos4{ grid-column:1; grid-row:2; }
.pos5{ grid-column:2; grid-row:2; }
.pos6{ grid-column:3; grid-row:2; }
.pos7{ grid-column:1; grid-row:3; }
.pos8{ grid-column:2; grid-row:3; }
.pos9{ grid-column:3; grid-row:3; }

#botonDado{
  position:absolute;
  left:1132px;
  top:630px;
  width:90px;
  height:56px;
  border-radius:50%;
  border:5px solid white;
  background: radial-gradient(ellipse at 50% 30%, #ff6f6f 0%, #e53935 45%, #b71c1c 100%);
  color:#1a0000;
  font-size:14px;
  font-weight:bold;
  letter-spacing:1px;
  cursor:pointer;
  z-index:50;
  box-shadow: 0 6px 0 #ddd, 0 9px 11px rgba(0,0,0,0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
#botonDado:hover{
  filter:brightness(1.08);
}
#botonDado:active{
  transform: translateY(6px);
  box-shadow: 0 2px 0 #ddd, 0 4px 8px rgba(0,0,0,0.4);
}
#controlesZoom{
  position:fixed;
  top:10px;
  right:10px;
  display:flex;
  gap:6px;
  z-index:1000;
}
#controlesZoom button{
  width:36px;
  height:36px;
  font-size:20px;
  font-weight:bold;
  border-radius:8px;
  border:2px solid #333;
  background:white;
  cursor:pointer;
}
#controlesZoom button:hover{
  background:#eee;
}

#btnPantallaCompleta {
  width: 36px;
  height: 36px;
  cursor: pointer;
  border: 2px solid #333;
  border-radius: 8px;
  background: white;
  box-sizing: border-box;
}

#btnPantallaCompleta:hover {
  background: #eee;
}

#zonaPruebas {
    position: absolute;
    left: 15px;
    top: 170px;
    width: 250px;
    height: 330px;
    background-image: url('imagenes/Pergamino.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent !important;
    border: none;
    border-radius: 0;
    padding: 55px 18px 35px 32px;
    box-sizing: border-box;
    z-index: 50;
    color: #120a03;
    box-shadow: none;
}

#pruebaTitulo {
    margin: 0 0 8px 0;
    font-size: 18px;
    text-align: center;
    border-bottom: 1px dashed #5c4033;
    padding-bottom: 3px;
    letter-spacing: 1px;
    color: #2B1E10;
}

#pruebaContenido {
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    max-height: 205px;
    overflow-y: auto;
    padding-right: 4px;
}


.instruccion-espera {
    color: #3a2a18;
    text-align: center;
    font-style: italic;
    font-size: 18px;
    margin-top: 30px;
}

.item-prueba {
    margin-top: 4px;
    font-weight: normal;
}

#contenedorBotonesPrueba {
    position: absolute;
    left: 1125px;
    top: 150px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}

.btnComponente {
    width: 145px;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
    background-color: #4a7ebb;
    border: 2px solid #204060;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px rgba(0,0,0,0.3);
    transition: all 0.1s ease;
}

.btnComponente:not(:disabled):hover {
    background-color: #5b92d6;
}

.btnComponente:not(:disabled):active {
    transform: translateY(2px);
    box-shadow: 0 2px rgba(0,0,0,0.3);
}

.btnComponente:disabled {
    background-color: #555 !important;
    color: #888;
    border-color: #333;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#pruebaContenido span {
    color: #b71c1c !important;
    font-weight: bold;
}

#pruebaContenido strong {
    color: #0d47a1 !important;
}

#ejemploGuia {
    margin-top: 15px;
    font-size: 0.9em;
    color: #5d4037;
    font-style: italic;
    word-wrap: break-word;
}

#zonaRespuesta {
    position: absolute;
    left: 510px;
    top: 620px;
    width: 480px;
    height: 90px;
    background-image: url('imagenes/PergaminoRespuesta.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 55px;
    box-sizing: border-box;
}

#textareaRespuesta {
    flex: 1;
    height: 60px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    font-family: 'Georgia', serif;
    font-weight: 600;
    color: #2b1a0d;
}

#textareaRespuesta::placeholder {
    color: #3a2a18;
    opacity: 0.85;
}

#textareaRespuesta:disabled {
    color: #3a2a18;
    opacity: 1;
}

#btnFinalizarRespuesta {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background-color: #c0533a;
    border: 2px solid #8a3a26;
    border-radius: 50px;
    cursor: pointer;
}

#btnFinalizarRespuesta:disabled {
    background-color: #555;
    color: #888;
    border-color: #333;
    cursor: not-allowed;
}