/* ===== Diablo II Style Theme ===== */

:root {
    --bg-dark: #0a0a0a;
    --bg-medium: #1a1410;
    --bg-light: #2a2218;
    --gold: #d4af37;
    --gold-dark: #a88e2f;
    --gold-bright: #ffd700;
    --blood: #8b0000;
    --blood-light: #b22222;
    --copper: #6b4423;
    --copper-light: #8b5a3c;
    --text-main: #e8d7b0;
    --text-dim: #a89968;
    --blue: #4169e1;
    --blue-light: #6495ed;
}

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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-dark) 100%);
    color: var(--text-main);
    min-height: 100vh;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.3) 2px, rgba(0,0,0,.3) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.3) 2px, rgba(0,0,0,.3) 4px);
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

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

/* ===== Header ===== */
.shrine-header {
    text-align: center;
    padding: 15px 0;
    border-bottom: 2px solid var(--copper);
    margin-bottom: 20px;
    background: linear-gradient(to bottom, transparent, rgba(107, 68, 35, 0.2));
}

.shrine-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.3rem, 4vw, 2rem);
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8), 0 0 40px rgba(212, 175, 55, 0.4);
    letter-spacing: 2px;
    margin-bottom: 8px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.8), 0 0 40px rgba(212, 175, 55, 0.4); }
    50% { text-shadow: 0 0 30px rgba(212, 175, 55, 1), 0 0 60px rgba(212, 175, 55, 0.6), 0 0 90px rgba(212, 175, 55, 0.3); }
}

.rune {
    display: inline-block;
    animation: runeFloat 4s ease-in-out infinite;
}

@keyframes runeFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-dim);
    font-style: italic;
}

/* ===== Status Panel ===== */
.status-panel {
    background: rgba(26, 20, 16, 0.8);
    border: 2px solid var(--copper);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 0 30px rgba(107, 68, 35, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.stat-bar {
    margin-bottom: 10px;
}

.stat-bar:last-of-type {
    margin-bottom: 12px;
}

.stat-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.bar-container {
    position: relative;
    width: 100%;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--copper-light);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}

.bar {
    height: 100%;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: 0 0 15px currentColor;
}

.bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
}

.health-bar {
    background: linear-gradient(to right, var(--blood), var(--blood-light));
}

.mana-bar {
    background: linear-gradient(to right, var(--blue), var(--blue-light));
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    z-index: 1;
}

.rune-status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    gap: 10px;
}

.rune-label {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.rune-active {
    color: var(--gold-bright);
    font-weight: bold;
    animation: runeActivate 2s ease-in-out infinite;
}

@keyframes runeActivate {
    0%, 100% { text-shadow: 0 0 10px var(--gold-bright); }
    50% { text-shadow: 0 0 20px var(--gold-bright), 0 0 30px var(--gold); }
}

/* ===== Upload Zone ===== */
.upload-shrine {
    margin-bottom: 15px;
}

.drop-zone {
    border: 2px dashed var(--copper);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: rgba(26, 20, 16, 0.6);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    border-radius: 50%;
}

.drop-zone:hover::before {
    width: 400px;
    height: 400px;
}

.drop-zone:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4), inset 0 0 30px rgba(212, 175, 55, 0.1);
}

.drop-zone.drag-over {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.6), inset 0 0 50px rgba(212, 175, 55, 0.2);
}

.scroll-icon {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    margin-bottom: 12px;
    animation: scrollFloat 3s ease-in-out infinite;
}

@keyframes scrollFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.drop-text {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--gold);
    margin-bottom: 10px;
}

.drop-subtext {
    color: var(--text-dim);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pentagram {
    font-size: 4rem;
    color: var(--gold);
    animation: pentagramSpin 2s linear infinite;
}

@keyframes pentagramSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.progress-text {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold);
}

/* ===== Result Section ===== */
.result-section {
    background: rgba(26, 20, 16, 0.8);
    border: 2px solid var(--copper);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(107, 68, 35, 0.5);
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--gold);
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid var(--copper);
    padding-bottom: 8px;
}

.scroll-container {
    background: rgba(232, 215, 176, 0.12);
    border: 1px solid var(--copper-light);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    min-height: 100px;
}

.scroll-text {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.8;
    color: #f5e6c8;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
    font-weight: 400;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--copper);
    border-radius: 6px;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 3px;
}

.stat-name {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    color: var(--text-dim);
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    font-family: 'Cinzel', serif;
    padding: 8px 20px;
    border: 2px solid;
    border-radius: 6px;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    border-radius: 50%;
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn.primary {
    border-color: var(--gold);
    color: var(--gold);
}

.action-btn.primary:hover {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.action-btn.secondary {
    border-color: var(--blue);
    color: var(--blue);
}

.action-btn.secondary:hover {
    background: var(--blue);
    color: white;
    box-shadow: 0 0 20px rgba(65, 105, 225, 0.6);
}

.action-btn.danger {
    border-color: var(--blood);
    color: var(--blood-light);
}

.action-btn.danger:hover {
    background: var(--blood);
    color: white;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.6);
}

/* ===== Error Panel ===== */
.error-panel {
    background: rgba(139, 0, 0, 0.2);
    border: 2px solid var(--blood);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.5);
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.error-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--blood-light);
    margin-bottom: 8px;
}

.error-message {
    color: var(--text-dim);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
}

/* ===== Footer ===== */
.shrine-footer {
    text-align: center;
    padding: 15px 0;
    border-top: 2px solid var(--copper);
    margin-top: 20px;
    color: var(--text-dim);
}

.footer-text {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-bottom: 5px;
}

.footer-version {
    font-size: 0.8rem;
    color: var(--copper-light);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Scrollbar Styling ===== */
.scroll-container::-webkit-scrollbar {
    width: 10px;
}

.scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--copper);
    border-radius: 5px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .shrine-header {
        padding: 20px 0;
    }

    .status-panel {
        padding: 15px;
    }

    .drop-zone {
        padding: 40px 15px;
    }

    .result-section {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .shrine-title {
        letter-spacing: 1px;
    }

    .scroll-container {
        max-height: 300px;
    }
}
