/* Design Press, the press card: slot boxes, reel roll animation, lookup menu */

.press {
    background: var(--dark-transparent);
    border: 1px solid var(--fp-edge);
    border-radius: var(--fp-radius);
    padding: clamp(16px, 3vw, 28px);
    transition: border-color .2s, box-shadow .2s;
}

/* Session running, the whole formula is locked in */
.press.locked-in {
    border-color: var(--accentTransparent);
    box-shadow: 0 0 12px var(--glow);
}

.press.locked-in .slot {
    border-color: var(--accentTransparent);
}

.press.locked-in .word,
.press.locked-in .lock {
    cursor: default;
}

.press.locked-in .word:hover {
    color: var(--textColor);
}

@keyframes fp-timesup {
    0%, 100% {
        border-color: var(--fp-edge);
        box-shadow: none;
    }
    20% {
        border-color: var(--accentColor);
        box-shadow: 0 0 26px var(--glow);
    }
    60% {
        border-color: var(--accentColor);
        box-shadow: 0 0 10px var(--glow);
    }
}

.press.flash {
    animation: fp-timesup 1.1s ease-out 2;
}

/* ---------- formula row ---------- */
.formula {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    min-height: clamp(90px, 16vw, 140px);
}

.op {
    align-self: center;
    font-family: var(--fp-display);
    font-weight: 700;
    color: var(--accentColor);
    font-size: clamp(1.1rem, 2.6vw, 1.7rem);
    user-select: none;
}

/* ---------- slot box ---------- */
.slot {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    max-width: 100%;
    background: var(--backgroundColor-Transparent);
    border: 1px solid var(--fp-edge);
    border-radius: var(--fp-radius);
    padding: 10px 14px 12px;
    transition: border-color .2s, box-shadow .2s;
}

.slot.locked {
    border-color: var(--accentTransparent);
    box-shadow: 0 0 8px var(--glow);
}

.slot-head {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.slot-label {
    font-family: var(--fp-display);
    font-weight: 500;
    font-size: .62rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accentColor);
    white-space: nowrap;
}

.lock {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid var(--fp-muted);
    background: transparent;
    padding: 0;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.lock:hover {
    border-color: var(--textColor);
}

.lock[aria-pressed="true"] {
    background: var(--accentColor);
    border-color: var(--accentColor);
    box-shadow: 0 0 6px var(--glow);
}

.lookup {
    margin-left: auto;
    display: flex;
    align-items: center;
    background: none;
    border: 0;
    padding: 2px;
    cursor: pointer;
    color: var(--fp-muted);
    transition: color .15s;
}

.lookup:hover {
    color: var(--accentColor);
}

.lookup svg {
    width: 13px;
    height: 13px;
    display: block;
}

/* ---------- reel window and word ---------- */
.reel-window {
    position: relative;
    overflow: hidden;
    /* centers the word in the leftover slot height */
    margin-block: auto;
}

.word {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: var(--fp-display);
    font-weight: 600;
    font-size: clamp(1.25rem, 3.2vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: .5px;
    color: var(--textColor);
    text-align: left;
    white-space: nowrap;
    transition: color .15s;
}

.word:hover {
    color: var(--accentColor);
}

.reel-strip {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    pointer-events: none;
    will-change: transform;
}

.reel-strip span {
    display: flex;
    align-items: center;
    font-family: var(--fp-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .5px;
    white-space: nowrap;
    color: var(--textColor);
}

@keyframes fp-land {
    0% {
        transform: translateY(14%) scale(1.03);
        color: var(--accentColor);
        text-shadow: 0 0 14px var(--glow);
    }
    60% {
        transform: translateY(-3%) scale(1);
    }
    100% {
        transform: none;
        text-shadow: none;
    }
}

.word.land {
    animation: fp-land .3s cubic-bezier(.2, .85, .3, 1.15) both;
}

/* ---------- lookup menu ---------- */
.lookup-menu {
    position: fixed;
    z-index: 80;
    min-width: 190px;
    background: var(--dark);
    border: 1px solid var(--accentTransparent);
    border-radius: var(--fp-radius);
    box-shadow: 0 0 12px var(--glow), 0 10px 30px rgba(0, 0, 0, .4);
    padding: 8px;
}

.lookup-menu[hidden] {
    display: none;
}

.lookup-term {
    font-family: var(--fp-display);
    font-weight: 600;
    font-size: .68rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accentColor);
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--fp-edge);
    margin-bottom: 4px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lookup-menu a {
    display: block;
    padding: 7px 8px;
    border-radius: calc(var(--fp-radius) - 3px);
    font-family: var(--fp-ui);
    font-size: .74rem;
    color: var(--textColor) !important;
    text-decoration: none;
    transition: background .12s, color .12s;
}

.lookup-menu a:hover {
    background: var(--accentVeryTransparent);
    color: var(--accentColor) !important;
    text-decoration: none;
}

/* ---------- mobile ---------- */
@media (max-width: 560px) {
    .formula {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .op {
        align-self: center;
        padding: 0;
        font-size: 1rem;
    }

    .word {
        font-size: clamp(1.15rem, 6vw, 1.6rem);
    }

    .lookup-menu {
        left: 12px !important;
        right: 12px;
        top: auto !important;
        bottom: 12px;
        min-width: 0;
    }

    .lookup-term {
        max-width: none;
    }
}
