body {
    font-family: monospace;
    text-align: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    transition: filter 2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body.time-travel {
    filter: invert(1);
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 10s cubic-bezier(0.1, 0.1, 0.9, 0.9);
}

.page-wrapper.stretch-x {
    transform: scaleY(0.01) rotate(-36000deg);
}

.page-wrapper.stretch-y {
    transform: scaleX(0.01) rotate(7200deg);
}

body.final-white {
    background: #fff;
    filter: invert(0);
}

#displayNum {
    font-size: clamp(1rem, 72px, 7vw);
    font-weight: bold;
    margin-bottom: 40px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateY(80px);
}

#displayNum.positioned {
    transform: translateY(0);
}

.mode-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(-30px) scale(0.8);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    max-width: 75vw;
    justify-content: center;
}

.mode-buttons.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.mode-buttons button {
    padding: 10px 18px;
    font-family: monospace;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mode-buttons button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.mode-buttons button.active {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    font-weight: bold;
}

.ctrl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 300px;
    opacity: 1;
    transition: all 0.5s ease;
}

.ctrl-grid button {
    padding: 30px;
    font-size: 20px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    border: solid 1px #fff;
    background: #000;
    color: #fff;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px #ffffff33;
    position: relative;
}

.ctrl-grid button::after {
    content: attr(data-label);
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 10px;
    opacity: 0.6;
    font-weight: normal;
}

.ctrl-grid button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.4);
}

.ctrl-grid button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.ctrl-grid button.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.ctrl-grid span {
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

#displayNum.floating {
    animation: float 3s ease-in-out infinite;
}