:root {
    /* Color Variables */
    --color-agree: #33a474;
    --color-disagree: #88619a;
    --color-neutral: #b3b3b3;
    --color-bg: #ffffff;
    --color-text: #333333;
    --color-border: #eee;
    --color-shadow: rgba(0, 0, 0, 0.05);
    --color-bg-light: #f9f9f9;
    --color-bg-lighter: #f2f2f2;
    --color-text-secondary: #666;
    --color-text-muted: #999;
    --color-link: #ccc;

    /* Group Colors */
    --color-analyst: #6a4fa1;
    --color-diplomat: #1b9c6c;
    --color-sentinel: #2b83a2;
    --color-explorer: #d78c29;

    /* Transition */
    --transition: all 0.2s ease;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 32px;
    --spacing-2xl: 40px;
    --spacing-3xl: 60px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 30px;
    --radius-circle: 50%;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-lighter);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ====== Container & Layout ====== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: var(--color-bg);
    min-height: 80vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    background: white;
    border-bottom: 1px solid var(--color-border);
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: #444;
    white-space: nowrap;
}

/* ====== Global Nav ====== */
.site-nav {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: nowrap;
}

.site-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: #444;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 8px;
}

.nav-link:hover {
    background: var(--color-bg-lighter);
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: #f3f4f6;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(640px, 90vw);
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    padding: 16px;
    z-index: 20;
}

@media (max-width: 720px) {
    .dropdown-menu {
        position: fixed;
        top: 64px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 80px);
        overflow: auto;
        grid-template-columns: 1fr;
    }
}

.dropdown-menu.open {
    display: grid;
}

.dropdown-group-title {
    font-weight: 700;
    color: var(--color-disagree);
    text-decoration: none;
}

.dropdown-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.dropdown-types a {
    text-decoration: none;
    color: #555;
    background: var(--color-bg-lighter);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.85rem;
}

.dropdown-types a:hover {
    background: #ececec;
}

/* ====== Progress Bar ====== */
.progress-section {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 0 var(--spacing-2xl);
    padding: var(--spacing-md) 0 var(--spacing-lg);
    background: var(--color-bg);
    text-align: center;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.04);
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--color-agree);
    transition: width 0.5s ease;
}

.progress-text {
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ====== Question Block ====== */
.question-block {
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-2xl) 0;
    text-align: center;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-2xl);
    color: #444;
    line-height: 1.6;
}

/* ====== Options (Radio Circles) ====== */
.options-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    position: relative;
}

/* 同意・反対のラベル */
.label-agree,
.label-disagree {
    font-size: 0.8rem;
    font-weight: 700;
    display: block;
    position: absolute;
    top: 100%;
    transform: translateY(8px);
}

.label-agree {
    left: 0;
    right: auto;
    color: var(--color-agree);
}

.label-disagree {
    right: 0;
    left: auto;
    color: var(--color-disagree);
}

/* PC以上でラベルを表示 */
@media (min-width: 600px) {

    .label-agree,
    .label-disagree {
        display: block;
        position: static;
        transform: none;
    }

    .options-wrapper {
        justify-content: space-between;
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ラジオボタン本体は隠す */
.option-input {
    display: none;
}

/* 円のデザイン（Custom Radio） */
.option-circle {
    display: block;
    border: 2px solid;
    border-radius: var(--radius-circle);
    cursor: pointer;
    transition: var(--transition);
    background-color: transparent;
    touch-action: manipulation;
}

.option-circle:hover {
    transform: scale(1.1);
}

/* 円のサイズと色の定義 (左から右へ) */
.circle-1 {
    width: 50px;
    height: 50px;
    border-color: var(--color-agree);
}

.circle-2 {
    width: 40px;
    height: 40px;
    border-color: var(--color-agree);
}

.circle-3 {
    width: 30px;
    height: 30px;
    border-color: var(--color-agree);
}

.circle-4 {
    width: 24px;
    height: 24px;
    border-color: var(--color-neutral);
}

.circle-5 {
    width: 30px;
    height: 30px;
    border-color: var(--color-disagree);
}

.circle-6 {
    width: 40px;
    height: 40px;
    border-color: var(--color-disagree);
}

.circle-7 {
    width: 50px;
    height: 50px;
    border-color: var(--color-disagree);
}

/* 選択時のスタイル（塗りつぶし） */
.option-input:checked+.option-circle {
    background-color: currentColor;
}

.option-input[data-group="agree"]:checked+.option-circle {
    background-color: var(--color-agree);
}

.option-input[data-group="neutral"]:checked+.option-circle {
    background-color: var(--color-neutral);
}

.option-input[data-group="disagree"]:checked+.option-circle {
    background-color: var(--color-disagree);
}


/* ====== Navigation Buttons ====== */
.nav-buttons {
    display: none;
    margin-top: var(--spacing-xl);
    text-align: center;
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
}

.nav-buttons.show {
    display: block;
}

/* ====== Buttons ====== */
.btn-primary {
    background-color: var(--color-disagree);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(136, 97, 154, 0.4);
}

.btn-primary:disabled {
    background-color: #c3adc9;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: var(--color-text);
    border: none;
    padding: 13px 32px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
    text-decoration: none;
}

.result-actions {
    width: 100%;
}

.btn-secondary:hover {
    background-color: #d6d8dd;
}

/* ====== Result Image ====== */
.result-image {
    text-align: center;
    margin-top: var(--spacing-md);
}

.result-image img {
    max-width: 260px;
    width: 60%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.result-type-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    margin: var(--spacing-xl) auto;
    display: block;
    transition: var(--transition);
}

.result-type-image:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* ====== Type Section ====== */
.type-section {
    margin: var(--spacing-3xl) 0;
}

.type-section h2 {
    text-align: center;
}

/* types.html はカードが多いので横幅を少し広めにする */
#types-container.container {
    max-width: 1100px;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

@media (max-width: 520px) {
    .type-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 980px) {
    .type-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.type-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    overflow: hidden;
}

.type-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    display: block;
}

.group-analyst .card-icon {
    filter: drop-shadow(0 2px 4px rgba(106, 79, 161, 0.3));
}

.group-diplomat .card-icon {
    filter: drop-shadow(0 2px 4px rgba(27, 156, 108, 0.3));
}

.group-sentinel .card-icon {
    filter: drop-shadow(0 2px 4px rgba(43, 131, 162, 0.3));
}

.group-explorer .card-icon {
    filter: drop-shadow(0 2px 4px rgba(215, 140, 41, 0.3));
}

.type-card-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--color-bg-lighter);
}

.type-card h3 {
    margin: 0 0 var(--spacing-sm);
    font-size: 1.05rem;
}

.type-card .type-tag {
    display: inline-block;
    font-weight: 700;
    color: var(--color-disagree);
    margin-left: var(--spacing-sm);
}

.type-card p {
    margin: var(--spacing-sm) 0;
    color: #444;
    line-height: 1.5;
    font-size: 0.95rem;
}

.group-desc {
    color: #444;
    margin: var(--spacing-sm) 0 var(--spacing-md);
    line-height: 1.5;
    text-align: center;
}

/* 強調アニメーション（types.htmlでのスクロール対象） */
.highlight-target {
    outline: 3px solid var(--color-disagree);
    border-radius: 12px;
    animation: highlightFade 2s ease forwards;
}

@keyframes highlightFade {
    0% {
        box-shadow: 0 0 0 6px rgba(136, 97, 154, .25);
    }

    100% {
        box-shadow: none;
    }
}

/* Group Colors */
.group-analyst .type-tag {
    color: var(--color-analyst);
}

.group-diplomat .type-tag {
    color: var(--color-diplomat);
}

.group-sentinel .type-tag {
    color: var(--color-sentinel);
}

.group-explorer .type-tag {
    color: var(--color-explorer);
}

.type-card.group-analyst {
    border-left: 4px solid var(--color-analyst);
}

.type-card.group-diplomat {
    border-left: 4px solid var(--color-diplomat);
}

.type-card.group-sentinel {
    border-left: 4px solid var(--color-sentinel);
}

.type-card.group-explorer {
    border-left: 4px solid var(--color-explorer);
}

.type-card.group-analyst:hover {
    box-shadow: 0 8px 20px rgba(106, 79, 161, 0.2);
}

.type-card.group-diplomat:hover {
    box-shadow: 0 8px 20px rgba(27, 156, 108, 0.2);
}

.type-card.group-sentinel:hover {
    box-shadow: 0 8px 20px rgba(43, 131, 162, 0.2);
}

.type-card.group-explorer:hover {
    box-shadow: 0 8px 20px rgba(215, 140, 41, 0.2);
}

/* ====== Quiz Note ====== */
.quiz-note {
    margin-top: var(--spacing-lg);
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* ====== Stats Page ====== */
.stats-section {
    margin-bottom: 3rem;
}

.stats-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-disagree);
    border-bottom: 2px solid var(--color-disagree);
    padding-bottom: 0.5rem;
}

.stats-section h3 {
    font-size: 1.1rem;
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
}

.stat-cards {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: #f3f4f6;
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    text-align: center;
    flex: 1;
    min-width: 140px;
}

.stat-card h4 {
    margin: 0 0 var(--spacing-sm);
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #7c3aed;
    margin: 0;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.popular-types {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: var(--spacing-lg);
}

.popular-list h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--color-disagree);
}

.popular-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.popular-item:last-child {
    border-bottom: none;
}

.popular-item .rank {
    font-weight: bold;
    color: var(--color-disagree);
    font-size: 1.1rem;
    min-width: 40px;
}

.popular-item .type-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.popular-item .type-count {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    color: var(--color-text);
}

.chart-container h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    color: var(--color-text);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

/* ====== Hero Section (Home Page) ====== */
.hero-section {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-2xl);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    color: white;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

/* ====== Start Card ====== */
.start-card {
    background: white;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: -80px;
    position: relative;
    z-index: 5;
}

.start-card h2 {
    margin-top: 0;
}

/* ====== Feature Grid ====== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-2xl) 0;
}

.feature-item {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    background: var(--color-bg-light);
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-disagree);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    display: block;
}

.feature-item h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-disagree);
}

.feature-item p {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ====== Site Footer ====== */
.site-footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--color-link);
    text-decoration: none;
    font-size: 0.7rem;
    margin-top: var(--spacing-sm);
    display: inline-block;
}

/* ====== Responsive Design ====== */
@media (max-width: 600px) {
    .site-header {
        padding: var(--spacing-md);
    }

    .site-nav {
        width: 100%;
        padding-bottom: 4px;
    }

    .options-wrapper {
        gap: var(--spacing-sm);
    }

    .circle-1,
    .circle-7 {
        width: 40px;
        height: 40px;
    }

    .circle-2,
    .circle-6 {
        width: 34px;
        height: 34px;
    }

    .circle-3,
    .circle-5 {
        width: 28px;
        height: 28px;
    }

    .circle-4 {
        width: 22px;
        height: 22px;
    }

    .container {
        padding: var(--spacing-md);
        box-shadow: none;
        min-height: auto;
    }

    .progress-section {
        margin: 0 0 var(--spacing-xl);
        padding: var(--spacing-sm) 0 var(--spacing-md);
    }

    .progress-bar-bg {
        height: 10px;
    }

    .hero-section {
        padding: var(--spacing-2xl) var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .start-card {
        margin-top: var(--spacing-lg);
        padding: var(--spacing-xl);
    }

    .question-block {
        padding: var(--spacing-xl) 0;
    }

    .question-text {
        font-size: 1rem;
        margin-bottom: var(--spacing-xl);
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 520px;
        padding-left: 20px;
        padding-right: 20px;
    }

    #result-container .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .chart-container {
        padding: 1.25rem;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .stat-cards {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .logo {
        font-size: 1.05rem;
    }
}

@media (max-width: 600px) {
    .mbti-tile {
        min-width: 160px;
        height: 210px;
        padding: var(--spacing-md);
    }

    .mbti-tile img {
        width: 120px;
        height: 120px;
    }
}

/* ====== MBTI All Types Carousel ====== */
.all-types-section {
    margin: var(--spacing-3xl) 0;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
}

.all-types-section h2 {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.types-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-2xl);
    font-size: 0.95rem;
}

.mbti-carousel-container {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: var(--spacing-lg) 0;
}

.mbti-carousel {
    display: flex;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-lg);
    width: fit-content;
    animation: slideInfinite 25s linear infinite;
}

@keyframes slideInfinite {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - var(--spacing-md)));
    }
}

.mbti-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    height: 240px;
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
    transition: var(--transition);
    cursor: pointer;
    flex-shrink: 0;
}

.mbti-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: var(--color-disagree);
}

.mbti-tile img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: var(--spacing-md);
    transition: var(--transition);
}

.mbti-tile:hover img {
    transform: scale(1.08);
}

.mbti-tile span {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-disagree);
    text-align: center;
}

/* ====== Home (index.html) ====== */
body.home-index {
    --color-primary: #8a4fff;
    --color-secondary: #00c9a7;
    --color-bg-surface: #ffffff;
    --color-text-main: #334155;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    background-color: #f8fafc;
    color: var(--color-text-main);
}

body.home-index .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px;
    background: transparent;
    min-height: auto;
    box-shadow: none;
}

body.home-index .site-footer {
    display: block;
    text-align: center;
    padding: 40px 24px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    background: white;
}

body.home-index .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border: none;
    padding: 0 40px;
    height: 50px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.home-index .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(138, 79, 255, 0.5);
}

body.home-index .type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

body.home-index .type-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

body.home-index .type-card:hover {
    transform: translateY(-5px);
}

/* --- Home Hero (simple) --- */
body.home-index .hero-section.hero-simple {
    position: relative;
    min-height: 100vh;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 20px;
    color: #fff;
    background: 
        url('data/images/background_mobile.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    overflow: hidden;
}

/* PC用背景画像 (768px以上) */
@media (min-width: 768px) {
    body.home-index .hero-section.hero-simple {
        background: 
            url('data/images/background_pc.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: scroll;
    }
}

/* タブレット・高解像度対応 */
@media (min-width: 768px) and (min-resolution: 2dppx) {
    body.home-index .hero-section.hero-simple {
        background-size: cover;
    }
}

/* スマホでのパフォーマンス向上 */
@media (max-width: 767px) {
    body.home-index .hero-section.hero-simple {
        background-attachment: scroll;
        background-size: cover;
    }
}

body.home-index .hero-section.hero-simple::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

body.home-index .hero-simple-inner {
    position: relative;
    z-index: 2;
    width: min(920px, 92vw);
    text-align: center;
}

body.home-index .hero-title {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4.8vw, 3rem);
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.4);
    font-weight: 700;
}

body.home-index .hero-description {
    margin: 0 auto 26px;
    max-width: 48rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);
}

body.home-index .hero-kicker {
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

body.home-index .hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

body.home-index .hero-actions .btn-primary,
body.home-index .hero-actions .btn-secondary {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

body.home-index .hero-secondary-link {
    background: rgba(229, 231, 235, 0.95);
    color: #374151;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

body.home-index .hero-secondary-link:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
}

body.home-index .hero-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

body.home-index .hero-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.15s ease, background 0.15s ease;
}

body.home-index .hero-chip:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
}

body.home-index .hero-chip.chip-analyst {
    border-color: rgba(138, 79, 255, 0.6);
}

body.home-index .hero-chip.chip-diplomat {
    border-color: rgba(0, 201, 167, 0.6);
}

body.home-index .hero-chip.chip-sentinel {
    border-color: rgba(0, 184, 212, 0.6);
}

body.home-index .hero-chip.chip-explorer {
    border-color: rgba(255, 183, 0, 0.65);
}

/* --- Home infinite scroll list --- */
@keyframes home-infinity-scroll-left {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

body.home-index .scroll-infinity {
    margin-bottom: 40px;
    overflow: hidden;
    padding: 20px 0;
}

body.home-index .scroll-infinity__wrap {
    display: flex;
    width: fit-content;
}

body.home-index .scroll-infinity__list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    animation: home-infinity-scroll-left 60s linear infinite;
}

body.home-index .scroll-infinity__item {
    margin: 0 10px;
    min-width: 120px;
    text-align: center;
    background: white;
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

body.home-index .scroll-infinity__item img {
    width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
}

body.home-index .scroll-infinity__item span {
    font-weight: bold;
    color: var(--color-text-main);
}

@media (max-width: 768px) {
    body.home-index .character-group {
        gap: 14px;
        padding: 0 12px;
    }
}

@media (max-width: 600px) {
    body.home-index .scene-label {
        top: 10%;
        font-size: clamp(2.8rem, 12vw, 4rem);
    }

    body.home-index .character-group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-bottom: 72px;
        padding: 0 12px;
        max-width: 92vw;
    }

    body.home-index .character-group img {
        height: clamp(90px, 18vh, 150px);
    }

    body.home-index .hero-content-fixed {
        bottom: 6%;
        width: 92%;
        max-width: 520px;
    }

    body.home-index .start-card {
        padding: 20px;
    }

    body.home-index .start-card h2 {
        font-size: 1.5rem;
    }

    body.home-index .btn-primary {
        width: 100%;
        padding: 14px 18px;
    }

    body.home-index .scroll-infinity {
        padding: 12px 0;
    }
}

/* ホーム画面のレスポンシブ対応 */
@media (max-width: 767px) {
    body.home-index .hero-section.hero-simple {
        padding: 60px 15px;
    }
    
    body.home-index .hero-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    body.home-index .btn-primary,
    body.home-index .hero-secondary-link {
        width: 100%;
        max-width: 280px;
    }
}

    body.home-index .scroll-infinity__item {
        min-width: 96px;
        padding: 12px;
    }

    body.home-index .scroll-infinity__item img {
        width: 180px;
        max-width: 70vw;
    }

    body.home-index .container {
        padding: 36px 16px;
    }
}