@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&family=Aref+Ruqaa:wght@400;700&display=swap');

:root {
    --primary: #d500f9;
    --primary-alt: #aa00ff;
    --secondary: #6200ea;
    --accent: #e1bee7;
    --dark: #05000a;
    --purple-glow: rgba(213, 0, 249, 0.4);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --gold: #ffd700;
}

body.theme-wood {
    --primary: #00e676;
    --primary-alt: #00c853;
    --secondary: #33691e;
    --purple-glow: rgba(0, 230, 118, 0.4);
}

body.theme-iron {
    --primary: #ff5252;
    --primary-alt: #ff1744;
    --secondary: #8e0000;
    --purple-glow: rgba(255, 82, 82, 0.4);
}


/* Setup Screen Overlay */
.setup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 15, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50000;
    backdrop-filter: blur(100px);
    transition: opacity 1s ease, visibility 1s;
}

.setup-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


.setup-card {
    background: var(--glass);
    border: 2px solid var(--primary);
    padding: 30px;
    border-radius: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 0 100px var(--purple-glow);
    animation: card-glow 3s infinite alternate;
}

.setup-card::-webkit-scrollbar {
    display: none;
}

.ritual-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    direction: rtl;
}

.ritual-tab {
    flex: 1;
    background: transparent;
    border: 2px solid var(--glass-border);
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Aref Ruqaa', serif;
    cursor: pointer;
    transition: all 0.3s;
}

.ritual-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--purple-glow);
    font-weight: bold;
}



@keyframes card-glow {
    from { box-shadow: 0 0 30px rgba(213, 0, 249, 0.2); }
    to { box-shadow: 0 0 100px rgba(213, 0, 249, 0.6); }
}

.setup-card h2 {
    color: var(--primary);
    margin-bottom: 40px;
    font-size: 2.2rem;
    font-family: 'Aref Ruqaa', serif;
}

.input-group {
    margin-bottom: 20px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    color: #fff;
    font-size: 1.2rem;
    font-family: 'Aref Ruqaa', serif;
}

.input-group input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.3s;
    text-align: right;
    font-family: inherit;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Machine Selector Cards */
.machine-selector {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
    direction: rtl;
    width: 100%;
}

.machine-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0; /* Prevents flex items from overflowing */
}

.machine-card img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.1));
    transition: all 0.3s ease;
}

.machine-card span {
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Aref Ruqaa', serif;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.machine-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.machine-card.active {
    border-color: var(--primary);
    background: var(--purple-glow);
    box-shadow: 0 0 15px var(--purple-glow);
}

.machine-card.active img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px var(--primary));
}

.machine-card.active span {
    color: var(--primary);
    font-weight: bold;
}



.start-btn {
    width: 100%;
    padding: 18px;
    margin-top: 20px;
    background: var(--primary);
    border: none;
    border-radius: 15px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Aref Ruqaa', serif;
    box-shadow: 0 0 30px var(--primary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.start-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 0 60px var(--primary);
}

.vibration-note {
    margin-top: 30px;
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Initial Splash Screen */
.splash-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60000;
    transition: opacity 1s ease, visibility 1s;
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 800px;
    padding: 20px;
}

.splash-img {
    max-width: 100%;
    height: auto;
    max-height: 50vh;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    animation: image-fade 2s infinite alternate ease-in-out;
}

@keyframes image-fade {
    from { filter: brightness(1) drop-shadow(0 0 10px #fff); }
    to { filter: brightness(1.2) drop-shadow(0 0 30px var(--primary)); }
}

.splash-text {
    font-size: 3.5rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    font-family: 'Aref Ruqaa', serif;
    animation: text-float 3s infinite ease-in-out;
}

.proceed-btn {
    padding: 15px 50px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 1.8rem;
    cursor: pointer;
    border-radius: 10px;
    font-family: 'Aref Ruqaa', serif;
    transition: all 0.3s;
}

.proceed-btn:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 40px var(--primary);
    transform: scale(1.1);
}


.splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}



* {
    box-sizing: border-box;
    user-select: none;
    cursor: none; /* Custom magic cursor */
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark);
    font-family: 'Outfit', 'Aref Ruqaa', serif;
    color: white;
    overflow: hidden;
}

/* Custom Cursor */
.magic-cursor {
    position: fixed;
    width: 25px;
    height: 25px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999; /* Fix: stay above loader */
    mix-blend-mode: screen;
    box-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary);
    transition: transform 0.1s ease;
}

.magic-cursor-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    opacity: 0.5;
}


/* Enhanced Background */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-areas: 
        "header header header"
        "god-left machine ."
        "footer footer footer";
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 150px 1fr 100px;
    background: radial-gradient(circle at center, #1a0033 0%, #05000a 100%);
    overflow: hidden;
}

.floating-curse-text {
    position: fixed;
    color: var(--primary);
    font-size: 2rem;
    font-family: 'Aref Ruqaa', serif;
    font-weight: bold;
    text-shadow: 0 0 20px var(--primary), 0 0 30px #fff;
    pointer-events: none;
    z-index: 25000;
    white-space: nowrap;
}


#background-portal {
    position: fixed;
    inset: -50%;
    background: radial-gradient(circle, var(--purple-glow) 0%, transparent 60%);
    z-index: 1;
    filter: blur(120px);
    animation: rotate-portal 100s linear infinite;
    opacity: 0.5;
}

/* Status Bars */
.status-container {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 600px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: center;
    direction: rtl;
    gap: 30px;
    background: rgba(10, 0, 20, 0.85);
    padding: 15px 40px;
    border-radius: 60px;

    pointer-events: none; /* Critical: Prevent HUD from blocking drags */
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary);
    box-shadow: 0 0 40px rgba(213, 0, 249, 0.3);
}




.curse-meter-bg {
    flex: 1;
    height: 12px;

    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.curse-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary), #fff);
    box-shadow: 0 0 30px var(--primary);
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.soul-counter {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px var(--primary);
    white-space: nowrap;
}


header {
    grid-area: header;
    text-align: center;
    z-index: 10;
    padding-top: 50px;
}

h1 {
    font-family: 'Aref Ruqaa', serif;
    font-size: 4rem;
    margin: 0;
    background: linear-gradient(to right, #ffffff, var(--primary), var(--secondary), #ffffff);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px var(--primary));
    animation: title-shine 8s linear infinite;
}

@keyframes title-shine {
    to { background-position: 300% center; }
}

/* Side God Pedestals */
.god-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#god-left-area { grid-area: god-left; }
#god-right-area { grid-area: god-right; }

.pedestal {
    width: 250px;
    height: 350px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(30px);
    border-radius: 100px 100px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 30px 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 30px var(--purple-glow);
    transition: all 0.4s ease;
    animation: pedestal-float 6s infinite ease-in-out;
}

@keyframes pedestal-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(1deg); }
}

.pedestal:hover {
    border-color: var(--primary);
    box-shadow: 0 30px 80px var(--purple-glow);
    transform: scale(1.05) translateY(-30px);
}

.god-circle {
    width: 180px;
    height: 180px;
    cursor: grab;
    z-index: 50;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 3px dashed var(--primary);
    border-radius: 50%;
    box-shadow: inset 0 0 20px var(--purple-glow);
}

.god-circle:active { cursor: grabbing; }

.victim-icon {
    font-size: 5.5rem;
    filter: drop-shadow(0 0 20px var(--primary));
    pointer-events: none;
    transition: all 0.3s;
}



/* Central Machine */
.machine-center {
    grid-area: machine;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    position: relative;
}

.machine-area {
    width: 600px;
    height: 600px;
    position: relative;
}

.ritual-ring {
    position: absolute;
    inset: 0;
    border: 2px dashed var(--primary);
    border-radius: 50%;
    opacity: 0.1;
    animation: rotate-ritual 40s linear infinite;
}

.ritual-ring-inner {
    position: absolute;
    inset: 50px;
    border: 1px solid var(--secondary);
    border-radius: 50%;
    opacity: 0.2;
    animation: rotate-ritual 20s linear infinite reverse;
}

@keyframes rotate-ritual {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.machine-body {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.machine-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 0 80px var(--secondary));
}

/* Drop Glitch Effect */
.glitch-layer {
    position: fixed;
    inset: 0;
    background: var(--purple-glow);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
}

@keyframes glitch-anim {
    0% { opacity: 0; transform: translate(0); }
    20% { opacity: 0.5; transform: translate(-10px, 5px) skewX(10deg); }
    40% { opacity: 0.8; transform: translate(15px, -10px) skewY(-5deg); }
    60% { opacity: 0.5; transform: translate(-5px, 15px); }
    80% { opacity: 0.3; transform: translate(10px, -5px); }
    100% { opacity: 0; transform: translate(0); }
}


/* Advanced Particles */
.soul-particle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
}

/* Custom Message Box */
.message-box {
    position: fixed;
    bottom: 180px;
    left: 50%;

    transform: translate(-50%, 50px);
    background: rgba(10, 0, 20, 0.95);
    border: 1px solid var(--primary);
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 50px var(--primary);
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Fix: Message box won't block drag */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}


.message-box.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* Ritual Loader Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 10, 0.97);
    backdrop-filter: blur(80px);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Block input when not ritualing */
    transition: all 0.5s ease;
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all; /* Allow interaction with re-curse button */
}


.ritual-vessel {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px; /* Space between vessel and text */
}

.ritual-orb {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 60%);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 100px var(--primary);
    animation: orb-pulse 0.8s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

/* Ritual Symbols Levitation */
.ritual-symbols {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    pointer-events: none;
    animation: rotate-ritual 15s linear infinite;
    z-index: 4;
}


.ritual-symbols span {
    position: absolute;
    font-size: 2rem;
    color: var(--accent);
    opacity: 0.6;
    text-shadow: 0 0 20px var(--primary);
}

.ritual-symbols span:nth-child(1) { top: 10%; left: 50%; transform: translateX(-50%); }
.ritual-symbols span:nth-child(2) { bottom: 10%; left: 50%; transform: translateX(-50%); }
.ritual-symbols span:nth-child(3) { left: 10%; top: 50%; transform: translateY(-50%); }
.ritual-symbols span:nth-child(4) { right: 10%; top: 50%; transform: translateY(-50%); }

@keyframes orb-pulse {
    from { transform: scale(1) rotate(0deg); filter: brightness(1) drop-shadow(0 0 20px var(--primary)); }
    to { transform: scale(1.3) rotate(45deg); filter: brightness(2) drop-shadow(0 0 80px var(--primary)); }
}

.loader-text {
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 40px;
    text-shadow: 0 0 30px var(--primary), 0 0 60px var(--secondary);
    font-family: 'Aref Ruqaa', serif;
    text-align: center;
    max-width: 90%;
    animation: text-flicker 2s infinite;
}

@keyframes text-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
    55% { opacity: 1; }
}

.floating-phrase {
    position: absolute;
    top: 55%; /* Adjusted for better visibility */
    left: 50%;
    transform: translate(-50%, 0);
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 30px #f00, 0 0 60px var(--primary);
    font-family: 'Aref Ruqaa', serif;
    text-align: center;
    width: 90%;
    pointer-events: none;
    z-index: 25000;
}

@media (max-width: 768px) {
    .floating-phrase {
        font-size: 1.8rem;
        white-space: normal; /* Allow wrapping on small screens */
        top: 60%;
    }
}

.floating-phrase.extreme {
    color: #ff0;
    text-shadow: 0 0 40px #f00, 0 0 80px orange, 0 0 120px red;
    font-size: 4.5rem;
    animation: hyper-text-shake 0.1s infinite;
}

@keyframes hyper-text-shake {
    0% { transform: translate(-50%, 0) rotate(1deg); }
    50% { transform: translate(-51%, 1px) rotate(-1deg); }
    100% { transform: translate(-49%, -1px) rotate(0deg); }
}

@media (max-width: 768px) {
    .floating-phrase.extreme {
        font-size: 2.2rem;
    }
}

.explosion-flash {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
}

@keyframes flash-burst {
    0% { opacity: 0; transform: scale(1); }
    10% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.5); }
}


/* Re-curse Button */
.recurse-btn {
    margin-top: 30px;
    padding: 15px 40px;
    background: var(--glass);
    border: 2px solid var(--primary);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    display: none; /* Initially hidden */
    font-family: 'Outfit', 'Aref Ruqaa', serif;
    animation: btn-glow 2s infinite alternate;
}

@keyframes btn-glow {
    from { box-shadow: 0 0 10px var(--primary); }
    to { box-shadow: 0 0 30px var(--primary), 0 0 50px var(--secondary); }
}

.recurse-btn:hover {
    background: var(--primary);
    transform: scale(1.1) translateY(-5px);
}

.recurse-btn.active {
    display: block;
}

/* Hyper Stage 2 Vortex */
.loader-overlay.stage2 {
    background: radial-gradient(circle, #4a001a 0%, #05000a 100%);
    animation: hyper-shake 0.1s infinite;
}

@keyframes hyper-shake {
    0% { transform: translate(2px, 2px); }
    25% { transform: translate(-2px, -2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, 2px); }
    100% { transform: translate(0, 0); }
}

/* Iron Stage 2 - Industrial Hell */
.loader-overlay.stage2-iron {
    background: radial-gradient(circle, #222 0%, #000 100%);
    animation: hyper-shake 0.05s infinite;
}

.stage2-iron .vortex-effect {
    opacity: 1;
    background: conic-gradient(from 0deg, transparent, #ff4400, transparent, #888, transparent);
    animation: rotate-vortex 0.2s infinite linear;
    filter: blur(30px) contrast(200%);
}

.stage2-iron .ritual-orb {
    animation: iron-vortex 0.2s infinite linear;
    background: radial-gradient(circle, #ff6600 0%, #ff0000 70%);
    box-shadow: 0 0 150px #ff4400, 0 0 300px #f00;
}

@keyframes iron-vortex {
    from { transform: rotate(0deg) scale(2.5) skewX(10deg); filter: brightness(1.5) contrast(1.5); }
    to { transform: rotate(360deg) scale(2.7) skewX(-10deg); filter: brightness(2) contrast(2); }
}

.stage2-iron .floating-phrase.extreme {
    color: #ff4400;
    text-shadow: 0 0 30px #000, 0 0 60px #ff0000, 0 0 100px #ffaa00;
    font-size: 5rem;
}

.explode-action-btn {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ff0000, #ff5500);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Aref Ruqaa', serif;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    white-space: nowrap;
    z-index: 1000; /* Higher priority */
    animation: pulse-red 1.5s infinite;
    transition: opacity 0.5s ease;
}

.explode-action-btn.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

@keyframes pulse-red {
    0% { transform: translateX(-50%) scale(1); box-shadow: 0 0 10px #f00; }
    50% { transform: translateX(-50%) scale(1.05); box-shadow: 0 0 30px #f00; }
    100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 10px #f00; }
}

@media (max-width: 768px) {
    .explode-action-btn {
        width: 90%;
        bottom: -60px;
        font-size: 0.9rem;
    }
}

.loader-overlay.stage2 .ritual-orb {
    animation: hyper-vortex 0.4s infinite linear;
    background: radial-gradient(circle, var(--primary) 0%, var(--secondary) 70%);
    box-shadow: 0 0 200px var(--primary);
}


@keyframes hyper-vortex {
    from { transform: rotate(0deg) scale(2); filter: hue-rotate(0deg) contrast(200%); }
    to { transform: rotate(360deg) scale(2.2); filter: hue-rotate(360deg) contrast(300%); }
}


@keyframes vortex {
    from { transform: rotate(0deg) scale(1.5); }
    to { transform: rotate(360deg) scale(1.5); }
}

.vortex-effect {
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, var(--primary), transparent, var(--secondary), transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    filter: blur(50px);
}

.stage2 .vortex-effect {
    opacity: 0.8;
    animation: rotate-vortex 1s infinite linear;
}

@keyframes rotate-vortex {
    to { transform: rotate(360deg) scale(1.5); }
}



.progress-container {
    width: 80%;
    max-width: 500px;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary), #fff);
    box-shadow: 0 0 30px var(--primary);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: energy-arc 1s infinite linear;
}

@keyframes energy-arc {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}


.interaction-effect {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        grid-template-areas: 
            "header header"
            "machine machine"
            "god-left god-left"
            "footer footer";
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 100px 350px auto 100px;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    header { 
        padding-top: 20px; 
        z-index: 20; 
        grid-area: header;
    }

    h1 { font-size: 2.5rem; }
}

.ritual-subtext {
    font-size: 1.5rem;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--primary);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    font-family: 'Aref Ruqaa', serif;
}

.ritual-subtext.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .ritual-subtext {
        font-size: 1.1rem;
        padding: 0 10px;
    }
    /* Disable Hover on Mobile */
    .pedestal:hover {
        transform: none !important;
        box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 30px var(--purple-glow) !important;
        border-color: var(--glass-border) !important;
    }

    .god-side {
        flex-direction: row;
        gap: 15px;
        padding: 10px;
        z-index: 10;
        min-height: auto;
    }

    #god-left-area { grid-area: god-left; }
    #god-right-area { grid-area: god-right; }

    .pedestal {
        width: 140px;
        height: 180px;
        border-radius: 40px 40px 10px 10px;
        animation: none;
        padding: 15px 5px;
    }

    .god-circle {
        width: 100px;
        height: 100px;
    }
    
    .victim-icon {
        font-size: 3rem;
    }

    .god-name {
        font-size: 0.9rem;
        bottom: -25px;
        padding: 3px 8px;
    }

    .machine-center { 
        grid-area: machine;
        padding: 0; 
        height: 350px;
    }

    .machine-area {
        width: 320px;
        height: 320px;
    }

    .ritual-vessel {
        width: 300px;
        height: 300px;
    }

    .ritual-orb { width: 100px; height: 100px; }
    .loader-text { font-size: 1.4rem; margin-bottom: 15px; }

    .status-container {
        width: 95%;
        padding: 10px 20px;
        gap: 10px;
        min-width: unset;
        bottom: 15px;
        z-index: 1000;
        background: rgba(10, 0, 20, 0.95);
        pointer-events: none; /* Critical on mobile */
    }


    .soul-counter { font-size: 0.9rem; min-width: auto; }
    .curse-meter-bg { height: 8px; }

    .recurse-btn {
        width: 85%;
        font-size: 1.1rem;
        padding: 10px;
    }

    /* Setup & Splash Mobile Fixes */
    .setup-card {
        padding: 20px 15px;
        width: 95%;
        border-radius: 20px;
    }
    .setup-card h2 { font-size: 1.5rem; margin-bottom: 15px; }
    .input-group label { font-size: 1rem; }
    .input-group input { padding: 10px; font-size: 1rem; }
    .start-btn { font-size: 1.2rem; padding: 15px; }

    .splash-text { font-size: 1.8rem; }
    .splash-img { max-height: 40vh; }
    .proceed-btn { font-size: 1.4rem; padding: 10px 30px; }
}







