/* style.css - ふるさと納税「自己負担2000円」魔法チェッカー */

.bg-magic {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* 魔法や錬金術、お肉の炎を連想させるお祭り感のあるグラデーション */
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 20%, #ea580c 50%, #be123c 100%);
    background-size: 300% 300%;
    animation: magicAura 12s ease infinite;
    z-index: -1;
}

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

body {
    color: #1e293b;
    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: 800px;
    padding: 60px 20px 40px;
    position: relative;
    z-index: 10;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #9f1239;
    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.magic-app-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid #fbbf24;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(190, 18, 60, 0.3), 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, #ea580c, #be123c);
    -webkit-background-clip: text;
    background-clip: text;
    -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: #e11d48;
}

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

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 20px;
}
.grid-inputs:last-child { margin-bottom: 0; }

.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: #ea580c;
}

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

/* ラジオボタン 家族構成UI */
.family-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-card {
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 12px 5px;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.radio-card input[type="radio"]:checked + .radio-label {
    background: #fff1f2;
    border-color: #e11d48;
    color: #be123c;
    box-shadow: 0 4px 6px rgba(225, 29, 72, 0.15);
    transform: translateY(-2px);
}

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

/* 視覚的アリーナ (魔法の箱) */
.visual-section {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border: 2px dashed #fbbf24;
    margin-bottom: 1.5rem;
    text-align: center;
}

.magic-title {
    font-weight: bold;
    margin-bottom: 20px;
    color: #b45309;
    font-size: 1.1rem;
}

.loot-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 80px;
    padding: 15px;
    background: rgba(254, 243, 199, 0.3);
    border-radius: 12px;
    font-size: 2.2rem;
    margin-bottom: 20px;
}

/* ポップするアニメーション */
.loot-item {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0);
}

@keyframes popIn {
    to { opacity: 1; transform: scale(1); }
}

.magic-equation {
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 0.95rem;
}

.magic-equation .cost { color: #64748b; }
.magic-equation .arrow { color: #fbbf24; font-weight: 900; }
.magic-equation .value { color: #e11d48; }
.magic-equation .value strong { font-size: 1.3rem; }

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

.stat-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

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

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

.limit { color: #334155; }

.net-box {
    background: rgba(255, 241, 242, 0.8);
    border-color: #f43f5e;
    border-style: solid;
    border-width: 2px;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.2);
}
.net-box .stat-value.highlight {
    color: #be123c;
    font-size: 2.2rem;
}

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

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

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

.verdict-magic {
    border-color: #fbbf24;
    background: #fffbeb;
}

@media (max-width: 650px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
