body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 2vh 10px;
    box-sizing: border-box;
}

.container {
    text-align: center;
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    position: relative;
}

/* Toast Styles */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff6600;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.toast.hidden {
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
}

.toast:hover {
    transform: translateY(-5px);
    background-color: #f1aa1c;
}

.toast:active {
    transform: scale(0.95);
}

.toast .icon {
    font-size: 20px;
}

h1 {
    color: #ff6600;
    letter-spacing: 2px;
}

.squad-selection button {
    background-color: #ff6600;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
}

.squad-selection button.selected {
    background-color: #f1aa1c;
}

#roll {
    background-color: #ff6600;
    color: #ffffff;
    border: none;
    padding: 10px 25px;
    margin-top: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
}

#roll:disabled {
    background-color: #555555;
    cursor: not-allowed;
    opacity: 0.7;
}

.results {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.result-category {
    background-color: #3a3a3a;
    padding: 15px;
    border-radius: 5px;
}

h2 {
    color: #ff6600;
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

p {
    font-size: 18px;
    min-height: 25px;
}

.reroll-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    transition: transform 0.2s ease-in-out;
    font-family: sans-serif; /* Fallback for emoji */
    margin-left: 5px;
}

.reroll-btn:hover {
    transform: scale(1.2) rotate(15deg);
}

@media (max-width: 800px) {
    .results {
        grid-template-columns: 1fr;
    }
    
    body {
        padding-top: 15px;
        padding-bottom: 10px;
    }
    
    .container {
        padding-top: 15px;
    }
    
    .container h1 {
        margin-top: 0;
    }
}

/* Animation for rolling dice */
@keyframes roll {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rolling {
    animation: roll 0.3s linear infinite;
}

.condition-text {
    font-size: 14px;
    color: #b0b0b0;
    margin-top: -10px;
    min-height: 20px;
}

/* Trophy Button */
.trophy-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
}

.trophy-btn:hover {
    transform: scale(1.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: #2a2a2a;
    width: 90%;
    max-width: 600px;
    height: 80%;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #ff6600;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #ff6600;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
}

.modal-controls {
    margin-bottom: 15px;
    text-align: left;
}

.modal-controls select {
    background-color: #3a3a3a;
    color: #fff;
    border: 1px solid #555;
    padding: 5px;
    border-radius: 5px;
    font-family: 'Orbitron', sans-serif;
}

.trophy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.trophy-item {
    background-color: #3a3a3a;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-align: left;
    border-left: 5px solid transparent;
}

.trophy-item.platinum { border-left-color: #E5E4E2; }
.trophy-item.gold { border-left-color: #FFD700; }
.trophy-item.silver { border-left-color: #C0C0C0; }
.trophy-item.bronze { border-left-color: #CD7F32; }

.trophy-checkbox {
    margin-top: 5px;
    transform: scale(1.5);
    cursor: pointer;
}

.trophy-info {
    flex-grow: 1;
}

.trophy-name {
    font-weight: bold;
    color: #ff6600;
    display: block;
    margin-bottom: 5px;
}

.trophy-desc {
    font-size: 14px;
    color: #cccccc;
    display: block;
    margin-bottom: 5px;
}

.trophy-rarity {
    font-size: 12px;
    font-style: italic;
    color: #888;
}

/* Tracked item styling */
.trophy-item.tracked {
    background-color: #4a3a2a;
    border: 1px solid #ff6600;
}

/* Enhanced Frost Overlay - severe and cracked */
:root {
    --frost-blur: 1.5px;
    --frost-brightness: 1.02;
    --frost-saturation: 0.9;
    --frost-vignette-color: rgba(100, 200, 255, 0.2);
    --ice-crack-color: rgba(255, 255, 255, 0.9);
    --ice-crack-glow-color: rgba(200, 255, 255, 0.8);
}

/* Shared styles for frost effect layers */
.frost-layer {
    /* Multiple layers for depth:
       1. Vignette (Deep Blue/White edges)
       2. Scratchy texture (Repeating Linear)
    */
    background:
        /* Lighter vignette, more subtle - lake ice effect */
        radial-gradient(circle at center, rgba(100, 200, 255, 0) 40%, rgba(150, 220, 255, 0.1) 60%, rgba(180, 230, 255, 0.3) 100%),
        /* Matte texture */
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 4px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 4px);

    /* Matte effect: Slight blur + saturation control */
    backdrop-filter: blur(var(--frost-blur)) brightness(var(--frost-brightness)) saturate(var(--frost-saturation));
}

.frost-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;

    /* Reduced inner freeze glow */
    box-shadow: inset 0 0 100px 30px var(--frost-vignette-color);

    opacity: 0;
    transition: opacity 3s ease-out;
}

/* Remove static cracks to allow dynamic interaction */
.frost-overlay::before {
    display: none;
}

.frost-overlay.active {
    opacity: 1;
}

/* Dynamic Crack Styling */
.ice-crack {
    position: absolute;
    width: 150px;
    height: 150px;
    pointer-events: none;
    z-index: 1000;
    overflow: visible;
}

.ice-crack svg {
    filter: drop-shadow(0 0 2px var(--ice-crack-glow-color));
    width: 100%;
    height: 100%;
}

.ice-crack svg path {
    stroke: var(--ice-crack-color);
    stroke-width: 1.5px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Frost Shard for Shatter Effect */
.frost-shard {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1001; /* Above overlay */

    /* Smaller inner glow for shards */
    box-shadow: inset 0 0 20px 5px var(--frost-vignette-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform-origin: center;
}
