/* The key menu (core/keyMenu.js): every game's keys and combos in a dialog over the cabinet, and the ways into it. */

/* The way in (the button in the home's title band) is styled with the band, in home.css. */
.keys-open-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---- The dialog: dark glass whatever the page's theme, with the tokens the brief and the stage use. It fades in
   as the card after a run does (play.css `over-in`, loaded with this sheet on every page) ---- */
.keys {
    --a: var(--brand);
    --text: #f8f6f1;
    --dim: #a3a7b0;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.18);
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: grid;
    place-items: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    color: var(--text);
    text-align: left;
    background: rgba(5, 4, 13, 0.74);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: over-in 0.18s ease-out;
}
/* the cabinet centres its own children on a wide screen; the menu is the whole window */
.games > .keys,
.stage > .keys {
    width: auto;
    max-width: none;
    margin: 0;
}
.keys-card {
    display: flex;
    flex-direction: column;
    width: min(1000px, 100%);
    height: min(760px, 100%);
    background: #15161b;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
.keys-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: none;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.keys-head h2 {
    margin-top: 2px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
}
.keys-close {
    min-height: 36px;
    padding: 0 14px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dim);
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    cursor: pointer;
}
.keys-close:hover {
    color: #fff;
    border-color: #fff;
}
.keys-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
}
.keys-nav,
.keys-page {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
/* ---- The games, down the side ---- */
.keys-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border-right: 1px solid var(--line);
}
.keys-tab {
    --a: var(--brand);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: center;
    flex: none;
    padding: 8px 10px 8px 12px;
    font: inherit;
    text-align: left;
    color: var(--dim);
    background: none;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
}
.keys-tab-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.keys-tab-kind {
    grid-column: 1;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.keys-tab-tag {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    border: 1px solid var(--a);
    border-radius: 999px;
}
.keys-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}
.keys-tab[aria-selected='true'] {
    background: rgba(255, 255, 255, 0.09);
    border-left-color: var(--a);
}
.keys-tab:focus-visible,
.keys-close:focus-visible,
.keys-who:focus-visible,
.keys-page:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}
.keys-foot {
    flex: none;
    padding: 10px 20px;
    border-top: 1px solid var(--line);
}

/* ---- A phone: the whole screen, the games across the top ---- */
@media (max-width: 720px) {
    .keys {
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    .keys-card {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
    }
    .keys-head {
        padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    }
    .keys-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }
    .keys-nav {
        flex-direction: row;
        gap: 6px;
        padding: 10px 16px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .keys-tab {
        display: inline-flex;
        gap: 6px;
        min-height: 40px;
        padding: 0 14px;
        white-space: nowrap;
        border: 1px solid var(--line-strong);
        border-radius: 999px;
    }
    .keys-tab-kind {
        display: none;
    }
    .keys-tab[aria-selected='true'] {
        background: #fff;
        border-color: #fff;
    }
    .keys-tab[aria-selected='true'] .keys-tab-name,
    .keys-tab[aria-selected='true'] .keys-tab-tag {
        color: var(--dark);
    }
}
@media (prefers-reduced-motion: reduce) {
    .keys {
        animation: none;
    }
}
