/* Rechte Spalte (hält Top 10 und Zufalls-Box zusammen) */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

.sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1.25rem; /* Etwas kompakterer Innenabstand */
    box-shadow: var(--shadow);
}

.sidebar h2 {
    font-size: 1.15rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Top-10-Liste */
.top-list {
    list-style: none;
}

/* Kompakte Top-10-Zeilen */
.top-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.28rem 0.4rem; /* Deutlich geringere Zeilenhöhe (vorher 0.55rem) */
    border-bottom: 1px solid var(--bg-color);
    transition: background 0.15s;
    border-radius: 6px;
}

.top-item:last-child {
    border-bottom: none;
}

.top-item:hover {
    background: var(--bg-color);
}

.top-item.rank-up {
    animation: rankHighlight 0.8s ease;
}

@keyframes rankHighlight {
    0%   { background-color: rgba(234, 88, 12, 0.22); }
    100% { background-color: transparent; }
}

.top-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.rank-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-item:nth-child(1) .rank-badge { background: #eab308; } /* Gold */
.top-item:nth-child(2) .rank-badge { background: #94a3b8; } /* Silber */
.top-item:nth-child(3) .rank-badge { background: #b45309; } /* Bronze */

.top-emoji {
    font-size: 1.25rem; /* Etwas kleineres Emoji (vorher 1.5rem) */
    line-height: 1.1;
}

.top-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.top-clicks {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.mini-copy-btn {
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mini-copy-btn:hover {
    background: var(--primary);
    color: white;
}

.mini-copy-btn.copied {
    background: var(--success) !important;
    color: white !important;
    border-color: var(--success) !important;
}

/* Zufalls-Emoji Box */
.random-display {
    text-align: center;
    padding: 1rem 0.5rem;
    background: var(--bg-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px dashed var(--border);
}

.random-char {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 0.4rem;
    display: inline-block;
    user-select: none;
}

.random-char.pop {
    animation: randomPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes randomPop {
    0%   { transform: scale(0.4) rotate(-20deg); opacity: 0.3; }
    70%  { transform: scale(1.2) rotate(8deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.random-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.random-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto; /* Würfeln, Kopieren und daneben der kompakte 🪧-Button */
    gap: 0.45rem;
}

.random-copy-btn:disabled,
.random-sign-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.random-sign-btn:not(:disabled):hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px) scale(1.06);
}

.random-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.random-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.random-btn:active {
    transform: scale(0.96);
}

.random-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Sidebar-Anpassung */
@media (max-width: 900px) {
    .sidebar-column {
        position: static;
    }
    .top-name {
        max-width: 200px;
    }
}
