:root {
    --primary-color: #ffb7b2;
    --secondary-color: #e2f0cb;
    --accent-color: #ffdac1;
    --text-dark: #4a4a4a;
    --text-light: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --btn-bg: rgba(255, 255, 255, 0.8);
    --btn-hover: rgba(255, 255, 255, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', 'Quicksand', sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* 追記: フッターを下に押し出すため */
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-color: #f7f9fc;
}

/* 動的背景のスタイル */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #ffb7b2;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #e2f0cb;
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #ffdac1;
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* 言語セレクター */
.lang-selector-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.lang-selector {
    appearance: none;
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lang-selector:hover {
    background-color: var(--btn-hover);
    border-color: #ffb7b2;
}

/* コンテナ */
.container {
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
    z-index: 1;
}

/* グラスモーフィズムパネル */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 3rem 2rem;
    overflow: hidden;
}

.glass-panel-inner {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.05);
}

/* スクリーン切り替え */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.5s ease forwards;
}

.screen.active {
    display: flex;
}

.screen.hidden {
    display: none !important;
}

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

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

/* テキストスタイル */
.title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ff8b94;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 500;
    color: #8c7b80;
}

.description {
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.icon-pulse {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

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

/* ボタンスタイル */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    color: var(--text-dark);
    padding: 1rem 3rem;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.6);
}

.primary-btn .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.primary-btn:hover .arrow {
    transform: translateX(5px);
}

.secondary-btn {
    background: var(--btn-bg);
    color: var(--text-dark);
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
}

.ghost-btn {
    background: transparent;
    color: #8c7b80;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    text-decoration: underline;
}

.ghost-btn:hover {
    color: var(--text-dark);
}

/* 質問画面スタイル */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

#progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff9a9e, #fecfef);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #8c7b80;
    margin-bottom: 2rem;
    align-self: flex-end;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    min-height: 4rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.option-btn {
    display: flex;
    align-items: center;
    background: var(--btn-bg);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 16px;
    text-align: left;
    width: 100%;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: #ffb7b2;
}

.option-letter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: rgba(255, 183, 178, 0.3);
    color: #ff8b94;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
}

.option-text {
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* ローディング画面 */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.cat-loader {
    font-size: 3rem;
    animation: bounce 0.6s infinite alternate cubic-bezier(0.5, 0.05, 1, 0.5);
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-20px);
    }
}

/* 結果画面 */
.result-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.cat-result-image {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 4px solid var(--glass-bg);
}

.cat-name {
    font-size: 2rem;
    color: #ff8b94;
    margin-bottom: 0.5rem;
}

.cat-type-label {
    display: inline-block;
    background: #e2f0cb;
    color: #5d8233;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.traits-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.trait-tag {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
}

.description-box {
    text-align: left;
    background: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.compatibility-box {
    background: rgba(255, 218, 193, 0.3);
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed #ffdac1;
}

.compatibility-box h4 {
    color: #d18d6a;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    align-items: center;
}

.sns-share-container {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.sns-btn {
    flex: 1 1 calc(50% - 0.8rem);
    min-width: 140px;
    max-width: 180px;
    padding: 0.8rem 0.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.line-btn {
    background-color: #06c755;
}

.line-btn:hover {
    background-color: #05b14a;
    transform: translateY(-2px);
}

.x-btn {
    background-color: #000000;
}

.x-btn:hover {
    background-color: #333333;
    transform: translateY(-2px);
}

.insta-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.insta-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.copy-btn {
    background-color: #6c757d;
}

.copy-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.insta-guide-box {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #8c7b80;
    max-width: 400px;
}

/* === レスポンシブ最適化 (メディアクエリ) === */

@media (max-width: 768px) {
    .container {
        width: 95%;
        margin: 1rem auto;
    }

    .glass-panel {
        padding: 2.5rem 1.5rem;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .icon-pulse {
        font-size: 3.5rem;
    }

    .question-text {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }

    .option-btn {
        padding: 1rem;
    }

    .cat-name {
        font-size: 1.8rem;
    }

    .cat-result-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.7rem;
    }

    .glass-panel {
        padding: 2rem 1rem;
        border-radius: 16px;
    }

    .primary-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        width: 100%;
    }

    .action-buttons {
        gap: 0.8rem;
    }

    .secondary-btn,
    .ghost-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }

    .lang-selector-container {
        top: 0.5rem;
        right: 0.5rem;
    }

    .lang-selector {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 700px;
    }

    .glass-panel {
        padding: 4rem 3rem;
    }

    .title {
        font-size: 3rem;
    }

    .action-buttons {
        flex-direction: column;
        justify-content: center;
    }

    .sns-share-container {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .sns-btn {
        flex: 1;
        max-width: none;
    }
}

/* === フッター（AdSense・規約対応） === */
.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 10;
}

.footer-links {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff8b94;
}

.copyright {
    font-size: 0.8rem;
    color: #999;
}

@media (max-width: 600px) {
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}