.shukuyo-monthly-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.shukuyo-monthly-container h2 {
    text-align: center;
    color: #23282d;
    background: transparent;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 600;
}

.shukuyo-monthly-container h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.shukuyo-input-section {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input,
.shuku-select,
.passcode-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.shuku-selector {
    margin-bottom: 20px;
}

.shuku-select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #667eea;
    border-radius: 5px;
}

.passcode-input {
    width: 100%;
    max-width: 100%;
    min-width: 300px;
}

.url-display {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.url-display input {
    flex: 1;
    padding: 10px;
    border: 2px solid #2196f3;
    border-radius: 5px;
}

.url-display button {
    padding: 10px 20px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.url-display button:hover {
    background: #1976d2;
}

.subscription-info h4 {
    color: #333;
    margin-top: 20px;
}

.subscription-info ol {
    margin-left: 20px;
}

.subscription-info .note {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.btn-primary, .btn-success {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #2271b1;
    color: white;
}

.btn-primary:hover {
    background: #135e96;
}

.btn-success {
    background: #00a32a;
    color: white;
    margin-top: 20px;
}

.btn-success:hover {
    background: #008a20;
}

.shuku-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.shuku-info h3 {
    color: white;
    margin: 0;
}

.fortune-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.lunar-description-section {
    margin-bottom: 30px;
    text-align: left;
}

.lunar-desc-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: left;
}

.lunar-desc-title {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    text-align: left;
}

.lunar-desc-item {
    margin-bottom: 15px;
    text-align: left;
}

.lunar-desc-item strong {
    display: block;
    color: #555;
    font-size: 1.05em;
    margin-bottom: 8px;
    text-align: left;
}

.lunar-desc-item p {
    color: #333;
    line-height: 1.8;
    margin: 0;
    padding-left: 10px;
    white-space: pre-wrap;
    text-align: left;
}

.summary-item {
    padding: 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.calendar-header-day {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
}

.calendar-header-day.sunday {
    color: #f44336;
}

.calendar-header-day.saturday {
    color: #2196f3;
}

.calendar-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
    cursor: grab;
}

.calendar-wrapper.dragging {
    cursor: grabbing;
    user-select: none;
}

.calendar-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    min-width: 100%;
}

.calendar-spacer {
    background: transparent;
}

.day-card {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    border: 9px solid;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.day-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* PC版：日付・点数・月相・特殊日のみ表示 */
.day-card .shuku-name,
.day-card .status-name,
.day-card .lunar-date,
.day-card .ryohitsu-badge {
    display: none;
}

/* 月相と特殊日は常に表示 */
.day-card .special-day-badge,
.day-card .sekki-badge.always-show {
    display: block;
}

/* 展開時は全て表示 */
.day-card.expanded .shuku-name,
.day-card.expanded .status-name,
.day-card.expanded .lunar-date,
.day-card.expanded .ryohitsu-badge,
.day-card.expanded .sekki-badge {
    display: block;
}

.day-card.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    z-index: 1000;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
    aspect-ratio: auto;
}

.day-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    flex: 1;
    padding: 8px 4px;
    background: rgba(255,255,255,0.8);
}

/* 新月・満月の日付背景を黒、文字を白に */
.day-card.has-new-moon .day-header,
.day-card.has-full-moon .day-header {
    background: #000;
    color: #fff;
}

.day-card.has-new-moon .day-number,
.day-card.has-full-moon .day-number {
    color: #fff;
}

.day-number {
    font-size: 1.4em;
    font-weight: 700;
}

.weekday {
    font-size: 0.7em;
    color: #666;
}

.fortune-level {
    font-size: 0.75em;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
}

.day-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 4px;
    background: rgba(255,255,255,0.9);
}

/* 特殊日の点数欄を濃いグレー背景、白文字に */
.day-card.has-special-day .day-content {
    background: #555;
}

.day-card.has-special-day .total-score {
    color: #fff;
}

/* 六害宿の点数欄を黒背景、白文字に */
.day-card.has-rokugai .day-content {
    background: #000;
}

.day-card.has-rokugai .total-score {
    color: #fff;
}

.day-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 4px;
    background: rgba(255,255,255,0.95);
}

.shuku-name {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.status-name {
    color: #999;
    font-size: 0.85em;
}

.total-score {
    font-size: 1.1em;
    color: #333;
    font-weight: 700;
    text-align: center;
}

.lunar-date {
    color: #999;
    font-size: 0.8em;
    margin-top: 5px;
}

.ryohitsu-badge {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 5px;
}

.special-day-badge {
    display: inline-block;
    color: white;
    font-size: 0.65em;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    background: #9c27b0;
    text-align: center;
    white-space: nowrap;
}

.sekki-badge {
    display: inline-block;
    color: white;
    font-size: 0.65em;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.sekki-24 {
    background: #4caf50;
}

.sekki-zassetsu {
    background: #ff9800;
}

.sekki-moon {
    background: #2196f3;
}

.export-section {
    text-align: center;
}

.export-info {
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

#loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #667eea;
}

/* 運勢レベルごとの色（8段階：紫→紺→青→緑→黄→橙→ピンク→赤） */
.fortune-大大吉 { border-color: #9c27b0; }
.fortune-大吉 { border-color: #1a237e; }
.fortune-吉 { border-color: #2196f3; }
.fortune-中吉 { border-color: #4caf50; }
.fortune-小吉 { border-color: #ffeb3b; }
.fortune-小凶 { border-color: #ff9800; }
.fortune-凶 { border-color: #e91e63; }
.fortune-大凶 { border-color: #f44336; }

/* 日曜日と土曜日のスタイル */
.day-card.sunday .weekday {
    color: #f44336;
    font-weight: bold;
}

.day-card.saturday .weekday {
    color: #2196f3;
    font-weight: bold;
}

/* オーバーレイ（PC版でも使用） */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-overlay.active {
    display: block;
}

/* 温度計スケール凡例 */
.fortune-scale {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(to right, #f44336, #e91e63, #ff9800, #ffeb3b, #4caf50, #2196f3, #1a237e, #9c27b0);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fortune-scale-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.fortune-scale-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* スマホ用の凡例 */
.fortune-scale-mobile {
    display: none;
}

@media (max-width: 768px) {
    .fortune-scale {
        display: none;
    }

    .fortune-scale-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .fortune-scale-mobile-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .fortune-scale-mobile-color {
        width: 40px;
        height: 40px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .fortune-scale-mobile-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .fortune-scale-mobile-name {
        font-weight: bold;
        font-size: 0.95em;
    }

    .fortune-scale-mobile-range {
        font-size: 0.75em;
        color: #666;
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .calendar-view,
    .calendar-header {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
    }

    .calendar-header {
        font-size: 0.7em;
        padding: 5px 2px;
    }

    .day-card {
        font-size: 0.7em;
        cursor: pointer;
        position: relative;
        border-radius: 5px;
        border-width: 5px;
    }

    /* スマホでは2等分：上半分日付、下半分点数 */
    .day-header {
        padding: 4px 2px;
    }

    .day-content {
        padding: 2px;
        justify-content: center;
        align-items: center;
    }

    .day-footer {
        display: none;
    }

    .day-number {
        font-size: 1em;
    }

    .total-score {
        font-size: 0.85em;
    }

    /* スマホでは簡略表示（運勢レベルは表示） */
    .day-card .shuku-name,
    .day-card .status-name,
    .day-card .lunar-date,
    .day-card .ryohitsu-badge,
    .day-card .special-day-badge,
    .day-card .sekki-badge {
        display: none;
    }

    .day-card .fortune-level {
        font-size: 0.65em;
    }

    /* クリックで詳細表示 */
    .day-card.expanded {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        z-index: 1000;
        padding: 20px;
        font-size: 1em;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        max-height: 80vh;
        overflow-y: auto;
        aspect-ratio: auto;
        border-width: 9px;
    }

    .day-card.expanded .shuku-name,
    .day-card.expanded .status-name,
    .day-card.expanded .lunar-date,
    .day-card.expanded .ryohitsu-badge,
    .day-card.expanded .special-day-badge,
    .day-card.expanded .sekki-badge,
    .day-card.expanded .fortune-level {
        display: block;
    }

    .day-card.expanded .day-header {
        padding: 12px 8px;
    }

    .day-card.expanded .day-content {
        padding: 12px 8px;
    }

    .day-card.expanded .day-footer {
        display: flex;
        padding: 12px 8px;
    }

    .day-card.expanded .day-number {
        font-size: 1.8em;
    }

    .day-card.expanded .total-score {
        font-size: 1.3em;
    }
}

    .day-card .day-number {
        font-size: 0.9em;
    }

    .day-card .fortune-level {
        font-size: 0.7em;
    }

    .day-card .total-score {
        font-size: 0.65em;
    }

    .day-card .special-day-badge,
    .day-card .sekki-badge {
        font-size: 0.55em;
        padding: 1px 3px;
    }

    .input-group {
        flex-direction: column;
    }
}
