:root {
    --primary-color: #e11d48;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.6);
    --text-main: #1f2937;
    --text-muted: #4b5563;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background-color: #1a1a1a;
    position: relative;
    overflow-x: hidden;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 100;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(0,0,0,0.8);
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 初期値20万の場合の痛い赤～グレーグラデーション */
    background: linear-gradient(135deg, #4b5563 0%, #9f1239 100%);
    z-index: -1;
    transition: background 1s ease;
}

.app-container {
    width: 100%;
    max-width: 500px;
    z-index: 10;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -0.05em;
    transition: color 1s ease;
}

header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-section {
    margin-bottom: 32px;
}

.input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.highlight-value {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    transition: color 1s ease;
}

input[type="range"] {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.1s, background 1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.warning-badge {
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #9f1239;
    background: #ffe4e6;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    transition: opacity 0.3s, background 1s, color 1s;
}

/* Results */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #be123c 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(225, 29, 72, 0.3);
    transition: background 1s ease, box-shadow 1s ease;
}

.result-card.primary h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.amount {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.unit {
    font-size: 1.2rem;
    font-weight: 700;
    margin-left: 4px;
}

.sub-amount, .sub-hint {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.9;
}

/* メタファーカード */
.metaphor-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.metaphor-icon {
    font-size: 3rem;
    line-height: 1;
}

.metaphor-text {
    flex: 1;
    text-align: left;
}

.metaphor-text h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.metaphor-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.result-card.secondary {
    border: 1px solid #e2e8f0;
    padding: 16px;
}

.result-card.secondary .amount {
    font-size: 1.8rem;
    color: var(--text-main);
}
.result-card.secondary h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.disclaimer {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px dashed #cbd5e1;
}

@media (max-width: 480px) {
    .glass-card { padding: 24px 16px; }
    .amount { font-size: 2.5rem; }
    .metaphor-icon { font-size: 2.5rem; }
}
