/* =========================
   GLOBAL
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #111;
    font-family: 'Crimson Text', serif;
    color: #C1C1C1;
    font-size: 14px;
    letter-spacing: 0.5px;
    line-height: 1.5;
    display: block; 
}


/* =========================
   MAIN RITUAL CONTAINER
========================= */

.ritual-page {
    width: min(700px, 92vw);
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 10px;
    max-width: 100%;
}

/* =========================
   TITLE (CRIMSON TEXT)
========================= */

.ritual-title {
    font-family: 'Crimson Text', serif;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 2px;
    color: #e44e53;
    text-shadow:
        0 0 6px rgba(228, 78, 83, 0.6),
        0 0 18px rgba(228, 78, 83, 0.4);
    margin: 0;
}

.title2 {
    font-size: 18px;
    font-family: 'UnifrakturCook', serif;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    display: inline-flex;
    align-items: center;
}

/* =========================
   Circles
========================= */

.ritual-stage {
    position: relative;
    width: min(500px, 92vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

/* ALL LAYERS */
.pentagram,
.ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ROTATION */
.ring-under {
    z-index: 0;
    animation: slow-spin 240s linear infinite reverse;
}

.ring-over {
    z-index: 2;
    animation: slow-spin 180s linear infinite;
}

/* RUNES */
.rune {
    position: absolute;
    width: 100px;
    height: 100px;
    object-fit: contain;
    transform: translate(-50%, -50%);
    z-index: 3;
      filter:
        drop-shadow(0 0 6px rgba(255,255,255,0.25))
        drop-shadow(0 0 14px rgba(0,0,0,0.25));
}

.rune1 { top: 86%; left: 50%; }   /* bottom apex (main point) */
.rune2 { top: 60%; left: 16%; }   /* upper-left */
.rune3 { top: 15%; left: 24%; }   /* top point */
.rune4 { top: 15%; left: 76%; }   /* upper-right */
.rune5 { top: 60%; left: 87%; }   /* inner lower center */


@keyframes slow-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.theme-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px; 
}

/* =========================
   REROLL ANIMATION
========================= */

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

.rune-refresh {
    animation: summonFlash 0.25s ease;
}

/* =========================
   BUTTON
========================= */

#reroll-button,
#invoke-button {
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #2a2a2a;
    padding: 8px 14px;
    font-family: 'Crimson Text', serif;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.15s ease,
                background 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease;
}
    


#reroll-button:hover,
#invoke-button:hover {
    border-color: #888;
    box-shadow: 0 0 8px rgba(255,255,255,0.15);
}


/* TITLE */
.blue-theme .ritual-title {
    color: #4771C5;
    text-shadow:
        0 0 6px rgba(71,113,197,0.6),
        0 0 18px rgba(71,113,197,0.4);
}



/* TOGGLE TEXT */
.blue-theme #theme-text {
    color: #4771C5;
    text-shadow:
        0 0 4px #4771C5,
        0 0 10px #4771C5,
        0 0 20px #4771C5;
}

/* BASE COLORS (RED THEME DEFAULT) */
#theme-text .text-red {
    color: #e44e53;
    text-shadow: 0 0 6px rgba(228, 78, 83, 0.6);
}

#theme-text .text-blue {
    color: #4771C5;
    text-shadow: 0 0 6px rgba(71, 113, 197, 0.6);
}

/* VISIBILITY CONTROL */
#theme-text .text-blue {
    display: none;
}

body.blue-theme #theme-text .text-red {
    display: none;
}

body.blue-theme #theme-text .text-blue {
    display: inline;
}

/* RED MODE (explicit reset so switching is clean) */
.ritual-title,
.ring,
.pentagram,
#theme-text {
    transition: all 0.4s ease;
}

/* =========================
   CYBER TOGGLE
========================= */

.cyber-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    cursor: pointer;
    margin-bottom: 0px;
}

.cyber-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cyber-toggle span {
    position: absolute;
    inset: 0;
    background: #171717;
    border-radius: 50px;
    border: 2px solid #e44e53;
    box-shadow:
        0 0 8px rgba(228, 78, 83, 0.6),
        inset 0 0 6px rgba(0,0,0,0.8);
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.cyber-toggle span::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    background: #e44e53;
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(228, 78, 83, 0.8),
        inset 0 0 4px rgba(255,255,255,0.3);
    transition:
        transform 0.35s ease,
        background 0.35s ease,
        box-shadow 0.35s ease;
}

.cyber-toggle input:checked + span {
    border-color: #4771C5;
    box-shadow:
        0 0 10px rgba(71, 113, 197, 0.8),
        inset 0 0 6px rgba(0,0,0,0.8);
}

.cyber-toggle input:checked + span::before {
    transform: translate(28px, -50%);
    background: #4771C5;
    box-shadow:
        0 0 12px rgba(71, 113, 197, 0.9),
        inset 0 0 4px rgba(255,255,255,0.3);
}

/* DEFAULT (RED THEME ACTIVE) */
#theme-text .text-blue {
    display: none;
}

#theme-text .text-red {
    display: inline;
}

/* BLUE THEME OVERRIDE */
body.blue-theme #theme-text .text-red {
    display: none;
}

body.blue-theme #theme-text .text-blue {
    display: inline;
}


/* =========================
   FOOTER
========================= */

.ritual-footer {
    width: 100%;
    margin: 0;
    padding: 6px 0 0 0; 
    border-top: 1px dashed #333;
    font-size: 13px;
}

.ritual-footer a {
    color: #ccc;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s ease;
}

.ritual-footer a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(228, 78, 83, 0.5);
}


/* =========================
   MOBILE
========================= */

@media (max-width: 500px) {

    .ritual-page {
        padding: 0;         
        margin: 10px auto;  
        border: none;        
    }

    .ritual-stage {
        width: 92vw;
        height: 92vw;
    }

    .ritual-title {
        margin-top: 10px;
        font-size: 28px;
    }
    
     .rune {
        width: clamp(54px, 14vw, 80px);
        height: clamp(54px, 14vw, 80px);
    }
    
}