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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #444;
}

h1 {
    color: #9c2929;
}

.dice-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.dice-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.dice-row {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.dice {
    position: relative;
    text-align: center;
    transition: transform 0.3s ease;
}

.dice-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.dice:hover .dice-img {
    transform: scale(1.05);
    border-color: #9c2929;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.dice-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.dice:hover .dice-tooltip {
    opacity: 1;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 40px;
}

.primary-btn {
    padding: 10px 20px;
    background: #9c2929;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #7e2121;
}

.spell-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.spell-btn {
    padding: 8px 15px;
    background: #4b7bec;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.spell-btn:hover {
    background: #3867d6;
}

.game-log {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

#log-entries {
    font-family: monospace;
    font-size: 14px;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-bottom: 1px solid #ddd;
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(-5deg); }
    20% { transform: rotate(5deg); }
    30% { transform: rotate(-5deg); }
    40% { transform: rotate(5deg); }
    50% { transform: rotate(-5deg); }
    60% { transform: rotate(5deg); }
    70% { transform: rotate(-5deg); }
    80% { transform: rotate(5deg); }
    90% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.highlight {
    animation: highlight 1s;
}

@keyframes highlight {
    0% { border-color: #ddd; }
    50% { border-color: #ffce00; }
    100% { border-color: #ddd; }
}

.dice.selectable .dice-img {
    cursor: pointer;
    border-color: #4b7bec;
}

.dice.selected .dice-img {
    border-color: #3867d6;
    box-shadow: 0 0 15px rgba(59, 103, 214, 0.7);
}