/* SWELL Compatibility & Reset */
#seo-diagnosis-app {
    /* Scoped Variables */
    --app-primary: #00a381;
    /* ThinkMove Teal */
    --app-primary-dark: #007a61;
    /* Darker Teal */
    --app-accent: #f59e0b;
    /* Amber 500 (Keep for contrast) */
    --app-bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    /* Teal-ish tint */
    --app-glass-bg: rgba(255, 255, 255, 0.9);
    --app-glass-border: rgba(0, 163, 129, 0.2);
    --app-text-main: #1e293b;
    /* Slate 800 */
    --app-text-sub: #64748b;
    /* Slate 500 */
    --app-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --app-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --app-radius-lg: 24px;
    --app-radius-md: 12px;
    --app-font: 'Noto Sans JP', sans-serif;

    font-family: var(--app-font);
    color: var(--app-text-main);
    line-height: 1.6;
    position: relative;
    width: 100%;
    max-width: 800px;
    /* Slightly wider for premium feel */
    margin: 0 auto;
    padding: 40px 20px;
    overflow: hidden;
    background: transparent;
    /* Let site bg show or handle via shapes */
}

/* Reset inside app */
#seo-diagnosis-app * {
    box-sizing: border-box;
}

#seo-diagnosis-app button {
    font-family: var(--app-font);
}

/* Background Shapes */
#seo-diagnosis-app .bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.6;
}

#seo-diagnosis-app .shape-1 {
    width: 300px;
    height: 300px;
    background: #ccfbf1;
    /* Teal 100 */
    top: -50px;
    left: -50px;
}

#seo-diagnosis-app .shape-2 {
    width: 250px;
    height: 250px;
    background: #fef3c7;
    /* Amber 100 */
    bottom: 50px;
    right: -50px;
}

#seo-diagnosis-app .shape-3 {
    width: 150px;
    height: 150px;
    background: #d1fae5;
    /* Emerald 100 */
    top: 40%;
    left: 20%;
}

/* Layout & Screens */
#seo-diagnosis-app .app-container {
    position: relative;
    min-height: 600px;
}

#seo-diagnosis-app .screen {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}

#seo-diagnosis-app .screen.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    pointer-events: none;
    visibility: hidden;
}

#seo-diagnosis-app .screen.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
    position: relative;
    /* Restore flow */
}

/* Glass Card Style */
#seo-diagnosis-app .glass-card {
    background: var(--app-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--app-glass-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-lg);
    padding: 40px;
}

/* Hero Section */
#seo-diagnosis-app .hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#seo-diagnosis-app .hero-badge {
    background: #e0e7ff;
    color: var(--app-primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
}

#seo-diagnosis-app .main-title {
    margin-bottom: 32px;
}

#seo-diagnosis-app .main-title .sub {
    display: block;
    font-size: 1.1rem;
    color: var(--app-text-sub);
    margin-bottom: 8px;
    font-weight: 700;
}

#seo-diagnosis-app .main-title .main {
    display: block;
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.2;
    background: linear-gradient(135deg, #007a61 0%, #00a381 50%, #2dd4bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#seo-diagnosis-app .visual-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #ccfbf1 0%, #e0f2fe 100%);
    animation: pulse 3s infinite ease-in-out;
}

/* Hero Visual 3D */
#seo-diagnosis-app .hero-visual-3d {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 40px;
    perspective: 1000px;
}

#seo-diagnosis-app .floating-item {
    position: absolute;
    font-size: 5rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    animation: float 6s ease-in-out infinite;
    z-index: 2;
}

#seo-diagnosis-app .item-1 {
    top: 20%;
    left: 35%;
    font-size: 6rem;
    animation-delay: 0s;
    transform: rotate(-10deg);
}

#seo-diagnosis-app .item-2 {
    top: 10%;
    right: 10%;
    font-size: 3rem;
    animation-delay: -2s;
    transform: rotate(15deg);
    font-weight: 900;
}

/* SEO 10 Types Visual */
#seo-diagnosis-app .types-visual {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 32px auto;
}

#seo-diagnosis-app .types-group-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 163, 129, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: imageFloat 4s ease-in-out infinite;
}

@keyframes imageFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow:
            0 20px 60px rgba(0, 163, 129, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    50% {
        transform: translateY(-10px) scale(1.02);
        box-shadow:
            0 30px 70px rgba(0, 163, 129, 0.35),
            0 0 0 1px rgba(255, 255, 255, 0.2);
    }
}

/* Confetti */
#seo-diagnosis-app #confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    border-radius: var(--app-radius-lg);
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    animation: fall linear forwards;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(-10deg);
    }

    50% {
        transform: translateY(-20px) rotate(-5deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.8;
    }
}

/* Type Ticker */
#seo-diagnosis-app .type-ticker-container {
    width: 100%;
    max-width: 500px;
    /* Wider */
    margin: 0 auto 32px;
    /* More space */
    overflow: hidden;
    position: relative;
    height: 40px;
    /* Explicit height */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    background: rgba(0, 163, 129, 0.05);
    /* Slight background to show existence */
    border-radius: 20px;
    display: flex;
    align-items: center;
}

#seo-diagnosis-app .type-ticker-track {
    display: flex;
    gap: 20px;
    /* More gap */
    width: max-content;
    animation: ticker-scroll 25s linear infinite;
    padding: 0 20px;
    /* Padding */
}

#seo-diagnosis-app .ticker-item {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--app-primary-dark);
    /* Darker for contrast */
    background: #fff;
    padding: 6px 16px;
    border-radius: 99px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 163, 129, 0.15);
    /* Teal shadow */
    border: 1px solid rgba(0, 163, 129, 0.1);
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

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

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

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

@keyframes fall {
    to {
        transform: translateY(600px) rotate(720deg);
    }
}

#seo-diagnosis-app .catchphrase {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
}

#seo-diagnosis-app .description {
    color: var(--app-text-sub);
    margin-bottom: 32px;
    font-size: 1rem;
}

#seo-diagnosis-app .meta-info {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

#seo-diagnosis-app .meta-tag {
    font-size: 0.9rem;
    color: var(--app-text-sub);
    background: rgba(255, 255, 255, 0.5);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Primary Button */
#seo-diagnosis-app .btn-primary {
    background: linear-gradient(135deg, #00a381 0%, #059669 100%);
    color: white;
    border: none;
    padding: 18px 60px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 20px -5px rgba(0, 163, 129, 0.4);
    width: 100%;
    max-width: 320px;
}

#seo-diagnosis-app .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(0, 163, 129, 0.5);
}

#seo-diagnosis-app .btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

/* Quiz Section */
#seo-diagnosis-app .quiz-header {
    margin-bottom: 32px;
}

#seo-diagnosis-app .progress-area {
    margin-bottom: 12px;
}

#seo-diagnosis-app .progress-label {
    font-size: 0.75rem;
    color: var(--app-text-sub);
    margin-bottom: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#seo-diagnosis-app .progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

#seo-diagnosis-app .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a381, #2dd4bf);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#seo-diagnosis-app .question-count {
    text-align: right;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

#seo-diagnosis-app .question-count .current {
    font-size: 1.5rem;
    color: var(--app-primary);
}

#seo-diagnosis-app .question-count .total {
    font-size: 1rem;
    color: var(--app-text-sub);
}

#seo-diagnosis-app .question-text {
    font-size: 1.4rem;
    margin-bottom: 32px;
    line-height: 1.5;
    font-weight: 700;
}

#seo-diagnosis-app .options-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#seo-diagnosis-app .option-btn {
    background: white;
    border: 2px solid transparent;
    padding: 20px 24px;
    border-radius: var(--app-radius-md);
    text-align: left;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--app-text-main);
    box-shadow: var(--app-shadow-md);
    position: relative;
    overflow: hidden;
}

#seo-diagnosis-app .option-btn:hover {
    border-color: var(--app-primary);
    background: #f5f7ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.1);
}

#seo-diagnosis-app .option-btn:active {
    transform: scale(0.98);
}

/* Result Section */
#seo-diagnosis-app .result-header {
    text-align: center;
    margin-bottom: 32px;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 32px;
}

#seo-diagnosis-app .result-intro {
    font-size: 1rem;
    color: var(--app-text-sub);
    margin-bottom: 8px;
    font-weight: 700;
}

#seo-diagnosis-app .result-type-name {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--app-primary-dark);
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#seo-diagnosis-app .result-position-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

#seo-diagnosis-app .result-position-box .label {
    font-size: 0.75rem;
    background: var(--app-text-main);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

#seo-diagnosis-app .result-position-box .position-ja {
    font-size: 1.1rem;
    font-weight: 700;
}

#seo-diagnosis-app .result-position-box .position-en {
    font-size: 0.85rem;
    color: var(--app-text-sub);
    font-family: 'Outfit', sans-serif;
}

#seo-diagnosis-app .result-catch-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    padding: 20px;
    border-radius: var(--app-radius-md);
    font-weight: 700;
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 24px;
    border: 1px solid #fcd34d;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
}

#seo-diagnosis-app .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

#seo-diagnosis-app .detail-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--app-primary-dark);
    border-bottom: 2px solid #e0e7ff;
    padding-bottom: 8px;
}

#seo-diagnosis-app .detail-box ul {
    list-style: none;
    padding: 0;
}

#seo-diagnosis-app .detail-box li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

#seo-diagnosis-app .detail-box li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: var(--app-primary);
    font-weight: bold;
    font-size: 0.8rem;
    top: 2px;
}

#seo-diagnosis-app .pitfalls li::before {
    content: "!";
    color: var(--app-accent);
}

#seo-diagnosis-app .result-extras-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* Recommendation Link */
#seo-diagnosis-app .recommendation-area {
    margin: 24px 0;
    text-align: center;
}

/* Result Image */
#seo-diagnosis-app .result-image-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 32px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 163, 129, 0.15);
    background: white;
    padding: 16px;
}

#seo-diagnosis-app .result-type-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

#seo-diagnosis-app .btn-recommendation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--app-primary-dark);
    border: 1px solid var(--app-primary);
    padding: 12px 24px;
    border-radius: 99px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 163, 129, 0.1);
    font-size: 0.95rem;
}

#seo-diagnosis-app .btn-recommendation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 163, 129, 0.2);
    background: var(--app-primary);
    color: white;
}

#seo-diagnosis-app .btn-recommendation::after {
    content: '→';
    font-weight: bold;
}

#seo-diagnosis-app .extra-item {
    background: white;
    padding: 20px;
    border-radius: var(--app-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: var(--app-shadow-md);
}

#seo-diagnosis-app .extra-item .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

#seo-diagnosis-app .extra-item h4 {
    font-size: 0.8rem;
    color: var(--app-text-sub);
    margin-bottom: 4px;
}

#seo-diagnosis-app .extra-item p {
    font-weight: 700;
    font-size: 0.95rem;
}

#seo-diagnosis-app .result-message-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 24px;
    border-radius: var(--app-radius-md);
    margin-bottom: 40px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

#seo-diagnosis-app .message-icon {
    font-size: 1.5rem;
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#seo-diagnosis-app .message-content h4 {
    color: #047857;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

#seo-diagnosis-app .message-content p {
    color: #065f46;
    font-weight: 700;
    font-size: 1rem;
}

#seo-diagnosis-app .share-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

#seo-diagnosis-app .btn-share {
    background: #000;
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

#seo-diagnosis-app .btn-share:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

#seo-diagnosis-app .btn-secondary {
    background: transparent;
    color: var(--app-text-sub);
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}

#seo-diagnosis-app .btn-secondary:hover {
    color: var(--app-primary);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

@keyframes shine {
    100% {
        left: 125%;
    }
}

/* Responsive */
@media (max-width: 600px) {
    #seo-diagnosis-app .main-title .main {
        font-size: 2.2rem;
    }

    #seo-diagnosis-app .result-grid,
    #seo-diagnosis-app .result-extras-grid {
        grid-template-columns: 1fr;
    }

    #seo-diagnosis-app .glass-card {
        padding: 24px;
    }
}

#seo-diagnosis-app .app-footer {
    text-align: center;
    margin-top: 40px;
    color: var(--app-text-sub);
    font-size: 0.8rem;
    opacity: 0.7;
}