/**
 * =========================================================
 * YUMBAKER: Alias Game Final UI Styles 2026 05 10
 * ---------------------------------------------------------
 * Зачем:
 * - Фиксирует финальный мобильный UI для всех экранов игры.
 * - Использует одну и ту же мобильную плашку на desktop и mobile.
 * - Сжимает карточки под экран, минимизируя необходимость скролла.
 * =========================================================
 */
.yba-game,
.yba-game *,
.yba-game *::before,
.yba-game *::after { box-sizing: border-box; }

.yba-game {
    --yba-base: #fff;
    --yba-contrast: #15151b;
    --yba-muted: rgba(21,21,27,.62);
    --yba-line: rgba(21,21,27,.14);
    --yba-burgundy: var(--yumbaker-color-burgundy, var(--wp--preset--color--burgundy, #a32f45));
    --yba-matcha: var(--yumbaker-color-matcha, var(--wp--preset--color--matcha, #788956));
    --yba-gold: #c89b3c;
    --yba-soft: #f6f4ef;
    display: inline-block;
    color: var(--yba-contrast);
    font-family: inherit;
}

.yba-game-is-open { overflow: hidden; }
.yba-game__overlay[hidden], .yba-game__screen[hidden], .yba-game__footer-actions[hidden], .yba-game__next-player[hidden], .yba-game__next-player[hidden] { display: none !important; }

.yba-game button, .yba-game input, .yba-game select { font: inherit; }

.yba-game__launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: .75rem 1.25rem;
    border: 1px solid var(--yba-burgundy);
    border-radius: 999px;
    background: transparent;
    color: var(--yba-burgundy);
    font-weight: 700;
    cursor: pointer;
    -webkit-text-fill-color: currentColor;
}

.yba-game__overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    background: rgba(18,18,22,.34);
    backdrop-filter: blur(1px);
}

.yba-game__modal {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(92vw, 360px);
    height: min(92vh, 730px);
    max-height: 92vh;
    overflow: hidden;
    border-radius: 22px;
    background: var(--yba-base);
    box-shadow: 0 22px 70px rgba(0,0,0,.18);
}

.yba-game__close,
.yba-game .yba-game__close {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    z-index: 10;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 1px solid var(--yba-line) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--yba-contrast) !important;
    box-shadow: 0 9px 22px rgba(0,0,0,.1) !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer;
    -webkit-text-fill-color: currentColor;
}

.yba-game__header {
    padding: 22px 64px 10px 20px;
    background: linear-gradient(#fff 84%, rgba(255,255,255,.88));
}

.yba-game__brand { display: inline-flex; align-items: center; gap: 10px; min-height: 38px; }
.yba-game__brand-logo { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; color: var(--yba-burgundy); }
.yba-game__brand-logo img, .yba-game__brand-logo svg { width: 34px !important; height: 34px !important; max-width: 34px !important; max-height: 34px !important; object-fit: contain; display: block; }
.yba-game__brand-logo svg { fill: currentColor; }
.yba-game__title { margin: 0; font-size: 24px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }

.yba-game__body {
    min-height: 0;
    overflow: auto;
    padding: 10px 20px 14px;
    scrollbar-width: none;
}
.yba-game__body::-webkit-scrollbar { display: none; }

.yba-game__screen { min-height: 100%; display: grid; align-content: start; gap: 16px; }
.yba-game__screen--play { gap: clamp(12px, 2.2vh, 20px); }
.yba-game__screen--handoff, .yba-game__screen--final { align-content: center; gap: 18px; }

.yba-game__field { display: grid; gap: 8px; font-weight: 800; font-size: 14px; }
.yba-game__field select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--yba-line);
    border-radius: 12px;
    background: #fff;
    color: var(--yba-contrast);
    padding: 0 14px;
    font-weight: 700;
}

.yba-game__setting-row { display: grid; gap: 10px; font-size: 14px; font-weight: 800; }
.yba-game__stepper {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    min-height: 48px;
    border-radius: 999px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--yba-line);
}
.yba-game__stepper button {
    width: 40px;
    height: 40px;
    margin: 4px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--yba-burgundy);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
    font-weight: 900;
    font-size: 22px;
    cursor: pointer;
    -webkit-text-fill-color: currentColor;
}
.yba-game__stepper span { text-align: center; font-size: 24px; line-height: 1; font-weight: 900; }

.yba-game__context { display: grid; gap: 6px; font-size: clamp(13px, 3.5vw, 15px); line-height: 1.45; }
.yba-game__context p { margin: 0; }
.yba-game__context [data-yba-topic-label] { color: var(--yba-burgundy); font-weight: 900; }

.yba-game__roundline { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.yba-game__roundmeta { display: grid; gap: 7px; align-content: center; }
.yba-game__roundmeta strong { font-size: 20px; }
.yba-game__finish-link {
    justify-self: start;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--yba-burgundy);
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
    -webkit-text-fill-color: currentColor;
}
.yba-game__timer {
    width: 76px;
    height: 76px;
    border: 2px solid #111;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.yba-game__word-card {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    justify-items: center;
    min-height: 0;
    height: clamp(230px, 43vh, 330px);
    padding: clamp(20px, 5vw, 34px) 18px 22px;
    border: 2px solid #111;
    border-radius: 18px;
    overflow: hidden;
}
.yba-game__word {
    width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-align: center;
    hyphens: auto;
    overflow-wrap: anywhere;
    font-size: clamp(34px, 10.5vw, 58px);
    font-weight: 950;
    line-height: .98;
    letter-spacing: -.045em;
}
.yba-game__counter { font-size: 18px; font-weight: 600; }

.yba-game__section-title { display: grid; grid-template-columns: auto max-content 1fr; gap: 10px; align-items: center; color: var(--yba-burgundy); font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.yba-game__section-title::after { content: ''; height: 1px; background: rgba(163,47,69,.45); }
.yba-game__section-icon, .yba-game__section-icon svg { width: 19px; height: 19px; fill: currentColor; }
.yba-game__hint { margin: -4px 0 4px; color: var(--yba-muted); font-size: 13px; line-height: 1.35; }
.yba-game__participant-list { display: grid; gap: 10px; }
.yba-game__participant {
    min-height: 58px;
    display: grid;
    grid-template-columns: 26px 38px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--yba-line);
    border-radius: 13px;
    padding: 6px;
    background: #fff;
}
.yba-game__drag svg { width: 20px; height: 20px; fill: rgba(21,21,27,.38); display: block; }
.yba-game__avatar { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--yba-burgundy); color: #fff; font-weight: 900; font-size: 14px; }
.yba-game__participant:nth-child(2n) .yba-game__avatar { background: var(--yba-matcha); }
.yba-game__participant:nth-child(3n) .yba-game__avatar { background: var(--yba-gold); }
.yba-game__participant input { min-width: 0; width: 100%; height: 44px; border: 1px solid var(--yba-line); border-radius: 12px; padding: 0 12px; background: #fff; color: var(--yba-contrast); font-size: 15px; }
.yba-game__participant-delete { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--yba-line); border-radius: 11px; background: #fff; color: var(--yba-contrast); cursor: pointer; }
.yba-game__participant-delete svg { width: 20px; height: 20px; fill: currentColor; }
.yba-game__add { min-height: 56px; border: 1px dashed var(--yba-burgundy); border-radius: 14px; background: transparent; color: var(--yba-burgundy); font-weight: 800; cursor: pointer; -webkit-text-fill-color: currentColor; }
.yba-game__add::before { content: '+ '; }

.yba-game__center-hero { display: grid; justify-items: center; text-align: center; gap: 8px; }
.yba-game__center-hero h3 { margin: 0; font-size: 24px; line-height: 1.05; font-weight: 900; }
.yba-game__center-hero p { margin: 0; font-size: 14px; }
.yba-game__hero-icon { width: 112px; height: 112px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--yba-soft); color: var(--yba-matcha); }
.yba-game__hero-icon svg { width: 72px; height: 72px; fill: currentColor; }
.yba-game__next-player { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; justify-self: center; min-width: 220px; padding: 11px 16px; border-radius: 14px; background: var(--yba-soft); color: var(--yba-matcha); font-size: 13px; }
.yba-game__next-player strong { grid-column: 2; color: var(--yba-matcha); font-size: 15px; }
.yba-game__next-icon { grid-row: 1 / span 2; }
.yba-game__next-icon svg { width: 28px; height: 28px; fill: currentColor; }
.yba-game__summary-card, .yba-game__final-list { border: 1px solid var(--yba-line); border-radius: 16px; overflow: hidden; background: #fff; }
.yba-game__summary-card div, .yba-game__result-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--yba-line); font-size: 14px; }
.yba-game__summary-card div:first-child, .yba-game__result-row:first-child { border-top: 0; }
.yba-game__summary-card strong, .yba-game__result-row strong { color: var(--yba-matcha); }
.yba-game__mini-icon { color: var(--yba-matcha); font-size: 20px; line-height: 1; }
.yba-game__result-row { font-size: 13px; }
.yba-game__result-row strong { font-size: 14px; }
.yba-game__result-row:first-child strong { color: var(--yba-burgundy); }
.yba-game__email-result { justify-self: center; color: var(--yba-burgundy); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; -webkit-text-fill-color: currentColor; }

.yba-game__footer { padding: 10px 20px 20px; background: linear-gradient(rgba(255,255,255,0), #fff 26%); }
.yba-game__footer-actions { display: grid; gap: 12px; }
.yba-game__footer-actions--two { grid-template-columns: 1fr 1fr; gap: 14px; }
.yba-game__footer-note { margin: -2px 0 0; color: var(--yba-muted); font-size: 12px; line-height: 1.3; text-align: center; }
.yba-game__button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 0 18px; font-weight: 850; border: 1px solid transparent; cursor: pointer; -webkit-text-fill-color: currentColor; }
.yba-game__button--primary { background: var(--yba-matcha); border-color: var(--yba-matcha); color: #fff; box-shadow: 0 12px 24px rgba(120,137,86,.18); }
.yba-game__button--secondary { background: transparent; border-color: var(--yba-burgundy); color: var(--yba-burgundy); }
.yba-game__button--burgundy { background: var(--yba-burgundy); border-color: var(--yba-burgundy); color: #fff; box-shadow: 0 12px 24px rgba(163,47,69,.18); }
.yba-game__button--primary, .yba-game__button--burgundy { color: #fff !important; -webkit-text-fill-color: #fff !important; }
.yba-game__button--secondary, .yba-game__launcher, .yba-game__stepper button, .yba-game__add, .yba-game__finish-link, .yba-game__email-result { color: var(--yba-burgundy) !important; -webkit-text-fill-color: var(--yba-burgundy) !important; }
.yba-game__button:disabled { opacity: .56; cursor: default; pointer-events: none; filter: grayscale(.08); }

@media (max-height: 720px) {
    .yba-game__modal { height: min(94vh, 660px); }
    .yba-game__header { padding-top: 18px; padding-bottom: 6px; }
    .yba-game__body { padding-top: 6px; padding-bottom: 8px; }
    .yba-game__screen { gap: 12px; }
    .yba-game__context { font-size: 13px; line-height: 1.35; }
    .yba-game__timer { width: 66px; height: 66px; font-size: 30px; }
    .yba-game__word-card { height: clamp(210px, 38vh, 290px); }
    .yba-game__word { font-size: clamp(30px, 9vw, 50px); }
    .yba-game__hero-icon { width: 92px; height: 92px; }
    .yba-game__hero-icon svg { width: 58px; height: 58px; }
}

@media (max-width: 380px) {
    .yba-game__modal { width: min(94vw, 340px); }
    .yba-game__header, .yba-game__body, .yba-game__footer { padding-left: 16px; padding-right: 16px; }
    .yba-game__participant { grid-template-columns: 22px 34px minmax(0,1fr) 44px; gap: 6px; }
    .yba-game__timer { width: 66px; height: 66px; font-size: 30px; }
    .yba-game__word-card { height: clamp(205px, 38vh, 285px); }
}


/**
 * =========================================================
 * YUMBAKER: Alias Game visual hotfix 2026 05 10
 * ---------------------------------------------------------
 * Зачем:
 * - стабилизировать видимость текста и SVG в обычном/hover/focus состояниях;
 * - убрать любые тени/плашки у деликатной ссылки завершения раунда;
 * - сохранить фирменные состояния secondary/add controls независимо от темы.
 * =========================================================
 */
.yba-game .yba-game__finish-link,
.yba-game .yba-game__finish-link:hover,
.yba-game .yba-game__finish-link:focus,
.yba-game .yba-game__finish-link:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--yba-burgundy) !important;
    -webkit-text-fill-color: var(--yba-burgundy) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.yba-game .yba-game__participant-delete,
.yba-game .yba-game__participant-delete:hover,
.yba-game .yba-game__participant-delete:focus,
.yba-game .yba-game__participant-delete:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--yba-line) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: var(--yba-contrast) !important;
    -webkit-text-fill-color: var(--yba-contrast) !important;
}
.yba-game .yba-game__participant-delete svg {
    width: 19px !important;
    height: 19px !important;
    min-width: 19px !important;
    min-height: 19px !important;
    display: block !important;
    fill: currentColor !important;
    stroke: none !important;
}
.yba-game .yba-game__participant-delete:hover,
.yba-game .yba-game__participant-delete:focus {
    border-color: var(--yba-burgundy) !important;
    color: var(--yba-burgundy) !important;
    -webkit-text-fill-color: var(--yba-burgundy) !important;
}

.yba-game .yba-game__add,
.yba-game .yba-game__add:hover,
.yba-game .yba-game__add:focus,
.yba-game .yba-game__add:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border: 1px dashed var(--yba-burgundy) !important;
    color: var(--yba-burgundy) !important;
    -webkit-text-fill-color: var(--yba-burgundy) !important;
    box-shadow: none !important;
}
.yba-game .yba-game__add:hover,
.yba-game .yba-game__add:focus {
    background: rgba(163, 47, 69, .07) !important;
}

.yba-game .yba-game__button--secondary,
.yba-game .yba-game__button--secondary:hover,
.yba-game .yba-game__button--secondary:focus,
.yba-game .yba-game__button--secondary:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border-color: var(--yba-burgundy) !important;
    color: var(--yba-burgundy) !important;
    -webkit-text-fill-color: var(--yba-burgundy) !important;
    box-shadow: none !important;
}
.yba-game .yba-game__button--secondary:hover,
.yba-game .yba-game__button--secondary:focus {
    background: rgba(163, 47, 69, .07) !important;
}


/**
 * =========================================================
 * YUMBAKER: Alias Game micro hotfix 2026 05 10
 * ---------------------------------------------------------
 * Зачем:
 * - выровнять лейбл раунда строго по левому краю;
 * - сделать ссылку досрочного завершения деликатнее;
 * - стабилизировать раскраску кнопки шорткода во всех состояниях.
 * =========================================================
 */
.yba-game .yba-game__screen--play,
.yba-game .yba-game__roundline,
.yba-game .yba-game__roundmeta {
    text-align: left !important;
}

.yba-game .yba-game__roundmeta {
    justify-items: start !important;
    align-items: start !important;
}

.yba-game .yba-game__roundmeta strong {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
}

.yba-game .yba-game__finish-link,
.yba-game .yba-game__finish-link:hover,
.yba-game .yba-game__finish-link:focus,
.yba-game .yba-game__finish-link:active {
    font-size: 15px !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
}

.yba-game .yba-game__launcher,
.yba-game .yba-game__launcher:visited,
.yba-game .yba-game__launcher:hover,
.yba-game .yba-game__launcher:focus,
.yba-game .yba-game__launcher:active {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--yba-burgundy) !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--yba-burgundy) !important;
    -webkit-text-fill-color: var(--yba-burgundy) !important;
    text-decoration: none !important;
}

.yba-game .yba-game__launcher:hover,
.yba-game .yba-game__launcher:focus {
    background: rgba(163, 47, 69, .07) !important;
    color: var(--yba-burgundy) !important;
    -webkit-text-fill-color: var(--yba-burgundy) !important;
}
