/* ========================================
   鬮倡伐繧ｯ繝ｭ繝 け Web
   style.css
   Version 0.4
======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;

    background: #000000;
    color: #ffffff;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        sans-serif;
}

body {
    min-height: 100dvh;
    overflow-x: hidden;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}


/* ========================================
   蜈ｨ菴 
======================================== */

.clock-app {
    width: 100%;
    min-height: 100dvh;

    padding:
        max(20px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));

    display: flex;
    flex-direction: column;
}


/* ========================================
   譎りｨ医お繝ｪ繧｢
======================================== */

.clock-area {
    flex: 0 0 auto;

    min-height: 34vh;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    user-select: none;
    -webkit-user-select: none;

    touch-action: pan-x;
}


/* 莉頑律 */

.today-label {
    margin-bottom: 18px;

    color: #ffffff;

    font-size: clamp(16px, 4vw, 24px);
    font-weight: 700;

    letter-spacing: 0.12em;
}


/* ========================================
   繝 ず繧ｿ繝ｫ譎りｨ 
======================================== */

.digital-clock {
    color: #ffffff;

    font-size: clamp(58px, 17vw, 120px);
    font-weight: 300;

    line-height: 1;

    font-variant-numeric: tabular-nums;

    letter-spacing: -0.04em;

    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.15);
}


/* ========================================
   繧｢繝翫Ο繧ｰ譎りｨ 
======================================== */

.analog-clock {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
}


.clock-face {
    position: relative;

    width: 230px;
    height: 230px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: #000000;

    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.12);
}


/* 謨ｰ蟄  */

.clock-mark {
    position: absolute;

    color: #ffffff;

    font-size: 21px;
    font-weight: 600;

    line-height: 1;
}


.mark-12 {
    top: 12px;
    left: 50%;

    transform: translateX(-50%);
}


.mark-3 {
    top: 50%;
    right: 15px;

    transform: translateY(-50%);
}


.mark-6 {
    bottom: 12px;
    left: 50%;

    transform: translateX(-50%);
}


.mark-9 {
    top: 50%;
    left: 15px;

    transform: translateY(-50%);
}


/* 驥  */

.clock-hand {
    position: absolute;

    left: 50%;
    bottom: 50%;

    transform-origin: 50% 100%;

    border-radius: 10px;
}


.hour-hand {
    width: 5px;
    height: 60px;

    margin-left: -2.5px;

    background: #ffffff;

    z-index: 3;
}


.minute-hand {
    width: 4px;
    height: 82px;

    margin-left: -2px;

    background: #ffffff;

    z-index: 4;
}


.second-hand {
    width: 2px;
    height: 90px;

    margin-left: -1px;

    background: #e00000;

    z-index: 5;
}


/* 荳ｭ蠢  */

.clock-center {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 12px;
    height: 12px;

    transform:
        translate(-50%, -50%);

    border-radius: 50%;

    background: #e00000;

    z-index: 6;
}


/* ========================================
   譌･莉 
======================================== */

.date-display {
    margin-top: 20px;

    color: #cccccc;

    font-size: clamp(17px, 4.5vw, 26px);
    font-weight: 500;
}


/* ========================================
   繧ｫ繝ｬ繝ｳ繝繝ｼ
======================================== */

.calendar-area {
    flex: 1;

    width: min(100%, 760px);

    margin: 10px auto 0;

    display: flex;
    flex-direction: column;
}


.calendar-header {
    min-height: 58px;

    display: grid;

    grid-template-columns:
        60px
        1fr
        60px;

    align-items: center;

    border-top: 1px solid #b00000;
    border-bottom: 1px solid #b00000;
}


.calendar-title {
    text-align: center;

    color: #ffffff;

    font-size: clamp(21px, 5vw, 30px);
    font-weight: 700;
}


.month-button {
    width: 52px;
    height: 52px;

    border: 0;

    background: transparent;
    color: #ff2020;

    font-size: 42px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;
}


.month-button:active {
    transform: scale(0.9);
}


/* ========================================
   繧ｫ繝ｬ繝ｳ繝繝ｼ譛ｬ菴 
======================================== */

.calendar {
    flex: 1;

    display: grid;

    grid-template-columns:
        repeat(7, 1fr);

    grid-auto-rows:
        minmax(48px, 1fr);

    padding-top: 10px;
}


/* 譖懈律 */

.calendar-weekday {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #aaaaaa;

    font-size: clamp(13px, 3.4vw, 18px);
    font-weight: 700;
}


.calendar-weekday.sunday,
.calendar-weekday.saturday {
    color: #ff3030;
}


/* 譌･莉  */

.calendar-day {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    min-height: 48px;

    color: #eeeeee;

    font-size: clamp(17px, 4.2vw, 24px);
    font-weight: 500;

    font-variant-numeric: tabular-nums;
}


.calendar-day.empty {
    color: transparent;
}


/* 蝨滓律逾  */

.calendar-day.holiday::before,
.calendar-day.sunday::before,
.calendar-day.saturday::before {
    content: "";

    position: absolute;

    width: 38px;
    height: 38px;

    border: 2px solid #d80000;
    border-radius: 50%;

    z-index: 0;
}


.calendar-day > span {
    position: relative;

    z-index: 1;
}


/* 莉頑律 */

.calendar-day.today::after {
    content: "";

    position: absolute;

    width: 44px;
    height: 44px;

    border: 2px solid #ffffff;
    border-radius: 5px;

    z-index: 2;

    pointer-events: none;
}


/* ========================================
   謠蝉ｾ帛 
======================================== */

.calendar-footer {
    padding-top: 14px;

    display: flex;
    justify-content: flex-end;
}


.calendar-source {
    color: #777777;

    font-size: 12px;

    text-decoration: none;
}


.calendar-source:hover {
    color: #ff3030;
}


/* ========================================
   邵ｦ逕ｻ髱｢
======================================== */

@media (orientation: portrait) {

    .clock-app {
        min-height: 100dvh;

        padding:
            max(10px, env(safe-area-inset-top))
            max(18px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(18px, env(safe-area-inset-left));
    }


    .clock-area {
        min-height: 0;

        padding-top: 32px;
        padding-bottom: 20px;
    }


    .digital-clock {
        font-size: clamp(58px, 17vw, 78px);
    }


    .clock-face {
        width: 220px;
        height: 220px;
    }


    .calendar-area {
        flex: 0 0 auto;

        width: 100%;

        margin-top: 0;
    }


    .calendar {
        flex: none;

        grid-auto-rows: 55px;

        padding-top: 8px;
    }


    .calendar-day {
        min-height: 55px;
    }


    .calendar-day.holiday::before,
    .calendar-day.sunday::before,
    .calendar-day.saturday::before {
        width: 43px;
        height: 43px;
    }


    .calendar-day.today::after {
        width: 47px;
        height: 47px;
    }


    .calendar-footer {
        padding-top: 4px;
    }
}


/* ========================================
   讓ｪ逕ｻ髱｢
======================================== */

@media (orientation: landscape) {

    .clock-app {
        flex-direction: row;

        gap: 30px;
    }


    .clock-area {
        flex: 0 0 46%;

        min-height: 0;
    }


    .calendar-area {
        flex: 1;

        width: auto;

        margin: 0;

        min-height: 0;
    }


    .digital-clock {
        font-size: clamp(58px, 9vw, 120px);
    }


    .today-label {
        font-size: clamp(15px, 2vw, 22px);
    }


    .date-display {
        font-size: clamp(16px, 2.2vw, 24px);
    }


    .clock-face {
        width: min(32vh, 230px);
        height: min(32vh, 230px);
    }


    .calendar-title {
        font-size: clamp(20px, 2.5vw, 28px);
    }


    .calendar-day {
        min-height: 38px;

        font-size: clamp(15px, 2vw, 22px);
    }


    .calendar-day.holiday::before,
    .calendar-day.sunday::before,
    .calendar-day.saturday::before {
        width: 34px;
        height: 34px;
    }


    .calendar-day.today::after {
        width: 40px;
        height: 40px;
    }
}


/* ========================================
   鬮倥＆縺ｮ菴弱＞讓ｪ逕ｻ髱｢
======================================== */

@media
(orientation: landscape)
and
(max-height: 500px) {

    .clock-app {
        padding-top: 10px;
        padding-bottom: 10px;
    }


    .calendar-header {
        min-height: 42px;
    }


    .month-button {
        width: 40px;
        height: 40px;

        font-size: 34px;
    }


    .calendar {
        grid-auto-rows:
            minmax(30px, 1fr);

        padding-top: 4px;
    }


    .calendar-day {
        min-height: 30px;
    }


    .calendar-footer {
        padding-top: 4px;
    }
}
/* Screen switching */
[hidden]{display:none!important}
#clockArea{cursor:pointer}
