/* ========================================
   リセットとベーススタイル
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: radial-gradient(ellipse at center, #1a0d2e 0%, #0a0415 50%, #000000 100%);
    min-height: 100vh;
    color: #00D9FF;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* 星空の背景エフェクト */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 85%, white, transparent),
        radial-gradient(1px 1px at 15% 60%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%, 40% 60%, 130% 270%, 70% 100%;
    animation: stars 120s linear infinite;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

@keyframes stars {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

/* 魔法陣の輝きエフェクト */
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(106, 27, 154, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ========================================
   画面表示制御
   ======================================== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 40px 0;
    position: relative;
}

.screen.active {
    display: block;
}

/* 診断中の質問ページ遷移（シンプルなフェード） */
.screen.fade-out {
    animation: simpleFadeOut 0.3s ease-out forwards;
}

.screen.fade-in {
    animation: simpleFadeIn 0.3s ease-in forwards;
}

@keyframes simpleFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes simpleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* サイコロオーバーレイ */
.dice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(ellipse at center, #1a0d2e 0%, #0a0415 50%, #000000 100%);
}

.dice-overlay.hidden {
    display: none;
}

.dice-animation {
    font-size: 120px;
    filter: drop-shadow(0 0 30px rgba(0, 217, 255, 0.8));
}

/* スタート→診断：サイコロ吸い込み */
.dice-overlay.suck-in {
    animation: suckInBackground 1.2s ease-in-out forwards;
}

.dice-overlay.suck-in .dice-animation {
    animation: diceRollAndSuckIn 1.2s ease-in-out forwards;
}

@keyframes diceRollAndSuckIn {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.3) rotate(180deg);
        opacity: 1;
    }
    60% {
        transform: scale(1.1) rotate(360deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(720deg);
        opacity: 0;
    }
}

@keyframes suckInBackground {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    70% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 診断→結果：サイコロパンアウト */
.dice-overlay.pan-out {
    animation: panOutBackground 1.5s ease-out forwards;
}

.dice-overlay.pan-out .dice-animation {
    animation: diceRollAndPanOut 1.5s ease-out forwards;
}

@keyframes diceRollAndPanOut {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    40% {
        transform: scale(1.2) rotate(360deg);
        opacity: 1;
    }
    70% {
        transform: scale(1.5) rotate(540deg);
        opacity: 1;
    }
    100% {
        transform: scale(8) rotate(720deg);
        opacity: 0;
    }
}

@keyframes panOutBackground {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
    70% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(3);
    }
}

/* ========================================
   魔法陣の背景デザイン
   ======================================== */
.mystical-circle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: rotate 60s linear infinite;
}

.mystical-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 50%;
}

.mystical-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 50%;
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   キャラクター画像エリア
   ======================================== */
.character-container {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.character-image {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d3561 0%, #1a1f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 
        0 0 40px rgba(0, 217, 255, 0.4),
        0 0 80px rgba(106, 27, 154, 0.3),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(0, 217, 255, 0.5);
    animation: glow 3s ease-in-out infinite, float 4s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 
            0 0 40px rgba(0, 217, 255, 0.4),
            0 0 80px rgba(106, 27, 154, 0.3),
            inset 0 0 40px rgba(0, 0, 0, 0.5);
    }
    50% { 
        box-shadow: 
            0 0 60px rgba(0, 217, 255, 0.6),
            0 0 120px rgba(106, 27, 154, 0.5),
            inset 0 0 40px rgba(0, 0, 0, 0.5);
    }
}

.character-image::before {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    background-image: url('../images/mascot/frame-1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.95;
    animation: mascotIdle 3s steps(1) infinite;
}

@keyframes mascotIdle {
    0% { background-image: url('../images/mascot/frame-1.png'); }
    14.28% { background-image: url('../images/mascot/frame-2.png'); }
    28.57% { background-image: url('../images/mascot/frame-3.png'); }
    42.85% { background-image: url('../images/mascot/frame-4.png'); }
    57.14% { background-image: url('../images/mascot/frame-5.png'); }
    71.42% { background-image: url('../images/mascot/frame-6.png'); }
    85.71% { background-image: url('../images/mascot/frame-7.png'); }
    100% { background-image: url('../images/mascot/frame-1.png'); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ========================================
   装飾付きテキストボックス
   ======================================== */
.message-box {
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.95) 0%, rgba(15, 10, 25, 0.98) 100%);
    border: 3px solid rgba(0, 217, 255, 0.6);
    border-radius: 16px;
    padding: 20px 30px;
    position: relative;
    box-shadow: 
        0 0 30px rgba(0, 217, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    margin: 30px auto;
    max-width: 600px;
}

/* 装飾的な角のデザイン */
.message-box::before,
.message-box::after {
    content: '◆';
    position: absolute;
    color: rgba(0, 217, 255, 0.8);
    font-size: 20px;
}

.message-box::before {
    top: -12px;
    left: 20px;
}

.message-box::after {
    bottom: -12px;
    right: 20px;
}

.message-box .corner-ornament {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(0, 217, 255, 0.5);
}

.message-box .corner-ornament.top-left {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.message-box .corner-ornament.top-right {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.message-box .corner-ornament.bottom-left {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.message-box .corner-ornament.bottom-right {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.message-text {
    font-size: 18px;
    color: #f5f5f5;
    text-align: left; /* 中央揃えから左揃えに変更 */
    line-height: 1.7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
    position: relative;
    z-index: 1;
    white-space: pre-line; /* 改行を保持 */
    min-height: 122px; /* 4行分の固定高さ (18px * 1.7 * 4 ≈ 122px) */
    max-height: 122px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 中央揃えから左揃えに変更 */
}

.message-text.typing::after {
    content: '|';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================
   ファンタジー風ボタン
   ======================================== */
.option-button {
    background: linear-gradient(135deg, rgba(30, 25, 50, 0.9) 0%, rgba(20, 15, 35, 0.95) 100%);
    border: 2px solid rgba(0, 217, 255, 0.5);
    border-radius: 50px;
    padding: 18px 40px;
    margin: 12px auto;
    display: block;
    width: 90%;
    max-width: 550px;
    min-height: 60px; /* 最小高さを確保して円形を保つ */
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ボタンの左右の装飾 */
.option-button::before {
    content: '⟨';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 217, 255, 0.6);
    font-size: 24px;
    transition: all 0.3s ease;
}

.option-button::after {
    content: '⟩';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 217, 255, 0.6);
    font-size: 24px;
    transition: all 0.3s ease;
}

.option-button:hover {
    background: linear-gradient(135deg, rgba(40, 35, 60, 0.95) 0%, rgba(30, 25, 45, 0.98) 100%);
    border-color: rgba(0, 217, 255, 0.8);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 217, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.option-button:hover::before {
    left: 15px;
    color: rgba(0, 217, 255, 1);
}

.option-button:hover::after {
    right: 15px;
    color: rgba(0, 217, 255, 1);
}

.option-button-text {
    font-size: 17px;
    color: #f5f5f5;
    text-align: center;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    padding: 0 40px;
}

/* ========================================
   標準ボタン
   ======================================== */
.btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid rgba(0, 217, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(30, 25, 50, 0.9) 0%, rgba(20, 15, 35, 0.95) 100%);
    color: #f5f5f5;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
    border-color: rgba(0, 217, 255, 0.8);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #4a148c 0%, #311b92 100%);
    color: #00D9FF;
    border-color: rgba(0, 217, 255, 0.6);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6a1b9a 0%, #4a148c 100%);
    border-color: rgba(0, 217, 255, 0.9);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(40, 35, 60, 0.9) 0%, rgba(30, 25, 45, 0.95) 100%);
    color: #00D9FF;
    border-color: rgba(0, 217, 255, 0.5);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(50, 45, 70, 0.95) 0%, rgba(40, 35, 55, 0.98) 100%);
    border-color: rgba(0, 217, 255, 0.8);
}

/* ========================================
   スタート画面
   ======================================== */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

.main-title {
    font-size: 48px;
    font-weight: 700;
    color: #00D9FF;
    margin-bottom: 20px;
    text-shadow: 
        0 0 20px rgba(0, 217, 255, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 4px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { 
        text-shadow: 
            0 0 20px rgba(0, 217, 255, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.8);
    }
    50% { 
        text-shadow: 
            0 0 30px rgba(0, 217, 255, 1),
            0 0 50px rgba(0, 217, 255, 0.6),
            0 4px 8px rgba(0, 0, 0, 0.8);
    }
}

.subtitle {
    font-size: 20px;
    color: #a8a8a8;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ========================================
   質問画面
   ======================================== */
.progress-container {
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.8) 0%, rgba(15, 10, 25, 0.9) 100%);
    border: 2px solid rgba(0, 217, 255, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #00D9FF 0%, #f4d03f 50%, #00D9FF 100%);
    transition: width 0.4s ease;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.8);
}

.progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #00D9FF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.question-card {
    position: relative;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.question-card.fade-out {
    opacity: 0;
}

.question-text {
    font-size: 24px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 30px;
    line-height: 1.8;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-option {
    background: linear-gradient(135deg, rgba(30, 25, 50, 0.9) 0%, rgba(20, 15, 35, 0.95) 100%);
    border: 2px solid rgba(0, 217, 255, 0.4);
    border-radius: 50px;
    padding: 18px 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 17px;
    text-align: center;
    color: #f5f5f5;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.answer-option::before {
    content: '⟨';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 217, 255, 0.5);
    font-size: 22px;
    transition: all 0.3s ease;
}

.answer-option::after {
    content: '⟩';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 217, 255, 0.5);
    font-size: 22px;
    transition: all 0.3s ease;
}

.answer-option:hover {
    background: linear-gradient(135deg, rgba(40, 35, 60, 0.95) 0%, rgba(30, 25, 45, 0.98) 100%);
    border-color: rgba(0, 217, 255, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.3);
}

.answer-option:hover::before {
    left: 15px;
    color: rgba(0, 217, 255, 0.9);
}

.answer-option:hover::after {
    right: 15px;
    color: rgba(0, 217, 255, 0.9);
}

.answer-option.selected {
    background: linear-gradient(135deg, rgba(106, 27, 154, 0.8) 0%, rgba(74, 20, 140, 0.9) 100%);
    border-color: rgba(0, 217, 255, 0.9);
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.5);
}

.answer-option.selected::before,
.answer-option.selected::after {
    color: rgba(0, 217, 255, 1);
}

.navigation-buttons {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-top: 30px;
}

.navigation-buttons .btn {
    flex: 1;
}

/* ========================================
   結果画面
   ======================================== */
.result-header {
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.9) 0%, rgba(15, 10, 25, 0.95) 100%);
    border: 3px solid rgba(0, 217, 255, 0.5);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    position: relative;
}

.result-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 217, 255, 0.1) 0%, transparent 70%);
    border-radius: 16px;
    pointer-events: none;
}

.result-header h1 {
    font-size: 36px;
    color: #00D9FF;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
    position: relative;
}

.result-type-container {
    margin-top: 20px;
    position: relative;
}

.result-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d3561 0%, #1a1f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.5);
    border: 3px solid rgba(0, 217, 255, 0.6);
}

.result-type {
    font-size: 32px;
    font-weight: 700;
    color: #00D9FF;
    margin-bottom: 16px;
    text-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
}

.result-quote {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.quote-original {
    font-size: 16px;
    font-style: italic;
    color: #a0a0a0;
    line-height: 1.8;
    margin-bottom: 16px;
    text-align: left;
    font-family: 'Times New Roman', serif;
}

.quote-translation {
    font-size: 17px;
    color: #e0e0e0;
    line-height: 1.9;
    margin-bottom: 12px;
    text-align: left;
}

.quote-source {
    font-size: 14px;
    color: #808080;
    line-height: 1.6;
    text-align: right;
    font-style: italic;
    margin-top: 8px;
}

.arcana-description {
    font-size: 19px;
    color: #ffffff;
    line-height: 2.0;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 500;
    padding: 0 20px;
}

.score-section {
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.9) 0%, rgba(15, 10, 25, 0.95) 100%);
    border: 2px solid rgba(0, 217, 255, 0.5);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.score-section h3 {
    font-size: 24px;
    color: #00D9FF;
    margin-bottom: 24px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

#score-chart {
    max-width: 500px;
    margin: 0 auto;
    height: 400px !important;
    display: block;
}

/* 同心円チャートコンテナ */
.concentric-chart-container {
    max-width: 500px;
    margin: 0 auto 30px;
    padding: 20px;
}

#concentric-chart {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(0, 217, 255, 0.3));
}

/* スコア数値表示 */
.score-numbers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.score-category h4 {
    font-size: 18px;
    color: #00D9FF;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.5);
}

.score-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(30, 25, 50, 0.5);
    border-radius: 6px;
    border-left: 3px solid;
    transition: all 0.3s ease;
}

.score-item:hover {
    background: rgba(40, 35, 60, 0.7);
    transform: translateX(5px);
}

.score-item.selected {
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.score-label {
    font-size: 15px;
    color: #f5f5f5;
    font-weight: 500;
}

.score-value {
    font-size: 16px;
    color: #00D9FF;
    font-weight: 600;
}

.score-item.selected .score-label,
.score-item.selected .score-value {
    color: #00D9FF;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
}

.details-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.9) 0%, rgba(15, 10, 25, 0.95) 100%);
    border: 2px solid rgba(0, 217, 255, 0.5);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.3);
}

.detail-card h3 {
    font-size: 22px;
    color: #00D9FF;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.detail-card ul {
    list-style: none;
    padding-left: 0;
}

.detail-card li {
    font-size: 16px;
    color: #c0c0c0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.detail-card li:last-child {
    border-bottom: none;
}

.detail-card li::before {
    content: '✦';
    color: #00D9FF;
    font-weight: bold;
    margin-right: 12px;
}

/* 特殊能力カード */
.special-ability-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ability-row {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05) 0%, rgba(0, 150, 200, 0.08) 100%);
    border-left: 4px solid #00D9FF;
    border-radius: 8px;
}

.ability-label {
    font-size: 14px;
    font-weight: 600;
    color: #00D9FF;
    min-width: 120px;
    margin-right: 15px;
}

.ability-value {
    font-size: 16px;
    color: #e0e0e5;
    line-height: 1.6;
    flex: 1;
}

/* イメージツリー（シンプルグリッドスタイル） */
.image-tree-container {
    padding: 30px 20px;
    text-align: center;
}

.tree-center {
    font-size: 60px;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tree-branches-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.tree-branch-item {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(0, 150, 200, 0.15) 100%);
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    opacity: 0;
    animation: fadeInBranch 0.6s ease forwards;
}

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

.tree-parent {
    font-size: 18px;
    font-weight: 700;
    color: #00D9FF;
    margin-bottom: 15px;
    padding: 10px 20px;
    border: 2px solid rgba(0, 217, 255, 0.6);
    border-radius: 25px;
    background: rgba(0, 217, 255, 0.1);
    display: inline-block;
}

.tree-children {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.tree-child {
    font-size: 14px;
    color: #a0e0f0;
    padding: 6px 12px;
    border: 1px solid rgba(0, 217, 255, 0.4);
    border-radius: 15px;
    background: rgba(0, 217, 255, 0.05);
    opacity: 0;
    animation: fadeInChild 0.4s ease forwards;
    width: fit-content;
}

@keyframes fadeInChild {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* タブレット対応 */
@media (max-width: 768px) {
    .tree-branches-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .tree-center {
        font-size: 50px;
    }
    
    .tree-parent {
        font-size: 16px;
        padding: 8px 16px;
    }
    
    .tree-child {
        font-size: 13px;
    }
}

/* スマホ対応 */
@media (max-width: 480px) {
    .tree-branches-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tree-center {
        font-size: 40px;
        margin-bottom: 20px;
    }
    
    .tree-branch-item {
        padding: 15px;
    }
    
    .tree-parent {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .tree-child {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.action-buttons .btn {
    min-width: 200px;
}

/* Xシェアボタン */
.btn-x-share {
    background: #000000;
    color: #ffffff;
    border: 2px solid #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-x-share:hover:not(:disabled) {
    background: #1a1a1a;
    border-color: #555555;
    transform: translateY(-2px);
}

.btn-x-share svg {
    flex-shrink: 0;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .screen {
        padding: 20px 0;
    }

    .character-image {
        width: 180px;
        height: 180px;
    }

    .character-image::before {
        width: 160px;
        height: 160px;
    }

    .main-title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 18px;
    }

    .message-box {
        padding: 20px 25px;
    }

    .message-text {
        font-size: 15px; /* 16pxから15pxに縮小 */
        line-height: 1.6; /* 行間を少し詰める */
        min-height: 96px; /* 4行分の高さ (15px * 1.6 * 4 ≈ 96px) */
        max-height: 96px;
    }

    .option-button {
        padding: 16px 30px;
        min-height: 56px; /* タブレットサイズで円形を保つ */
    }

    .option-button-text {
        font-size: 16px;
        padding: 0 30px;
        line-height: 1.4; /* 行間を調整 */
    }

    .question-text {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .answer-option {
        padding: 14px 40px;
        font-size: 15px;
        margin-bottom: 10px;
    }

    .navigation-buttons {
        flex-direction: column;
        margin-top: 20px;
    }
    
    .navigation-buttons .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .result-header {
        padding: 30px 20px;
    }

    .result-type {
        font-size: 28px;
    }

    .result-description {
        font-size: 16px;
    }

    .score-section {
        padding: 20px 15px;
    }
    
    .score-numbers {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .concentric-chart-container {
        padding: 10px;
    }
    
    .detail-card {
        padding: 20px;
    }
    
    #score-chart {
        height: 300px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .mystical-circle {
        width: 400px;
        height: 400px;
    }
    
    .progress-container {
        padding: 12px 15px;
        margin-bottom: 15px;
    }
    
    .progress-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 15px;
    }

    .character-image {
        width: 180px;
        height: 180px;
    }

    .character-image::before {
        width: 160px;
        height: 160px;
    }

    .message-box {
        padding: 20px 25px;
    }

    .message-text {
        font-size: 14px; /* 16pxから14pxに縮小 */
        line-height: 1.5; /* 行間を更に詰める */
        min-height: 84px; /* 4行分の高さ (14px * 1.5 * 4 ≈ 84px) */
        max-height: 84px;
        padding: 0 5px; /* 左右に少し余白を追加 */
    }

    .option-button {
        padding: 14px 25px;
        min-height: 52px; /* スマホサイズで円形を保つ */
        width: 95%; /* スマホでは幅を広げる */
    }

    .option-button-text {
        font-size: 14px;
        padding: 0 20px;
        line-height: 1.3; /* スマホではコンパクトに */
    }

    .result-image {
        width: 150px;
        height: 150px;
    }

    .mystical-circle {
        width: 300px;
        height: 300px;
    }
}
