:root {
    --primary: #6c5ce7;
    --primary-dark: #5649e0;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #e9ecef;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --radius: 16px;
}

[data-theme="dark"] {
    --bg: #1a1a2e;
    --card-bg: #16213e;
    --text: #eaeaea;
    --text-light: #9b9b9b;
    --border: #0f3460;
    --shadow: 0 4px 15px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

header { margin-bottom: 20px; }

header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

.back-btn {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.quick-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.quick-btn {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.quick-btn:active { transform: scale(0.96); }

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--text);
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.category-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-card:active { transform: scale(0.96); }

.cat-emoji { font-size: 1.8rem; }
.cat-title { font-size: 0.85rem; font-weight: 500; }

.random-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.random-btn:active { transform: scale(0.97); }

.wishes-list {
    margin-bottom: 24px;
}

.wish-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.15s, transform 0.15s;
    box-shadow: var(--shadow);
}

.wish-item:active {
    transform: scale(0.98);
    border-color: var(--primary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.card-thumb {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow);
    background: var(--card-bg);
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.card-thumb:active img { transform: scale(1.05); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 20px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    z-index: 1;
    background: rgba(0,0,0,0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalImage {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
}

.modal-wish {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.copy-btn, .share-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.copy-btn {
    background: var(--bg);
    color: var(--text);
}

.share-btn {
    background: var(--primary);
    color: white;
}

.modal-promo {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 8px;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.promo { font-weight: 500; color: var(--primary); }

.profile-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 16px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.progress-bar {
    background: var(--border);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
    margin-top: 12px;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.progress-text {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 6px;
}

.referral-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.referral-box h3 { margin-bottom: 8px; }
.referral-box p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 12px; }

.referral-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    background: var(--bg);
    color: var(--text);
}

.referral-box button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* === Скоро праздники === */
.holiday-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.holiday-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff5e6, #fff);
    border: 2px solid #ffd966;
    border-radius: 14px;
    text-decoration: none;
    color: #333;
    transition: transform 0.15s, box-shadow 0.15s;
}
.holiday-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 200, 50, 0.3);
}
.holiday-emoji {
    font-size: 28px;
    flex-shrink: 0;
}
.holiday-title {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
}
.holiday-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.holiday-date {
    font-size: 13px;
    color: #999;
}
.holiday-days {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 8px;
}
.holiday-days.hot {
    color: #fff;
    background: #ff4444;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
