/* Dice Forge - Fantasy Dice Roller Styles */

:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #0f3460;
    --accent-gold: #ffd700;
    --accent-gold-dim: #b8860b;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --success: #00ff88;
    --danger: #ff4444;
    --border: #2a2a4a;
    
    /* Dice Colors */
    --d4-color: #e74c3c;
    --d6-color: #3498db;
    --d8-color: #2ecc71;
    --d10-color: #9b59b6;
    --d12-color: #f39c12;
    --d20-color: #1abc9c;
    --d100-color: #e91e63;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at top, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(26, 188, 156, 0.05) 0%, transparent 50%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.app-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-style: italic;
}

/* Dice Selector */
.dice-selector {
    margin-bottom: 30px;
}

.dice-selector h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.dice-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.dice-btn.selected {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.dice-icon {
    font-size: 2.5rem;
    transition: transform 0.3s ease;
}

.dice-btn:hover .dice-icon {
    transform: rotate(15deg) scale(1.1);
}

.dice-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Roll Configuration */
.roll-config {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.config-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.config-group {
    flex: 1;
    min-width: 120px;
}

.config-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.config-group input,
.config-group select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.config-group input:focus,
.config-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* Roll Display */
.roll-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.roll-notation {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--accent-gold);
    min-width: 150px;
    text-align: center;
}

.roll-btn {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dim) 100%);
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3);
}

.roll-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.4);
}

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

.roll-text {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--bg-dark);
    font-weight: 700;
}

.roll-icon {
    font-size: 2rem;
}

/* Rolling Animation */
.roll-btn.rolling .roll-icon {
    animation: dice-spin 0.5s ease-in-out infinite;
}

@keyframes dice-spin {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* Result Section */
.result-section {
    margin-bottom: 30px;
    animation: fade-in 0.5s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border);
}

.dice-rolls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dice-result {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    animation: pop-in 0.3s ease backwards;
    position: relative;
}

.dice-result.advantage-used {
    opacity: 0.4;
    text-decoration: line-through;
}

.dice-result.kept {
    box-shadow: 0 0 20px currentColor;
}

@keyframes pop-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.result-total {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-total.critical-hit {
    color: var(--success);
    text-shadow: 0 0 30px var(--success);
    animation: pulse-glow 1s ease infinite;
}

.result-total.critical-miss {
    color: var(--danger);
    text-shadow: 0 0 30px var(--danger);
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 30px var(--success); }
    50% { text-shadow: 0 0 50px var(--success), 0 0 70px var(--success); }
}

.result-breakdown {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Presets Section */
.presets-section {
    margin-bottom: 30px;
}

.presets-section h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.preset-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-gold);
}

/* Bottom Panels */
.bottom-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
}

@media (max-width: 768px) {
    .bottom-panels {
        grid-template-columns: 1fr;
    }
}

/* Statistics Panel */
.stats-panel {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.stats-panel h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 10px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-item.crit .stat-value {
    color: var(--success);
}

.stat-item.fumble .stat-value {
    color: var(--danger);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* History Panel */
.history-panel {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.history-header h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.clear-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
}

.empty-history {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-roll {
    color: var(--text-secondary);
}

.history-total {
    font-weight: 600;
    font-size: 1.1rem;
}

.history-item.critical-hit .history-total {
    color: var(--success);
}

.history-item.critical-miss .history-total {
    color: var(--danger);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .app-header h1 {
        font-size: 2rem;
    }
    
    .roll-btn {
        width: 100px;
        height: 100px;
    }
    
    .roll-text {
        font-size: 1rem;
    }
    
    .result-total {
        font-size: 3rem;
    }
    
    .dice-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .dice-btn {
        padding: 15px 10px;
    }
    
    .dice-icon {
        font-size: 1.8rem;
    }
}
