
/* ═══════════════════════════════════════════════════════════
   MATCH-3 MINI APP — NEON THEME
═══════════════════════════════════════════════════════════ */

/* Неоновые цвета */
:root {
    --neon-pink:   #ff2d78;
    --neon-gold:   #ffcc00;
    --neon-green:  #00ff7f;
    --neon-amber:  #ff9500;
    --neon-purple: #d946ef;
    --neon-cyan:   #00eaff;
    --neon-white:  #f0e8ff;
}

.neon-gold   { color: var(--neon-gold) !important; text-shadow: 0 0 8px var(--neon-gold); }
.neon-green  { color: var(--neon-green) !important; text-shadow: 0 0 8px var(--neon-green); }
.neon-pink   { color: var(--neon-pink) !important; text-shadow: 0 0 8px var(--neon-pink); }
.neon-amber  { color: var(--neon-amber) !important; text-shadow: 0 0 8px var(--neon-amber); }
.neon-cyan   { color: var(--neon-cyan) !important; text-shadow: 0 0 8px var(--neon-cyan); }

/* Шапка */
.m3-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px 4px;
    background: rgba(10,6,24,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.m3-back-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--neon-white);
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
}
.m3-title-block {
    flex: 1;
    min-width: 0;
}
.m3-title {
    font-size: clamp(0.78rem, 2.6vw, 0.92rem);
    line-height: 1.05;
    font-weight: 900;
    color: var(--neon-gold);
    text-shadow: 0 0 10px rgba(255,204,0,0.4);
}
.m3-level-display {
    font-size: 0.58rem;
    line-height: 1.05;
    color: var(--neon-white);
    opacity: 0.78;
    font-weight: 700;
}
.m3-subtitle {
    font-size: 0.57rem;
    line-height: 1.05;
    color: var(--neon-white);
    opacity: 0.82;
    margin-top: 1px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m3-mute-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--theme-text);
    font-size: 0.95rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Статистика */
.m3-stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 4px 6px;
    flex-shrink: 0;
}
.m3-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px 3px;
}
.m3-stat-lbl {
    font-size: 0.57rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--neon-white);
    opacity: 0.92;
    letter-spacing: 0.4px;
}
.m3-stat-val {
    font-size: 0.84rem;
    font-weight: 900;
    color: var(--theme-headings);
    line-height: 1.15;
}

/* Прогресс */
.m3-progress-track {
    height: 3px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
    margin: 0 10px;
    border-radius: 2px;
    overflow: hidden;
}
.m3-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-gold), var(--neon-green));
    border-radius: 2px;
    transition: width 0.4s ease;
    box-shadow: 0 0 6px var(--neon-gold);
}

.m3-time-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 4px 6px 1px;
    flex-shrink: 0;
}
.m3-time-pill {
    min-width: 0;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.035);
    border-radius: 8px;
    padding: 4px 3px;
    text-align: center;
}
.m3-time-pill span {
    display: block;
    font-size: 0.57rem;
    line-height: 1.1;
    color: var(--neon-white);
    opacity: 0.92;
    font-weight: 800;
    text-transform: uppercase;
}
.m3-time-pill strong {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    line-height: 1.1;
    color: var(--theme-headings);
    white-space: nowrap;
}
.m3-time-pill-danger strong {
    color: var(--neon-pink);
    text-shadow: 0 0 8px rgba(255,45,120,0.55);
}

/* Контейнер поля */
.m3-board-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 330px;
    width: 100%;
    box-sizing: border-box;
}

/* Игровое поле */
/* Убираем глобальную шапку и обнуляем внешние отступы для полного экрана игры */
#match3-section .app-header,
#match3-section .app-header {
    display: none !important;
}
#match3-section,
#match3-section,
#match3-section,
#match3-section {
    padding-bottom: 0 !important;
}
#match3-section #client-nav,
body:has(#match3-section) #client-nav,
body:has(#match3-section) .pet-widget {
    display: none !important;
}
#match3-section #app-main-scroller,
#match3-section #app-main-scroller {
    padding: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
}
#match3-section {
    display: none;
    max-width: 580px;
    margin: 0 auto !important;
    width: 100%;
    min-height: 520px;
    flex-direction: column !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: rgba(10, 6, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 30px rgba(168, 85, 247, 0.18);
    overflow: visible;
    user-select: none !important;
    -webkit-user-select: none !important;
}

#match3-section.active {
    display: flex !important;
}

/* Игровое поле */
.m3-board {
    display: grid;
    gap: clamp(2px, 0.5vmin, 5px);
    width: min(100%, 92vw, calc(100vh - 290px), 480px) !important;
    height: auto !important;
    min-width: min(100%, 250px) !important;
    min-height: 0 !important;
    max-width: 100%;
    max-height: 480px;
    aspect-ratio: 1 / 1;
    align-self: center;
    justify-self: center;
    background: var(--bg, #0d081f);
    border: 1.5px solid var(--border, rgba(255,255,255,0.14));
    border-radius: 14px;
    padding: clamp(3px, 0.5vmin, 6px);
    box-sizing: border-box;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.7),
        0 0 20px rgba(217,70,239,0.12),
        0 0 40px rgba(255,204,0,0.06);
    position: relative;
    overflow: visible;
    touch-action: none;
}
.m3-shake {
    animation: none;
}


@container m3-viewport (max-height: 680px) {
    .m3-header { padding-top: 4px; padding-bottom: 3px; }
    .m3-subtitle { display: none; }
    .m3-stats-bar { padding-top: 3px; padding-bottom: 3px; }
    .m3-time-strip { padding-top: 2px; }
    .m3-footer { padding-top: 4px; padding-bottom: 5px; }
    .m3-stat { padding: 3px 2px; }
    .m3-stat-val { font-size: 0.78rem; }
    .m3-time-pill { padding: 3px 2px; }
    .m3-time-pill strong { font-size: 0.64rem; }
}

/* Ячейка */
.m3-cell {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.035);
    border-radius: 8px;
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
    overflow: visible;
}
.m3-cell:active { background: rgba(255,255,255,0.06); }

/* Кристалл */
.m3-gem {
    width: var(--gem-size, 78%);
    height: var(--gem-size, 78%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.85rem, 3.5vw, 1.3rem);
    cursor: pointer;
    user-select: none;
    touch-action: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Стили для кристаллов с картинками */
.m3-gem.has-image {
    width: var(--gem-image-size, 95%) !important;
    height: var(--gem-image-size, 95%) !important;
    background: rgba(15, 12, 28, 0.45) !important;
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.m3-gem.has-image img {
    width: 95% !important;
    height: 95% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Неоновые цвета гемов */
.m3-gem[data-type="0"] { background: radial-gradient(circle at 35% 35%, #ff6ea0, #ff2d78); box-shadow: 0 0 10px rgba(255,45,120,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="1"] { background: radial-gradient(circle at 35% 35%, #ffda5a, #ff9500); box-shadow: 0 0 10px rgba(255,149,0,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="2"] { background: radial-gradient(circle at 35% 35%, #fff176, #ffcc00); box-shadow: 0 0 10px rgba(255,204,0,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="3"] { background: radial-gradient(circle at 35% 35%, #6effa0, #00c651); box-shadow: 0 0 10px rgba(0,198,81,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="4"] { background: radial-gradient(circle at 35% 35%, #f5a0ff, #d946ef); box-shadow: 0 0 10px rgba(217,70,239,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="5"] { background: radial-gradient(circle at 35% 35%, #ffe0aa, #ff6b00); box-shadow: 0 0 10px rgba(255,107,0,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="6"] { background: radial-gradient(circle at 35% 35%, #ffd6f5, #ff69c9); box-shadow: 0 0 10px rgba(255,105,201,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="7"] { background: radial-gradient(circle at 35% 35%, #a8ffee, #00d4aa); box-shadow: 0 0 10px rgba(0,212,170,0.6), inset 0 1px 3px rgba(255,255,255,0.3); }
.m3-gem[data-type="8"] { background: radial-gradient(circle at 35% 35%, #c5e0ff, #7ab8ff); box-shadow: 0 0 10px rgba(122,184,255,0.5), inset 0 1px 3px rgba(255,255,255,0.3); }

/* Выделен */
.m3-gem.m3-selected {
    animation: m3Pulse 0.6s infinite alternate ease-in-out;
    z-index: 10;
    transform: scale(1.2);
}
.m3-gem.m3-hint-from,
.m3-gem.m3-hint-to {
    animation: m3HintPulse 0.7s infinite alternate ease-in-out;
    z-index: 30;
}
.m3-gem.m3-hint-from {
    outline: 2px solid var(--neon-cyan);
    box-shadow: 0 0 16px var(--neon-cyan), 0 0 28px rgba(0,234,255,0.35) !important;
}
.m3-gem.m3-hint-to {
    outline: 2px solid var(--neon-gold);
    box-shadow: 0 0 16px var(--neon-gold), 0 0 28px rgba(255,204,0,0.35) !important;
}
@keyframes m3HintPulse {
    0% { transform: scale(1.08); filter: brightness(1.25); }
    100% { transform: scale(1.26); filter: brightness(1.85) saturate(1.8); }
}
@keyframes m3Pulse {
    0%  { transform: scale(1.12); filter: brightness(1.3) saturate(1.5); }
    100%{ transform: scale(1.28); filter: brightness(1.8) saturate(2.0); }
}

/* Взрыв — убираем */
.m3-gem.m3-blast {
    animation: m3Blast 0.22s ease-out forwards;
}
@keyframes m3Blast {
    0%  { opacity: 1; filter: brightness(1); }
    40% { opacity: 1; filter: brightness(1.28) saturate(1.12); }
    100%{ opacity: 0; filter: brightness(1.4); }
}

/* Шоквейв — кольцо взрыва */
.m3-shockwave {
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 3px solid currentColor;
    opacity: 1;
    pointer-events: none;
    animation: m3ShockwavePop 0.32s ease-out forwards;
    z-index: 20;
    top: 10%;
    left: 10%;
}
@keyframes m3ShockwavePop {
    0%  { opacity: 0.52; }
    100%{ opacity: 0; }
}

/* Частица взрыва */
.m3-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9000;
    animation: m3Particlefly 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes m3Particlefly {
    0%  { transform: translate(0,0); opacity: 1; }
    100%{ transform: translate(var(--px),var(--py)); opacity: 0; }
}

/* Вспышка при матче */
.m3-flash {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
    animation: m3CellFlash 0.25s ease-out forwards;
}
@keyframes m3CellFlash {
    0%  { opacity: 0.7; }
    100%{ opacity: 0; }
}

/* Оверлей итогов */
.m3-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6,4,16,0.96);
    backdrop-filter: blur(16px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    border-radius: 14px;
    animation: fadeIn 0.3s ease;
}
.m3-modal-glow {
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: m3GlowPulse 2s infinite ease-in-out;
}
@keyframes m3GlowPulse {
    0%,100% { transform: scale(1); opacity: 0.25; }
    50% { transform: scale(1.2); opacity: 0.45; }
}
.m3-modal-emoji {
    font-size: 3.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px currentColor);
    animation: emptyFloat 1.4s infinite alternate ease-in-out;
    position: relative;
}
.m3-modal-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 0 16px rgba(255,204,0,0.5);
    position: relative;
}
.m3-modal-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.7);
    max-width: 240px;
    margin-bottom: 10px;
    position: relative;
}
.m3-modal-award {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--neon-gold);
    text-shadow: 0 0 12px var(--neon-gold);
    margin-bottom: 16px;
    position: relative;
}
.m3-modal-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 220px;
    position: relative;
}
.m3-btn-primary {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    color: #fff;
    font-weight: 900;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,45,120,0.35);
    transition: transform 0.15s;
}
.m3-btn-primary:active { transform: scale(0.97); }
.m3-btn-secondary {
    padding: 9px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}
.m3-reset-zone {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.m3-btn-danger-outline {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,45,120,0.38);
    background: rgba(255,45,120,0.08);
    color: #ffd7e5;
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
}
.m3-reset-confirm {
    margin-top: 9px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,204,0,0.22);
    background: rgba(255,204,0,0.08);
    text-align: center;
}
.m3-reset-confirm-title {
    color: var(--neon-gold);
    font-size: 0.82rem;
    font-weight: 900;
}
.m3-reset-confirm-text {
    margin-top: 4px;
    color: rgba(255,255,255,0.72);
    font-size: 0.72rem;
    line-height: 1.35;
}
.m3-reset-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 9px;
}
.m3-btn-danger {
    padding: 9px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,45,120,0.55);
    background: linear-gradient(135deg, rgba(255,45,120,0.92), rgba(139,92,246,0.82));
    color: #fff;
    font-size: 0.76rem;
    font-weight: 900;
    cursor: pointer;
}

/* Футер */
.m3-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px calc(8px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
    background: rgba(10,6,24,0.85);
    border-top: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 50;
}
.m3-btn-restart {
    flex: 1;
    padding: 9px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
}
.m3-btn-hint {
    flex: 0 0 auto;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(0,234,255,0.22);
    background: linear-gradient(135deg, rgba(0,234,255,0.14), rgba(217,70,239,0.12));
    color: var(--neon-white);
    font-weight: 900;
    font-size: 0.75rem;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0,234,255,0.08);
}
.m3-combo-display {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 80;
    font-size: 0.85rem;
    font-weight: 900;
    min-width: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(7, 7, 29, 0.82);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    color: var(--neon-gold);
    text-shadow: 0 0 8px var(--neon-gold);
}
.m3-combo-display:empty { display: none; }

    .m3-leaderboard-open {
        min-width: 38px;
    }

    .m3-leaderboard-modal {
        position: absolute;
        inset: 0;
        z-index: 260;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(6, 4, 16, 0.84);
        backdrop-filter: blur(14px);
    }

    .m3-leaderboard-panel {
        width: min(100%, 360px);
        max-height: min(88%, 560px);
        overflow: auto;
        border: 1px solid var(--theme-border);
        border-radius: 12px;
        background: var(--theme-bg-secondary);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
        color: var(--theme-text);
        padding: 14px;
    }

    .m3-leaderboard-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
    }

    .m3-leaderboard-kicker {
        color: var(--neon-gold, #ffcc00);
        font-size: 0.65rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .m3-leaderboard-head h3 {
        margin: 2px 0 0;
        color: var(--theme-headings);
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .m3-leaderboard-close {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        border: 1px solid var(--theme-border);
        background: var(--theme-card-bg);
        color: var(--theme-headings);
        font-size: 1.2rem;
        font-weight: 900;
        cursor: pointer;
    }

    .m3-leaderboard-note {
        margin-bottom: 10px;
        color: var(--theme-text);
        opacity: 0.78;
        font-size: 0.72rem;
        line-height: 1.35;
        font-weight: 700;
    }

    .m3-leaderboard-table {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .m3-leaderboard-row {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 74px;
        gap: 8px;
        align-items: center;
        min-height: 38px;
        padding: 8px 10px;
        border: 1px solid var(--theme-border);
        border-radius: 10px;
        background: var(--theme-card-bg);
    }

    .m3-leaderboard-row-head {
        min-height: 28px;
        padding-top: 5px;
        padding-bottom: 5px;
        color: var(--theme-text);
        opacity: 0.7;
        font-size: 0.64rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .m3-leaderboard-row.is-me {
        border-color: var(--neon-gold, #ffcc00);
        box-shadow: 0 0 14px rgba(255, 204, 0, 0.16);
    }

    .m3-you-badge {
        display: inline-flex;
        align-items: center;
        margin-left: 6px;
        padding: 2px 6px;
        border-radius: 999px;
        background: rgba(255, 204, 0, 0.14);
        color: var(--neon-gold, #ffcc00);
        font-size: 0.58rem;
        font-weight: 900;
        text-transform: uppercase;
        vertical-align: middle;
    }

    .m3-leaderboard-me-outside {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-top: 8px;
        padding: 10px;
        border-radius: 10px;
        border: 1px solid rgba(255, 204, 0, 0.24);
        background: rgba(255, 204, 0, 0.08);
        color: var(--theme-headings);
        font-size: 0.78rem;
        font-weight: 800;
    }

    .m3-leaderboard-me-outside b,
    .m3-leaderboard-me-outside strong {
        color: var(--neon-gold, #ffcc00);
    }

    .m3-leaderboard-rank,
    .m3-leaderboard-level {
        color: var(--theme-headings);
        font-weight: 900;
        text-align: center;
    }

    .m3-leaderboard-name {
        min-width: 0;
        color: var(--theme-headings);
        font-weight: 900;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .m3-leaderboard-name-line,
    .m3-admin-username {
        display: block;
    }

    .m3-admin-username {
        margin-top: 3px;
        color: var(--neon-cyan, #62eaff);
        font-size: 0.66rem;
        font-weight: 800;
        text-transform: none;
    }

    .m3-leaderboard-empty {
        padding: 18px 12px;
        border: 1px dashed var(--theme-border);
        border-radius: 10px;
        color: var(--theme-text);
        text-align: center;
        font-size: 0.82rem;
        line-height: 1.4;
        font-weight: 800;
    }

#match3-section .m3-comfort-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; min-height:30px; padding:4px 8px; background:rgba(6,12,28,.76); border-bottom:1px solid rgba(143,198,255,.22); color:rgba(240,248,255,.88); font-size:.68rem; font-weight:700; text-align:center; box-sizing:border-box; max-width:100%; }
#match3-section .m3-soft-light-btn { min-height:24px; padding:4px 10px; border:1px solid rgba(116,217,255,.62); border-radius:999px; background:rgba(15,58,91,.88); color:#fff; font:inherit; font-weight:900; cursor:pointer; }
#match3-section.m3-soft-light .m3-soft-light-btn { background:rgba(53,109,104,.92); border-color:rgba(183,255,226,.8); }
#match3-section.m3-soft-light .m3-gem { filter:none; box-shadow:0 0 4px rgba(145,195,235,.22)!important; }
/* Preserve the hue of the art. The comfort mode reduces glare mostly through
   glow and effect intensity, not by turning the crystals grey. */
#match3-section.m3-soft-light .m3-gem.has-image img { filter:brightness(.84) saturate(1.30) contrast(1.04); }
#match3-section.m3-soft-light .m3-gem:not(.has-image) { filter:brightness(.84) saturate(1.26) contrast(1.04); }
#match3-section.m3-soft-light .m3-flash, #match3-section.m3-soft-light .m3-shockwave, #match3-section.m3-soft-light .m3-particle { opacity:.66!important; }
#match3-section.m3-soft-light .m3-score, #match3-section.m3-soft-light .m3-modal-title { text-shadow:none!important; }
@media (max-width:380px) { #match3-section .m3-comfort-bar { gap:5px; font-size:.62rem; } #match3-section .m3-soft-light-btn { padding:4px 8px; } }

    .game-guest-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 28px;
        padding: 4px 12px;
        border-block: 1px solid color-mix(in srgb, var(--accent, #8b7dff) 30%, transparent);
        background: color-mix(in srgb, var(--card, #17142b) 88%, transparent);
        color: var(--text-secondary, #c9c4df);
        font-size: 0.72rem;
        font-weight: 700;
        text-align: center;
    }

    .game-guest-cta[hidden] {
        display: none !important;
    }

    .game-guest-cta a {
        color: var(--accent, #a99cff);
        font-weight: 900;
        text-decoration: underline;
        text-underline-offset: 2px;
    }




/* Desktop centering overrides */
#match3-section { display: none; width: 100%; max-width: 600px; margin: 0 auto; background: rgba(10,6,24,0.7); border-radius: 16px; overflow: hidden; }
#match3-section.active { display: flex !important; flex-direction: column; min-height: 80vh; }
#match3-section:not(.active) { display: none !important; }
.m3-board-container { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 10px; }
