/* --- 全体スタイル --- */
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;900&display=swap');

:root {
    --primary-color: #ff9800; /* 明るいオレンジ */
    --secondary-color: #4caf50; /* ポジティブなグリーン */
    --background-color: #fffbeb; /* 暖かいクリーム色 */
    --text-color: #333;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    overflow-x: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    min-height: 90vh;
    max-height: 95vh;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- 画面制御 --- */
.screen {
    display: none;
    width: 100%;
    flex-grow: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex;
}

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

/* --- UI要素 --- */
h1, h2, h3 {
    font-weight: 900;
    color: var(--primary-color);
}

h1 { font-size: 2.2rem; margin-bottom: 10px; }
h2 { font-size: 1.8rem; margin-bottom: 15px; }
p { margin-bottom: 20px; line-height: 1.6; }

.btn {
    display: inline-block;
    background-image: linear-gradient(45deg, var(--primary-color), #ffc107);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.4);
    margin: 5px;
    width: 90%;
    max-width: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 152, 0, 0.6);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
    width: auto;
    max-width: none;
}

/* --- スタート画面 --- */
#start-screen .top-image {
    width: 90%;
    max-width: 350px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

/* --- 診断フェーズ --- */
#diagnosis-screen .question-box {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
}

#diagnosis-screen .options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    width: 0%;
    background-color: var(--secondary-color);
    transition: width 0.5s ease;
}

/* 診断中アニメーション */
.diagnosing-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    display: none;
}
.diagnosing-animation.active {
    display: flex;
}
.diagnosing-animation .spinner {
    width: 60px;
    height: 60px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- リザルトフェーズ --- */
#result-card {
    background-color: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 25px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    box-shadow: var(--shadow);
    position: relative;
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23FF9800' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

#result-card .card-title {
    color: #777;
    font-weight: 700;
    margin-bottom: 15px;
}
#result-card .result-type {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 20px;
    min-height: 60px;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-item .label {
    font-size: 0.8rem;
    color: #666;
}
.stat-item .value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--secondary-color);
}

.result-description {
    font-size: 0.9rem;
    text-align: left;
    margin-top: 15px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* --- フッター --- */
.footer {
    margin-top: auto;
    padding-top: 15px;
    font-size: 0.8rem;
    color: #aaa;
}