@font-face {
    font-family: "DIN Condensed";
    src: url("./fonts/DINCondensedBold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Helvetica Neue";
    src: url("./fonts/HelveticaNeue.ttc") format("collection");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Fonts */
    --font-primary: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-condensed: "DIN Condensed", sans-serif;

    /* Colors */
    --color-navy: #1C1C67;
    --color-navy-dark: #2A2A55;
    --color-gold: #8C6228;
    --color-white: #FFFFFF;
    --color-black: #000000;

    /* Shadows */
    --shadow-elevated: 0 4px 10px rgba(28, 28, 103, 0.9);

    /* Layout */
    --popup-offset: 156px;

    /* Motion */
    --transition-popup: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
    --transition-button: transform 120ms ease, opacity 120ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

body {
    overscroll-behavior: none;
    font-family: var(--font-primary);
}

img {
    /* Prevent haptic touch previews */
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

/* The 640x800 stage that holds the background */
.stage {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    align-items: center;
    width: 640px;
    height: 100%;
    min-height: 100dvh;
    max-width: 100vw;
    margin: 0 auto;
    background-image: url("./images/hp-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.stage-title {
    font-size: 2.562rem;
    line-height: 2.9375rem;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 1.812rem;
    white-space: pre-line;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 4px;
    row-gap: 10px;
    line-height: 0;
}

@media (min-width: 640px) {
    .menu {
        max-width: 70%;
    }
}

.menu-item {
    position: relative;
    display: block;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
    box-shadow: var(--shadow-elevated);
    border-radius: 26px;
    max-width: 114px;
}

.menu-item-label {
    font-family: var(--font-condensed);
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    color: var(--color-navy-dark);
    font-size: 1.25rem;
    line-height: 200%;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    font-weight: 300;
}

.menu-image {
    display: block;
    width: 100%;
    height: auto;
}


/* Mobile-only guard: hide on larger screens */
@media (min-width: 768px) and (orientation: portrait) {
    body {
        background: var(--color-black);
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .stage {
        display: none;
    }

    body::after {
        content: "This page is available on mobile devices only.";
        color: var(--color-white);
        font-size: 18px;
        text-align: center;
        padding: 24px;
    }
}

/* Landscape: only block on genuinely large (desktop) screens */
@media (min-width: 900px) and (orientation: landscape) {
    body {
        background: var(--color-black);
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .stage {
        display: none;
    }

    body::after {
        content: "This page is available on mobile devices only.";
        color: var(--color-white);
        font-size: 18px;
        text-align: center;
        padding: 24px;
    }
}

/* ==========================================================================
   Slot machine (category "Inspiruj mě")
   ========================================================================== */
.slot-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

@media (min-width: 640px) {
    .slot-back {
        margin-top: 100px;
    }
}

.slot-back span {
    color: var(--color-navy);
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 1.5rem;
}

.slot-back img {
    width: 33px;
    height: 28px;
    margin-bottom: 1rem;
}

.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    padding: 2rem 1.5rem;
    min-height: 100dvh;
}

@media (max-width: 639px) {
    .slot {
        justify-content: space-between;
    }
}

.slot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.5rem;
}

/* The framed "window" where images spin */
.slot-frame {
    width: 182px;
    overflow: hidden;
    box-shadow: var(--shadow-elevated);
    border-radius: 8px;
    border: 1px solid var(--color-white);
}

/* Clips the reel to exactly one image tall (height set from JS) */
.slot-window {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

/* Vertical strip of stacked cells that scrolls during a spin */
.slot-reel {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

/* One item in the reel: width fills the frame, height follows the image */
.slot-cell {
    flex: 0 0 auto;
    width: 100%;
    line-height: 0;
}

.slot-cell-image {
    width: 100%;
    height: auto;
    display: block;
}

.slot-button {
    appearance: none;
    cursor: pointer;
    padding: 12px 35px;
    border-radius: 999px;
    background: var(--color-white);
    border: 1px solid var(--color-black);
    color: var(--color-black);
    font-family: var(--font-primary);
    font-size: 1.5rem;
    line-height: 2.937rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: var(--transition-button);
}

.slot-button:active {
    transform: translateY(2px);
}

.slot-button:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ==========================================================================
   Result popup (slides up over the button; swipe down to reveal button)
   ========================================================================== */
.slot-popup {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 512px;
    /*min-height: 356px;*/
    min-height: 35svh;
    margin: 0 auto;
    background-color: var(--color-white);
    background-image: url("./images/popup-box.png");
    border-top-right-radius: 12px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 0 1.5rem 5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transform: translateY(101%);
    transition: var(--transition-popup);
    z-index: 4;
    touch-action: none;
    cursor: grab;
    pointer-events: none;
}

@media (max-width: 639px) {
    .slot-popup {
        padding: 0 1.5rem 2rem;
    }
}

.slot-popup.is-open {
    transform: translateY(0);
    pointer-events: auto;
}

.slot-popup-handle {
    width: 117px;
    height: 5px;
    border-radius: 999px;
    margin: 20px auto;
    background: var(--color-navy);
}

.slot-popup-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    line-height: 2.25rem;
    text-transform: uppercase;
    color: var(--color-navy);
    text-align: left;
    margin-bottom: 20px;
    white-space: pre-line;
}

.slot-popup-text {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.25rem;
    color: var(--color-navy);
    text-align: left;
    white-space: pre-line;
}

@media (max-width: 480px) {
    .stage-title {
        font-size: 2.2rem;
        line-height: 2.6375rem;
    }

    .slot-popup-title {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }

    .slot-popup-text {
        font-size: 0.975rem;
        line-height: 1.2rem;
    }
}

@media (max-width: 380px) {
    .stage-title {
        font-size: 1.7rem;
        line-height: 2.1375rem;
        margin-bottom: 0;
    }

    .slot-popup-title {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }

    .slot-popup-text {
        font-size: 0.875rem;
        line-height: 1.2rem;
    }
}

@media (min-width: 640px) {
    .slot-popup-title,
    .slot-popup-text {
        margin-left: var(--popup-offset);
    }

    .slot-popup-handle {
        position: relative;
        left: calc(var(--popup-offset) / 2);
    }
}