/* Play / game modes. Loaded after the existing screen styles. */
.play-screen-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 999px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.play-screen-button:focus-visible {
    outline: 3px solid #c9b8ff;
    outline-offset: 6px;
}
body.cart-screen .play-screen-button img {
    width: min(220px, 60vw);
    transition: filter 160ms ease, scale 160ms ease;
}
.play-screen-button:active img { scale: .95; }

.play-menu {
    box-sizing: border-box;
    width: min(400px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: auto;
    padding: 26px 24px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #a99ad5 transparent;
    border: 2px solid #251744;
    border-radius: 32px;
    color: #fff;
    background:
        radial-gradient(ellipse at 16% 0%, #b2a0e633, transparent 62%),
        linear-gradient(145deg, #61508070, #2e234a55),
        url('assets/меню выбора режима для карт/Menu cards.png') center / 100% 100% no-repeat;
    background-color: #4a3c68;
    box-shadow: 0 24px 90px #0009, inset 0 1px 0 #e0d4ff33;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-tap-highlight-color: transparent;
}
.play-menu::backdrop {
    background: #0a0913b8;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.play-menu[open] { animation: play-menu-in 240ms cubic-bezier(.2,.8,.2,1) both; }
.play-menu[open]::backdrop { animation: play-backdrop-in 200ms ease both; }
.play-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.play-menu-eyebrow {
    margin: 0 0 8px;
    color: #d2c3f5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.4px;
}
.play-menu h1 { margin: 0; font-size: clamp(22px, 6vw, 28px); line-height: 1.15; letter-spacing: -.7px; }
.play-menu-close {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid #d2c3ff33;
    border-radius: 50%;
    color: #eee7ff;
    background: #23163540;
    cursor: pointer;
    touch-action: manipulation;
}
.play-menu-close svg { width: 22px; height: 22px; }
.play-menu-description { margin: 10px 0 24px; color: #d6cbe6; font-size: 13px; line-height: 1.5; }
.game-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.game-mode {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    aspect-ratio: 408 / 311;
    padding: 0;
    border: 0;
    border-radius: 26%;
    color: #fff;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}
.game-mode img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.game-mode-create {
    background: #6a58a0;
    box-shadow: inset 0 -3px 0 #0002;
    padding: 5% 5% 7%;
}
.create-game-icon { display: block; width: 66%; height: 73%; }
.create-game-label { font-size: clamp(12px, 4.5vw, 19px); line-height: 1.25; font-weight: 700; text-shadow: 0 2px 3px #0005; }
.game-mode:active:not(:disabled) { transform: scale(.95); }
.game-mode:focus-visible, .play-menu-close:focus-visible {
    outline: 3px solid #e5d9ff;
    outline-offset: 4px;
}
.game-mode[aria-pressed='true'] { box-shadow: 0 0 0 3px #e1d4ff, 0 7px 22px #21133b66; }
.mode-check {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5d9ff;
    color: #3a235e;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px #0003;
}
.game-mode[aria-pressed='true'] .mode-check { display: flex; }
.game-mode-soon { opacity: .65; cursor: default; }
.game-mode-status {
    min-height: 18px;
    margin: 22px 0 0;
    color: #d8cdea;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}
@media (hover: hover) {
    .game-mode:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.12); }
    .play-menu-close:hover { background: #b4a0e633; }
    .play-screen-button:hover img { filter: brightness(1.12); }
}
@media (max-width: 359px) {
    .play-menu { padding: 22px 18px 16px; border-radius: 28px; }
    .game-modes { gap: 16px 18px; }
    .play-menu-description { margin-bottom: 20px; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .play-menu { width: min(520px, calc(100vw - 40px)); padding: 14px 20px 10px; }
    .game-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin-top: 12px; }
    .play-menu-description { display: none; }
    .game-mode-status { margin-top: 10px; }
}
@keyframes play-menu-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes play-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .play-menu[open], .play-menu[open]::backdrop { animation: none; }
    .game-mode, body.cart-screen .play-screen-button img { transition: none; }
}
