/* Baldur's Gate 2 Stat Roller - Styling */

/* Import medieval fantasy font */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Spectral:wght@400;600&display=swap');

:root {
    /* BG2 Color Palette */
    --bg-dark: #1a0f0a;
    --bg-medium: #2d1810;
    --parchment-light: #d4c4a8;
    --parchment-dark: #a89968;
    --gold: #d4af37;
    --gold-dark: #b8941f;
    --gold-light: #f4d03f;
    --border-dark: #3d2817;
    --text-light: #e8dcc0;
    --text-dark: #2d1810;
    --stat-highlight: #ffd700;
}

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

body {
    font-family: 'Spectral', serif;
    background: linear-gradient(135deg, #0a0604 0%, #1a0f0a 50%, #0f0805 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    padding: 20px;
}

/* Begin Screen */
.begin-screen {
    text-align: center;
    max-width: 500px;
    width: 100%;
    background: linear-gradient(145deg, #2d1810 0%, #1f1108 100%);
    border: 3px solid var(--gold-dark);
    border-radius: 8px;
    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.3),
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.8);
    padding: 60px 40px;
    position: relative;
}

.begin-screen h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.begin-button {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    padding: 20px 50px;
    border: 3px solid var(--gold);
    background: linear-gradient(145deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    color: var(--gold-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.4),
        0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.begin-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.begin-button:hover::before {
    width: 400px;
    height: 400px;
}

.begin-button:hover {
    border-color: var(--gold-light);
    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.6),
        0 6px 15px rgba(0, 0, 0, 0.7);
    transform: translateY(-3px) scale(1.05);
}

.begin-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.container {
    max-width: 700px;
    width: 100%;
    background: linear-gradient(145deg, #2d1810 0%, #1f1108 100%);
    border: 3px solid var(--gold-dark);
    border-radius: 8px;
    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.3),
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.8);
    padding: 30px;
    position: relative;
}

/* Decorative corner accents */
.container::before,
.container::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--gold);
}

.container::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.container::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gold-dark);
}

.header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.character-info {
    font-size: 1.1rem;
    color: var(--parchment-light);
    margin-top: 8px;
}

.character-info .name {
    font-weight: 600;
    color: var(--gold-light);
}

.character-info .class {
    font-style: italic;
    color: var(--parchment-dark);
}

/* Stats Grid */
.stats-container {
    margin: 30px 0;
}

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

.stat-box {
    background: linear-gradient(135deg, rgba(212, 196, 168, 0.1) 0%, rgba(168, 153, 104, 0.05) 100%);
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    padding: 12px 15px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--gold-dark);
    background: linear-gradient(135deg, rgba(212, 196, 168, 0.15) 0%, rgba(168, 153, 104, 0.1) 100%);
    transform: translateY(-2px);
}

.stat-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--parchment-dark);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    justify-content: flex-end;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--stat-highlight);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    min-width: 30px;
    text-align: right;
}

.stat-exceptional {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold-light);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Stat Arrows */
.stat-arrows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.arrow-btn {
    font-family: 'Spectral', serif;
    font-size: 1rem;
    font-weight: 700;
    width: 32px;
    height: 24px;
    padding: 0;
    border: 2px solid var(--border-dark);
    background: linear-gradient(145deg, rgba(61, 40, 23, 0.8) 0%, rgba(26, 15, 10, 0.9) 100%);
    color: var(--gold-dark);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.arrow-btn::before {
    display: none;
}

.arrow-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(145deg, rgba(61, 40, 23, 1) 0%, rgba(26, 15, 10, 1) 100%);
    color: var(--gold-light);
    box-shadow:
        0 0 10px rgba(212, 175, 55, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.6);
    transform: translateY(-1px);
}

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

.arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-dark);
    color: var(--parchment-dark);
}

.arrow-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border-color: var(--border-dark);
    background: linear-gradient(145deg, rgba(61, 40, 23, 0.8) 0%, rgba(26, 15, 10, 0.9) 100%);
}

/* Total Display */
.total-display {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(184, 148, 31, 0.1) 100%);
    border: 3px solid var(--gold);
    border-radius: 6px;
    padding: 20px;
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.3),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
    display: flex;
    gap: 40px;
    justify-content: center;
}

.total-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.total-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--parchment-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.total-values {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.total-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold-light);
    text-shadow:
        0 0 15px rgba(255, 215, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.points-available {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold-light);
    text-shadow:
        0 0 15px rgba(255, 215, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

/* Roll Counter */
.roll-counter {
    text-align: center;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: var(--parchment-dark);
    font-style: italic;
}

.roll-counter .count {
    color: var(--gold-light);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Buttons */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    padding: 14px 28px;
    border: 2px solid var(--gold-dark);
    background: linear-gradient(145deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    color: var(--gold);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    border-color: var(--gold-light);
    color: var(--gold-light);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.5),
        0 6px 15px rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-dark);
    color: var(--parchment-dark);
}

button:disabled:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#roll-button {
    background: linear-gradient(145deg, #3d2817 0%, #2d1810 100%);
    border-color: var(--gold);
    flex: 1;
    min-width: 150px;
}

#store-button,
#recall-button {
    min-width: 120px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .total-value {
        font-size: 2.5rem;
    }

    .button-container {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}