:root {
	--bg-base: #f4f3ee;      
	--bg-panel: #eae9e2;     
	--bg-input: #fcfcfb;     
	--text-main: #2b2b2a;    
	--text-muted: #7a7368;   
	--border-color: #dcdbd3; 
	
	--accent-brick: #b84a39; 
	--accent-slate: #6b7a75; 
	--accent-olive: #8a8867; 
	
	--font-base: 'Helvetica Neue', 'Noto Sans JP', sans-serif;
	--font-logo: 'Playfair Display', serif; 
	--transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body { background-color: var(--bg-base); color: var(--text-main); font-family: var(--font-base); line-height: 1.6; overflow-x: hidden; }

.rams-container { max-width: 1200px; margin: 0 auto; padding: 20px; min-height: 100vh; display: flex; flex-direction: column; }
.rams-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 0 25px 0; border-bottom: 2px solid var(--text-muted); }
.title-link { text-decoration: none; color: var(--text-main); }
/* 🌟 正体（normal）に修正 */
/* 修正後（line-height: 1.1; を追加） */
.title-link h1 { 
	font-family: var(--font-logo); 
	font-size: 2rem; 
	font-weight: 600; 
	font-style: normal; 
	letter-spacing: 0.5px; 
	line-height: 1.1; /* 🌟 行間を詰める設定を追加 */
}
.header-controls { display: flex; align-items: center; gap: 15px; }

.lang-select {
	background: transparent; border: 1px solid var(--border-color); color: var(--text-muted);
	padding: 6px 12px; border-radius: 4px; font-family: var(--font-base); font-size: 0.85rem;
	cursor: pointer; outline: none; transition: var(--transition);
}
.lang-select:hover { border-color: var(--text-muted); color: var(--text-main); }
.lang-select:focus { border-color: var(--text-main); }

.btn-info-toggle { width: 32px; height: 32px; border-radius: 50%; background-color: var(--bg-panel); border: 1px solid var(--border-color); color: var(--text-muted); font-family: serif; font-style: italic; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); box-shadow: inset 0 1px 2px #fff, 0 2px 4px rgba(0,0,0,0.05); }
.btn-info-toggle:hover { background-color: var(--text-muted); color: #fff; }

/* 🌟 グリッドアイテムのはみ出しを防ぐ `minmax(0, 1fr)` の適用 */
.rams-main-grid { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 30px; margin-top: 30px; flex: 1; }
@media (max-width: 850px) { .rams-main-grid { grid-template-columns: 1fr; } }

.rams-panel { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; padding: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); position: relative; }

.rams-step-indicator { display: flex; gap: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 25px; }
.rams-step-indicator .step { font-size: 0.85rem; color: var(--border-color); font-weight: bold; transition: var(--transition); display: flex; align-items: center; gap: 8px; }
.rams-step-indicator .step.active { color: var(--accent-brick); }
.step-arrow { color: var(--border-color); font-size: 0.7rem; }
.step.active .step-arrow { color: var(--accent-brick); }

.intro-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; white-space: pre-wrap; }
.section-title { font-size: 1.4rem; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; margin-bottom: 32px; }
.summon-header-text { font-size: 1.2rem; font-weight: bold; margin-bottom: 32px; }
.quiz-question { font-size: 1.3rem; margin-bottom: 40px; line-height: 1.5; }
label { display: block; font-weight: bold; font-size: 0.9rem; margin-bottom: 12px; color: var(--text-main); }

textarea { width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 6px; font-family: var(--font-base); font-size: 1rem; color: var(--text-main); resize: none; outline: none; transition: var(--transition); margin-bottom: 15px; }
textarea:focus { border-color: var(--text-muted); }

button { font-family: var(--font-base); cursor: pointer; border-radius: 6px; font-weight: bold; transition: var(--transition); border: none; padding: 12px 20px; width: 100%; font-size: 0.95rem; }
.rams-btn-primary { background: var(--text-main); color: var(--bg-base); margin-top: 5px; }
.rams-btn-primary:hover { background: #1a1a1a; }
.rams-btn-secondary { background: transparent; border: 1px solid var(--text-muted); color: var(--text-main); margin-top: 10px; }
.rams-btn-secondary:hover { background: var(--border-color); }
.rams-btn-accent { background: var(--accent-brick); color: #fff; margin-bottom: 10px; }
.rams-btn-accent:hover { background: #9c3c2e; }
.rams-btn-option { background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main); text-align: left; padding: 15px; margin-bottom: 12px; }
.rams-btn-option:hover { border-color: var(--text-muted); background: #fdfdfc; }
.rams-btn-text { background: transparent; color: var(--text-muted); padding: 8px; text-decoration: underline; font-size: 0.85rem; }
.rams-btn-text:hover { color: var(--text-main); }
.rams-btn-outline { background: var(--bg-input); border: 1px dashed var(--text-muted); color: var(--text-main); font-size: 0.85rem; padding: 10px; margin-bottom: 10px; transition: var(--transition); }
.rams-btn-outline:hover { background: var(--border-color); border-style: solid; }
.action-divider { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: 5px 0 15px 0; }
.btn-back { width: auto; padding: 6px 12px; font-size: 0.8rem; background: transparent; color: var(--text-muted); border: 1px solid var(--border-color); margin-bottom: 24px; border-radius: 4px; }
.btn-back:hover { background: var(--border-color); color: var(--text-main); }
.btn-reset-small { width: auto; margin-top: 10px; }

.current-issue-box { border-left: 4px solid var(--text-muted); padding-left: 15px; margin-top: 20px; }
.current-issue-box small { font-weight: bold; color: var(--text-muted); }
.res-text { font-size: 1.1rem; font-weight: bold; margin-top: 5px; }

/* Carousel Layout */
.carousel-wrapper { position: relative; display: flex; align-items: center; width: 100%; min-width: 0; }
.slider-btn { width: 36px; height: 36px; border-radius: 50%; padding: 0; background: var(--bg-panel); border: 1px solid var(--border-color); color: var(--text-muted); font-size: 1.1rem; display: flex; align-items: center; justify-content: center; position: absolute; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: var(--transition); flex-shrink: 0; }
.slider-btn:hover { background: var(--text-muted); color: #fff; border-color: var(--text-muted); }
.slider-btn.left { left: 0px; } 
.slider-btn.right { right: 0px; }

.carousel-container { 
	display: flex; gap: 20px; overflow-x: auto; 
	width: 100%;
	padding: 10px 45px 20px 45px; 
	scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; 
}
.carousel-container::-webkit-scrollbar { display: none; }

.oracle-card { flex: 0 0 240px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; scroll-snap-align: center; position: relative; cursor: pointer; transform-style: preserve-3d; transition: transform 0.4s ease, border-color 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.oracle-card:hover { transform: translateY(-5px); border-color: var(--text-muted); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }

.mind-card-active { flex: 1; max-width: 300px; transform: none; cursor: default; border-top: 4px solid var(--accent-slate); }
.mind-card-active:hover { transform: none; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.card-active { flex: 1; max-width: 300px; transform: none; cursor: default; border-top: 4px solid var(--accent-brick); }
.card-active:hover { transform: none; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }

@media (max-width: 768px) {
	.carousel-container { flex-direction: column; padding: 10px 0 20px 0; overflow-x: visible; scroll-snap-type: none; }
	.slider-btn { display: none; }
	.oracle-card { flex: 1 1 auto; width: 100%; max-width: none; }
	.dual-cards { flex-direction: column; }
	.mini-card { max-width: 100%; }
}

.dual-cards { gap: 15px !important; }
.mini-card { padding: 15px; }
.mini-card h3 { font-size: 1.05rem !important; margin-bottom: 8px !important; }
.mini-card .card-desc { display: none; }
.mini-card .card-phil { font-size: 0.85rem; }

.card-corner { font-family: serif; font-size: 1.2rem; position: absolute; top: 15px; right: 20px; opacity: 0.7; }
.corner-mind { color: var(--accent-slate); }
.corner-card { color: var(--accent-brick); }

.oracle-card h3 { font-size: 1.2rem; margin-bottom: 16px; color: var(--text-main); }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.card-label { font-size: 0.8rem; color: var(--text-main); display: block; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; margin-bottom: 12px; }
.card-phil { font-size: 0.9rem; font-weight: bold; }

.workspace-grid { display: flex; gap: 30px; align-items: flex-start; }
@media (max-width: 768px) { .workspace-grid { flex-direction: column; } }
.card-action-area { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; }

.insight-box { background: var(--text-main); color: var(--bg-base); padding: 15px; border-radius: 6px; margin: 32px 0 24px 0; font-weight: bold; font-size: 1.05rem; }

.result-badge { display: inline-block; background: var(--text-main); color: var(--bg-base); padding: 4px 12px; font-size: 0.8rem; font-weight: bold; border-radius: 12px; margin-bottom: 16px; }
.result-timeline { border-left: 2px solid var(--border-color); margin-left: 10px; padding-left: 20px; margin-top: 24px; }
.res-node { margin-bottom: 25px; position: relative; }
.res-node::before { content: ''; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-color); }
.node-issue::before { background: var(--text-muted); }
.highlight-node::before { background: var(--accent-olive); }
.flex-node { display: flex; gap: 20px; }
@media (max-width: 600px) { .flex-node { flex-direction: column; gap: 15px; } }
.node-half { flex: 1; background: var(--bg-input); padding: 15px; border-radius: 6px; border: 1px solid var(--border-color); }
.border-mind { border-top: 3px solid var(--accent-slate); }
.border-card { border-top: 3px solid var(--accent-brick); }
.res-sub-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 5px; }
.res-text-large { font-size: 1.2rem; font-weight: bold; color: var(--accent-olive); margin-top: 5px; }

.share-buttons { display: flex; gap: 10px; margin-bottom: 15px; }
.share-buttons button { background: var(--text-main); color: #fff; width: auto; flex: 1; }

.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 2000; display: flex; justify-content: flex-end; transition: opacity 0.3s ease; }
.modal.hidden { display: none !important; }
.modal-backdrop { position: absolute; width: 100%; height: 100%; background-color: rgba(43, 43, 42, 0.4); backdrop-filter: blur(2px); }
.modal-rams-container { position: relative; width: 100%; max-width: 400px; height: 100%; background-color: var(--bg-base); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 40px; z-index: 2001; animation: slideIn 0.3s ease; overflow-y: auto;}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.modal-rams-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--text-muted); padding-bottom: 15px; margin-bottom: 24px; }
.close-rams-btn { background: none; border: none; font-size: 2rem; color: var(--text-muted); line-height: 1; padding: 0; width: auto; }
.close-rams-btn:hover { color: var(--accent-brick); }
.pre-line-text { white-space: pre-line; font-size: 0.9rem; color: var(--text-muted); }

.standby-visual { display: flex; flex-direction: column; justify-content: center; height: 100%; min-height: 400px; padding: 0 20px; }
/* 🌟 正体（normal）に修正 */
.standby-logo { font-family: var(--font-logo); font-size: 4rem; font-style: normal; color: var(--text-main); margin-bottom: 15px; line-height: 1.1; }
.standby-copy { font-size: 1.25rem; font-weight: bold; color: var(--accent-brick); margin-bottom: 15px; }
.standby-desc { font-size: 0.95rem; color: var(--text-muted); max-width: 90%; line-height: 1.7; margin-bottom: 30px; }

.rams-footer { margin-top: 50px; padding-top: 25px; border-bottom: 1px solid transparent; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; gap: 15px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.8rem; transition: var(--transition); }
.footer-links a:hover { color: var(--text-main); text-decoration: underline; }
.copyright { font-size: 0.75rem; color: var(--text-muted); }

.hidden { display: none !important; }
.mt-20 { margin-top: 20px; }