
* {
    box-sizing: border-box;
}

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

.studio-clock {
    width: 100%;
    height: 100vh;
    height: 100dvh;

    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;

    overflow: hidden;
}

.clock-main {
    min-height: 0;
    min-width: 0;

    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1rem;

    padding: 1rem;
}

.clock-primary {
    min-height: 0;
    min-width: 0;

    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
}

.clock-canvas {
    min-height: 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.clock-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.clock-time {
    text-align: center;
    font-size: clamp(2rem, 3vw, 3rem);
}

.clock-secondary {
    min-height: 0;
    min-width: 0;

    display: grid;
    grid-template-rows:
        minmax(0, 0.7fr)
        minmax(0, 1.6fr)
        minmax(0, 1.1fr);

    gap: 1rem;
}

.clock-branding,
.clock-weather,
.clock-now-playing {
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.clock-weather {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
    padding: clamp(0.5rem, 1.2vw, 1rem);
    text-align: center;
}

.weather-heading {
    min-width: 0;
}

.weather-title,
.weather-day-label {
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    opacity: 0.7;
}

.weather-location {
    overflow: hidden;
    font-size: clamp(0.9rem, 1.4vw, 1.25rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-days {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    min-height: 0;
}

.weather-day {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.weather-icon {
    font-size: clamp(1.5rem, 3.5vw, 3rem);
}

.weather-condition {
    overflow: hidden;
    max-width: 100%;
    font-size: clamp(0.75rem, 1.3vw, 1.1rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-temperatures {
    display: flex;
    gap: 0.6rem;
    font-size: clamp(0.9rem, 1.6vw, 1.4rem);
    font-weight: 700;
}

.weather-low {
    opacity: 0.65;
}

.weather-attribution {
    font-size: 0.65rem;
    opacity: 0.7;
}

.weather-attribution a {
    color: inherit;
}

.weather-unavailable {
    display: grid;
    place-items: center;
    height: 100%;
    text-align: center;
    font-size: clamp(0.9rem, 1.5vw, 1.25rem);
    opacity: 0.7;
    grid-row: 1 / -1;
}

.clock-now-playing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    padding: clamp(0.75rem, 2vw, 1.5rem);
    text-align: left;
}

.now-playing-artwork {
    width: clamp(4rem, 28%, 10rem);
    aspect-ratio: 1;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 0.5rem;
}

.now-playing-artwork-placeholder {
    display: grid;
    place-items: center;
    background: rgb(127 127 127 / 20%);
    font-size: clamp(2rem, 6vw, 4rem);
}

.now-playing-details {
    min-width: 0;
}

.now-playing-label {
    margin-bottom: 0.4rem;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    opacity: 0.7;
}

.now-playing-title,
.now-playing-artist {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.now-playing-title {
    font-size: clamp(1.1rem, 2vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
}

.now-playing-artist {
    margin-top: 0.4rem;
    font-size: clamp(0.9rem, 1.4vw, 1.25rem);
    opacity: 0.8;
}

.now-playing-idle {
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    opacity: 0.7;
}

.clock-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.clock-branding-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.clock-branding-name {
    font-size: 2rem;
    font-weight: 700;
}

.clock-status {
    min-height: 0;
    padding: 0.5rem 1rem;
}

.status-lamps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}