@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #5a2dff 0%, #00ca98 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

body.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-theme .dice-face {
    background: linear-gradient(145deg, #ff009f, #cc0077);
    border: 2px solid #990055;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1);
}

.dark-theme .results {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.dark-theme .dice-count select {
    background: #2a2a3e;
    color: white;
    border: 2px solid #444;
}

.game-container {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
}

.title {
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.dice-area {
    perspective: 1000px;
    margin: 3rem 0;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.dice {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
}



.dice.rolling {
    animation: roll 1.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.dice-face {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #ff009f, #e6008a);
    border: 2px solid #cc0077;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

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

.dot {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-family: 'Orbitron', monospace;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: linear-gradient(145deg, #2196F3, #1976D2);
}

.dice-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: bold;
}

.dice-count select {
    width: 100px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    background: white;
    cursor: pointer;
}

.results {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(255,255,255,0.2);
}

.result-item {
    color: white;
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.total {
    font-size: 2rem;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

footer {
    background-color: white;
    text-align: center;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.footer-links {
    color: #555;
    font-size: 0.8em;
    margin-bottom: 10px;
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    color: #777;
    font-size: 0.7em;
}

@keyframes roll {
    0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
    25% { transform: rotateX(180deg) rotateY(180deg) rotateZ(90deg); }
    50% { transform: rotateX(360deg) rotateY(360deg) rotateZ(180deg); }
    75% { transform: rotateX(540deg) rotateY(540deg) rotateZ(270deg); }
    100% { transform: rotateX(720deg) rotateY(720deg) rotateZ(360deg); }
}

@media (max-width: 768px) {
    .title { font-size: 2rem; }
    .dice { width: 60px; height: 60px; }
    .dice-face { width: 60px; height: 60px; font-size: 1.5rem; }
    .dice-face.front, .dice-face.back, .dice-face.right, 
    .dice-face.left, .dice-face.top, .dice-face.bottom { 
        transform-origin: center;
    }
    .dice-face.front { transform: rotateY(0deg) translateZ(30px); }
    .dice-face.back { transform: rotateY(180deg) translateZ(30px); }
    .dice-face.right { transform: rotateY(90deg) translateZ(30px); }
    .dice-face.left { transform: rotateY(-90deg) translateZ(30px); }
    .dice-face.top { transform: rotateX(90deg) translateZ(30px); }
    .dice-face.bottom { transform: rotateX(-90deg) translateZ(30px); }
}