* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main, #0f172a);
    color: var(--text-main, #f8fafc);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.language-switcher {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 100;
    display: flex;
    gap: 4px;
}

.language-switcher button {
    border: 1px solid var(--border-color, #334155);
    background: var(--bg-card, #1e293b);
    color: var(--text-muted, #94a3b8);
    padding: 6px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.language-switcher button.active {
    background: var(--accent, #6366f1);
    color: #fff;
}

.qr-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 70px 20px 30px;
}

.qr-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
    text-align: center;
    backdrop-filter: blur(12px);
}

.qr-card h1 {
    font-size: 1.5rem;
    margin: 0 0 8px;
}

.qr-card p {
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.input-group input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    background: var(--bg-main, #0f172a);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-main, #f8fafc);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent, #6366f1);
}

.input-group button,
.btn-download {
    background: var(--accent, #6366f1);
    color: #fff;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

.input-group button:hover,
.btn-download:hover {
    opacity: .9;
}

.qr-result-wrapper {
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border: 1px dashed var(--border-color, #334155);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

#placeholder-text {
    color: #64748b;
    font-size: 14px;
    position: absolute;
}

#qrcode canvas,
#qrcode img {
    display: block;
    margin: 0 auto;
}

.btn-download {
    width: 100%;
    padding: 12px;
}

#ad-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.ad-box {
    background: var(--bg-card, #1e293b);
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    border: 1px solid var(--border-color, #334155);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,.5);
}

.ad-box h3 {
    color: var(--text-main, #fff);
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.ad-box p {
    color: var(--text-muted, #94a3b8);
    font-size: 13px;
    margin-bottom: 16px;
}

#yandex_rtb_container {
    background: rgba(0,0,0,.2);
    border-radius: 8px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
}

#close-ad-btn {
    width: 100%;
    padding: 12px;
    background: #64748b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

@media (max-width: 600px) {

    .qr-container {
        padding: 75px 12px 20px;
    }

    .qr-card {
        padding: 22px 15px;
        border-radius: 12px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group button {
        padding: 12px;
    }

    .language-switcher {
        top: 10px;
        right: 10px;
    }

    .ad-box {
        padding: 20px 15px;
    }
}