@charset "utf-8";

.world-clocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.clock {
    background-color: rgba(255, 225, 196, 0.75);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 中心對齊 */
    align-items: center;
    /* 中心對齊 */
    height: auto;
    /* 自動高度 */
}

.clock:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
}

.clock h3 {
    margin: 0;
    color: #2c3e50;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
    font-weight: bold;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.clock-face {
    position: relative;
    width: 100px;
    height: 100px;
    border: 4px solid #2c3e50;
    border-radius: 50%;
    margin: 20px auto;
    background: white;
    aspect-ratio: 1 / 1;
    /* 強制維持縱橫比 */
}

.number {
    position: absolute;
    font-size: 0.8rem;
    color: #2c3e50;
    text-align: center;
    transform: translate(-50%, -50%);
}

.number1 {
    top: 15%;
    left: 73%;
}

.number2 {
    top: 27%;
    left: 85%;
}

.number3 {
    top: 50%;
    left: 90%;
}

.number4 {
    top: 73%;
    left: 85%;
}

.number5 {
    top: 85%;
    left: 73%;
}

.number6 {
    top: 90%;
    left: 50%;
}

.number7 {
    top: 85%;
    left: 27%;
}

.number8 {
    top: 73%;
    left: 15%;
}

.number9 {
    top: 50%;
    left: 10%;
}

.number10 {
    top: 27%;
    left: 15%;
}

.number11 {
    top: 15%;
    left: 27%;
}

.number12 {
    top: 10%;
    left: 50%;
}

.hand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 0% 50%;
    transform: rotate(-90deg);
    /* 初始化為指向12點方向 */
    transition: all 0.05s ease-in-out;
}

.hour-hand {
    width: 25%;
    height: 4px;
    background: #333;
}

.minute-hand {
    width: 40%;
    height: 3px;
    background: #333;
}

.second-hand {
    width: 45%;
    height: 2px;
    background: red;
}

.clock-center {
    width: 8px;
    height: 8px;
    background: #333;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.time {
    font-size: 1.6rem;
    color: #333;
    font-weight: bold;
    margin: 0;
}

.date {
    font-size: 1.3rem;
    /* 日期字體大小可以保持不變，或視需要略微調整 */
    color: #555;
    font-weight: normal;
    margin-top: 2px;
    /* 減小與星期之間的行間距 */
    line-height: 1;
    /* 調整行高以減小行間距 */
}

.day {
    font-size: 1.2rem;
    /* 設置星期字體大小 */
    color: #777;
    font-weight: normal;
    margin-top: 2px;
    /* 減小與上方元素的間距 */
    line-height: 1;
    /* 調整行高以減小與日期之間的行間距767 */

}

.lunar-date {
    font-size: 0.8rem;
    color: #555;
    font-weight: normal;
    margin-top: 2px;
    line-height: 1;
}

@media (max-width: 750px) {

    .clock {
        padding: 15px;
        height: auto;
        /* 自動高度 */
        justify-content: center;
        /* 垂直中心對齊 */
        align-items: center;
        /* 水平中心對齊 */
    }

    .clock-face {
        width: 100px;
        /* 保持寬度不變 */
        height: 100px;
        /* 保持高度不變 */
        aspect-ratio: 1 / 1;
        /* 保持圓形 */
    }

    .time {
        font-size: 1.35rem;

    }

    .date {
        font-size: 1rem;
    }

    .day {
        font-size: 0.9rem;
        /* 設置星期字體大小 */
        color: #777;
        font-weight: normal;
        margin-top: 2px;
        /* 減小與上方元素的間距 */
        line-height: 1;
        /* 調整行高以減小與日期之間的行間距 */
    }

    .lunar-date {
        font-size: 0.8rem;
        color: #555;
        font-weight: normal;
        margin-top: 2px;
        line-height: 1;
    }

    .clock h3 {
        font-size: 1.2rem
    }
}