* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.dice-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.dice {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    background-size: cover;
    background-position: center;
}

.dice.rolling {
    animation: shake 0.5s infinite;
}

.dice[data-value="1"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="10" fill="black"/></svg>'); }
.dice[data-value="2"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="10" fill="black"/><circle cx="75" cy="75" r="10" fill="black"/></svg>'); }
.dice[data-value="3"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="10" fill="black"/><circle cx="50" cy="50" r="10" fill="black"/><circle cx="75" cy="75" r="10" fill="black"/></svg>'); }
.dice[data-value="4"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="10" fill="black"/><circle cx="75" cy="25" r="10" fill="black"/><circle cx="25" cy="75" r="10" fill="black"/><circle cx="75" cy="75" r="10" fill="black"/></svg>'); }
.dice[data-value="5"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="10" fill="black"/><circle cx="75" cy="25" r="10" fill="black"/><circle cx="50" cy="50" r="10" fill="black"/><circle cx="25" cy="75" r="10" fill="black"/><circle cx="75" cy="75" r="10" fill="black"/></svg>'); }
.dice[data-value="6"] { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="20" r="10" fill="black"/><circle cx="75" cy="20" r="10" fill="black"/><circle cx="25" cy="50" r="10" fill="black"/><circle cx="75" cy="50" r="10" fill="black"/><circle cx="25" cy="80" r="10" fill="black"/><circle cx="75" cy="80" r="10" fill="black"/></svg>'); }

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

button, .button {
    padding: 12px 25px;
    font-size: 1.1rem;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover, .button:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

button:active, .button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stats {
    text-align: center;
    font-size: 1.2rem;
    margin: 10px 0;
}

.score p {
    margin: 8px 0;
}

.result {
    min-height: 60px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 10px;
    width: 100%;
    transition: all 0.5s ease;
}

.success {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4caf50;
    color: #4caf50;
}

.failure {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    color: #f44336;
}

.neutral {
    background: rgba(33, 150, 243, 0.3);
    border: 2px solid #2196f3;
    color: #2196f3;
}


@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .dice-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dice {
        width: 70px;
        height: 70px;
        font-size: 1.7rem;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    button, .button {
        width: 100%;
    }
}