*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    line-height: 1.5;
    padding: 16px;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 20px;
    border: 1px solid #334155;
}

/* ヘッダー・ナビゲーション */
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #334155;
}
.header h1 {
    font-size: clamp(14px, 8.00px + 1.56vw, 22px);
    color: #fbbf24;
    letter-spacing: 0.05em;
}
.btn-home {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3b82f6;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.2s;
}
.btn-home:hover {
    background-color: #2563eb;
}

/* 月移動コントロール */
.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    background-color: #0f172a;
    padding: 10px 16px;
    border-radius: 8px;
}
.month-nav a {
    color: #93c5fd;
    text-decoration: none;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 4px;
    background-color: #1e293b;
    border: 1px solid #334155;
    font-size: 0.9rem;
}
.month-nav a:hover {
    background-color: #334155;
    color: #ffffff;
}
.current-ym {
    font-size: 1.25rem;
    font-weight: bold;
    color: #f8fafc;
}

/* 月間星座サマリー */
.zodiac-summary {
    text-align: center;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #cbd5e1;
    background-color: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 8px;
    border-radius: 6px;
}
.zodiac-summary span {
    color: #fbbf24;
    font-weight: bold;
}

/* カレンダーテーブル（PC・タブレット標準表示） */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.calendar-table th {
    padding: 10px 4px;
    background-color: #0f172a;
    color: #cbd5e1;
    font-size: 0.9rem;
    border: 1px solid #334155;
}
.calendar-table th.sun { color: #f87171; }
.calendar-table th.sat { color: #60a5fa; }

.calendar-table td {
    height: 92px;
    vertical-align: top;
    padding: 6px;
    border: 1px solid #334155;
    background-color: #1e293b;
}
.calendar-table td.empty {
    background-color: #131c2e;
}
.calendar-table td.today {
    background-color: rgba(251, 191, 36, 0.15);
    box-shadow: inset 0 0 0 2px #fbbf24;
}
.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.day-num {
    font-size: 1.05rem;
    font-weight: bold;
}
.sun .day-num { color: #f87171; }
.sat .day-num { color: #60a5fa; }
.weekday-sp {
    display: none;
    font-size: 0.85rem;
    margin-left: 4px;
}

.zodiac-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid #334155;
}
.zodiac-symbol {
    font-size: 1.2rem;
    color: #fbbf24;
    line-height: 1.2;
}
.zodiac-name {
    font-size: 0.78rem;
    color: #e2e8f0;
    white-space: nowrap;
}
.zodiac-switch {
    border-color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.12);
}

/* フッター */
.footer {
    margin-top: 20px;
    text-align: center;
}

/* タブレット対応 (768px以下) */
@media (max-width: 768px) {
    .container { padding: 14px; }
    .calendar-table td { height: 82px; padding: 4px; }
    .zodiac-name { font-size: 0.7rem; }
}

/* スマートフォン対応 (540px以下: 見やすいリスト型へ自動切替) */
@media (max-width: 540px) {
    .header h1 { font-size: 1.2rem; }
    .calendar-table thead,
    .calendar-table td.empty {
        display: none;
    }
    .calendar-table,
    .calendar-table tbody,
    .calendar-table tr,
    .calendar-table td {
        display: block;
        width: 100%;
    }
    .calendar-table tr {
        margin-bottom: 0;
    }
    .calendar-table td {
        height: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-bottom: none;
    }
    .calendar-table tr:last-child td:last-child {
        border-bottom: 1px solid #334155;
    }
    .day-header {
        margin-bottom: 0;
    }
    .weekday-sp {
        display: inline;
    }
    .zodiac-box {
        flex-direction: row;
        gap: 8px;
        padding: 4px 10px;
    }
    .zodiac-name {
        font-size: 0.85rem;
    }
}
