:root {
    --primary-color: #B22222;
    /* Vermilion (Shoujouhi) - Torii Gate Red */
    --secondary-color: #2F2F4F;
    /* Deep Purple (Kon) - Night Sky */
    --bg-color: #FDFCF8;
    /* Washi White */
    --accent-color: #D4AF37;
    /* Gold */
    --text-color: #333333;
    /* Sumi Ink */
    --border-color: #E0D8CC;
    --card-shadow: 0 4px 15px rgba(47, 47, 79, 0.1);
}

body {
    font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
    background-color: #e6e6e6;
    /* Fallback */
    background-image: url('../images/shrine_bg.png');
    background-repeat: repeat;
    background-size: 300px;
    /* Adjust scale of texture */
    margin: 0;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.8;
}

.fortune-app-wrapper {
    max-width: 900px;
    margin: 3rem auto;
    background: rgba(255, 255, 255, 0.92);
    /* Slight translucency for washi feel */
    padding: 3rem;
    border-radius: 4px;
    /* Traditional paper is not very rounded */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    position: relative;
    /* Decorative borders (simulated with box-shadow or simple border) */
    border-top: 5px solid var(--primary-color);
    border-bottom: 5px solid var(--primary-color);
}

/* Header */
.fortune-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.fortune-header h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 10px;
}

.fortune-header p {
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 500;
}

/* Input Area */
.fortune-input-area {
    background: #fff;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

/* Decorate corners or style like a talisman/ema */
.fortune-input-area::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid var(--primary-color);
    pointer-events: none;
    opacity: 0.3;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.input-group input[type="date"] {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    border: 1px solid var(--secondary-color);
    background: #fff;
    border-radius: 0;
    /* Traditional look */
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    color: var(--secondary-color);
}

.input-group input[type="date"]:focus {
    border-color: var(--primary-color);
    background: #fffafa;
}

/* Button - Seal Style */
.diagnose-btn {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    padding: 1rem 3.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 0;
    /* Square seal style */
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--secondary-color);
    /* Retro shadow */
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.1em;
}

.diagnose-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--secondary-color);
    background: #a01f1f;
}

/* Results */
.fortune-results-container {
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Result Section is just a container now */

/* Result Section Headers */
.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 1rem;
}

.result-header .icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.result-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.result-summary {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.highlight-text {
    font-size: 2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    font-weight: bold;
    padding: 0 10px;
}

/* Nine Star Grid - Responsive */
/* Nine Star Grid - Vertical Block Layout */
.ns-grid {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    gap: 30px;
    margin: 40px 0;
}

.ns-item {
    background: #fff;
    padding: 2rem;
    border: 1px solid var(--border-color);
    text-align: left;
    /* Left align for cleaner block look */
    position: relative;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ns-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
    border-color: var(--accent-color);
}

.ns-item::after {
    /* Top accent bar */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.ns-label {
    display: inline-block;
    font-size: 1rem;
    color: white;
    background: var(--primary-color);
    padding: 5px 15px;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
    border-radius: 4px;
    /* Label style */
}

.ns-value {
    display: block;
    font-size: 1.5rem;
    /* Larger for emphasis */
    color: var(--secondary-color);
    font-weight: bold;
    line-height: 1.5;
    width: 100%;
}

/* Guardian Deity Section */
#ns-guardian-image-container {
    margin-top: 15px;
    border: 5px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

#ns-guardian-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Details Section */
.ns-details {
    background: #fffafa;
    /* Very light pinkish white */
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    margin-top: 3rem;
    position: relative;
}

/* Japanese vertical text feel for headers (optional, kept horizontal for web usable) */
.ns-details h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.4rem;
    color: var(--secondary-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.ns-feature-list li {
    margin-bottom: 1.2rem;
    line-height: 1.8;
    border-bottom: 1px dashed #ddd;
    /* Washi tear line */
    padding-bottom: 1.2rem;
}

.ns-feature-list li strong {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.1rem;
}

/* 2026 Fortune Special Style */
#ns-fortune-2026 {
    background: #fffbf0 !important;
    /* Creamy background */
    border: 2px solid var(--accent-color) !important;
    position: relative;
}

#ns-fortune-2026::before {
    /* Corner decoration (gold leaf) */
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    border-top: 3px solid var(--accent-color);
    border-left: 3px solid var(--accent-color);
}

#ns-fortune-2026::after {
    /* Corner decoration */
    content: '';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-bottom: 3px solid var(--accent-color);
    border-right: 3px solid var(--accent-color);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .fortune-app-wrapper {
        padding: 1.5rem;
        margin: 1rem;
    }

    .fortune-header h2 {
        font-size: 1.8rem;
    }

    .result-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .diagnose-btn {
        width: 100%;
        padding: 1rem;
    }

    .tab-content-area {
        padding: 1.5rem;
    }

    #ns-fortune-2026>div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .ns-item {
        padding: 1.5rem;
        /* Slightly less padding on mobile */
    }

    .ns-label {
        font-size: 0.9rem;
        /* Adjust for mobile */
    }

    .ns-value {
        font-size: 1.3rem;
        word-break: break-all;
        /* Prevent overflow */
    }
}