:root {
    --primary-color: #8E8098;
    /* Muted Lavender */
    --primary-op: rgba(142, 128, 152, 0.1);
    --secondary-color: #D8D2DE;
    /* Pale Lavender Grey */
    --accent-color: #A99F8D;
    /* Bronzey Gold */
    --text-color: #554E5A;
    /* Dark Grey Purple */
    --text-light: #96909A;
    --bg-color: #FDFCF8;

    /* Paper White */


    /* Radar Chart */

    --font-heading: 'Zen Old Mincho',
        serif;
    --font-body: 'Zen Kaku Gothic New',
        sans-serif;
    --font-script: 'Allura',
        cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.05em;
}

/* Texture Overlay */
.bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

/* Wave Container */
.wave-container-bg {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 432px;
    /* Fixed height (40vh of 1080p) to maintain scale */
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

/* Base Classes */
.wave-flow {
    position: absolute;
    bottom: 0;
    left: 0;
    /* Align to left to prevent gaps */
    width: 200%;
    min-width: 3840px;
    /* Force at least 1920px * 2 width */
    margin-left: 0;
    height: 100%;
    will-change: transform;
}

.wave-sway {
    width: 100%;
    height: 100%;
    background-repeat: repeat-x;
    background-position: bottom center;
    background-size: 50% 100%;
    /* Ensure SVG stretches correctly to match loop */
    will-change: transform;
}

/* Animations */
@keyframes flow {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes sway {
    0% {
        transform: translate3d(0, -10px, 0);
        /* Move slightly up */
    }

    100% {
        transform: translate3d(0, 40px, 0);
        /* Move down */
    }
}

/* Wave 1 (Back / Slowest) */
.wave-flow-1 {
    animation: flow 30s linear infinite;
    z-index: 0;
}

.wave-sway-1 {
    /* Pale Lavender */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'%3E%3Cpath d='M0,100 Q250,50 500,100 T1000,100 V200 H0 Z' fill='rgba(216, 210, 222, 0.4)'/%3E%3C/svg%3E");
    animation: sway 6s ease-in-out infinite alternate;
}

/* Wave 2 (Middle) */
.wave-flow-2 {
    animation: flow 22s linear infinite reverse;
    z-index: 1;
    bottom: -10px;
}

.wave-sway-2 {
    /* Muted Sage/Beige */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'%3E%3Cpath d='M0,100 Q250,150 500,100 T1000,100 V200 H0 Z' fill='rgba(169, 159, 141, 0.3)'/%3E%3C/svg%3E");
    animation: sway 8s ease-in-out infinite alternate-reverse;
}

/* Wave 3 (Front / Fastest) */
.wave-flow-3 {
    animation: flow 15s linear infinite;
    z-index: 2;
    bottom: -20px;
}

.wave-sway-3 {
    /* Primary Lavender */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'%3E%3Cpath d='M0,100 Q250,50 500,100 T1000,100 V200 H0 Z' fill='rgba(142, 128, 152, 0.25)'/%3E%3C/svg%3E");
    animation: sway 5s ease-in-out infinite alternate;
}

/* Layout */
#app {
    width: 100%;
    max-width: 480px;
    padding: 15px;
    /* Ensure gap allows background to show on mobile */
    margin: 0 auto;
}

.main-content {
    position: relative;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.6);
    /* 60% Opacity */
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(142, 128, 152, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align top instead of center */
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-height: auto;
    /* Allow height to fit content */
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 20px;
    /* Reduced bottom padding */
    margin-top: -15px;
    /* Pull closer to header */
    flex: 1;
    justify-content: flex-start;
    /* Align top */
}

.center-content {
    justify-content: center;
    /* Override for loading page */
    min-height: 50vh;
    /* Ensure some height to center within */
}

/* Typography Helpers */
.script-accent {
    font-family: var(--font-script);
    color: var(--accent-color);
    font-size: 1.8rem;
    display: block;
    margin-bottom: 5px;
}

.main-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 2.6rem;
    color: var(--text-color);
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.note {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 15px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
    }
}

.active-section {
    display: block;
}

.hidden-section {
    display: none;
}

.fade-in {
    animation: fadeIn 1s ease;
}

.fade-up {
    animation: fadeUp 1s ease;
}

/* Buttons */
.primary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 14px 40px;
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.4s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    background-color: var(--primary-color);
    color: #FFF;
}

.secondary-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    border-bottom: 1px solid #DDD;
    padding-bottom: 2px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 15px;
}

/* HERO */
.hero {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

#result-page .hero {
    margin-top: 40px;
    /* Spacer from logo specifically for result page */
}

.main-title-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 -20px;
    /* Reduced bottom margin */
    /* Expand beyond container padding */
    width: calc(100% + 40px);
    /* 100% + left/right padding (20+20) */
    max-width: unset;
    /* Allow it to exceed container width */
}

.hero-desc {
    font-size: 1.3rem;
    /* Distinctly larger (Catchcopy) */
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.8;
    letter-spacing: 0.1em;
    margin-bottom: 30px;
    /* More separation */
    font-feature-settings: 'palt';
    /* Optimize Japanese kerning */
}

.hero-message {
    font-size: 0.85rem;
    /* Distinctly smaller (Body) */
    color: var(--text-color);
    line-height: 1.8;
    max-width: 240px;
    /* Match visual width of hero-desc */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    /* Let parent .hero margin (30px) handle spacing */
    font-family: var(--font-body);
    /* Matches body default */
    font-weight: 400;
    /* Regular weight */
}

/* Text Highlight */
.text-highlight {
    color: var(--primary-color);
    font-weight: 700;
    background: linear-gradient(transparent 70%, rgba(142, 128, 152, 0.2) 70%);
    /* Marker effect */
}

.hero-visual {
    margin-bottom: 40px;
    position: relative;
    /* Anchor for watermark */
    z-index: 1;
    /* Ensure visual stays on top of waves if needed */
}

.bg-title-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: -1;
    /* Behind the frame */
    overflow: hidden;
    /* Prevent scrollbar if marquee extends */
    opacity: 0.1;
    /* Subtle watermark effect */
    pointer-events: none;
}

.marquee-track {
    display: flex;
    gap: 20px;
    font-family: var(--font-script);
    font-size: 4rem;
    /* Large text */
    color: var(--primary-color);
    white-space: nowrap;
    /* Optional: Add basic marquee animation if desired, but user only asked for position */
}

.visual-frame {
    width: 280px;
    height: 360px;
    border-radius: 140px 140px 0 0;
    /* Outer Arch */
    margin: 0 auto;
    position: relative;

    /* Frame Style */
    border: 1px solid var(--accent-color);
    /* Thicker border */
    padding: 12px;
    /* Whitespace between border and image */
    background-color: transparent;
    /* Transparent gap */

    box-shadow: 0 10px 40px rgba(142, 128, 152, 0.1);
}



/* Result Frame (Square Override with Force) */
/* Result Frame (Character Cutout Style) */
.visual-frame.result-frame {
    width: 100%;
    max-width: 320px;
    /* Standard mobile width */
    aspect-ratio: 1 / 1;
    /* Enforce Square */
    border-radius: 0 !important;
    /* Force square (no rounded corners) */
    margin: 0 auto 10px;
    /* Center horizontally and add minimal bottom spacing */
    border: none;
    /* No border for cutout */
    box-shadow: none;
    /* No shadow */
    padding: 0;
    /* No padding */
    background: transparent;
    background: transparent;
    position: relative;
    height: auto;
    /* Ensure height follows aspect-ratio */
}

.visual-frame.result-frame #result-image-placeholder {
    width: 100%;
    height: 100%;
    /* Fill the square */
    /* Removed min-height to prevent distortion/overflow */
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 128px 128px 0 0;
    /* Inner Arch */
    display: block;
    opacity: 0.95;
    filter: sepia(0.1);
    /* Slight vintage feel */
}

/* QUIZ PAGE */
.quiz-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 60px;
    /* Separated from logo */
}

.progress-indicator {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-top: 5px;
}

.progress-current {
    font-size: 1.4rem;
    color: var(--primary-color);
}

.progress-divider {
    margin: 0 5px;
    font-weight: 300;
}

/* Progress Bar - High Design Sparkle */
.progress-bar-container {
    width: 140%;
    /* Much wider */
    margin-left: -20%;
    /* Center it */
    height: 4px;
    background-color: #F0F0F0;
    border-radius: 4px;
    margin-top: 20px;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-bar-fill {
    height: 100%;
    /* Subtle gradient - Less flashy */
    background: linear-gradient(90deg, #D4C9D9 0%, var(--primary-color) 100%);
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: none;
    /* Removed shadow */
}

/* Sparkle Tip */
.progress-bar-fill::after {
    content: '✦';
    position: absolute;
    right: -7px;
    /* Adjusted center */
    top: 50%;
    transform: translateY(-56%);
    color: var(--accent-color);
    /* Bronze Gold */
    font-size: 1.1rem;
    /* Slightly larger */
    text-shadow: none;
    /* No glow */
    line-height: 1;
    z-index: 10;
    animation: gentlePulse 2s infinite ease-in-out;
}

@keyframes gentlePulse {

    0%,
    100% {
        opacity: 0.8;
        transform: translateY(-56%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-56%) scale(1.15);
    }
}

.question-card {
    text-align: center;
    width: 100%;
}

.restart-area {
    margin-top: 100px;
    /* Increased separation further */
    text-align: center;
    width: 100%;
}

#question-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    /* Slight increase */
    font-weight: 500;
    margin-bottom: 50px;
    color: var(--text-color);
    min-height: 5.5rem;
    /* More height for visual balance */
    display: flex;
    flex-direction: column;
    /* Stack text and underline */
    align-items: center;
    justify-content: center;
    /* Elegant Typography */
    letter-spacing: 0.08em;
    line-height: 1.6;
}

/* Elegant separated underline */
#question-text::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background-color: var(--accent-color);
    margin-top: 20px;
    /* Clear separation */
    opacity: 0.6;
}

/* Scale UI - Delicate Dots */
.scale-wrapper {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.label-neutral {
    font-size: 12px;
    /* Small text as requested */
    opacity: 0.85;
    /* Increased visibility */
    margin-top: 2px;
}

.scale-track {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scale-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #E0DEE5;
    z-index: -1;
}

.scale-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.scale-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FFF;
    border: 1px solid #CCC;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

/* Scale Buttons - Gradiation by Importance */
/* No (Strong) - Left */
.scale-btn:nth-child(1) {
    transform: scale(1.6);
    background-color: #F5F5F5;
    /* Slight emphasis */
}

/* No (Weak) */
.scale-btn:nth-child(2) {
    transform: scale(1.3);
}

/* Neutral */
.scale-btn:nth-child(3) {
    transform: scale(1.0);
    opacity: 0.7;
    /* Visually weaker */
}

/* Yes (Weak) */
.scale-btn:nth-child(4) {
    transform: scale(1.3);
}

/* Yes (Strong) - Right */
.scale-btn:nth-child(5) {
    transform: scale(1.6);
    background-color: #F5F5F5;
}

@media (hover: hover) {
    .scale-btn:hover {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        transform: scale(1.5);
    }
}

/* RESULT PAGE */
.result-header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 60px;
    /* Separated from logo */
}

.result-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.6rem;
    /* Slightly reduced main title for balance */
    color: var(--primary-color);
    letter-spacing: 0.1em;
    line-height: 1.4;
}

.result-catch {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.2rem;
}

.result-main-text {
    display: block;
    font-size: 1.4rem;
    /* Main emphasis */
    font-weight: 600;
}

.result-sub-title {
    display: inline-block;
    /* Allow padding/bg to wrap text tightly */
    font-size: 0.8rem;
    margin-top: 8px;
    /* Closer to main text */
    font-weight: 500;
    /* Slightly bolder for white text */
    background-color: var(--primary-color);
    /* Elliptical fill */
    color: #fff;
    padding: 2px 20px;
    border-radius: 50px;
    /* Elliptical shape */
    opacity: 1;
    /* Reset opacity for clear bg */
    letter-spacing: 0.05em;
}

.result-visual {
    /* Remove fixed dimensions to prevent overlap */
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    /* Removed bottom margin to pull chart closer */
    background-color: transparent;
}

.chart-box {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 10px;
    /* Reduced from 40px */
    position: relative;
}

.result-description {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 10px;
}

.result-description h3 {
    font-size: 1.15rem;
    /* Match detail-title size as requested */
    margin-bottom: 20px;
    font-family: var(--font-heading);
    color: var(--primary-color);
}

.result-details {
    margin-bottom: 0px;
    /* Reduced from 40px */
    text-align: left;
}

.detail-section {
    margin-bottom: 30px;
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
}

/* Symptoms: Clean & Informative */
.symptoms-section {
    background-color: #FFF;
    border: 1px solid #EAE8ED;
    /* Light Grey */
}

.symptoms-section .detail-title {
    color: var(--primary-color);
    font-size: 1.15rem;
    font-family: var(--font-heading);
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--accent-color);
    padding-bottom: 5px;
    display: inline-block;
    letter-spacing: 0.05em;
}

/* Self-Care: Warm & actionable */
.selfcare-section {
    background-color: #FAF9F6;
    border: 1px dashed var(--accent-color);
    /* Dashed accent */
}

.selfcare-section .detail-title {
    color: var(--primary-color);
    font-size: 1.15rem;
    font-family: var(--font-heading);
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--accent-color);
    padding-bottom: 5px;
    display: inline-block;
    letter-spacing: 0.05em;
}

/* Base List Style (Shared) */
.detail-list {
    list-style: none;
    padding-left: 0;
    text-align: left;
}

/* Matrix Styles */
.matrix-box {
    width: 100%;
    max-width: 280px;
    margin: 40px auto;
    position: relative;
    aspect-ratio: 1/1;
}

.matrix-container {
    width: 100%;
    height: 100%;
    position: relative;
    /* 4 Quadrants Background - Soft/Watercolor feel */
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%),
        conic-gradient(from 0deg,
            rgba(230, 222, 210, 0.4) 0deg 90deg,
            rgba(215, 218, 230, 0.4) 90deg 180deg,
            rgba(232, 209, 209, 0.4) 180deg 270deg,
            rgba(210, 230, 225, 0.4) 270deg 360deg);
    border: 1px solid rgba(142, 128, 152, 0.2);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5);
}

.matrix-axis {
    position: absolute;
    border: 0.5px dashed var(--accent-color);
    /* Dashed lines */
    background-color: transparent;
    /* Remove solid bg */
    opacity: 0.4;
}

.axis-y {
    top: 10%;
    bottom: 10%;
    left: 50%;
    border-left: 1px dashed var(--accent-color);
    width: 0;
    transform: translateX(-50%);
}

.axis-x {
    left: 10%;
    right: 10%;
    top: 50%;
    border-top: 1px dashed var(--accent-color);
    height: 0;
    transform: translateY(-50%);
}

.matrix-label {
    position: absolute;
    font-size: 0.8rem;
    color: var(--text-color);
    font-family: var(--font-heading);
    /* Serif font */
    letter-spacing: 0.05em;
    /* White Ellipse Style */
    background-color: #fff;
    padding: 2px 12px;
    border-radius: 99px;
    box-shadow: 0 2px 5px rgba(142, 128, 152, 0.2);
    white-space: nowrap;
    z-index: 5;
}

.label-top {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}

.label-bottom {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
}

.label-left {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
}

.label-right {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
}

.matrix-pin {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px rgba(142, 128, 152, 0.2), 0 0 10px rgba(142, 128, 152, 0.4);
    /* Initial position (center), updated by JS */
    top: 50%;
    left: 50%;
    /* Bounce effect */
    z-index: 2;
    animation: pin-pulse 2s infinite;
}

@keyframes pin-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(142, 128, 152, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(142, 128, 152, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(142, 128, 152, 0);
    }
}

.pin-text {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: #fff;
    font-family: var(--font-heading);
    /* Serif */
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    /* More rounded */
    white-space: nowrap;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pin-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--primary-color);
}


.matrix-area-label {
    position: absolute;
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.8;
    font-weight: 500;
}

.area-tl {
    top: 25%;
    left: 25%;
    transform: translate(-50%, -50%);
}

.area-tr {
    top: 25%;
    right: 25%;
    transform: translate(50%, -50%);
}

.area-bl {
    bottom: 25%;
    left: 25%;
    transform: translate(-50%, 50%);
}

.area-br {
    bottom: 25%;
    right: 25%;
    transform: translate(50%, 50%);
}

.detail-list li {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 12px;
    position: relative;
    padding-left: 1.4em;
    color: var(--text-color);
}

.detail-list li::before {
    content: "✦";
    /* Elegant diamond/star bullet */
    color: var(--accent-color);
    position: absolute;
    left: 0;
    top: 1px;
    font-size: 0.8rem;
}

.deco-line {
    display: inline-block;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 5px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-light);
}

#result-desc {
    text-align: justify;
    text-justify: inter-ideograph;
}

.result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Loading - Elegant Ring */
.loading-ring {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.loading-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 50px;
    height: 50px;
    margin: 6px;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    animation: loading-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--primary-color) transparent transparent transparent;
}

.loading-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.loading-ring div:nth-child(2) {
    animation-delay: -0.3s;
}

.loading-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loading-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--primary-color);
}

.loading-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* Nav Buttons */
.quiz-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.nav-btn {
    background: transparent;
    border: 1px solid #CCC;
    color: var(--text-light);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.nav-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-link {
    background: none;
    border: none;
    color: #AAA;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* Site Header */
.site-header {
    width: 100%;
    padding: 25px 0 10px;
    text-align: center;
}

.logo-box {
    width: 150px;
    height: 50px;
    /* Placeholder size */
    margin: 0 auto;
    /* background-color: #F0F0F0; Removed placeholder color */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.site-logo {
    max-width: 100%;
    max-height: 100%;
}

/* Site Footer */
.site-footer {
    width: 100%;
    padding: 40px 20px 30px;
    text-align: center;
    margin-top: auto;
}

.copyright {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 15px;
    letter-spacing: 0.05em;
}

.footer-link {
    font-size: 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 2px;
    transition: all 0.3s;
}

.footer-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .main-content {
        background-color: rgba(255, 255, 255, 0.6);
        /* backdrop-filter removed */
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: none;
        width: 100%;
        margin: 0 0 120px 0;
        border-radius: 20px;
        min-height: auto;
    }

    .wave-container-bg {
        /* height: 50vh; Removed to keep fixed px height */
        opacity: 1;
        /* Maximum visibility */
        z-index: -1;
    }
}

/* Slider Styles */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 128px 128px 0 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    text-justify: inter-ideograph;
}

.result-details {
    margin-bottom: 0px;
    /* Removed margin to bring share area closer */
    text-align: left;
}

.detail-section:last-child {
    margin-bottom: 30px;
    /* Restored to default for consistent spacing */
}

/* Share Area - Integrated Elegant Design */
.result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding: 30px;
    background: #FFF;
    border-radius: 16px;
    /* Slightly tighter radius */
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--secondary-color);
    /* Subtle Lavender Grey border */
    position: relative;
    /* Removed heavy shadow for a cleaner look, or keep very subtle */
    box-shadow: 0 4px 15px rgba(142, 128, 152, 0.08);
}

.share-title {
    font-size: 1.0rem;
    color: var(--text-color);
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
    font-weight: 500;
    position: relative;
    display: inline-block;
}

/* Simple accent underline */
.share-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 1px;
    background-color: var(--accent-color);
    margin: 8px auto 0;
}

.share-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.restart-area {
    margin-top: 50px;
    /* Reduced separation */
    text-align: center;
    width: 100%;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* Circle shape */
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    padding: 12px;
    /* Add padding so image doesn't touch edges */
}

.share-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* remove drop-shadow as background provides contrast */
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Restore Background Colors */
.btn-x {
    background-color: #000;
}

.btn-x .share-icon-img {
    transform: scale(0.7);
    /* Visually adjust to match other icons */
}

.btn-insta {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.btn-line {
    background-color: #06C755;
}

/* Loading Page Layout */
#loading-page {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-height: 50vh;
    /* Ensure minimum height */
}

#loading-page.active-section {
    display: flex;
}

/* Loading - Elegant Ring */
.loading-ring {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.loading-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 50px;
    height: 50px;
    margin: 6px;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    animation: loading-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--primary-color) transparent transparent transparent;
}

.loading-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.loading-ring div:nth-child(2) {
    animation-delay: -0.3s;
}

.loading-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loading-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--primary-color);
}

.loading-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* Nav Buttons */
.quiz-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.nav-btn {
    background: transparent;
    border: 1px solid #CCC;
    color: var(--text-light);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.nav-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-link {
    background: none;
    border: none;
    color: #AAA;
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    /* Added pointer */
}

/* Site Header */
.site-header {
    width: 100%;
    padding: 25px 0 10px;
    text-align: center;
}

.logo-box {
    width: 200px;
    height: auto;
    /* Placeholder size */
    margin: 0 auto;
    /* background-color: #F0F0F0; Removed placeholder color */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.site-logo {
    max-width: 100%;
    max-height: 100%;
}

/* Site Footer */
.site-footer {
    width: 100%;
    padding: 40px 20px 30px;
    text-align: center;
    margin-top: auto;
}

.copyright {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 15px;
    letter-spacing: 0.05em;
}

.footer-link {
    font-size: 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 2px;
    transition: all 0.3s;
}

.footer-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .main-content {
        background-color: rgba(255, 255, 255, 0.6);
        /* backdrop-filter removed */
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: none;
        width: 100%;
        margin: 0 0 120px 0;
        border-radius: 20px;
        min-height: auto;
    }

    .wave-container-bg {
        height: 50vh;
        /* Taller waves */
        opacity: 1;
        /* Maximum visibility */
        z-index: -1;
    }
}

/* Slider Styles */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 128px 128px 0 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-slide.active-slide {
    opacity: 1;
    z-index: 2;
}

/* Background Title Watermark (Scrolling) */
.bg-title-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Keeps it centered vertically within the frame */
    z-index: 0;
    /* Behind slides */

    /* Full width of the app/page, unrelated to frame width */
    width: 100vw;
    max-width: 480px;
    /* Match app max-width */
    height: 100%;
    /* Match hero-visual height */

    display: flex;
    align-items: center;
    overflow: hidden;
    /* Crop text outside frame */
    pointer-events: none;
    mix-blend-mode: multiply;
}

.btn-download {
    background-color: #fff;
    /* White background */
    display: flex !important;
    /* Ensure flex */
    display: inline-flex !important;
    /* inline-flex to fit content */
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Space between icon and text */

    color: #5d6d7e;
    /* Muted blue-gray text */
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;

    width: auto;
    /* max-width removed to allow natural pill shape */
    margin-top: 15px;
    padding: 12px 40px;
    /* Wider padding for pill look */

    border: 1px solid #cbd5e1;
    /* Silver border */
    border-radius: 50px;
    /* Pill shape */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.btn-download:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    opacity: 1;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    animation: marqueeScroll 60s linear infinite;
    /* Speed up to 1/3 of 30s */
    width: max-content;
    /* Allow content to dictate width */
}

.marquee-track span {
    font-family: var(--font-heading);
    /* Reverted to Zen Old Mincho */
    font-style: normal;
    font-weight: 500;
    /* slightly bolder for visibility */
    font-size: 5rem;
    /* Increased size for impact */
    color: rgba(169, 159, 141, 0.12);
    /* Slightly increased opacity from 0.08 */
    padding-right: 0.8em;
    /* Adjusted spacing */
}

/* Hero Decorations (Corner Accents) */
/* Hero Decorations (Corner Accents) */
.hero-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.deco-tl,
.deco-tr,
.deco-br,
.deco-bl {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 1px solid var(--accent-color);
    opacity: 0.8;
}

.deco-tl {
    top: -8px;
    left: -8px;
    border-right: none;
    border-bottom: none;
}

.deco-tr {
    top: -8px;
    right: -8px;
    border-left: none;
    border-bottom: none;
}

.deco-br {
    bottom: -8px;
    right: -8px;
    border-top: none;
    border-left: none;
}

.deco-bl {
    bottom: -8px;
    left: -8px;
    border-top: none;
    border-right: none;
}

/* Dots - simplified positioning relative to corners */
.deco-tl::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 4px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.deco-tr::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 4px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.deco-br::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 4px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.deco-bl::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 4px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Move half way if contents are doubled to loop seamless */
    }
}

@media (max-width: 480px) {
    .marquee-track span {
        font-size: 3rem;
    }
}

/* CV Area Styles - Premium & High Conversion */
.cv-container {
    margin-bottom: 15px;
    /* Reduced to bring buttons closer */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.cv-pop {
    background: var(--primary-color);
    /* Muted Lavender */
    color: #FFF;
    font-size: 0.8rem;
    /* Reduced from 0.95rem */
    font-weight: bold;
    padding: 6px 15px;
    /* Reduced from 8px 20px */
    border-radius: 50px;
    position: relative;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(142, 128, 152, 0.4);
    animation: bounce 2s infinite ease-in-out;
    letter-spacing: 0.05em;
    z-index: 2;
}

.cv-pop::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.cv-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%;
    max-width: 340px;
    /* Champagne Gold Gradient - Elegant & Impactful */
    background: linear-gradient(135deg, #CDBBA7 0%, #A99F8D 50%, #8C8270 100%);
    color: #FFF;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 18px 24px;
    border-radius: 0;
    /* Rectangle */
    box-shadow: 0 8px 25px rgba(169, 159, 141, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Shine effect */
.cv-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-20deg);
    animation: shine 3.5s infinite;
}

.cv-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(169, 159, 141, 0.5);
    /* Bronze shadow */
    opacity: 1;
}

/* Arrow icon (CSS only) */
.cv-btn::after {
    content: '→';
    margin-left: 10px;
    font-family: sans-serif;
    font-weight: bold;
    transition: transform 0.2s;
}

.cv-btn:hover::after {
    transform: translateX(4px);
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    15% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

/* Adjust primary btn to have less emphasis compared to CV btn and ensure proper spacing */
#restart-btn {
    font-size: 0.95rem;
    /* Slightly larger */
    opacity: 1;
    /* Removed transparency */
    background: transparent;
    color: var(--text-color);
    /* Darker text */
    border: 1px solid #CCC;
    /* Slightly darker border */
    padding: 12px 24px;
    box-shadow: none;
    margin-top: 10px;
    /* Reduced spacing */
    border-radius: 0;
    /* Rectangle */
    transition: all 0.2s;
}

#restart-btn:hover {
    background: rgba(142, 128, 152, 0.05);
    /* Very subtle hover bg */
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Mobile Optimizations for spacing */
/* Mobile Optimizations for spacing */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
        padding-top: 0;
        /* Handled by #app margin */
    }

    .restart-area {
        margin-top: 50px;
    }

    .container {
        padding-bottom: 20px;
    }

    #app {
        padding: 0 10px;
        margin: 20px auto;
        /* 20px Top/Bottom as requested */
    }

    .main-content {
        margin-bottom: 0;
        min-height: calc(100vh - 40px);
        /* 100vh - 20px top - 20px bottom */
    }
}

/* Prescription Section - Premium Medical Design */
.prescription-section {
    background: linear-gradient(180deg, #FFFCF5 0%, #FDFCF8 100%);
    border: 2px solid #A99F8D;
    /* Thicker border */
    padding: 30px 20px !important;
    /* Deep shadow for "lift" effect */
    box-shadow: 0 15px 40px rgba(169, 159, 141, 0.3), 0 5px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 10;
    /* Ensure it sits above others visually */
    border-radius: 16px;
    /* Slightly more rounded */
    transform: scale(1.02);
    /* Subtle scale up */
    margin: 40px 0;
    /* Extra spacing to isolate it */
}

.prescription-section::before {
    content: "Medical";
    position: absolute;
    top: -10px;
    right: -10px;
    font-family: var(--font-script);
    font-size: 4rem;
    color: var(--accent-color);
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.prescription-title-main {
    font-size: 1.4rem;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.6;
    display: block;
    text-align: center;
}

.prescription-title-sub {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 10px;
    font-weight: normal;
}

.prescription-highlight {
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 2px;
}

/* Prescription Button */
/* Prescription Button - Champagne Gold */
.prescription-btn {
    display: block;
    width: 100%;
    /* Luxury Gradient */
    background: linear-gradient(to right, #fff 0%, #fdfbf7 100%);
    border: 1px solid #D8D2DE;
    border-left: 5px solid #A99F8D;
    /* Bronze accent */

    padding: 22px 20px;
    text-decoration: none;
    border-radius: 8px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    /* Ensure all content aligns left */

    /* Soft Shadow */
    box-shadow: 0 4px 12px rgba(169, 159, 141, 0.1), inset 0 1px 0 #fff;
    margin-top: 25px;
    overflow: hidden;
}

.prescription-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.prescription-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(169, 159, 141, 0.25);
    background: #fff;
    border-color: #B8A892;
}

.prescription-btn:hover::before {
    transform: translateX(100%);
}

.prescription-btn-text {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    color: #554E5A;
    margin-bottom: 8px;
    text-align: left;
}

.presc-sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: #888;
    margin-bottom: 2px;
    font-family: var(--font-body);
}

.presc-main {
    font-size: 1.3rem;
    /* Larger title */
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-heading);
    line-height: 1.3;
    white-space: nowrap;
}

/* Button-like styling for the interaction cue */
.prescription-btn-arrow {
    display: inline-block;
    background-color: #A99F8D;
    /* Accent bronze */
    color: #FFF !important;
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(169, 159, 141, 0.2);
    /* Ensure arrow is white */
}

.prescription-btn-arrow::after {
    content: "\2192";
    margin-left: 8px;
    color: #FFF;
    transition: margin-left 0.3s;
}

.prescription-btn:hover .prescription-btn-arrow {
    background-color: #8C8270;
    /* Darker on hover */
    transform: translateX(4px);
    box-shadow: 0 6px 12px rgba(169, 159, 141, 0.3);
}

.prescription-btn:hover .prescription-btn-arrow::after {
    margin-left: 12px;
}