    /* ===== Quantum Click - Optimized CSS ===== */

/* CSS Variables */
:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --primary: #818cf8;
    --secondary: #38bdf8;
    --text: #f8fafc;
}

/* ===== Reset & Base Styles ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: manipulation;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
span {
    color: rgb(255, 255, 255)
}
/* ===== Glass Panel ===== */
.glass-panel, .glass-panel2 {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    position: relative;
    max-height: 100vh;
    overflow: hidden;
}

.glass-panel {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loaded .glass-panel {
    opacity: 1;
}

/* ===== Header & Title ===== */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-teh {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: none;
}

/* ===== Score ===== */
.score {
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

/* ===== Progress Bars ===== */
.progress-container {
    position: relative;
    margin: 2rem 0;
}

.progress, .progress2 {
    height: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
}

.progress-fill, .progress-fill2 {
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.progress-fill2 {
    background: linear-gradient(90deg, #ff8c00, #ffcc00);
}

.progress-fill::after, .progress-fill2::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.progress-fill::after {
    background: var(--primary);
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.4);
}

.progress-fill2::after {
    background: #ff8c00;
    box-shadow: 0 0 16px rgba(255, 140, 0, 0.4);
}

.progress2-container {
    position: relative;
    margin-left: 40px;
}

.plus-btn {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 0.8rem;
    width: 30px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plus-btn-dis {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(183, 183, 183, 0.938);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 0.8rem;
    width: 30px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Level Display ===== */
.level-display {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    margin: -1.5rem auto 1rem;
    width: 30%;
    min-width: 200px;
    transition: all 0.3s ease;
    align-items: center; /* Выравнивание по центру */
    text-align: center; /* Текст по центру */
}

.level-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    justify-content: center;
}

.level-icon {
    font-size: 1.6rem;
    color: #4a5271;
}

.level-coin {
    margin: 0;
    font-size: 1.3rem;
    color: #4a5271;
    min-width: 50px;
    text-align: right;
}

.level-item span:last-child {
    min-width: 40px;
    text-align: right;
    transition: min-width 0.3s ease;
}

.level-text1, .level-text2 {
    margin: 10px;
    font-size: 1.3rem;
    color: #76ef51;
    min-width: 50px;
    text-align: right;
    display: flex;
    align-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.level-text1 {
    font-size: 1.8rem;
}

.level-text2 {
    font-size: 1.8rem;
}

/* Level Classes */
.level-bronze {
    background: linear-gradient(45deg, #cd7f32, #a65e00);
    border-radius: 5px;
    text-align: center;
}

.level-silver {
    background: linear-gradient(45deg, #c0c0c0, #808080);
    border-radius: 5px;
    text-align: center;
}

.level-gold {
    background: linear-gradient(45deg, #ffd700, #daa520);
    border-radius: 5px;
    text-align: center;
}

.level-diamond {
    background: linear-gradient(45deg, #b9f2ff, #35b6f2);
    border-radius: 5px;
    animation: diamondGlow 2s infinite;
    text-align: center;
}

.level-emerald {
    background: linear-gradient(45deg, #50c878, #76ef51);
    animation: emeraldPulse 2s infinite, emegaldglow 2s infinite;
    border-radius: 5px;
    text-align: center;
}

@keyframes diamondGlow {
    0% { box-shadow: 0 0 10px #35b6f2; }
    50% { box-shadow: 0 0 20px #35b6f2; }
    100% { box-shadow: 0 0 10px #35b6f2; }
}

@keyframes emegaldglow {
    0% { box-shadow: 0 0 10px #3ef235; }
    50% { box-shadow: 0 0 20px #3ef235; }
    100% { box-shadow: 0 0 10px #3ef235; }
}

@keyframes emeraldPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== Game Level Badge ===== */
.game-level-badge, #gameLevelBadge, #gameLevelBadgeshop {
    color: white;
    padding: 0.8rem 2.2rem;
    border-radius: 30px;
    font-weight: 900;
    font-size: 1.2rem;
    text-transform: uppercase;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -4px 8px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 3px solid transparent;
    background-clip: padding-box;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    backdrop-filter: blur(10px);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-5px) scale(1.02); }
}

.game-level-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.8s ease;
    transform: skewX(-15deg);
}

.game-level-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 32px;
    padding: 2px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.8), transparent, rgba(255,255,255,0.4));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.game-level-badge:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -6px 12px rgba(0,0,0,0.3);
}

.game-level-badge:hover::before {
    left: 150%;
}

.game-level-badge:hover::after {
    opacity: 1;
    animation: borderRotate 2s linear infinite;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Bronze Level */
.game-level-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #E89C4D 15%, #CD7F32 30%, #A97142 60%, #8B4513 100%);
    border: 3px solid #FFB366;
    box-shadow: 0 8px 32px rgba(205, 127, 50, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -4px 8px rgba(139, 69, 19, 0.4), 0 0 20px rgba(255, 163, 102, 0.6);
    animation: bronzeGlow 2s ease-in-out infinite alternate;
}

@keyframes bronzeGlow {
    from {
        box-shadow: 0 8px 32px rgba(205, 127, 50, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -4px 8px rgba(139, 69, 19, 0.4), 0 0 15px rgba(255, 163, 102, 0.4);
    }
    to {
        box-shadow: 0 8px 32px rgba(205, 127, 50, 0.6), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -4px 8px rgba(139, 69, 19, 0.4), 0 0 25px rgba(255, 163, 102, 0.8);
    }
}

/* Silver Level */
.game-level-badge.silver {
    background: linear-gradient(135deg, #E8E8E8 0%, #FFFFFF 15%, #C0C0C0 30%, #F0F0F0 60%, #909090 100%);
    border: 3px solid #FFFFFF;
    color: #2c2c2c;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
    box-shadow: 0 8px 32px rgba(192, 192, 192, 0.5), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -4px 8px rgba(144, 144, 144, 0.3), 0 0 25px rgba(255, 255, 255, 0.7);
    animation: silverShine 3s ease-in-out infinite;
}

@keyframes silverShine {
    0%, 100% { filter: brightness(1) contrast(1); }
    50% { filter: brightness(1.1) contrast(1.2); }
}

/* Gold Level */
.game-level-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 15%, #FFEC8B 30%, #FFD700 60%, #FFAA00 100%);
    border: 3px solid #FFEC8B;
    color: #8B6508;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -4px 8px rgba(255, 170, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.8);
    animation: goldPulse 2s ease-in-out infinite;
}

@keyframes goldPulse {
    0%, 100% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 8px 32px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -4px 8px rgba(255, 170, 0, 0.4), 0 0 25px rgba(255, 215, 0, 0.7);
    }
    50% {
        transform: translateY(-5px) scale(1.03);
        box-shadow: 0 12px 40px rgba(255, 215, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -4px 8px rgba(255, 170, 0, 0.5), 0 0 40px rgba(255, 215, 0, 1);
    }
}

/* Diamond Level */
.game-level-badge.diamond {
    background: linear-gradient(135deg, #B9F2FF 0%, #E6F7FF 15%, #FFFFFF 25%, #B9F2FF 40%, #87CEEB 70%, #00BFFF 100%);
    border: 3px solid #E6F7FF;
    color: #0066cc;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
    box-shadow: 0 8px 32px rgba(0, 191, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -4px 8px rgba(0, 150, 255, 0.4), 0 0 35px rgba(185, 242, 255, 0.9);
    animation: diamondSparkle 4s linear infinite, diamondColorShift 6s ease-in-out infinite;
    background-size: 200% 200%;
    position: relative;
}

@keyframes diamondSparkle {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes diamondColorShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

/* Emerald Level */
.game-level-badge.emerald {
    background: linear-gradient(135deg, #50C878 0%, #98FB98 15%, #7CFC00 25%, #50C878 40%, #32CD32 70%, #2E8B57 100%);
    border: 3px solid #98FB98;
    color: #1a5a34;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
    box-shadow: 0 8px 32px rgba(80, 200, 120, 0.5), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -4px 8px rgba(46, 139, 87, 0.4), 0 0 35px rgba(80, 200, 120, 0.8);
    animation: emeraldPulse 3s ease-in-out infinite, emeraldGlow 4s ease-in-out infinite alternate;
    position: relative;
}

@keyframes emeraldGlow {
    from {
        box-shadow: 0 8px 32px rgba(80, 200, 120, 0.5), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -4px 8px rgba(46, 139, 87, 0.4), 0 0 30px rgba(80, 200, 120, 0.7);
    }
    to {
        box-shadow: 0 8px 32px rgba(80, 200, 120, 0.7), inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -4px 8px rgba(46, 139, 87, 0.6), 0 0 45px rgba(80, 200, 120, 1);
    }
}

/* Diamond & Emerald particles */
.game-level-badge.diamond::before,
.game-level-badge.emerald::before {
    content: '✦';
    position: absolute;
    font-size: 8px;
    color: rgba(255,255,255,0.8);
    animation: particleFloat 4s ease-in-out infinite;
}

.game-level-badge.diamond::before {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.game-level-badge.emerald::before {
    top: 70%;
    right: 15%;
    animation-delay: 2s;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0; }
    50% { transform: translateY(-10px) rotate(180deg); opacity: 1; }
}

/* ===== Currency Display ===== */
.currency-display {
    position: fixed;
    top: 3.5px;
    right: 10px;
    z-index: 100;
    background: rgba(30, 41, 59, 0.8);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 34px;
}

.currency-display2 {
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0);
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 24px;
}

.currency-item, .currency-item2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    position: relative;
}

.currency-item span:last-child {
    min-width: 40px;
    text-align: right;
    transition: min-width 0.3s ease;
}

.currency-display:hover .currency-item {
    transform: translateX(0);
}

.currency-icon {
    font-variation-settings: 'FILL' 1;
    color: #38bdf8;
    font-size: 1.4rem;
    flex-shrink: 0;
}

@keyframes scalePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.value-updated {
    animation: scalePulse 0.3s ease;
}

/* ===== Buttons ===== */
.control-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
    transition: transform 0.3s ease;
}

.control-btn:hover {
    transform: rotate(90deg) scale(1.1);
}

.menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.menu-btn:hover {
    transform: scale(1.1);
}

.menu-btn .material-symbols-rounded {
    transition: transform 0.3s ease;
}

/* ===== Coin Button ===== */
.coin {
    width: min(65vmin, 280px);
    height: min(65vmin, 280px);
    min-width: 160px;
    min-height: 160px;
    max-width: 90vw;
    max-height: 90vh;
    margin: 1.5rem auto;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s, all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    outline: none;
    user-select: none;
}

.coin::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(214, 214, 214, 0) 0%, rgba(255,255,255,0) 70%);
}

.coin:active {
    transform: scale(0.92);
}

.coin.visual-feedback {
    animation: visualPulse 0.1s ease;
}

@keyframes visualPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.coin-icon {
    font-size: 4rem;
    color: white;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.coin-image-container {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
}

.coin-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.coin:active .coin-image {
    transform: scale(0.95);
}
/* ===== Conversion Modal Styles ===== */
.slider-container {
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.slider {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.selected-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.modal-btn {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
/* ===== Click Effects ===== */
.click-effect {
    position: absolute;
    color: var(--primary);
    font-weight: 700;
    pointer-events: none;
    animation: fadeUp 1s ease-out forwards;
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(255,255,255,0.2);
}

@keyframes fadeUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-80px); opacity: 0; }
}

.click-plus {
    position: absolute;
    color: var(--primary);
    font-weight: 700;
    pointer-events: none;
    animation: floatPlus 1s ease-out forwards;
    font-size: 35px;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(255,255,255,0.2);
    left: 50%;
    transform: translateX(-50%);
}

@keyframes floatPlus {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, -80px); opacity: 0; }
}

.particles {
    position: fixed;
    pointer-events: none;
    opacity: 0;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ===== Goal Animation ===== */
@keyframes goal-reached {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.goal-reached-animation {
    animation: goal-reached 0.5s ease-in-out;
}

.goal-text {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ===== Modal Base Styles ===== */
.modal-overlay, .control-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    backdrop-filter: none;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow: auto;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalEnter 0.3s ease;
}

.control-modal-content {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    width: 95%;
    max-width: 700px;
    min-width: 400px;
    animation: modalEnter 0.3s ease;
    box-sizing: border-box;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalEnter {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* ===== Shop Styles ===== */
#crystalSlider { display: none; }
#modal[style*="display: flex"] #crystalSlider { display: block; }
#crystalSlider { display: none; }
#modal[style*="flex"] #crystalSlider { display: block; }
#crystalSlider::before,
#crystalSlider::after {
    display: none !important;
    content: none !important;
}

#modal .modal-content {
    filter: none !important;
    backdrop-filter: none !important;
}
#modal .modal-content {
    filter: none !important;
    backdrop-filter: none !important;
}

/* Фикс: модальное окно НЕ размывается */
body.blurred #modal {
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: relative;
    z-index: 10000;
}

/* Только фон (glass-panel) размывается */
body.blurred #glass-panel { display: none; } body.blurred .dummy {
    filter: blur(5px);
    -webkit-filter: blur(5px);
}
/* Затемнение glass-panel при открытом конверторе */
#glass-panel.dimmed {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

/* Убираем фон у modal-overlay */
#modal {
    background: transparent !important;
    backdrop-filter: none !important;
}
#modal, #modal * {
    filter: none !important;
    backdrop-filter: none !important;
}
