/* assets/css/style.css */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f3ff;
    color: #333;
}

a {
    color: #4b5cff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-header {
    background: linear-gradient(90deg, #4b5cff, #8f5cff);
    color: #fff;
    padding: 16px 0;
    margin-bottom: 24px;
}

.site-title {
    margin: 0;
    font-size: 1.6rem;
}

.site-nav {
    margin-top: 8px;
}

.site-nav a {
    margin-right: 12px;
    font-size: 0.95rem;
    color: #f5f5ff;
}

.site-main {
    padding-bottom: 40px;
}

.site-footer {
    background: #222;
    color: #aaa;
    font-size: 0.85rem;
    padding: 12px 0;
    text-align: center;
}

.hero {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.hero h2 {
    margin-top: 0;
}

.fortune-form-section,
.about,
.result-header,
.main-yokai,
.fortune-daily,
.fortune-related,
.fortune-weekly,
.fortune-monthly,
.error-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.fortune-form {
    max-width: 360px;
}

.form-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.form-row label {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.form-row input[type="date"] {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: #4b5cff;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #4b5cff;
    border: 1px solid #4b5cff;
}

.btn-primary:hover,
.btn-secondary:hover {
    opacity: 0.9;
}

.yokai-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.yokai-image img {
    max-width: 140px;
    height: auto;
    border-radius: 12px;
    border: 2px solid #eee;
    background: #fafafa;
}

.yokai-info h4 {
    margin-top: 0;
    margin-bottom: 6px;
}

.yokai-trait,
.yokai-element {
    font-size: 0.9rem;
    margin: 2px 0;
}

.yokai-desc {
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.fortune-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.fortune-item {
    background: #f7f6ff;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
}

.fortune-item h4 {
    margin-top: 0;
    font-size: 0.95rem;
}

.related-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.related-lists ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
}

.error-section h2 {
    margin-top: 0;
}

.back-link {
    text-align: center;
}

@media (max-width: 600px) {
    .yokai-card {
        flex-direction: column;
    }
}


/* --- 追加: 妖怪図鑑用 --- */

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yokai-filter {
    margin-bottom: 16px;
}

.yokai-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: flex-end;
}

.form-row-inline {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.form-row-inline select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.yokai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.yokai-card-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.yokai-card-list:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.yokai-card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.yokai-card-thumb {
    width: 80px;
    min-height: 80px;
    background: #f4f3ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yokai-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.yokai-card-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: #e0ddff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #4b4a7a;
}

.yokai-card-placeholder.detail {
    width: 120px;
    height: 120px;
    font-size: 1.2rem;
    border-radius: 24px;
}

.yokai-card-body {
    padding: 10px 12px;
    font-size: 0.9rem;
    flex: 1;
}

.yokai-card-title {
    margin: 0 0 4px;
    font-size: 1rem;
}

.yokai-card-meta {
    margin: 0;
    font-size: 0.78rem;
    color: #666;
    line-height: 1.4;
}

.yokai-card-trait {
    margin: 4px 0;
    font-size: 0.85rem;
    color: #444;
}

.yokai-card-snippet {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #777;
}

.yokai-detail .detail-card {
    flex-direction: row;
}

.yokai-detail .yokai-image {
    margin-right: 16px;
}

.yokai-detail-meta {
    font-size: 0.9rem;
    line-height: 1.5;
}

.yokai-detail-trait {
    font-size: 0.95rem;
    margin-top: 8px;
}

.yokai-detail-text {
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.yokai-detail-note {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #666;
}

@media (max-width: 600px) {
    .yokai-card-link {
        flex-direction: row;
    }
    .yokai-detail .detail-card {
        flex-direction: column;
    }
    .yokai-detail .yokai-image {
        margin-right: 0;
        margin-bottom: 12px;
        text-align: center;
    }
}



/* ====== 占い結果ページ用レイアウト ====== */

.result-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: #777;
}

.result-breadcrumb a {
    color: #777;
    text-decoration: none;
}

.result-breadcrumb a:hover {
    text-decoration: underline;
}

.result-hero-card {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, #f7f2ff, #fdfbff);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.result-hero-left,
.result-hero-right {
    flex: 1 1 260px;
}

.result-date-line {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 6px;
}

.result-title {
    margin: 4px 0;
    font-size: 1.4rem;
}

.result-subtitle {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #555;
}

.result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-element {
    background: #e0f5ff;
    color: #246a8d;
}

.badge-relation {
    background: #ffe8f0;
    color: #b24074;
}

.result-hero-main {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.yokai-main-name {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.yokai-main-trait {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #444;
}

.yokai-main-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.yokai-hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.yokai-hero-image img {
    max-width: 160px;
    max-height: 160px;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.yokai-hero-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    background: #e0ddff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #4b4a7a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.result-hero-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #777;
    text-align: center;
}

/* 今日の運勢セクション */
.fortune-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.fortune-overall-card {
    background: #fff7f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid #ffe1c2;
}

.fortune-overall-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.fortune-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.fortune-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #eee;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.02);
}

.fortune-card h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.fortune-card p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.fortune-advice-card {
    background: #f0f7ff;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #cfe4ff;
    font-size: 0.9rem;
}

/* 関連妖怪 */
.related-section {
    margin-bottom: 20px;
}

.related-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.related-box {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.related-good {
    background: #f1fff5;
    border: 1px solid #c6f0cf;
}

.related-bad {
    background: #fff5f5;
    border: 1px solid #f2c6c6;
}

.related-box h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.related-box ul {
    padding-left: 18px;
    margin: 0;
}

.related-box li {
    margin-bottom: 4px;
}

.yokai-chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dfeadf;
    font-size: 0.82rem;
}

.yokai-chip.bad {
    border-color: #f0c4c4;
    background: #fffafa;
}

.yokai-chip small {
    margin-left: 4px;
    color: #777;
}

/* 週・月 運勢 */
.fortune-week-month {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.fortune-card-wide {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #eee;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02);
    font-size: 0.9rem;
    line-height: 1.6;
}

.fortune-card-wide .section-title {
    margin-bottom: 4px;
}

.back-link {
    margin-top: 20px;
    text-align: center;
}

@media (max-width: 640px) {
    .result-hero-card {
        padding: 12px;
    }
}