/* Appleカラーパレットと設定 */
:root {
    --bg-color: #f5f5f7;
    /* Apple特有の薄いグレー背景 */
    --card-bg: #ffffff;
    /* 純白のカード */
    --text-main: #1d1d1f;
    /* 完全な黒ではない、視認性の高いダークグレー */
    --text-sub: #86868b;
    /* Appleらしい薄めのグレー */
    --apple-blue: #0071e3;
    /* Appleシグネチャーブルー */
    --apple-blue-hover: #0077ED;
    --error-color: #ff3b30;
    /* iOS標準の赤 */
}

/* Appleデバイスの標準フォントを呼び出す指定 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Hiragino Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    /* フォントを滑らかに */
}

.container {
    width: 100%;
    max-width: 340px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ヘッダー部分 */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0 0 4px 0;
}

.subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* メインのカード */
.card {
    background: var(--card-bg);
    width: 100%;
    border-radius: 24px;
    /* iOSウィジェットのような強い丸み */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    padding: 32px 0;
    margin-bottom: 24px;
    min-height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* データのレイアウト */
.data-grid {
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.sensor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.value-wrapper {
    display: flex;
    align-items: baseline;
    margin-bottom: 4px;
}

/* 数字は大きく、少し詰める（Apple Watch風） */
.value {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1;
}

.unit {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-sub);
    margin-left: 2px;
}

.label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub);
}

/* 中央の区切り線 */
.divider {
    width: 1px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.08);
}

/* Apple風のピル型（カプセル型）ボタン */
.apple-btn {
    background-color: var(--apple-blue);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 980px;
    /* 完全に丸い端 */
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    width: 80%;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.apple-btn:hover {
    background-color: var(--apple-blue-hover);
}

.apple-btn:active {
    transform: scale(0.96);
    /* 押した時に少し凹むアニメーション */
}

.apple-btn:disabled {
    background-color: #d2d2d7;
    color: #ffffff;
    cursor: not-allowed;
}

/* ステータス（ローディング・エラー） */
.status-view {
    font-size: 14px;
    color: var(--text-sub);
    text-align: center;
    padding: 0 20px;
}

.status-view.error {
    color: var(--error-color);
}

.hidden {
    display: none !important;
}

/* ローディングくるくる丸 */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--text-sub);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}