:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 20%, var(--accent-glow) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, var(--accent-glow) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h1.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 12px;
}

.title-year {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e5e7eb;
}

.title-main {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
    text-align: center;
}

.input-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

input[type="number"], select {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23e5e7eb' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
}

select::-ms-expand {
    display: none;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.toggle-group {
    display: flex;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 32px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.result-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.result-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-main);
}

.result-currency {
    font-size: 20px;
    color: var(--text-muted);
    margin-left: 4px;
}

.ad-placeholder {
    margin-top: 40px;
    height: 90px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.install-app-card {
    margin-top: 32px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-app-text h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.install-app-text p {
    font-size: 13px;
    color: var(--text-muted);
}

.install-app-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.install-app-button {
    margin-left: auto;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.install-app-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 10px 24px rgba(129, 140, 248, 0.4);
}

.install-app-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.install-app-button.hidden,
.install-app-card.hidden {
    display: none;
}

.top-ad {
    width: 100%;
    max-width: 728px;
    margin: 0 auto 16px;
}

.seo-text {
    max-width: 700px;
    margin: 32px auto 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.seo-text h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.seo-text p + p {
    margin-top: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .card {
        padding: 24px;
        border-radius: 20px;
    }
    .title-year { font-size: 32px; }
    .title-main { font-size: 22px; }
    .result-value { font-size: 36px; }

    .install-app-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .install-app-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
