/* style.css - NISA・iDeCo「税金無効化」究極チェッカー */

.bg-tax-free {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* プラチナ・ゴールド・クリアな光が差し込む「無敵モード」のグラデーション */
    background: linear-gradient(135deg, #f8fafc 0%, #fef3c7 30%, #fde68a 70%, #f59e0b 100%);
    background-size: 300% 300%;
    animation: platinumAura 15s ease infinite;
    z-index: -1;
}

@keyframes platinumAura {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    color: #334155;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

.sim-container {
    width: 100%;
    max-width: 850px;
    padding: 60px 20px 40px;
    position: relative;
    z-index: 10;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #b45309;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.back-link:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.main-app-card.tax-free-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid #fde047;
    border-radius: 24px;
    padding: 35px 24px;
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.2), inset 0 0 20px rgba(255, 255, 255, 1);
}

.sim-header {
    text-align: center;
    margin-bottom: 2rem;
}

.sim-header h2 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #d97706, #fbbf24, #d97706);
    -webkit-background-clip: text;
    background-clip: text; /* 追加: LINTエラー回避策 */
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.sim-header p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}
.sim-header p strong {
    color: #b45309;
}

/* 入力エリア */
.input-section {
    background: #fffcf2;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #fef08a;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-row {
    grid-column: 1 / -1;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1e293b;
    font-size: 0.95rem;
}

.highlight-val {
    font-size: 1.6rem;
    font-weight: 900;
    color: #f59e0b;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: #fef08a;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 4px solid #f59e0b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sub-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* 比較アリーナ (積み上げ棒グラフの横並び) */
.visual-section {
    background: #fff;
    padding: 25px 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    text-align: center;
}

.arena-title {
    font-weight: bold;
    margin-bottom: 25px;
    color: #475569;
    font-size: 1.1rem;
}

.comparison-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 300px;
    gap: 20px;
    padding: 0 10px;
}

.bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.bar-label {
    font-weight: bold;
    color: #64748b;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.shield-label {
    color: #b45309;
}

.stacked-bar {
    width: 100%;
    max-width: 120px;
    display: flex;
    flex-direction: column-reverse; /* 下から積み上げ */
    border-radius: 12px 12px 4px 4px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: all 0.5s ease;
}

/* NISA側は特別バリア効果 */
.shield-bar {
    border: 2px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.chunk-principal {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    min-height: 20px;
    transition: all 0.5s ease;
}

.chunk-net-yield {
    background: linear-gradient(135deg, #93c5fd, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    min-height: 20px;
    transition: all 0.5s ease;
}

.chunk-tax {
    background: linear-gradient(135deg, #fca5a5, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    min-height: 10px;
    opacity: 0.9;
    transition: all 0.5s ease;
}

.chunk-yield {
    background: linear-gradient(135deg, #fde047, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a3412;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
    min-height: 20px;
    transition: all 0.5s ease;
}

.end-value {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #64748b;
}
.end-value.highlighting {
    color: #d97706;
    font-size: 1.4rem;
}

/* 結果セクション */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 20px;
}

.stat-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.shield-box {
    background: rgba(254, 252, 232, 0.8);
    border: 2px dashed #fcd34d;
}

.highlight-box {
    background: #fff;
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.stat-title {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: bold;
    line-height: 1.4;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
}

.shield { color: #ea580c; }

.absolute { 
    background: linear-gradient(90deg, #d97706, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text; /* 追加: LINTエラー回避策 */
    -webkit-text-fill-color: transparent;
    font-size: 2.3rem;
}

.final-verdict {
    background: #fffbeb;
    border: 2px solid #fde047;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.final-verdict h3 {
    margin-bottom: 10px;
    color: #b45309;
}

.final-verdict p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

@media (max-width: 650px) {
    .grid-inputs { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .comparison-bars {
        height: 250px;
    }
}
