@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=MedievalSharp&display=swap');

:root {
    --rune-gold: #ffb700;
    --rune-blue: #00f3ff;
    --rune-purple: #9d00ff;
    --rune-red: #ff3333;
    --void-dark: #050208;
    --stone-bg: #1a1624;
}

body {
    background-color: var(--void-dark);
    color: #d4c5a9;
    font-family: 'MedievalSharp', cursive;
    background: linear-gradient(125deg, #0f0c29, #302b63, #24243e, #000000);
    background-size: 400% 400%;
    animation: aurora 15s ease infinite;
    cursor: crosshair;
}

@keyframes aurora {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Magical Particle Dust Background */
.dust-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.dust-mote {
    position: absolute;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    opacity: 0.3;
    animation: floatUp 15s infinite linear;
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) translateX(0) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    50% {
        transform: translateY(50vh) translateX(20px) scale(1.5);
        opacity: 0.4;
    }

    100% {
        transform: translateY(-10vh) translateX(-20px) scale(0);
        opacity: 0;
    }
}

/* UI Components */
.ancient-border {
    border: 2px solid #4a3b5e;
    border-image: linear-gradient(to bottom, #4a3b5e, var(--rune-gold), #4a3b5e) 1;
    background: rgba(10, 5, 15, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
    transition: all 0.3s ease;
}

.ancient-border:hover {
    border-color: #9d00ff;
    box-shadow: 0 0 40px rgba(157, 0, 255, 0.2);
}

.title-text {
    font-family: 'Cinzel', serif;
    background: linear-gradient(to bottom, #fff, var(--rune-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(255, 183, 0, 0.5);
}

/* Rune Grid Buttons */
.rune-stone {
    background: linear-gradient(145deg, #1e1828, #130f1a);
    border: 1px solid #332842;
    color: #554466;
    font-family: 'Cinzel', serif;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
}

/* Beat markers (every 4th step) background */
.beat-marker {
    background: linear-gradient(145deg, #251d30, #1a1525);
    border-color: #4a3b5e;
}

.rune-stone:active {
    transform: scale(0.90);
}

.rune-stone.active {
    border-color: var(--rune-gold);
    color: var(--rune-gold);
    background: linear-gradient(145deg, #2a1f35, #1a1220);
    box-shadow: 0 0 10px rgba(255, 183, 0, 0.2), inset 0 0 10px rgba(255, 183, 0, 0.1);
}

.rune-stone.playing {
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 0 30px #fff, 0 0 60px var(--rune-gold);
    transform: scale(1.15);
    border-color: #fff;
    z-index: 10;
}

/* Row Labels */
.row-label {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: #887;
    text-shadow: 0 0 5px rgba(0, 0, 0, 1);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    width: 100%;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    width: 18px;
    transform: rotate(45deg);
    background: var(--rune-gold);
    border: 2px solid #fff;
    box-shadow: 0 0 15px var(--rune-gold);
    cursor: pointer;
    margin-top: -7px;
    transition: transform 0.1s;
}

input[type=range]::-moz-range-thumb {
    appearance: none;
    height: 18px;
    width: 18px;
    transform: rotate(45deg);
    background: var(--rune-gold);
    border: 2px solid #fff;
    box-shadow: 0 0 15px var(--rune-gold);
    cursor: pointer;
    border-radius: 0;
    transition: transform 0.1s;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: rotate(45deg) scale(1.2);
    background: #fff;
}

input[type=range]:active::-moz-range-thumb {
    transform: rotate(45deg) scale(1.2);
    background: #fff;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #332842, var(--rune-purple), var(--rune-blue));
    border-radius: 2px;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #332842, var(--rune-purple), var(--rune-blue));
    border-radius: 2px;
}

/* Scrying Pool */
.orb-glow {
    box-shadow: 0 0 60px rgba(157, 0, 255, 0.15), inset 0 0 80px rgba(0, 0, 0, 0.9);
    transition: box-shadow 0.5s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0f0a14;
}

::-webkit-scrollbar-thumb {
    background: #4a3b5e;
    border-radius: 3px;
}

/* Utility for internal scrolling */
.tablet-scroll-area {
    scrollbar-width: thin;
    scrollbar-color: #4a3b5e #0f0a14;
}

/* Modal */
.modal-bg {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}