* { margin:0; padding:0; box-sizing:border-box; }
body { background: #0d1117; color: #c9d1d9; font-family: system-ui; transition: background 0.3s; }
body.incognito { background: #535454; }

.home { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; position: relative; }
.top { position: absolute; top: 20px; left: 20px; right: 20px; display: flex; gap: 10px; justify-content: space-between; }
.incognito-btn {
    background: #1c2128; border: 1px solid #30363d; color: #c9d1d9;
    padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 14px;
    transition: all 0.2s;
}
.incognito-btn:hover { background: #2b3139; }
body.incognito .incognito-btn { background: #4facfe; color: white; border-color: #4facfe; }

.langs { display: flex; gap: 8px; }
.langs span { padding: 4px 8px; border-radius: 6px; cursor: pointer; background: #1c2128; color: #8b949e; font-size: 13px; }
.langs span.active { background: #4facfe; color: white; }

.logo { width: 130px; margin-bottom: 20px; cursor: pointer; transition: filter 0.3s; }
.logo:hover { filter: drop-shadow(0 0 16px #4facfe); }

.rainbow-text { font-size: 3.5rem; font-weight: 800; letter-spacing: 4px; margin-bottom: 30px; background: linear-gradient(90deg, #ff0000, #ff7700, #ffff00, #00ff00, #00ffff, #0000ff, #8b00ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.search-box { position: relative; display: flex; width: 100%; max-width: 650px; }
.search-box input { flex: 1; padding: 14px 24px; border-radius: 36px; border: none; background: #1c2128; color: white; font-size: 17px; outline: none; }
.search-box button { margin-left: 12px; padding: 14px 28px; border-radius: 36px; border: none; background: #4facfe; color: white; font-weight: 700; cursor: pointer; }

/* Подсказки */
.suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #1c2128;
    border-radius: 16px;
    margin-top: 8px;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.suggestion-item { padding: 12px 24px; cursor: pointer; }
.suggestion-item:hover { background: #2b3139; }

/* История */
.history-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #1c2128;
    border-radius: 16px;
    margin-top: 8px;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px; cursor: pointer; }
.history-item:hover { background: #2b3139; }
.history-query { flex: 1; }
.history-delete { color: #ff4b5c; cursor: pointer; margin-left: 12px; }

/* Строка поиска на странице результатов */
.search-header { display: flex; align-items: center; gap: 16px; padding: 20px; }
.logo-small { width: 48px; cursor: pointer; transition: filter 0.3s; }
.logo-small:hover { filter: drop-shadow(0 0 10px #4facfe); }

/* Быстрый ответ */
.instant-answer { background: #1c2128; border-radius: 12px; padding: 16px 20px; margin: 0 20px 16px; border-left: 4px solid #4facfe; }
.instant-answer a { color: #4facfe; }

/* Результаты */
.results-list { padding: 20px; }
.result-item { background: #161b22; border-radius: 14px; padding: 18px; margin-bottom: 12px; border: 1px solid #2b3139; }
.result-item:hover { border-color: #4facfe; }
.result-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.favicon { width: 16px; height: 16px; }
.result-title { color: #58a6ff; text-decoration: none; font-size: 18px; font-weight: 600; }
.result-url { font-size: 13px; color: #3fb950; margin-bottom: 2px; word-break: break-all; }
.result-snippet { margin: 6px 0; font-size: 14px; opacity: 0.85; }
.result-actions { margin-top: 8px; display: flex; gap: 8px; }
.translate-btn { background: #1c2128; border: 1px solid #30363d; color: #c9d1d9; padding: 4px 12px; border-radius: 12px; cursor: pointer; font-size: 13px; }
.translate-btn:hover { background: #2b3139; }

/* Змейка */
.snake-game { text-align: center; padding: 20px; }
.snake-game canvas { background: #1c2128; border-radius: 12px; }
.snake-game p { margin-top: 10px; color: #8b949e; }

.no-results { text-align: center; opacity: 0.5; padding: 40px; }
#loader { padding: 30px; text-align: center; color: #8b949e; }

/* Вкладки */
.tabs { display: flex; gap: 4px; padding: 0 20px; margin-bottom: 12px; }
.tab { padding: 8px 18px; border-radius: 20px; cursor: pointer; font-size: 14px; color: #8b949e; background: #1c2128; transition: all 0.2s; }
.tab:hover { background: #2b3139; color: #c9d1d9; }
.tab.active { background: #4facfe; color: white; }

/* Видео */
.videos-list { padding: 0 20px 20px; }
.video-item { background: #161b22; border-radius: 12px; margin-bottom: 10px; border: 1px solid #2b3139; overflow: hidden; }
.video-item:hover { border-color: #4facfe; }
.video-link { display: flex; gap: 12px; text-decoration: none; color: inherit; padding: 12px; }
.video-thumb { width: 160px; height: 90px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.video-thumb.placeholder { background: #1c2128; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #4facfe; }
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 15px; font-weight: 600; color: #c9d1d9; margin-bottom: 4px; line-height: 1.3; }
.video-meta { font-size: 13px; color: #8b949e; }

/* Фото */
.images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 0 20px 20px; }
.image-item { background: #161b22; border-radius: 10px; overflow: hidden; border: 1px solid #2b3139; transition: border 0.2s; }
.image-item:hover { border-color: #4facfe; }
.image-item a { display: block; }
.image-item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.image-title { padding: 8px 10px; font-size: 13px; color: #8b949e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Skeleton screens */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #1c2128 25%, #2b3139 50%, #1c2128 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 8px;
}
.skeleton-block {
    background: #161b22;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid #2b3139;
}
.skeleton-thumb {
    width: 160px;
    height: 90px;
    flex-shrink: 0;
}
.skeleton-img {
    width: 100%;
    height: 150px;
}
/* Карты */
.maps-container { padding: 0 20px 20px; }
.map-canvas { height: 340px; border-radius: 12px; margin-bottom: 12px; border: 1px solid #2b3139; z-index: 1; }
.map-canvas .leaflet-container { border-radius: 12px; background: #0d1117; }
.maps-list { display: flex; flex-direction: column; gap: 6px; }
.map-result-item { background: #161b22; border: 1px solid #2b3139; border-radius: 10px; padding: 12px 16px; cursor: pointer; transition: all 0.2s; }
.map-result-item:hover, .map-result-item.active { border-color: #4facfe; background: #1c2128; }
.map-result-title { font-size: 15px; font-weight: 600; color: #58a6ff; }
.map-result-addr { font-size: 13px; color: #8b949e; margin-top: 2px; }
.map-result-type { font-size: 12px; color: #3fb950; margin-top: 2px; text-transform: capitalize; }

/* Новости */
.news-list { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.news-item { background: #161b22; border: 1px solid #2b3139; border-radius: 12px; overflow: hidden; transition: border 0.2s; }
.news-item:hover { border-color: #4facfe; }
.news-link { display: flex; gap: 12px; text-decoration: none; color: inherit; padding: 12px; }
.news-info { flex: 1; min-width: 0; }
.news-title { font-size: 15px; font-weight: 600; color: #c9d1d9; margin-bottom: 2px; line-height: 1.3; }
.news-meta { font-size: 12px; color: #8b949e; margin-bottom: 4px; }
.news-source { background: #1c2128; color: #4facfe; padding: 2px 8px; border-radius: 10px; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.news-date { color: #8b949e; }
.news-snippet { font-size: 13px; color: #8b949e; line-height: 1.4; }

.fade-in {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Ссылка навигации на главной */
.top-left { display: flex; gap: 10px; align-items: center; }
.nav-link { color: #8b949e; text-decoration: none; font-size: 14px; padding: 6px 14px; border-radius: 20px; background: #1c2128; border: 1px solid #30363d; cursor: pointer; transition: all 0.2s; }
.nav-link:hover { background: #2b3139; color: #c9d1d9; border-color: #4facfe; }

/* Страница переводчика */
.translator-page { max-width: 900px; margin: 0 auto; padding: 20px; min-height: 100vh; display: flex; flex-direction: column; }
.translator-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.translator-header h2 { font-size: 22px; font-weight: 700; color: #c9d1d9; }
.back-link { color: #4facfe; text-decoration: none; font-size: 14px; padding: 6px 14px; border-radius: 20px; background: #1c2128; border: 1px solid #30363d; transition: all 0.2s; }
.back-link:hover { background: #2b3139; border-color: #4facfe; }

.translator-grid { display: flex; gap: 8px; align-items: stretch; flex: 1; }
.translator-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.swap-col { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; }

.lang-row { margin-bottom: 8px; }
.lang-select {
    width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #30363d;
    background: #1c2128; color: #c9d1d9; font-size: 14px; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.lang-select:focus { outline: none; border-color: #4facfe; }
.lang-select option { background: #0d1117; color: #c9d1d9; }

.translator-textarea {
    flex: 1; min-height: 220px; padding: 16px; border-radius: 12px; border: 1px solid #30363d;
    background: #1c2128; color: #c9d1d9; font-size: 15px; line-height: 1.5; resize: vertical;
    font-family: system-ui; outline: none; transition: border-color 0.2s;
}
.translator-textarea:focus { border-color: #4facfe; }
.translator-textarea[readonly] { background: #161b22; cursor: default; }
.translator-textarea::placeholder { color: #484f58; }

.swap-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid #30363d;
    background: #1c2128; color: #8b949e; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.swap-btn:hover { background: #2b3139; color: #4facfe; border-color: #4facfe; }

.translator-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.translate-btn-primary {
    padding: 12px 32px; border: none; border-radius: 36px;
    background: #4facfe; color: white; font-weight: 700; font-size: 15px;
    cursor: pointer; transition: all 0.2s;
}
.translate-btn-primary:hover { background: #3d8bdb; }
.translate-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.translate-status { color: #8b949e; font-size: 13px; }
.char-count { color: #8b949e; font-size: 13px; margin-left: auto; }

.translator-meta { margin-top: 8px; color: #3fb950; font-size: 13px; min-height: 20px; }

/* Auth Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    padding: 0;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #30363d;
    position: relative;
}
.modal-tab {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    cursor: pointer;
    color: #8b949e;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}
.modal-tab.active { color: #4facfe; border-bottom: 2px solid #4facfe; }
.modal-tab:hover { color: #c9d1d9; }
.modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    cursor: pointer;
    color: #8b949e;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
}
.modal-close:hover { color: #ff4b5c; background: #1c2128; }
.auth-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-input {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #30363d;
    background: #1c2128;
    color: #c9d1d9;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.auth-input:focus { border-color: #4facfe; }
.auth-error { color: #ff4b5c; font-size: 13px; min-height: 18px; }
.auth-btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: 36px;
    background: #4facfe;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-btn-primary:hover { background: #3d8bdb; }

/* Profile button */
.top-right { display: flex; gap: 10px; align-items: center; }
.profile-btn {
    color: #4facfe;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    background: #1c2128;
    border: 1px solid #30363d;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}
.profile-btn:hover { background: #2b3139; border-color: #4facfe; }

/* Dev Page */
.dev-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}
.dev-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}
.dev-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dev-subtitle { color: #8b949e; margin-bottom: 32px; font-size: 15px; }
.dev-section { margin-bottom: 36px; }
.dev-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #c9d1d9;
    border-bottom: 1px solid #30363d;
    padding-bottom: 8px;
}
.dev-card {
    background: #161b22;
    border: 1px solid #2b3139;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.dev-card h3 { color: #58a6ff; margin-bottom: 8px; font-size: 16px; }
.dev-card h4 { color: #c9d1d9; margin: 12px 0 4px; font-size: 14px; }
.dev-card p { color: #8b949e; margin: 6px 0; font-size: 14px; line-height: 1.5; }
.dev-card code {
    background: #1c2128;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #f0c674;
}
.dev-key-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dev-key-controls .auth-input { flex: 1; min-width: 150px; }

/* Key/App Items */
.key-item {
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.key-info { flex: 1; min-width: 200px; }
.key-info strong { display: block; color: #c9d1d9; margin-bottom: 4px; }
.key-info code {
    font-size: 13px;
    color: #f0c674;
    word-break: break-all;
}
.key-meta { font-size: 12px; color: #8b949e; }
.key-delete {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #ff4b5c;
    color: #ff4b5c;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.key-delete:hover { background: #ff4b5c; color: white; }

/* Code Tabs */
.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
}
.code-tab {
    padding: 10px 18px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: #8b949e;
    background: #1c2128;
    border: 1px solid #30363d;
    border-bottom: none;
    transition: all 0.2s;
}
.code-tab:hover { color: #c9d1d9; }
.code-tab.active {
    color: #4facfe;
    background: #0d1117;
    border-color: #30363d;
    border-bottom-color: #0d1117;
}
.code-block {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0 12px 12px 12px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 16px;
}
.code-block pre {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e6edf3;
    white-space: pre;
    tab-size: 4;
}
.code-block pre .comment { color: #8b949e; font-style: italic; }

/* Profile Page */
.profile-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}
.profile-header { margin-bottom: 20px; }
.profile-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #161b22;
    border: 1px solid #2b3139;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-username { font-size: 24px; font-weight: 700; color: #c9d1d9; }
.profile-email { color: #8b949e; font-size: 14px; margin-top: 4px; }
.profile-date { color: #8b949e; font-size: 13px; margin-top: 2px; }
.profile-section {
    background: #161b22;
    border: 1px solid #2b3139;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.profile-section h3 {
    color: #c9d1d9;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}
.profile-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.profile-row .auth-input { flex: 1; }
.profile-msg {
    margin-top: 8px;
    font-size: 13px;
    min-height: 20px;
}
.friends-list { margin-top: 12px; }
.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #1c2128;
    border-radius: 10px;
    margin-bottom: 6px;
    border: 1px solid #30363d;
}
.friend-name {
    color: #58a6ff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.friend-name:hover { text-decoration: underline; }
.friend-remove-btn {
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #ff4b5c;
    color: #ff4b5c;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.friend-remove-btn:hover { background: #ff4b5c; color: white; }