/**
 * 神子花診断 スタイルシート v2.0
 * モダンで美しいデザイン
 */

/* ========================================
   基本設定
======================================== */
.micohana-result-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', Meiryo, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Hide specific page header */
body.page-id-253 .entry-header {
    display: none !important;
}

/* ========================================
   ヘッダー
======================================== */
.result-header {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.result-title {
    font-size: 2rem;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.result-title .icon {
    font-size: 2.5rem;
    display: inline-block;
    margin-right: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.birth-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1rem;
    color: #666;
}

.birth-info span {
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    font-weight: 500;
}

/* ========================================
   メインレイアウト：2カラム
======================================== */
.result-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .result-main {
        grid-template-columns: 1fr;
    }
}

.result-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   カード共通スタイル
======================================== */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
}

.card-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* ========================================
   花魂の核
======================================== */
.core-element-display {
    text-align: center;
}

.element-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

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

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

.element-jp {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}

.element-kanji {
    font-size: 1.2rem;
    display: block;
    margin-top: 5px;
    opacity: 0.9;
}

.element-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
}

/* ========================================
   守護動物
======================================== */
.animals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 480px) {
    .animals-grid {
        grid-template-columns: 1fr;
    }
}

.animal-item {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.animal-item.clickable {
    cursor: pointer;
}

.animal-item.clickable:hover {
    transform: scale(1.05) translateY(-3px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.animal-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.animal-item:hover .animal-label {
    color: rgba(255, 255, 255, 0.9);
}

.animal-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 5px 0;
}

.animal-detail-name {
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 600;
    margin: 3px 0;
}

.animal-item:hover .animal-detail-name {
    color: rgba(255, 255, 255, 0.95);
}

.animal-stage {
    font-size: 0.9rem;
    color: #888;
}

.animal-item:hover .animal-stage {
    color: rgba(255, 255, 255, 0.8);
}

.animal-point {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    margin-top: 5px;
}

.animal-item:hover .animal-point {
    color: rgba(255, 255, 255, 0.9);
}

.click-hint {
    font-size: 0.75rem;
    color: #999;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.animal-item.clickable:hover .click-hint {
    opacity: 1;
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   シナリオ
======================================== */
.scenario-content h4 {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.scenario-content p {
    line-height: 1.8;
    color: #555;
}

/* ========================================
   構造の珍しさ
======================================== */
.card-rarity .card-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.rarity-score-display {
    text-align: center;
    margin-bottom: 20px;
}

.score-circle {
    display: inline-block;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.score-level {
    margin-top: 10px;
}

.level-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
}

.level-極めて珍しい {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.level-珍しい {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.level-やや珍しい {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.level-ふつう {
    background: #e0e0e0;
    color: #666;
}

.rarity-features {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.rarity-features h4 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-tag {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.rarity-explanation p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.advice-box {
    padding: 15px;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6cc 100%);
    border-left: 4px solid #ff9800;
    border-radius: 5px;
    line-height: 1.6;
}

/* ========================================
   五行の突出率
======================================== */
.card-prominence .card-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.prominence-display {
    text-align: center;
    margin-bottom: 20px;
}

.prominence-percentage {
    display: inline-block;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(250, 112, 154, 0.4);
}

.percentage-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.percentage-symbol {
    font-size: 1.5rem;
    margin-left: 3px;
}

.prominence-level {
    margin-top: 10px;
}

.prominence-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.prominence-異常値 {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.prominence-極寄り {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.prominence-片寄り {
    background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%);
}

.prominence-強い {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.prominence-やや強 {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
    color: #333;
}

.prominence-分散 {
    background: #e0e0e0;
    color: #666;
}

.prominence-description {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #555;
}

.prominence-explanation {
    margin-top: 15px;
}

.prominence-explanation p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* 五行分布バー */
.elements-distribution {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.elements-distribution h4 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
}

.elements-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.element-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.element-label {
    width: 30px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 3px;
}

.axis-mark {
    color: #ffd700;
    font-size: 1rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

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

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.axis-element {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.axis-note {
    margin-top: 10px;
    padding: 8px;
    background: #fff9e6;
    border-left: 3px solid #ffd700;
    border-radius: 5px;
    font-size: 0.85rem;
    color: #666;
}

.element-bar {
    flex: 1;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.element-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 1s ease;
}

.element-wood {
    background: linear-gradient(90deg, #56ab2f 0%, #a8e063 100%);
}

.element-fire {
    background: linear-gradient(90deg, #eb3349 0%, #f45c43 100%);
}

.element-earth {
    background: linear-gradient(90deg, #c79081 0%, #dfa579 100%);
}

.element-metal {
    background: linear-gradient(90deg, #bdc3c7 0%, #2c3e50 100%);
}

.element-water {
    background: linear-gradient(90deg, #1e3c72 0%, #2a5298 100%);
}

.element-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========================================
   対人ストレス距離
======================================== */
.card-stress .card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stress-gauge {
    margin-bottom: 20px;
}

.gauge-container {
    margin-bottom: 15px;
}

.gauge-bar {
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 1s ease;
    border-radius: 15px;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
}

.current-value {
    font-weight: 700;
    color: #4facfe;
    font-size: 1.1rem;
}

.stress-level-badge {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.stress-description {
    margin: 20px 0;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 10px;
    line-height: 1.8;
}

.stress-details {
    margin: 20px 0;
}

.stress-details h4 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 480px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.9rem;
    color: #666;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4facfe;
}

.interpretation-box {
    margin-top: 20px;
    padding: 15px;
    background: #fff9e6;
    border-radius: 10px;
}

.interp-item {
    margin-bottom: 10px;
    line-height: 1.6;
}

.interp-item:last-child {
    margin-bottom: 0;
}

/* ========================================
   数値指標
======================================== */
.card-metrics .card-header {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.metric-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.metric-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-header h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.metric-badge {
    padding: 5px 12px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.metric-bar {
    height: 35px;
    background: #e0e0e0;
    border-radius: 17px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 17px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
}

.bar-value {
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
}

.metric-value-display {
    text-align: center;
    margin: 15px 0;
}

.value-number {
    font-size: 3rem;
    font-weight: 700;
    color: #43e97b;
    line-height: 1;
}

.value-max {
    font-size: 1.2rem;
    color: #999;
    margin-left: 5px;
}

.metric-description,
.metric-note {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
}

/* ========================================
   フッター
======================================== */
.result-footer {
    text-align: center;
    padding: 20px;
}

.btn-reset {
    padding: 15px 40px;
    background: white;
    color: #667eea;
    border: 3px solid white;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.btn-reset:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ========================================
   レスポンシブ調整
======================================== */
@media (max-width: 768px) {
    .micohana-result-container {
        padding: 15px;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .birth-info {
        flex-direction: column;
        gap: 10px;
    }

    .element-circle {
        width: 120px;
        height: 120px;
    }

    .element-jp {
        font-size: 2rem;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-number {
        font-size: 2rem;
    }

    .card-body {
        padding: 20px;
    }
}

/* ========================================
   アニメーション
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card {
    animation: fadeIn 0.6s ease-out;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.card:nth-child(5) {
    animation-delay: 0.5s;
}

.card:nth-child(6) {
    animation-delay: 0.6s;
}

/* ========================================
   プリント用スタイル
======================================== */
@media print {
    .micohana-result-container {
        box-shadow: none;
        background: white;
    }

    .result-footer {
        display: none;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .modal {
        display: none !important;
    }
}

/* ========================================
   モーダル
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #667eea;
}

/* 動物詳細モーダル */
.animal-detail-container {
    padding: 30px;
}

.animal-detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.animal-detail-header h2 {
    font-size: 2rem;
    color: #333;
    margin: 0 0 15px 0;
}

.animal-detail-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.position-badge,
.stage-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.position-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stage-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.animal-detail-section {
    margin-bottom: 25px;
}

.animal-detail-section h3 {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.essence-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    line-height: 1.8;
}

.animal-detail-section p {
    line-height: 1.8;
    color: #666;
}

.animal-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .animal-detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-box {
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid;
}

.strength-box {
    background: linear-gradient(135deg, #e6f7ff 0%, #d9f7be 100%);
    border-left-color: #52c41a;
}

.weakness-box {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
    border-left-color: #fa8c16;
}

.detail-box h4 {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: #333;
}

.detail-box p {
    margin: 0;
    line-height: 1.6;
}

/* 十二運星詳細 */
.stage-detail-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.stage-detail-section h3 {
    font-size: 1.4rem;
    color: #764ba2;
    margin-bottom: 15px;
}

.stage-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.keyword-tag {
    padding: 6px 14px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stage-description {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.stage-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .stage-detail-grid {
        grid-template-columns: 1fr;
    }
}

.stage-box {
    padding: 20px;
    background: white;
    border-radius: 15px;
    border: 2px solid #eee;
}

.stage-box h4 {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: #667eea;
}

.stage-box p {
    margin: 0;
    line-height: 1.6;
    color: #666;
}

/* モーダルのレスポンシブ */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .animal-detail-container {
        padding: 20px;
    }

    .animal-detail-header h2 {
        font-size: 1.5rem;
    }
}

/* ========================================
   守護神詳細モーダル & SWPバッジ追加スタイル
   ======================================== */

/* SWPバッジ (カード内表示) */
.animal-swp-type {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    /* Gold Gradient */
    color: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

/* モーダル基本設定 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 4% auto;
    padding: 30px;
    border-radius: 20px;
    width: 92%;
    max-width: 800px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* モーダル内コンテンツ */
.animal-detail-container {
    color: #333;
}

.animal-detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.animal-detail-header h2 {
    font-size: 2.2rem;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.animal-detail-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.position-badge,
.stage-badge {
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.position-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stage-badge {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* セクションスタイル */
.animal-detail-section,
.stage-detail-section {
    margin-bottom: 30px;
}

.animal-detail-section h3,
.stage-detail-section h3 {
    font-size: 1.3rem;
    color: #444;
    border-left: 5px solid #667eea;
    padding-left: 15px;
    margin-bottom: 15px;
    font-weight: 700;
}

.essence-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 15px;
    font-style: italic;
    border: 1px solid #eee;
    margin-bottom: 20px;
}

/* グリッドレイアウト */
.animal-detail-grid,
.stage-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {

    .animal-detail-grid,
    .stage-detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-box,
.stage-box {
    padding: 20px;
    border-radius: 12px;
    transition: transform 0.2s;
}

.detail-box:hover,
.stage-box:hover {
    transform: translateY(-3px);
}

.strength-box {
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    border: 1px solid #a5d6a7;
}

.weakness-box {
    background: linear-gradient(145deg, #ffebee, #ffcdd2);
    border: 1px solid #ef9a9a;
}

.stage-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.detail-box h4,
.stage-box h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 12段階・キーワード */
.stage-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.keyword-tag {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stage-description {
    line-height: 1.9;
    color: #555;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
}

/* スクロールロック制御用クラス (JSでbodyに付与) */
.no-scroll {
    overflow: hidden;
}

/* ========================================
   KRI関連（旧コード互換用）
======================================== */
.kri-section {
    margin: 40px 0;
    padding: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.kri-section h2 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
}

.section-subtitle {
    opacity: 0.9;
    margin-bottom: 25px;
    font-size: 14px;
}

/* KRIゲージコンテナ */
.kri-gauge-container {
    background: rgba(255, 255, 255, 0.15);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin: 25px 0;
}

.kri-gauge-wrapper {
    margin-bottom: 25px;
}

/* KRIゲージ本体 */
.kri-gauge {
    position: relative;
    height: 50px;
    background: linear-gradient(to right,
            #1976D2 0%,
            /* 深吸収: 濃青 */
            #2196F3 20%,
            /* 吸収: 青 */
            #4CAF50 40%,
            /* 中立: 緑 */
            #FF9800 60%,
            /* 放射: オレンジ */
            #F44336 80%,
            /* 強放射: 赤 */
            #D32F2F 100%
            /* 過放射: 濃赤 */
        );
    border-radius: 25px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

/* KRIマーカー */
.kri-marker {
    position: absolute;
    top: -8px;
    transform: translateX(-50%);
    width: 6px;
    height: 66px;
    background: white;
    border: 3px solid #333;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.kri-marker-value {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ゾーンラベル */
.kri-zones {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    opacity: 0.95;
    padding: 0 10px;
}

.zone {
    text-align: center;
    flex: 1;
}

/* 現在値表示 */
.kri-current-value {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.kri-number {
    font-size: 64px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.kri-label-main {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.kri-short-desc {
    font-size: 18px;
    opacity: 0.9;
    font-style: italic;
}

/* ゾーン詳細情報 */
.kri-zone-detail {
    background: rgba(255, 255, 255, 0.15);
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    backdrop-filter: blur(5px);
}

.zone-title {
    font-size: 24px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zone-icon {
    font-size: 28px;
}

.zone-description {
    line-height: 1.8;
    font-size: 16px;
    margin: 15px 0;
}

/* 講師用メモ */
.instructor-note {
    margin-top: 20px;
    padding: 18px;
    background: rgba(255, 193, 7, 0.2);
    border-left: 5px solid #FFC107;
    border-radius: 8px;
    font-size: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.note-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* KRI説明セクション */
.kri-explanation {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
}

.kri-explanation h4 {
    font-size: 20px;
    margin-bottom: 20px;
}

.explanation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.explanation-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.explanation-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.explanation-text {
    font-size: 14px;
    line-height: 1.6;
}

.explanation-text strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

/* ========================================
   対人圧力値（新セクション）
======================================== */
.interpersonal-pressure-section,
.energy-breakdown-section,
.energy-type-section {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.interpersonal-pressure-section h2,
.energy-breakdown-section h2,
.energy-type-section h2 {
    font-size: 1.5rem;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.section-subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* 圧力ゲージ */
.pressure-gauge-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.pressure-gauge-wrapper {
    margin-bottom: 30px;
}

.pressure-gauge {
    height: 30px;
    background: linear-gradient(90deg,
            #4facfe 0%,
            /* 深吸収 */
            #00f2fe 30%,
            /* 吸収 */
            #e0e0e0 45%,
            /* 中立 */
            #e0e0e0 55%,
            /* 中立 */
            #ff9a9e 70%,
            /* 放射 */
            #ff5e62 100%
            /* 強放射 */
        );
    border-radius: 15px;
    position: relative;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pressure-marker {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 40px;
    background: #333;
    transform: translateX(-50%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.pressure-marker::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #333;
}

.pressure-marker-value {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.pressure-zones {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-top: 15px;
    padding: 0 10px;
}

.zone {
    position: relative;
}

.zone::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 10px;
    background: #ccc;
}

/* 現在値表示 */
.pressure-current-value {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pressure-number {
    font-size: 3rem;
    font-weight: 800;
    color: #333;
    line-height: 1;
    margin-bottom: 5px;
}

.pressure-label-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.pressure-short-desc {
    color: #666;
    font-size: 0.95rem;
}

/* ゾーン詳細 */
.pressure-zone-detail {
    background: #f0f8ff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.zone-title {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zone-description {
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.instructor-note {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccd;
    font-size: 0.9rem;
    color: #444;
}

/* 説明グリッド */
.explanation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 600px) {
    .explanation-grid {
        grid-template-columns: 1fr;
    }
}

.explanation-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
}

/* 五行エネルギーバー */
.energy-bars {
    margin-bottom: 25px;
}

.energy-bar-item {
    margin-bottom: 15px;
}

.energy-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.energy-bar-container {
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
}

.energy-bar-fill {
    height: 100%;
    border-radius: 6px;
    position: relative;
    transition: width 1s ease-in-out;
}

.bar-percentage {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

/* 五行カード */
.element-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 15px;
}

@media (max-width: 600px) {
    .element-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.element-card {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}

.element-card strong {
    display: block;
    margin: 5px 0;
    color: #333;
}

.element-card p {
    margin: 0;
    color: #666;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* エネルギータイプ */
.energy-type-card {
    background: linear-gradient(135deg, #fff 0%, #f4f7f6 100%);
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.energy-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.energy-type-card .type-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.energy-type-card .type-name {
    font-size: 1.8rem;
    color: #333;
    margin: 0 0 10px 0;
}

.energy-type-card .type-description {
    color: #555;
    margin-bottom: 20px;
}

.type-advice {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.advice-text {
    margin: 0;
    color: #667eea;
    font-weight: 600;
}

/* ストレス比較 */
.stress-metrics-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 600px) {
    .stress-metrics-comparison {
        grid-template-columns: 1fr;
    }
}

.stress-metric-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stress-metric-card.internal {
    background: #fff0f0;
    border: 1px solid #ffcccc;
}

.stress-metric-card.interpersonal {
    background: #f0f8ff;
    border: 1px solid #cceeff;
}

.stress-metric-card .metric-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.metric-definition {
    font-size: 0.95rem;
    margin: 10px 0 15px;
}

.metric-points {
    text-align: left;
    padding-left: 20px;
    font-size: 0.85rem;
    color: #555;
}

.comparison-note {
    background: #fff9c4;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin-top: 15px;
}

/* ========================================
   タブナビゲーション (Enhanced for Clickability)
======================================== */
.result-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: relative;
    /* Ensure z-index works */
    z-index: 1000;
    /* Force on top of other elements */
}

.tab-btn {
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 1rem;
    color: #666;
    cursor: pointer !important;
    /* Force cursor pointer */
    transition: all 0.3s ease;
    font-weight: bold;
    outline: none;
    position: relative;
    /* Ensure z-index works */
    z-index: 1001;
    /* Force on top of container */
    pointer-events: auto !important;
    /* Force clickability */
}

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

.tab-btn.active {
    background-color: #e91e63;
    /* Pink accent */
    color: white;
    border-color: #e91e63;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.3);
}

/* タブコンテンツ制御 */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

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

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

/* ========================================
   相性診断フォーム (追加スタイル)
======================================== */
/* 相性診断フォームのアイコンやヘッダーを汎用的なものに */
.partner-header {
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.partner-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.partner-title {
    color: #555;
    /* 性別に依存しない落ち着いた色 */
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

/* 診断ボタンを少し落ち着いた、かつ特別な色（パープルゴールド系など）に */
.submit-button.compatibility-btn {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 4px 15px rgba(161, 140, 209, 0.3);
}

/* スマホでの血液型セレクトボックスの見え方 */
.blood-select-container select {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

/* モバイル表示でのズーム防止と入力欄の修正 */
@media screen and (max-width: 480px) {
    .compatibility-form .form-group {
        margin-bottom: 20px;
    }

    .compatibility-form input,
    .compatibility-form select {
        font-size: 16px !important;
        /* iOS zoom prevention */
        max-width: 100%;
        box-sizing: border-box;
    }

    .compatibility-form .time-select-container {
        width: 100%;
    }

    .compatibility-form .time-input {
        width: 100%;
        max-width: none;
        /* override previous max-width */
    }
}
/* 時間入力（プルダウン）のスタイル */
.time-dropdown-group {
    display: flex;
    align-items: center;
    gap: 5px;
}
.time-select {
    flex: 1;
    max-width: 80px; /* プルダウンの幅を制限 */
}
.time-separator {
    font-weight: bold;
    color: #555;
    padding: 0 5px;
}

/* ========================================
   相性診断フォーム (User Optimized Fix)
======================================== */

/* カード全体：スマホの幅に収める */
.hanamamori-form-card.compatibility-form {
    width: 95% !important;
    max-width: 450px;
    margin: 15px auto !important;
    padding: 20px !important;
    box-sizing: border-box !important; /* 絶対に必須 */
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

/* ラベル：重なりを防止するために一行を独占させる */
.compatibility-form .form-label {
    display: block !important;
    width: 100% !important;
    margin: 10px 0 8px 0 !important;
    font-weight: bold;
    font-size: 0.95rem;
    color: #333;
    text-align: left;
}

/* プルダウンの並び：スマホの幅に合わせて伸縮 */
.compatibility-form .birth-select-container {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box;
}

.compatibility-form .select-wrapper {
    flex: 1 !important; /* 均等に横幅を分ける */
    min-width: 0;
}

/* 入力パーツ共通：高さを出し、押しやすく */
.compatibility-form .form-control, 
.compatibility-form .select-wrapper select {
    width: 100% !important;
    height: 48px !important;
    font-size: 16px !important; /* iOSのズーム防止 */
    padding: 0 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 10px !important;
    background-color: #f9f9f9 !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
}

/* ボタンのデザイン */
.submit-button.compatibility-btn {
    width: 100% !important;
    height: 54px !important;
    margin-top: 25px !important;
    background: #e91e63; /* 診断ボタンらしい色 */
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

.help-text {
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
}
