* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    /* Root font-size controlled by breakpoints so rem scales everywhere */
    font-size: 16px; /* default desktop */
}

body {
    background-color: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Arial', sans-serif;
    /* Keep body font-size unset (use rems) */
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background-color: black;
    color: white;
}

body.pink-mode {
    background-color: #ff69b4;
    color: black;
}

.time-display {
    font-size: 1.25rem; /* 1.25 * root (20px on desktop) */
    color: #333;
    margin-bottom: 0rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

body.dark-mode .time-display {
    color: #ccc;
}

body.pink-mode .time-display {
    color: black;
}

.mainText {
    font-size: 20rem; /* large title: use rem so it scales with root */
    font-weight: bold;
    color: #000;
    text-align: center;
    letter-spacing: -0.05em;
    transition: color 0.3s ease;
    line-height: 0.95;
    overflow-wrap: break-word;
    word-break: break-word;
}

body.dark-mode .mainText {
    color: white;
}

body.pink-mode .mainText {
    color: black;
}

.subText {
    font-size: 2.5rem;
    color: #333;
    margin-top: -1rem;
    margin-bottom: 2rem;
    font-weight: 300;
    font-style: italic;
    transition: color 0.3s ease;
}

body.dark-mode .subText {
    color: #ccc;
}

body.pink-mode .subText {
    color: black;
}

/* Responsive root font-size via media queries so rem values scale */
@media (max-width: 1280px) {
    html { font-size: 15px; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    .time-display {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .mainText {
        /* smaller on tablet/mobile */
        font-size: 8rem;
    }

    .subText {
        font-size: 1.8rem;
    }
}

@media (max-width: 420px) {
    html { font-size: 13px; }

    .time-display { font-size: 1rem; }
    .mainText { font-size: 6.5rem; }
    .subText { font-size: 1.4rem; }
}