/* --- 全体のリセットと基本設定 --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Hiragino Sans', 'Meiryo', 'Helvetica Neue', Arial, sans-serif;
    background-color: #fdf6ec; /* 優しいクリーム色 */
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

/* --- 計算機本体のカード --- */
.calculator-container {
    background: #ffffff;
    padding: 30px 25px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 900px;
    text-align: center;
}

/* --- ヘッダー --- */
h1 {
    color: #d35400;
    font-size: 1.6rem;
    margin-top: 0;
    margin-bottom: 5px; /* descriptionとの距離を調整 */
}

h1::before {
    content: "🐾";
}

.description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 30px; /* フォームとの距離を確保 */
}

/* --- 入力エリアのグループ化 --- */
.input-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: #d35400;
    margin-bottom: 10px;
    padding-left: 5px;
}

/* --- 【重要】セレクトボックスと入力欄を大きく --- */
select, 
input[type="number"] {
    width: 100%;
    height: 60px; /* 高さをしっかり確保 */
    padding: 0 20px;
    font-size: 1.2rem; /* 文字を大きく */
    font-weight: 500;
    border: 2px solid #ff9f43;
    border-radius: 15px;
    background-color: #fff;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* セレクトボックス特有の矢印デザイン */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23ff9f43" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

/* フォーカス時の強調 */
select:focus, 
input[type="number"]:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 4px rgba(255, 159, 67, 0.15);
    background-color: #fffaf5;
}

/* --- 犬の年齢入力 (inputと単位を横並びにするためのFlexbox設定) --- */
.dog-age-input {
    display: flex; 
    align-items: flex-end; 
}

.dog-age-input input[type="number"] {
    flex-grow: 1; 
    width: auto; 
}

/* 単位「歳」のスタイリング */
.unit {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    /* inputと同じ高さとpaddingに合わせて調整 */
    height: 60px;
    line-height: 60px; 
    padding: 0 0 0 10px;
    margin-left: -5px; /* inputの枠線に近づける */
}

/* --- 計算ボタン --- */
button {
    background-color: #ff9f43;
    color: white;
    border: none;
    padding: 18px;
    width: 100%;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 0 #e67e22;
    margin-bottom: 10px;
}

button:hover {
    background-color: #ffaf5e;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #e67e22;
}

button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #e67e22;
}

/* --- 結果表示エリア --- */
.result-area {
    margin-top: 25px;
    padding: 20px;
    background-color: #fff9f0;
    border: 2px solid #ff9f43; /* dashedからsolidに変更 */
    border-radius: 15px;
    display: none; /* JSで表示切り替え */
    animation: fadeIn 0.4s ease-out;
}

.result-area.show {
    display: block;
}

/* 結果テキストの前文を調整 */
.result-area p:first-child {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 5px;
}

#resultText {
    margin: 0;
    font-size: 1.2rem; /* 全体を少し大きく */
    line-height: 1.6;
    font-weight: 500;
}

#resultText strong {
    display: inline;
    font-size: 2.5rem; /* さらに大きく強調 */
    color: #e67e22;
    margin: 0 5px; /* 数字の左右に少しスペース */
}

/* --- アニメーション --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 注意書き --- */
.note {
    font-size: 0.75rem;
    color: #999;
    margin-top: 15px;
}