:root {
    --background-primary: #121212;
    --background-secondary: #212121;

    --content-primary: #d89216;
    --content-secondary: #f0c184;
    --content-tertiary: #404040;
    --content-tertiary-container: #505050;
}

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

html {
    scrollbar-color: var(--content-tertiary-container) var(--background-primary);
}

html::-webkit-scrollbar-thumb {
    background-color: var(--content-tertiary-container);
}

body {
    background-color: var(--background-primary);
    font-family: 'Roboto', sans-serif;
}

#title {
    color: var(--content-secondary);
    font-size: clamp(2.4rem, 13vmin, 4.5rem);
    font-weight: 800;
    text-align: center;
}

#status-text {
    color: var(--content-tertiary-container);
    font-style: italic;
    text-align: center;
    font-size: clamp(1.1rem, 5.5vmin, 1.5rem);
}

#top-bar {
    padding: 40px 20px 20px;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

@media (hover: hover) {
    #about-button:hover {
        opacity: 0.9;
        background-color: var(--background-secondary);
    }
}

#about-button:active {
    transform: scale(0.9);
    background-color: var(--content-tertiary);
}

@media (hover: hover) {
    #about-close:not(:disabled):hover {
        opacity: 0.95;
        background-color: color-mix(in srgb, var(--content-tertiary-container) 25%, var(--background-secondary));
    }
}

#about-close:not(:disabled):active {
    transform: scale(0.9);
    background-color: color-mix(in srgb, var(--content-tertiary-container) 40%, var(--background-secondary));
}

#about-button svg {
    width: 40px;
    height: 40px;
}

#about-button {
    position: absolute;
    top: -25px;
    right: 0;
    color: var(--content-primary);
}

@media (max-width: 420px) {
    #top-bar {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    #about-button {
        right: -6px;
        top: -25px;
    }
}

#loading-screen {
    position: fixed;
    inset: 0;
    background-color: var(--background-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--content-tertiary);
    border-top-color: var(--content-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#summer-screen[hidden],
#error-screen[hidden],
#app[hidden] {
    display: none;
}

.inner {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

#content {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#pager-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

#bottom-bar {
    background-color: var(--background-secondary);
    padding: 20px;
}

#bottom-bar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#school-days-left {
    color: var(--content-primary);
    font-size: clamp(1.5rem, 6vmin, 2rem);
    font-weight: 700;
}

#progress-bar {
    position: relative;
    width: 100%;
    height: 36px;
    border-radius: 10px;
    background-color: var(--content-tertiary);
    overflow: hidden;
}

#progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 42%;
    background-color: var(--content-primary);
}

#progress-bar-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--content-secondary);
    font-weight: 700;
}

.holiday-countdown {
    color: var(--content-primary);
    font-size: clamp(4rem, 22vmin, 7.5rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.5;
}
.holiday-label {
    color: var(--content-secondary);
    font-size: clamp(1.4rem, 7.5vmin, 2.2rem);
    text-align: center;
    line-height: 1.3;
    white-space: pre-line;
}

#next-day-off {
    color: var(--content-tertiary);
    font-size: clamp(1.2rem, 6vmin, 1.7rem);
    text-align: center;
    padding-bottom: 20px;
}

#summer-screen,
#error-screen  {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    padding: 20px 20px 120px 20px;
}

#summer-screen h1 {
    color: var(--content-primary);
    font-size: clamp(2.2rem, 14vmin, 4rem);
}

#summer-screen p {
    color: var(--content-secondary);
    font-size: clamp(1.2rem, 8.5vmin, 2.3rem);
    line-height: 1.4;
}

#error-screen h1 {
    color: var(--content-primary);
    font-size: clamp(2.5rem, 10vmin, 3.5rem);
}

#error-screen p {
    color: var(--content-secondary);
    font-size: clamp(1.2rem, 5.5vmin, 1.5rem);
    line-height: 1.4;
}

#error-icon svg {
    width: 64px;
    height: 64px;
    color: var(--content-primary);
}

#error-retry {
    margin-top: 4px;
    padding: 12px 28px;
    border-radius: 999px;
    border: none;
    background-color: var(--content-primary);
    color: var(--background-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, transform 0.1s ease, filter 0.15s ease;
}

@media (hover: hover) {
    #error-retry:hover {
        background-color: var(--content-secondary);
        transform: translateY(-1px);
    }
}

#error-retry:active {
    transform: scale(0.96);
    filter: brightness(0.85);
}

#error-retry[hidden] {
    display: none;
}

#pager {
    position: relative;
    overflow: hidden;
    flex: 1;
    touch-action: pan-y;
    padding: 40px 0;
}

#pager-track {
    display: flex;
    width: 100%;
    height: 100%;
}

#app-container {
    min-height: 100dvh;
    background-color: var(--background-primary);
    display: flex;
    flex-direction: column;
}

.pager-page {
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

#pager-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.pager-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--background-secondary);
    border: none;
    color: var(--content-secondary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

@media(hover: hover) {
    .pager-arrow:not(:disabled):hover {
        color: var(--content-primary);
        background-color: var(--content-tertiary);
    }
}

.pager-arrow:not(:disabled):active {
    transform: scale(0.9);
    background-color: var(--content-tertiary-container);
}

.pager-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

#pager-next {
    margin-right: 10px;
}

#pager-prev {
    margin-left: 10px;
}

#pager-pills {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.pill {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: var(--content-tertiary);
    transition: width 0.2s, background-color 0.2s;
}

.pill.active .pill-dot {
    width: 24px;
    background-color: var(--content-primary);
}

.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    overflow-y: auto;
    overscroll-behavior: contain;
    justify-content: center;
    z-index: 20;
    padding: 20px;

    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility  0.25s ease;

    scrollbar-color: var(--content-tertiary-container) var(--background-secondary);
    scrollbar-width: thin;
}

.overlay::-webkit-scrollbar-thumb {
    background-color: var(--content-tertiary-container);
}

.overlay[hidden] {
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

#about-dialog {
    position: relative;
    background-color: var(--background-secondary);
    border-radius: 16px;
    padding: clamp(20px, 6vh, 40px) clamp(16px, 5vw, 28px) clamp(16px, 5vh, 28px);
    max-width: 460px;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: auto 0;
    text-align: center;
    gap: clamp(6px, 2vh, 10px);
    box-sizing: border-box;

    transform: translateY(0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay[hidden] #about-dialog {
    transform: translateY(25px);
    transition: transform 0.15s ease-in;
}

#about-close {
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--content-tertiary-container);
}

#about-close svg {
    width: 35px;
    height: 35px;
}

#about-title {
    color: var(--content-primary);
    font-size: clamp(1.8rem, 3vh + 2vw, 2.5rem);
    font-weight: 800;
    margin-bottom: clamp(4px, 1.5vh, 8px);
}

#about-developer {
    color: var(--content-secondary);
    font-size: clamp(1.1rem, 2vh + 1.5vw, 1.4rem);
}

#about-version {
    color: var(--content-tertiary-container);
    font-size: clamp(1rem, 1.8vh + 1.3vw, 1.2rem);
    margin-bottom: clamp(6px, 2vh, 14px);
}

#about-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

.link-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: clamp(8px, 1.5vh, 12px) 12px;
    border-radius: 12px;
    border: none;
    background-color: transparent;
    color: var(--content-primary);
    font-size: clamp(1.05rem, 2.4vh + 0.8vw, 1.2rem);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

@media (hover: hover) {
    .link-button:hover {
        background-color: var(--content-tertiary);
    }
}

.link-button:active {
    transform: scale(0.98);
    background-color: var(--content-tertiary-container);
}

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

.link-button svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: inherit;
}

.link-button-icon,
.external-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}