:root {
    --primary: #d32f2f;
    --gold: #ffb300;
    --bg-overlay: rgba(255, 248, 240, 0.85);
    --text-dark: #3e2723;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    color: var(--text-dark);
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.title-font {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    background-color: var(--bg-overlay);
    backdrop-filter: blur(3px);
}

/* --- Ritual Area (Top 65%) --- */
.ritual-area {
    position: relative;
    height: 65%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#hand {
    height: 90%;
    max-width: 100%;
    object-fit: contain;
    transform: translateY(-10%);
    z-index: 10;
}

#wrist-target {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    z-index: 20;
    cursor: pointer;
}

#tied-rakhi {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: auto;
    z-index: 15;
    pointer-events: none;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.diya-container {
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 80px;
    height: 80px;
    z-index: 25;
}

#diya {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

#diya-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 3;
}

.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,179,0,0.8) 0%, rgba(255,179,0,0) 70%);
    z-index: 1;
    border-radius: 50%;
    transition: all 1s ease-out;
}

.glow.active {
    width: 250px;
    height: 250px;
    animation: flicker 3s infinite alternate;
}

/* --- Bottom Panel (Bottom 35%) --- */
.bottom-panel {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 35%;
    background: white;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.step-content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    animation: fadeIn 0.4s ease-out forwards;
}

.step-content.active {
    display: flex;
}

.step-content h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.step-content p {
    color: #666;
    font-size: 0.95rem;
}

.rakhi-selector {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.rakhi-btn {
    background: #fff8f0;
    border: 2px solid #ffe0b2;
    border-radius: 15px;
    padding: 10px;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rakhi-btn img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rakhi-btn:active {
    transform: scale(0.95);
    border-color: var(--primary);
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 20px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.primary-btn:active {
    transform: scale(0.98);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.button-group .primary-btn {
    margin-top: 0;
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
}

.secondary-btn:active {
    transform: scale(0.98);
    background-color: rgba(211, 47, 47, 0.05);
}

.pulse-target {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
    animation: pulse 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes pulse {
    to { box-shadow: 0 0 0 30px rgba(211, 47, 47, 0); }
}

@keyframes flicker {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    100% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.95); }
}