/* style.css - フリマアプリ「梱包ダルすぎ」骨折り損チェッカー */

.bg-mercari {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* フリマアプリを連想させる赤、および梱包の段ボール色（クラフトオレンジ）のポップなグラデーション */
    background: linear-gradient(135deg, #fee2e2 0%, #ffedd5 50%, #fef3c7 100%);
    background-size: 300% 300%;
    animation: craftPop 15s ease infinite;
    z-index: -1;
}

@keyframes craftPop {
    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: 800px;
    padding: 60px 20px 40px;
    position: relative;
    z-index: 10;
}

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

.main-app-card.mercari-app-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid #fca5a5;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.15), 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, #ef4444, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.sim-header p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
}

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

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 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.3rem;
    font-weight: 900;
    color: #ea580c;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: #fed7aa;
    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 #f97316;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2);
}

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

/* ラジオボタン 送料UI */
.shipping-selector {
    display: flex;
    gap: 10px;
}

.radio-card {
    cursor: pointer;
    flex: 1;
    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: 10px 5px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.radio-card input[type="radio"]:checked + .radio-label {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* 視覚的アリーナ (積み上げバー) */
.visual-section {
    background: #fafaf9; /* クラフト系の極淡い色 */
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e7e5e4;
    margin-bottom: 1.5rem;
}

.box-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    color: #334155;
}

.box-title span {
    color: #ef4444;
    font-size: 1.2rem;
    font-weight: 900;
}

.box-bar-wrapper {
    width: 100%;
    height: 36px;
    background: #f1f5f9;
    border-radius: 18px;
    display: flex;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.bar-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.5s ease;
}

.segment-fee { background: repeating-linear-gradient(45deg, #ef4444, #ef4444 10px, #dc2626 10px, #dc2626 20px); }
.segment-ship { background: #3b82f6; } /* ブルー */
.segment-labor { background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 10px, #d97706 10px, #d97706 20px); } /* 警告のオレンジ */
.segment-net { background: linear-gradient(90deg, #10b981, #059669); } /* 緑：実質利益 */

.breakdown-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: #475569;
}

.bd-item strong {
    color: #ea580c;
    font-size: 1rem;
}

.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

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

.stat-box {
    background: #fff;
    border: 1px dashed #cbd5e1;
    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;
}

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

.net-box {
    background: rgba(254, 243, 199, 0.4);
    border-color: #f59e0b;
    border-style: solid;
}
.net-box .stat-value.highlight {
    color: #ea580c;
    font-size: 2.2rem;
}

/* 赤字時の手取りスタイル変更 */
.net-box.deficit {
    background: rgba(254, 226, 226, 0.5);
    border-color: #ef4444;
}
.net-box.deficit .stat-value.highlight {
    color: #dc2626;
}

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

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

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

/* 悲惨な宣告スタイル */
.verdict-hell {
    border-color: #ef4444;
    background: rgba(254, 226, 226, 0.4);
}
.verdict-hell h3 { color: #b91c1c; }

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