/* 
======================
DICE ROLLER ENHANCED STYLES
======================
*/

/* 
======================
DICE ROLLER HERO SECTION
======================
*/
.dice-roller-hero {
    background-position: bottom center;
    height: 300px;
}

.dice-roller-hero .hero-background {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../assets/images/dice-bg.png');
    background-size: cover;
    background-position: center;
}

.dice-roller-hero .magical-overlay {
    background: 
        radial-gradient(circle at 30% 70%, rgba(11, 42, 169, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(127, 14, 189, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(11, 42, 169, 0.3) 0%, transparent 70%);
}

/* 
======================
DICE ROLLER INTERFACE
======================
*/
.dice-roller-interface {
    background-color: var(--divine-light-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(11, 42, 169, 0.1);
}

.dice-roller-interface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-blue);
    z-index: 1;
}

/* 
======================
SELECTED DICE AREA - CRITICAL FUNCTIONALITY PRESERVED
======================
*/
/* Direct fix for the selected dice area display */
.selected-die {
    /* Reset styles to basic display */
    all: initial;
    
    /* Core sizing and positioning */
    display: inline-block;
    position: relative;
    width: 60px;
    height: 60px;
    margin: 8px;
    padding: 0;
    
    /* Visual appearance */
    background-color: white;
    border: 1px solid #3050c7;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    
    /* Prevent any animation */
    animation: none !important;
    transform: none !important;
    transition: none !important;
}
  
/* Fix for dice backgrounds - with SVG fallbacks if images don't load */
.selected-die.d4 {
    background: white url("../assets/images/dice/d4.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
.selected-die.d6 {
    background: white url("../assets/images/dice/d6.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
.selected-die.d8 {
    background: white url("../assets/images/dice/d8.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
.selected-die.d10 {
    background: white url("../assets/images/dice/d10.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
.selected-die.d12 {
    background: white url("../assets/images/dice/d12.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
.selected-die.d20 {
    background: white url("../assets/images/dice/d20.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
.selected-die.d100 {
    background: white url("../assets/images/dice/d100.svg") center/80% no-repeat;
    /* SVG fallback */
}
  
/* Fix for the count display on dice */
.die-count {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: #3050c7;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
  
/* Add a nice gradient background to the page */
body.dice-roller-page {
    background: linear-gradient(135deg, 
        var(--divine-light-white) 0%,
        #f4f4e8 50%,
        var(--divine-light-white) 100%);
}

/* Ensure the selected dice area maintains a consistent height */
.selected-dice-area {
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    /* Add fixed height to prevent layout shifts */
    height: 120px;
    overflow-y: auto; /* In case there are many dice */
}

/* Add light hover effect without changing core functionality */
.selected-die:hover {
    box-shadow: 0 4px 8px rgba(11, 42, 169, 0.3);
    cursor: pointer;
}

/* 
======================
NO DICE MESSAGE STYLING - MAINTAIN SAME HEIGHT
======================
*/
.no-dice-message {
    text-align: center;
    color: #888;
    animation: pulse 2s infinite;
    /* Make the message fill the container height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.animated-arrow {
    display: block;
    margin-top: 10px;
    font-size: 1.5rem;
    color: var(--primary-blue);
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 
======================
DICE ANIMATION AREA
======================
*/
.dice-animation-area {
    min-height: 150px;
    position: relative;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    perspective: 1000px;
}

.rolling-die {
    position: relative;
    width: 70px;
    height: 70px;
    transform-style: preserve-3d;
    animation: rollDice 1.5s ease-out forwards;
}

.rolling-die::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.rolling-die::after {
    content: attr(data-value);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-headers);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-blue);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 2;
    opacity: 0;
    animation: showValue 0.5s ease-in forwards;
    animation-delay: 1s;
}

.rolling-die.d20[data-value="20"]::after {
    color: var(--primary-purple);
    text-shadow: 0 0 10px rgba(127, 14, 189, 0.5);
    font-size: 2rem;
    animation: criticalSuccess 0.5s ease-in forwards, pulsate 2s infinite;
    animation-delay: 1s, 1.5s;
}

.rolling-die.d20[data-value="1"]::after {
    color: var(--primary-red);
    text-shadow: 0 0 10px rgba(195, 10, 61, 0.5);
    animation: criticalFail 0.5s ease-in forwards;
    animation-delay: 1s;
}

@keyframes rollDice {
    0% {
        transform: translateY(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        transform: translateY(0) rotateX(720deg) rotateY(720deg) rotateZ(720deg);
    }
    100% {
        transform: translateY(0) rotateX(720deg) rotateY(720deg) rotateZ(720deg);
    }
}

@keyframes showValue {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes criticalSuccess {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}

@keyframes criticalFail {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    25% {
        transform: scale(1.1) translateX(-5px);
    }
    50% {
        transform: scale(1.1) translateX(5px);
    }
    75% {
        transform: scale(1.1) translateX(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes pulsate {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* 
======================
DICE CONTROLS
======================
*/
.dice-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
}

.modifier-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(245, 245, 245, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.modifier-control label {
    font-family: var(--font-headers);
    font-weight: 600;
    color: var(--text-dark);
    margin-right: 10px;
}

.modifier-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modifier-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modifier-btn:hover {
    background: var(--primary-blue-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

input#modifier {
    width: 50px;
    height: 32px;
    border: 2px solid var(--primary-blue-light);
    border-radius: 4px;
    text-align: center;
    font-family: var(--font-headers);
    font-weight: bold;
    color: var(--primary-blue-dark);
}

.roll-controls {
    display: flex;
    gap: 10px;
}

#roll-btn {
    position: relative;
    overflow: hidden;
}

#roll-btn.rolling {
    pointer-events: none;
    animation: buttonShake 0.5s ease-in-out;
}

#roll-btn.rolling::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    animation: buttonSweep 1s linear infinite;
}

@keyframes buttonShake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-3px);
    }
    40%, 80% {
        transform: translateX(3px);
    }
}

@keyframes buttonSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 
======================
DICE RESULTS
======================
*/
.dice-results {
    border: 2px solid rgba(11, 42, 169, 0.2);
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    transition: all 0.3s ease;
    background: rgba(245, 245, 245, 0.7);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dice-results.has-results {
    background: rgba(245, 245, 245, 0.9);
    border-color: rgba(11, 42, 169, 0.4);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1), 0 0 20px rgba(11, 42, 169, 0.1);
}

.roll-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    text-align: center;
    color: #888;
    font-style: italic;
}

.roll-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.dice-result {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dice-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dice-result h4 {
    margin: 0 0 10px 0;
    color: var(--primary-blue);
    font-family: var(--font-headers);
    border-bottom: 2px solid rgba(11, 42, 169, 0.1);
    padding-bottom: 5px;
}

.dice-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.die, 
.modifier {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-light);
    border-radius: 6px;
    font-weight: bold;
    color: var(--text-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0);
}

/* Custom modifier styling to override inline styles */
div.dice-result h4:contains("MODIFIER") + div.dice-values span.die,
div.dice-result:has(h4:contains("MODIFIER")) span.die,
.dice-values span.die[style*="--primary-purple"],
span.die.roll-in[style*="--primary-purple"],
span.die.roll-in[style*="var(--primary-purple)"],
h4:contains("MODIFIER") ~ .dice-values .die,
div.dice-values span.die.roll-in {
    background-color: var(--background-light) !important;
    background: var(--background-light) !important;
}

.die.roll-in {
    animation: rollIn 0.5s forwards;
}

.die.critical-success {
    background-color: var(--primary-purple-light);
    color: white;
    box-shadow: 0 0 10px var(--primary-purple);
    animation: rollInSuccess 0.5s forwards, glowSuccess 2s infinite alternate;
}

.die.critical-fail {
    background-color: var(--primary-red-light);
    color: white;
    box-shadow: 0 0 10px var(--primary-red);
    animation: rollInFail 0.5s forwards, glowFail 2s infinite alternate;
}

@keyframes rollIn {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes rollInSuccess {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    70% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes rollInFail {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.1) translateX(-5px);
    }
    75% {
        transform: scale(1.1) translateX(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes glowSuccess {
    0% {
        box-shadow: 0 0 5px var(--primary-purple);
    }
    100% {
        box-shadow: 0 0 15px var(--primary-purple);
    }
}

@keyframes glowFail {
    0% {
        box-shadow: 0 0 5px var(--primary-red);
    }
    100% {
        box-shadow: 0 0 15px var(--primary-red);
    }
}

.dice-result p {
    margin: 5px 0 0 0;
    font-weight: 600;
    color: var(--text-dark);
}

.roll-total {
    grid-column: 1 / -1;
    background: var(--gradient-blue);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(11, 42, 169, 0.3);
    transform: scale(0.95);
    opacity: 0;
    animation: showTotal 0.5s 0.3s forwards;
}

.roll-total h3 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes showTotal {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 
======================
DICE SELECTION AREA
======================
*/
.dice-selection-area {
    background-color: var(--divine-light-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(11, 42, 169, 0.1);
}

.dice-selection-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-blue);
    z-index: 1;
}

.selection-title {
    text-align: center;
    color: var(--primary-blue);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.selection-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-blue);
    border-radius: 2px;
}

.dice-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dice-option {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
}

.dice-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(11, 42, 169, 0.2);
    border-color: rgba(11, 42, 169, 0.2);
}

.dice-option.selected {
    border-color: var(--primary-blue);
    background-color: rgba(11, 42, 169, 0.05);
}

.dice-image {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
}

.dice-option:hover .dice-image {
    transform: rotate(20deg);
}

.dice-option.selected .dice-image {
    transform: scale(1.1);
}

.dice-image.d4 {
    background-image: url('../assets/images/dice/d4.svg');
}

.dice-image.d6 {
    background-image: url('../assets/images/dice/d6.svg');
}

.dice-image.d8 {
    background-image: url('../assets/images/dice/d8.svg');
}

.dice-image.d10 {
    background-image: url('../assets/images/dice/d10.svg');
}

.dice-image.d12 {
    background-image: url('../assets/images/dice/d12.svg');
}

.dice-image.d20 {
    background-image: url('../assets/images/dice/d20.svg');
}

.dice-image.d100 {
    background-image: url('../assets/images/dice/d100.svg');
}

.dice-label {
    display: block;
    margin-bottom: 10px;
    font-family: var(--font-headers);
    font-weight: 600;
    color: var(--primary-blue);
}

.dice-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.counter-value {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background-color: var(--background-light);
    font-weight: bold;
    margin-bottom: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.counter-controls {
    display: flex;
    gap: 5px;
}

.counter-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.counter-btn:hover {
    background: var(--primary-blue-light);
    transform: scale(1.1);
}

.counter-btn:active {
    transform: scale(0.95);
}

.counter-decrease {
    background: var(--primary-red);
}

.counter-decrease:hover {
    background: var(--primary-red-light);
}

/* 
======================
COMMON ROLLS SECTION
======================
*/
.common-rolls {
    background-color: var(--divine-light-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(11, 42, 169, 0.1);
}

.common-rolls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-blue);
    z-index: 1;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.preset-roll {
    background-color: white;
    border: 2px solid rgba(11, 42, 169, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-headers);
    font-weight: 600;
    color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.preset-roll:hover {
    background-color: var(--background-light);
    border-color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(11, 42, 169, 0.1);
}

.preset-roll i {
    margin-right: 10px;
    color: var(--primary-purple);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.preset-roll:hover i {
    transform: rotate(20deg);
}

/* 
======================
DICE HISTORY SECTION
======================
*/
.dice-history {
    background-color: var(--divine-light-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(11, 42, 169, 0.1);
}

.dice-history::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-blue);
    z-index: 1;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(11, 42, 169, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
}

.empty-history-message {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: white;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-blue);
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.history-details {
    flex: 1;
}

.history-title {
    font-family: var(--font-headers);
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.history-dice {
    font-family: var(--font-body);
    font-weight: 500;
    margin-bottom: 5px;
}

.history-time {
    font-size: 0.8rem;
    color: #888;
}

.history-result {
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary-blue);
    margin: 0 20px;
    background: rgba(11, 42, 169, 0.1);
    border-radius: 8px;
    padding: 8px 15px;
    min-width: 50px;
    text-align: center;
}

.history-reroll {
    background: var(--gradient-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.history-reroll:hover {
    transform: rotate(180deg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Additional refinements for button highlighting */
#roll-btn.highlight {
    animation: highlight 1.5s ease;
}

@keyframes highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(11, 42, 169, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(11, 42, 169, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(11, 42, 169, 0);
    }
}

/* 
======================
RESPONSIVE ADJUSTMENTS
======================
*/
@media (max-width: 768px) {
    .dice-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .roll-controls {
        flex-direction: column;
    }
    
    .dice-options {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .preset-buttons {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .roll-details {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        text-align: center;
    }
    
    .history-result {
        margin: 10px 0;
    }
    
    .history-reroll {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .dice-option {
        padding: 10px;
    }
    
    .dice-image {
        width: 50px;
        height: 50px;
    }
    
    /* Keep the selected-die size as is for functional purposes */
}

/* Enhanced pulse animation for various elements */
@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}