/* ====== CSS変数（サイズ一元管理） ====== */
:root {
    --main-title-size: clamp(2.4rem, 8vw, 4.0rem);
    --sub-title-size: clamp(1.2rem, 4vw, 2.0rem);
    --catchphrase-size: clamp(0.85rem, 2.5vw, 1.1rem);
    --menu-font-size: clamp(0.9rem, 2vw, 1.1rem);
    --menu-desc-size: clamp(0.7rem, 1.5vw, 0.9rem);
}

/* ====== ベース ====== */
body {
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ====== ヒーローエリア（50%） ====== */
.hero-section {
    background: linear-gradient(145deg, #06C755 0%, #049a44 100%);
    color: white;
    height: calc(50vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    border-radius: 0 0 40px 40px;
    box-shadow: 0 4px 20px rgba(6, 199, 85, 0.3);
    position: relative;
    overflow: hidden;
}

/* ----- タイトル + イラスト 横並び ----- */
.hero-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 3vw, 24px);
    flex-wrap: wrap;
}

.hero-main-title {
    font-size: var(--main-title-size);
    font-weight: 700;
    letter-spacing: 4px;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hero-illustration {
    width: clamp(80px, 20vw, 150px);
    height: auto;
}

.hero-illustration svg {
    width: 100%;
    height: auto;
}

/* ----- サブタイトル ----- */
.hero-sub-title {
    font-size: var(--sub-title-size);
    font-weight: 400;
    letter-spacing: 2px;
    opacity: 0.9;
    margin: 4px 0 6px 0;
}

/* ----- キャッチコピー（改行禁止） ----- */
.hero-catchphrase {
    font-size: var(--catchphrase-size);
    opacity: 0.85;
    margin: 0 0 16px 0;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- ユーザー表示 ----- */
.hero-user {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: clamp(0.75rem, 1.8vw, 1rem);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ====== メニューエリア（50%） ====== */
.menu-section {
    height: calc(50vh - 80px);
    padding: 16px 14px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

/* ----- メニューカード（共通） ----- */
.menu-card,
.logout-button {
    background: white;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    font-size: inherit;
    font-family: inherit;
}

.menu-card:active,
.logout-button:active {
    transform: scale(0.97);
}

.menu-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.menu-icon {
    font-size: clamp(22px, 5vw, 28px);
    width: clamp(40px, 10vw, 48px);
    height: clamp(40px, 10vw, 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    border-radius: 12px;
    color: #06C755;
    flex-shrink: 0;
}

.menu-content { flex: 1; min-width: 0; }
.menu-title {
    font-size: var(--menu-font-size);
    font-weight: 600;
    margin-bottom: 1px;
}
.menu-desc {
    font-size: var(--menu-desc-size);
    color: #888;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-arrow { color: #ccc; font-size: clamp(16px, 4vw, 20px); }

/* ----- ログアウトボタン（赤色30%→100%ホバー） ----- */
.logout-button {
    background: rgba(255, 0, 0, 0.06);
    border: 1px solid rgba(255, 0, 0, 0.12);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.logout-button .menu-title {
    color: #e53935;
}

.logout-button .menu-desc {
    color: rgba(229, 57, 53, 0.6);
}

.logout-button:hover {
    background: rgba(255, 0, 0, 0.30);
    border-color: rgba(255, 0, 0, 0.4);
}

.logout-button:active {
    transform: scale(0.97);
}

/* ====== ローディング ====== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-size: 16px;
    color: #666;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #06C755;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====== スクロールバー非表示 ====== */
.menu-section::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* ====== レスポンシブ（スマホ最適化） ====== */
@media (max-width: 576px) {
    .hero-section {
        border-radius: 0 0 24px 24px;
    }
    .menu-section {
        padding: 12px 10px 10px 10px;
        gap: 8px;
    }
    .menu-card,
    .logout-button {
        padding: 12px 14px;
        border-radius: 12px;
        gap: 10px;
    }
}

/* ====== 超小型スマホ（画面幅320px以下） ====== */
@media (max-width: 380px) {
    .hero-title-wrapper {
        gap: 4px;
    }
    .hero-catchphrase {
        font-size: clamp(0.65rem, 2vw, 0.8rem);
    }
    .menu-card,
    .logout-button {
        padding: 10px 12px;
        gap: 8px;
    }
    .menu-desc {
        font-size: 0.6rem;
    }
}

/* ====== スマホ最適化（フォントサイズ調整） ====== */
@media (max-width: 576px) {
    .hero-main-title {
        font-size: clamp(1.8rem, 6vw, 2.6rem) !important;
    }
    .hero-sub-title {
        font-size: clamp(1rem, 3vw, 1.4rem) !important;
    }
    .hero-catchphrase {
        font-size: clamp(0.75rem, 2.2vw, 1rem) !important;
    }
    .hero-user {
        font-size: clamp(0.7rem, 1.8vw, 0.9rem) !important;
    }
    .menu-title {
        font-size: clamp(0.85rem, 2.2vw, 1.1rem) !important;
    }
    .menu-desc {
        font-size: clamp(0.65rem, 1.6vw, 0.85rem) !important;
    }
    .menu-icon {
        font-size: clamp(18px, 4vw, 24px) !important;
        width: clamp(36px, 8vw, 44px) !important;
        height: clamp(36px, 8vw, 44px) !important;
    }
    .page-title {
        font-size: clamp(1rem, 3.5vw, 1.4rem) !important;
    }
    .friend-name {
        font-size: clamp(0.85rem, 2.2vw, 1rem) !important;
    }
    .friend-status {
        font-size: clamp(0.6rem, 1.6vw, 0.8rem) !important;
    }
    .delete-btn {
        font-size: clamp(16px, 3.5vw, 20px) !important;
    }
    .calendar-month-year {
        font-size: clamp(0.9rem, 2.8vw, 1.2rem) !important;
    }
    .calendar-day {
        font-size: clamp(0.7rem, 2vw, 0.9rem) !important;
    }
    .event-time {
        font-size: clamp(0.6rem, 1.6vw, 0.8rem) !important;
    }
    .event-title {
        font-size: clamp(0.75rem, 2vw, 0.95rem) !important;
    }
}

/* ====== フッター専用（全画面共通） ====== */
.footer-links {
    text-align: center;
    padding: 12px 0 16px 0;
    font-size: clamp(10px, 2.5vw, 14px);
    color: #bbb;
    border-top: 1px solid #eee;
    background: #f5f5f5;
}
.footer-links a {
    color: #999;
    text-decoration: none;
    margin: 0 8px;
}
.footer-links a:hover {
    color: #666;
    text-decoration: underline;
}
.footer-links span {
    color: #ddd;
}
