/* Fantasy Medieval D&D Theme */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Philosopher:wght@400;700&display=swap');

:root {
    --parchment: #f4e8d0;
    --dark-brown: #3d2817;
    --gold: #d4af37;
    --blood-red: #8b0000;
    --forest-green: #2d5016;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Philosopher', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1f1f 100%);
    background-attachment: fixed;
    color: var(--parchment);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 0, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

h1, h2, h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 3em;
    text-align: center;
    margin: 30px 0;
    letter-spacing: 3px;
}

/* Parchment Card Style */
.card {
    background: linear-gradient(135deg, #f4e8d0 0%, #e8d5b5 100%);
    border: 3px solid var(--dark-brown);
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    color: var(--dark-brown);
}

.card::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(61, 40, 23, 0.2);
    border-radius: 7px;
    pointer-events: none;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.nav a, .btn {
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, var(--blood-red) 0%, #660000 100%);
    color: var(--gold);
    padding: 12px 30px;
    text-decoration: none;
    border: 2px solid var(--gold);
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: inline-block;
}

.nav a:hover, .btn:hover {
    background: linear-gradient(135deg, #a00000 0%, var(--blood-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(212, 175, 55, 0.4);
}

/* Form Styles */
.form-group {
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-brown);
    font-family: 'Cinzel', serif;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--dark-brown);
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Philosopher', sans-serif;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Dice Roller Styles */
.dice-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.dice-btn {
    background: linear-gradient(135deg, var(--gold) 0%, #b8941f 100%);
    color: var(--dark-brown);
    border: 3px solid var(--dark-brown);
    border-radius: 10px;
    padding: 30px 20px;
    font-size: 2em;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.dice-btn:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.5);
}

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

.dice-btn.rolling {
    animation: roll 0.5s ease-in-out;
}

@keyframes roll {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
}

/* Result Display */
.result-display {
    background: linear-gradient(135deg, var(--dark-brown) 0%, #2d1f1f 100%);
    color: var(--gold);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin: 30px 0;
    border: 3px solid var(--gold);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(212, 175, 55, 0.2);
}

.result-number {
    font-size: 5em;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
    margin: 20px 0;
}

/* Roll History */
.roll-history {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(61, 40, 23, 0.1);
    border-radius: 10px;
}

.roll-item {
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.5);
    border-left: 4px solid var(--gold);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin: 20px 0;
    font-weight: bold;
    border-left: 5px solid;
}

.alert-success {
    background: rgba(45, 80, 22, 0.2);
    border-color: var(--forest-green);
    color: var(--forest-green);
}

.alert-error {
    background: rgba(139, 0, 0, 0.2);
    border-color: var(--blood-red);
    color: var(--blood-red);
}

/* Decorative Elements */
.ornament {
    text-align: center;
    color: var(--gold);
    font-size: 2em;
    margin: 20px 0;
}

/* User Info */
.user-info {
    text-align: right;
    padding: 10px 20px;
    background: rgba(61, 40, 23, 0.5);
    border-radius: 5px;
    margin-bottom: 20px;
}

.user-info span {
    color: var(--gold);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .dice-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .dice-btn {
        padding: 20px 15px;
        font-size: 1.5em;
    }
    
    .result-number {
        font-size: 3em;
    }
}
