/* =====================================================
   LAPOZÓS RPG - 3D Kocka stílusok
   ===================================================== */

/* Kocka konténer */
.dice-container {
    perspective: 600px;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.dice-container.large {
    gap: 40px;
    padding: 40px;
}

/* 3D Kocka */
.dice-3d {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

.dice-3d.large {
    width: 100px;
    height: 100px;
}

/* Kocka lapok */
.dice-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff 0%, #e8e8e8 100%);
    border: 2px solid #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
}

.dice-3d.large .dice-face {
    font-size: 3rem;
    border-radius: 15px;
}

/* Pöttyök helyett számok (egyszerűbb, de hatásos) */
.dice-face::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

/* Lap pozíciók */
.dice-front  { transform: rotateY(0deg) translateZ(30px); }
.dice-back   { transform: rotateY(180deg) translateZ(30px); }
.dice-right  { transform: rotateY(90deg) translateZ(30px); }
.dice-left   { transform: rotateY(-90deg) translateZ(30px); }
.dice-top    { transform: rotateX(90deg) translateZ(30px); }
.dice-bottom { transform: rotateX(-90deg) translateZ(30px); }

.dice-3d.large .dice-front  { transform: rotateY(0deg) translateZ(50px); }
.dice-3d.large .dice-back   { transform: rotateY(180deg) translateZ(50px); }
.dice-3d.large .dice-right  { transform: rotateY(90deg) translateZ(50px); }
.dice-3d.large .dice-left   { transform: rotateY(-90deg) translateZ(50px); }
.dice-3d.large .dice-top    { transform: rotateX(90deg) translateZ(50px); }
.dice-3d.large .dice-bottom { transform: rotateX(-90deg) translateZ(50px); }

/* Kocka színezés */
.dice-3d.player-dice .dice-face {
    background: linear-gradient(135deg, #4169e1 0%, #1e40af 100%);
    border-color: #1e3a8a;
    color: #fff;
}

.dice-3d.enemy-dice .dice-face {
    background: linear-gradient(135deg, #dc143c 0%, #991b1b 100%);
    border-color: #7f1d1d;
    color: #fff;
}

/* Dobás animáció */
.dice-3d.rolling {
    animation: diceRoll 1s ease-out;
}

@keyframes diceRoll {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    20% {
        transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg);
    }
    40% {
        transform: rotateX(360deg) rotateY(180deg) rotateZ(90deg);
    }
    60% {
        transform: rotateX(540deg) rotateY(270deg) rotateZ(135deg);
    }
    80% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(180deg);
    }
    100% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(180deg);
    }
}

/* Különböző eredmények */
.dice-3d.show-1 { transform: rotateY(0deg); }
.dice-3d.show-2 { transform: rotateX(-90deg); }
.dice-3d.show-3 { transform: rotateY(90deg); }
.dice-3d.show-4 { transform: rotateY(-90deg); }
.dice-3d.show-5 { transform: rotateX(90deg); }
.dice-3d.show-6 { transform: rotateY(180deg); }

/* Dice Check Modal */
.dice-check-panel {
    width: 500px;
    text-align: center;
    padding: 40px;
}

.dice-check-panel h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-gold);
    margin-bottom: 20px;
}

.dice-check-desc {
    color: var(--color-text-muted);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.dice-check-target {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: var(--color-primary);
}

.dice-check-target span {
    font-weight: 700;
    font-size: 1.5rem;
}

.dice-result {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.dice-result-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    animation: resultPop 0.3s ease;
}

.dice-result-value.success {
    color: var(--color-success);
    text-shadow: 0 0 20px rgba(46, 213, 115, 0.8);
}

.dice-result-value.fail {
    color: var(--color-danger);
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.8);
}

.dice-result-text {
    font-size: 1.2rem;
    margin-top: 10px;
}

#btnRollDice {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-family: var(--font-display);
}

#btnRollDice:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pöttyös kocka stílus (opcionális) */
.dice-face.dotted {
    font-size: 0;
}

.dice-face.dotted .dot {
    width: 12px;
    height: 12px;
    background: currentColor;
    border-radius: 50%;
    position: absolute;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.3);
}

/* Pötty pozíciók */
.dice-face.dotted.face-1 .dot { top: 50%; left: 50%; transform: translate(-50%, -50%); }

.dice-face.dotted.face-2 .dot:nth-child(1) { top: 25%; left: 25%; }
.dice-face.dotted.face-2 .dot:nth-child(2) { top: 75%; left: 75%; }

.dice-face.dotted.face-3 .dot:nth-child(1) { top: 25%; left: 25%; }
.dice-face.dotted.face-3 .dot:nth-child(2) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice-face.dotted.face-3 .dot:nth-child(3) { top: 75%; left: 75%; }

.dice-face.dotted.face-4 .dot:nth-child(1) { top: 25%; left: 25%; }
.dice-face.dotted.face-4 .dot:nth-child(2) { top: 25%; left: 75%; }
.dice-face.dotted.face-4 .dot:nth-child(3) { top: 75%; left: 25%; }
.dice-face.dotted.face-4 .dot:nth-child(4) { top: 75%; left: 75%; }

.dice-face.dotted.face-5 .dot:nth-child(1) { top: 25%; left: 25%; }
.dice-face.dotted.face-5 .dot:nth-child(2) { top: 25%; left: 75%; }
.dice-face.dotted.face-5 .dot:nth-child(3) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice-face.dotted.face-5 .dot:nth-child(4) { top: 75%; left: 25%; }
.dice-face.dotted.face-5 .dot:nth-child(5) { top: 75%; left: 75%; }

.dice-face.dotted.face-6 .dot:nth-child(1) { top: 25%; left: 25%; }
.dice-face.dotted.face-6 .dot:nth-child(2) { top: 25%; left: 75%; }
.dice-face.dotted.face-6 .dot:nth-child(3) { top: 50%; left: 25%; }
.dice-face.dotted.face-6 .dot:nth-child(4) { top: 50%; left: 75%; }
.dice-face.dotted.face-6 .dot:nth-child(5) { top: 75%; left: 25%; }
.dice-face.dotted.face-6 .dot:nth-child(6) { top: 75%; left: 75%; }

/* Kocka árnyék */
.dice-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    filter: blur(5px);
}

/* Kocka dobás hang effekt vizuális */
.dice-container.shaking .dice-3d {
    animation: diceShake 0.1s ease infinite;
}

@keyframes diceShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-2px) rotate(-2deg); }
    75% { transform: translateX(2px) rotate(2deg); }
}

/* Kritikus dobás */
.dice-3d.critical {
    animation: criticalGlow 0.5s ease infinite alternate;
}

@keyframes criticalGlow {
    from {
        filter: drop-shadow(0 0 10px #ffd700);
    }
    to {
        filter: drop-shadow(0 0 25px #ffd700);
    }
}

/* Reszponzív */
@media (max-width: 600px) {
    .dice-3d {
        width: 50px;
        height: 50px;
    }

    .dice-3d .dice-face {
        font-size: 1.5rem;
    }

    .dice-front  { transform: rotateY(0deg) translateZ(25px); }
    .dice-back   { transform: rotateY(180deg) translateZ(25px); }
    .dice-right  { transform: rotateY(90deg) translateZ(25px); }
    .dice-left   { transform: rotateY(-90deg) translateZ(25px); }
    .dice-top    { transform: rotateX(90deg) translateZ(25px); }
    .dice-bottom { transform: rotateX(-90deg) translateZ(25px); }

    .dice-3d.large {
        width: 70px;
        height: 70px;
    }

    .dice-3d.large .dice-face {
        font-size: 2rem;
    }

    .dice-3d.large .dice-front  { transform: rotateY(0deg) translateZ(35px); }
    .dice-3d.large .dice-back   { transform: rotateY(180deg) translateZ(35px); }
    .dice-3d.large .dice-right  { transform: rotateY(90deg) translateZ(35px); }
    .dice-3d.large .dice-left   { transform: rotateY(-90deg) translateZ(35px); }
    .dice-3d.large .dice-top    { transform: rotateX(90deg) translateZ(35px); }
    .dice-3d.large .dice-bottom { transform: rotateX(-90deg) translateZ(35px); }

    .dice-check-panel {
        width: 90%;
        padding: 25px;
    }
}
