body.text-gray-800 {
    background-color: #0c0c0c !important;
    font-family: 'New Tegomin', 'serif', 'Noto Serif JP', serif;
    overflow-x: hidden;
}

#settings-modal,
#settings-modal *,
#shinobi-rules-area,
#shinobi-rules-area * {
    font-family: 'sans-serif', 'Arial', sans-serif !important;
}

#setup-area {
    background-image: url('parchment.png');
    background-size: cover;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(27, 26, 26, 0.8), inset 0 0 100px rgba(0, 0, 0, 0.2);
    border: 8px double #3e1b0c;
    color: #3e1b0c !important;
    position: relative;
    z-index: 10;
}

#current-time-display {
    font-family: 'New Tegomin', serif;
    font-size: 5rem;
    /* text-7xl equivalent */
    color: rgba(255, 255, 255, 0.4);
    z-index: 100;
    font-weight: 100;
    /* font-thin */
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

#extra-area {
    margin-top: 1rem;
    color: #e53e3e;
    font-family: 'New Tegomin', serif;
    /* Red for extra time */
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.2em;
}

#mission-title {
    display: block;
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #a11;
    letter-spacing: 0.5em;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-style: italic;
}

#start-btn {
    background-color: #a11;
    border: 4px solid #3e1b0c;
    box-shadow: 0 5px 0 #500;
    font-weight: bold;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

#start-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #500;
}

/* --- Smoke Bomb Animation --- */
#smoke-bomb-item {
    position: fixed;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #4a4a4a, #000);
    border-radius: 50%;
    z-index: 110;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

@keyframes bomb-fly {
    0% {
        bottom: -50px;
        left: 10%;
        transform: rotate(0deg);
        opacity: 1;
    }

    50% {
        bottom: 50%;
        left: 50%;
        transform: rotate(360deg);
        opacity: 1;
    }

    100% {
        bottom: 45%;
        left: 50%;
        transform: rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes smoke-expansion {
    0% {
        transform: scale(0);
        opacity: 0;
        filter: blur(0px);
    }

    30% {
        transform: scale(3);
        opacity: 1;
        filter: blur(5px);
    }

    100% {
        transform: scale(4);
        opacity: 0;
        filter: blur(20px);
    }
}

.smoke-cloud {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #fff, #ddd 40%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 120;
    pointer-events: none;
    opacity: 0;
}

.smoke-active {
    animation: smoke-expansion 2.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.bomb-active {
    animation: bomb-fly 1s ease-out forwards;
}

/* Reuse existing animations from style.css */
@keyframes ink-splash {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
    }

    100% {
        transform: scale(5);
        opacity: 0;
    }
}

.ink-splash {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #000 10%, rgba(0, 0, 0, 0.4) 40%, transparent 70%);
    pointer-events: none;
    z-index: 10;
    animation: ink-splash 1.2s ease-out forwards;
}

.mist-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
    z-index: 5;
    animation: mist-move 10s infinite linear;
}

#stealth-status {
    font-family: 'New Tegomin', serif !important;
}

.shuriken-icon {
    width: 120px;
    height: 120px;
    fill: #fbbf24;
    animation: spin-slow 8s infinite linear;
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5));
}

/* --- Success Scroll Result --- */
.success-scroll-container {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.success-scroll-container.active {
    opacity: 1;
    pointer-events: auto;
}

#result-scroll-wrapper {
    position: relative;
    width: 340px;
    height: 0;
    background-image: url('shinobi/ninja1.png');
    background-size: cover;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    transition: height 1s cubic-bezier(0.19, 1, 0.22, 1);
    border-left: 2px solid #3e1b0c;
    border-right: 2px solid #3e1b0c;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.scroll-unfurled #result-scroll-wrapper {
    height: 600px;
    padding: 2.5rem 1.5rem;
}

.scroll-handle {
    position: absolute;
    width: 360px;
    height: 40px;
    background: #3e1b0c;
    border-radius: 20px;
    z-index: 210;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#scroll-handle-top {
    top: -10px;
    transition: top 1s cubic-bezier(0.19, 1, 0.22, 1);
}

#scroll-handle-bottom {
    bottom: -10px;
    transition: bottom 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.scroll-unfurled #scroll-handle-top {
    top: -10px;
}

.scroll-unfurled #scroll-handle-bottom {
    bottom: -10px;
}

/* In unfurled state, the wrapper grows. Handles are absolute to the container. 
   Top handle at top: -20px. Bottom handle at bottom: -20px. 
   Container height goes from 0 to 500px.
*/

/* Corrected Success Scroll */
.success-scroll-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

@keyframes scroll-vibration {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-2px);
    }
}

.scroll-unfurled .scroll-handle {
    animation: scroll-vibration 2s infinite ease-in-out;
}

/* --- Background Clouds --- */
.bg-cloud {
    position: fixed;
    background-image: url('kumo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

@keyframes cloud-drift {
    0% {
        transform: translateX(0) translateY(0);
    }

    50% {
        transform: translateX(30px) translateY(-10px);
    }

    100% {
        transform: translateX(0) translateY(0);
    }
}

.cloud-anim-1 {
    animation: cloud-drift 20s infinite ease-in-out;
}

.cloud-anim-2 {
    animation: cloud-drift 25s infinite ease-in-out reverse;
}

.cloud-anim-3 {
    animation: cloud-drift 30s infinite ease-in-out;
}