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

:root {
    --cursor-default: url("./media/win95-arrow.png") 0 0, default;
    --cursor-pointer: url("./media/win95-pointer.png") 10 0, pointer;
    --cursor-grab: url("./media/win95-grab.png") 16 16, grab;
    --cursor-grabbing: url("./media/win95-grabbing.png") 16 16, grabbing;
}

body {
    cursor: var(--cursor-default);
    background-color: #f8f8f8;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

a, button {
    cursor: var(--cursor-pointer);
}

#linkv {
    color: #222222;
}

#linkm {
    color: #222222;
}

#linkt {
    color: #222222;
}

#linkv:hover {
    color: #4dd8ef;
}

#linkm:hover {
    color: #ffd500;
}

#linkt:hover {
    color: rgb(177, 11, 11);
}

.link {
    text-decoration: none;
    color: #333;
    font-weight: 700;
}

.link:hover {
    color: #33333375;
}

.container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slidercontainer {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 30px;
    display: flex;
    outline: 2px solid #333;
    outline-offset: 1px;
    border-radius: 15px;
    transition: all 0.4s ease-in-out;
    user-select: none;
}

.slidercontainer.hidden {
    opacity: 0;
    pointer-events: none;
}

.container.clicked .slidercontainer {
    display: none;
}

.container.clicked .slider-text {
    display: none;
}

.container.clicked .slider-dot {
    display: none;
}

.slider-dot {
    position: absolute;
    left: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #333;
    transform: translateX(-50%);
    transition: all 0.2s ease-in-out;
}

.slider-dot:hover,
.slider-dot.gesture-hover {
    cursor: var(--cursor-pointer);
    border: 2px solid #333;
    background-color: transparent;
}

.slider-text {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    z-index: 1000;
}

.circle-border {
    position: absolute;
    width: 400px;
    height: 400px;
    border: 3px solid #333;
    border-radius: 50%;
    transition: all 0.5s ease;
    pointer-events: none;
}

.container.clicked .circle-border {
    opacity: 0;
    transform: scale(1.2);
}

.elements-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: var(--cursor-pointer);
    transition: all 0.8s ease;
}

.container.clicked .elements-container {
    width: 600px;
    height: 120px;
}

.element {
    width: 120px;
    height: 120px;
    position: absolute;
    transition: all 0.5s ease;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.element-text {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.element-text svg {
    width: 140px;
    height: 140px;
    transition: transform 0.5s ease;
}

/* Show SVG on hover when in clicked state */
.container.clicked .element:hover .element-text,
.container.clicked .element.gesture-hover .element-text,
.container.clicked .element-link.gesture-hover .element-text {
    opacity: 1;
}

/* Optional: Add slight scale effect on hover */
.container.clicked .element:hover .element-text svg,
.container.clicked .element.gesture-hover .element-text svg,
.container.clicked .element-link.gesture-hover .element-text svg {
    transform: scale(1.1);
}

.element.yellow {
    background-color: #ffd500;
    transform: translate(-80px, 60px);
}

.element.blue {
    background-color: #4dd8ef;
    transform: translate(0px, -80px);
}

.element.red {
    background-color: rgb(177, 11, 11);
    transform: translate(80px, 60px);
}

/* Hover state - circles become rounded squares */
.container:not(.clicked):hover .element,
.container:not(.clicked).gesture-hover .element {
    border-radius: 16px;
}

/* Clicked state - squares become larger and arrange horizontally */
.container.clicked .element {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    cursor: var(--cursor-pointer);
}

.container.clicked .element:hover,
.container.clicked .element.gesture-hover {
    transform: scale(1.05);
    transition: transform 0.5s ease 0.2s;
}

.container.clicked .element.yellow {
    transform: translateX(-240px);
}

.container.clicked .element.blue {
    transform: translateX(0px);
}

.container.clicked .element.red {
    transform: translateX(240px);
}

/* Navigation hint */
.hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0, 0, 0, 0.4);
    font-size: 14px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.container.clicked .hint {
    opacity: 0;
}

/* Press to start text */
.press-to-start {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0, 0, 0, 0.6);
    font-size: 24px;
    font-weight: 300;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: fadeInOut 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

.container.clicked .press-to-start {
    opacity: 0;
    animation: none;
}

.lettercontainer {
    position: absolute;
    top: 5%;
    width: 60%;
    height: 80%;
    border: 2px solid #333;
    padding: 20px;
    overflow: hidden;

}

.letter {
    position: relative;
    width: 90%;
    height: 100%;
    font-family: 'Times New Roman', Times, serif;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 500;
    color: #333;
    text-align: left;
}

.letter h1 {
    font-size: clamp(18px, 3vw, 28px);
    margin-bottom: 10px;
}

.letter p {
    margin-top: 20px;
}

.nickleoutimg {
    width: 15%;
    height: 15%;
    justify-content: right;
    position: relative;
    right: 0;
    bottom: 0;
    object-fit: contain;
    filter: invert(1);
}

.back-button-container {
    position: relative;
    top: 40%;
    width: 60%;
    height: 10%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
}

.back-button {
    text-decoration: none;
    color: #333;
    font-size: 20px;
    font-weight: bold;
    padding: 6px 12px;
    border: 2px solid #333;
    border-radius: 0;
}

.back-button:hover {
    cursor: var(--cursor-pointer);
    background-color: #333;
    color: #fff;
}

.lang-toggle {
    background-color: transparent;
    color: #333;
    font-size: 20px;
    font-weight: bold;
    padding: 6px 12px;
    border: 2px solid #333;
    border-radius: 0;
    cursor: var(--cursor-pointer);
    font-family: inherit;
}

.lang-toggle:hover {
    background-color: #333;
    color: #fff;
}

/* Mobile responsiveness */
@media (max-width: 1080px) {
    body {
        height: auto;
        min-height: 100vh;
        flex-direction: column;
        overflow-y: auto;
        padding: 0;
    }

    .slidercontainer {
        position: absolute;
        bottom: 10%;
        left: 50%;
        transform: translateX(-50%);
        width: 240px;
        height: 24px;
        display: flex;
        outline: 2px solid #33333333;
        outline-offset: 1px;
        border-radius: 15px;
        z-index: 10;
    }
    
    .slidercontainer:hover,
    .slidercontainer.gesture-hover {
        outline-color: #333;
        transition: outline-color 0.2s ease-in-out;
    }
    .slider-dot {
        position: absolute;
        left: 12px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background-color: #33333333;
    }
    
    .slider-dot:hover,
    .slider-dot.gesture-hover {
        cursor: var(--cursor-pointer);
        transition: all 0.2s ease-in-out;
        border: 2px solid #333;
        background-color: transparent;
    }
    
    .slider-text {
        font-size: 14px;
        font-weight: bold;
        color: #333;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        pointer-events: none;
        z-index: 1000;
    }

    .lettercontainer {
        position: relative;
        width: 90%;
        height: auto;
        border: 2px solid #333;
        padding: 20px;
        margin: 20px auto;
    }

    .back-button-container {
        position: relative;
        top: 40%;
        width: 90%;
        height: 10%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0;
    }
    
    .letter {
        width: 100%;
        font-size: clamp(12px, 3.5vw, 18px);
        font-weight: 500;
        color: #333;
        text-align: left;
    }
    
    .letter h1 {
        font-size: clamp(12px,16px, 5vw, 24px);
    }
    
    .letter p {
        margin-top: 15px;
    }
    
    .nickleoutimg {
        width: 15%;
        height: 15%;
        justify-content: right;
        position: relative;

        object-fit: contain;
        filter: invert(1);
    }

    .back-button {
        font-size: 16px;
        padding: 6px 12px;
    }

    .lang-toggle {
        font-size: 16px;
        padding: 6px 12px;
    }
    
    .container {
        width: 300px;
        height: 300px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .element {
        width: 80px;
        height: 80px;
        position: absolute;
        transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .element.yellow {
        background-color: #ffd500;
        transform: translate(-55px, 40px);
    }
    
    .element.blue {
        background-color: #4dd8ef;
        transform: translate(0px, -70px);
    }
    
    .element.red {
        background-color: #dc312a;
        transform: translate(55px, 40px);
    }

    .circle-border {
        width: 300px;
        height: 300px;
    }

    .container.clicked .elements-container {
        width: 100vw;
        height: 100px;
    }

    .container.clicked .element {
        width: 120px;
        height: 120px;
    }

    .container.clicked .element.blue {
        transform: translateY(-180px);
    }

    .container.clicked .element.yellow {
        transform: translateX(0);
    }
    .container.clicked .element.red {
        transform: translateX(0);
        transform: translateY(180px);
    }
    /* Show SVGs by default on mobile when clicked */
    .container.clicked .element .element-text {
        opacity: 1;
        transition: all 0.5s ease; /* Fade in after click animation */
    }

    .element-text {
        width: 100%;
    }

    .element-text svg {
        width: 100px;
        height: 100px;
    }
}

.element-link {
    text-decoration: none;
    display: contents;
}

.container:not(.clicked) .element-link {
    pointer-events: none;
}

.container.clicked .element-link {
    cursor: var(--cursor-pointer);
}

/* ── Gesture control (desktop only) ─────────────────────────────────────── */

.gesture-hidden-video {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: -9999px;
    top: 0;
}

.gesture-cursor {
    position: fixed;
    z-index: 99999;
    width: 64px;
    height: 64px;
    pointer-events: none;
    display: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transform: translate(calc(-1 * var(--gx, 0px)), calc(-1 * var(--gy, 0px)));
    left: 0;
    top: 0;
}

html.gesture-cursor-active,
html.gesture-cursor-active * {
    cursor: none !important;
}

html.gesture-onboarding-open .gesture-dialog-next,
html.gesture-onboarding-open .gesture-dialog-skip,
html.gesture-onboarding-open .gesture-toggle {
    cursor: var(--cursor-pointer) !important;
}

.gesture-fist-hud {
    position: fixed;
    width: 290px;
    left: 50%;
    bottom: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    min-width: 220px;
    max-width: 90vw;
    padding: 10px 14px;
    background: #fff;
    border: 3px solid #000;
    border-radius: 10px;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

.gesture-fist-hud-label {
    margin-bottom: 8px;
}

.gesture-fist-hud-bar {
    height: 6px;
    border: 1px solid #000;
    border-radius: 3px;
    background: #fff;
    overflow: hidden;
}

.gesture-fist-hud-fill {
    height: 100%;
    width: 0%;
    background: #000;
}

.gesture-toggle {
    opacity: 0.6;
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    width: 200px;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 15px;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: var(--cursor-pointer);
    user-select: none;
    z-index: 20;
    transition: opacity 0.2s ease-in-out;
}

.gesture-toggle svg {
    width: 18px;
    height: 18px;
    stroke: #000;
    fill: none;
    stroke-width: 1.5;
    flex-shrink: 0;
}

.gesture-toggle.is-on svg {
    fill: #000;
    stroke: #000;
}

.gesture-toggle:hover,
.gesture-toggle.gesture-hover {
    opacity: 1;
}

.gesture-dialog {
    display: none;
    position: absolute;
    top: 15%;
    /*transform: translate(-50%, -50%);*/
    width: 200px;
    height: auto;
    z-index: 30;
    background: #fff;
    border: 2px solid #000;
    border-radius: 10px;
    color: #000;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    padding: 14px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.gesture-dialog.is-open {
    display: flex;
}

.gesture-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.gesture-dialog-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 8px;
}

.gesture-dialog-text {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 500;
    text-align: left;
    color: #000;
}

.gesture-dialog-error {
    font-size: 12px;
    color: #000;
    text-align: left;
    min-height: 1.2em;
}

.gesture-dialog-illust {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

.gesture-dialog-illust svg {
    width: 100%;
    max-width: 140px;
    height: auto;
    overflow: visible;
}

.gesture-dialog-next,
.gesture-dialog-skip {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: var(--cursor-pointer);
    line-height: 1.2;
}

.gesture-dialog-next {
    margin-left: auto;
}

.gesture-dialog-next:hover,
.gesture-dialog-skip:hover {
    background: #000;
    color: #fff;
}

.gesture-dialog-next:disabled,
.gesture-dialog-skip:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.gesture-step {
    display: none;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.gesture-step.is-active {
    display: flex;
}

/* Step 2: hand + cursor move L/R */
@keyframes gesture-hand-pan {
    0%, 100% { transform: translateX(15px); }
    50% { transform: translateX(35px); }
}

@keyframes gesture-cursor-pan {
    0%, 100% { transform: translate(-25px, 0); }
    50% { transform: translate(10px, 0); }
}

.gesture-anim-hand {
    transform-origin: center;
    animation: gesture-hand-pan 2.2s ease-in-out infinite;
}

.gesture-anim-cursor {
    transform-origin: center;
    animation: gesture-cursor-pan 2.2s ease-in-out infinite;
}

/* Step 3: pinch */
@keyframes gesture-pinch-thumb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(6px, -8px); }
}

@keyframes gesture-pinch-index {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-6px, 8px); }
}

.gesture-anim-thumb {
    transform-origin: center;
    animation: gesture-pinch-thumb 1.4s ease-in-out infinite;
}

.gesture-anim-index {
    transform-origin: center;
    animation: gesture-pinch-index 1.4s ease-in-out infinite;
}

@media (max-width: 1080px) {
    .gesture-toggle,
    .gesture-dialog {
        display: none !important;
    }
}

.gesture-fist-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.gesture-scroll-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.gesture-scroll-icon--flipped {
    transform: scaleY(-1);
}