/* Lisa — Kaomoji-Suche */

:root {
    --bg: #0d0d0d;
    --surface: #1a1a1a;
    --surface-hover: #252525;
    --border: #333;
    --text: #e0e0e0;
    --text-dim: #888;
    --accent: #c084fc;
    --accent-dim: #7c3aed;
    --heart: #ef4444;
    --heart-dim: #555;
    --toast-bg: #22c55e;
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 2.5rem 1rem 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 .subtitle {
    font-weight: 300;
    font-size: 1.5rem;
    opacity: 0.7;
}

.tagline {
    color: var(--text-dim);
    margin: 0.3rem 0 1.5rem;
    font-size: 0.95rem;
}

/* Suchfeld */
.search-wrap {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

#search {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

#search:focus {
    border-color: var(--accent);
}

#search::placeholder {
    color: var(--text-dim);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
}

/* Tab-Navigation */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.tab {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    font-family: inherit;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab .fav-heart {
    color: var(--heart);
}

.fav-count {
    font-size: 0.75rem;
    background: var(--accent-dim);
    color: #fff;
    border-radius: 10px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.2rem;
}

.fav-count:empty {
    display: none;
}

/* Tab-Content */
.tab-content {
    display: none;
    flex: 1;
}

.tab-content.active {
    display: block;
}

/* Tag-Leiste */
.tags-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.tag-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-family: inherit;
}

.tag-chip:hover,
.tag-chip.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
}

/* Ergebnis-Grid — flexbox statt grid, damit Karten sich an Kaomoji-Breite anpassen */
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
}

/* Karte */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 0.8rem 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
    min-width: 150px;
    max-width: 400px;
    flex-shrink: 0;
}

.card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card:active {
    transform: translateY(0);
}

.card .emoticon {
    font-size: 1.6rem;
    line-height: 1.4;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Geneva', 'Menlo', 'Apple Symbols', 'Euphemia UCAS', 'Mshtakan', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', 'MS Gothic', 'Segoe UI Symbol', 'Segoe UI Emoji', 'Gadugi', 'DejaVu Sans', 'Noto Sans', sans-serif;
}

.card .card-tags {
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Herz-Button */
.heart-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--heart-dim);
    transition: all 0.2s;
    padding: 0.2rem;
    line-height: 1;
    z-index: 2;
}

.heart-btn:hover {
    transform: scale(1.2);
    color: var(--heart);
}

.heart-btn.favorited {
    color: var(--heart);
}

.heart-btn.favorited:hover {
    transform: scale(1.2);
}

/* Kopier-Overlay */
.card .copied-overlay {
    position: absolute;
    inset: 0;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    border-radius: var(--radius);
}

.card.copied .copied-overlay {
    opacity: 1;
}

/* Tab-Hinweis */
.tab-hint {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 0.75rem 1rem 0;
}

/* Rang-Badge */
.rank-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

/* Kopier-Zähler */
.copies-badge {
    display: block;
    font-size: 0.65rem;
    color: var(--accent);
    margin-top: 0.3rem;
}

/* Leer-Zustand */
.empty {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-face {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.empty p {
    color: var(--text-dim);
}

/* Ladeanimation */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--toast-bg);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.25s;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }
    h1 .subtitle {
        font-size: 1.1rem;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    header {
        padding: 1.5rem 1rem 0.75rem;
    }
    .tabs {
        gap: 0;
    }
    .tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}
