/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    color: #fff;
    transition: background 0.6s;
}

/* ===== Calendar Card ===== */
.calendar {
    width: min(94vw, 560px);
    background: #fffef5;
    color: #222;
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.35),
        0 0 0 1px rgba(255,255,255,0.08);
    overflow: hidden;
    user-select: none;
    animation: popIn 0.5s cubic-bezier(.23,1.12,.58,1);
    position: relative;
}

@keyframes popIn {
    from { transform: scale(0.85) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== Top Bar (Month) ===== */
.calendar-top {
    text-align: center;
    padding: 18px 20px 12px;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    position: relative;
}

.calendar-top .month-en {
    font-size: clamp(0.8rem, 2vw, 1rem);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.6;
    display: block;
    margin-bottom: 2px;
}

.calendar-top .year-text {
    font-size: clamp(0.75rem, 1.8vw, 0.95rem);
    font-weight: 400;
    opacity: 0.5;
    display: block;
    margin-top: 2px;
}

/* ===== Day Number ===== */
.day-number {
    text-align: center;
    font-size: clamp(8rem, 28vw, 16rem);
    font-weight: 900;
    line-height: 1;
    padding: 10px 0 0;
    letter-spacing: -0.03em;
    position: relative;
}

.day-number.animate {
    animation: flipIn 0.45s cubic-bezier(.23,1.12,.58,1);
}

@keyframes flipIn {
    0%   { transform: rotateX(90deg) scale(0.8); opacity: 0; }
    60%  { transform: rotateX(-5deg) scale(1.02); opacity: 1; }
    100% { transform: rotateX(0) scale(1); opacity: 1; }
}

/* ===== Day of Week ===== */
.day-of-week {
    text-align: center;
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    font-weight: 700;
    padding: 0 0 6px;
    letter-spacing: 0.15em;
}

/* ===== Bottom Info ===== */
.calendar-bottom {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 10px 20px 20px;
    font-size: clamp(0.8rem, 2.2vw, 1.05rem);
    opacity: 0.7;
}

.calendar-bottom .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-bottom .info-label {
    font-weight: 500;
    opacity: 0.6;
    font-size: 0.85em;
}

/* ===== Day-of-Week Color Themes ===== */
/* Sunday */
.calendar.sunday .calendar-top {
    background: #d32f2f;
    color: #fff;
}
.calendar.sunday .day-number,
.calendar.sunday .day-of-week {
    color: #c62828;
}

/* Saturday */
.calendar.saturday .calendar-top {
    background: #1565c0;
    color: #fff;
}
.calendar.saturday .day-number,
.calendar.saturday .day-of-week {
    color: #0d47a1;
}

/* Weekday */
.calendar.weekday .calendar-top {
    background: #2e2e2e;
    color: #fff;
}
.calendar.weekday .day-number,
.calendar.weekday .day-of-week {
    color: #222;
}

/* ===== Hole decoration on top ===== */
.calendar::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a1a2e;
    z-index: 10;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.calendar-top {
    padding-top: 52px !important;
}

/* ===== Clock ===== */
.clock {
    position: fixed;
    bottom: 24px;
    right: 28px;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.05em;
}

/* ===== Fullscreen button ===== */
.fullscreen-btn {
    position: fixed;
    top: 16px;
    right: 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s, color 0.2s;
    z-index: 100;
}

.fullscreen-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-height: 520px) {
    .day-number {
        font-size: clamp(5rem, 20vw, 10rem);
    }
    .calendar-top {
        padding-top: 44px !important;
        padding-bottom: 6px;
    }
    .calendar::before {
        width: 28px;
        height: 28px;
        top: 8px;
    }
    .calendar-bottom {
        padding: 6px 16px 12px;
    }
}
