:root {
    --primary: var(--accent-soft, #60a5fa);
    --text-main: var(--color-text, #f1f5f9);
    --text-muted: var(--color-muted, #cbd5e1);
    --glass-hover: rgba(255, 255, 255, 0.14);
    --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }

.controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.guide-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    height: 50px;
}

.guide-star {
    color: #fbbf24;
    font-size: 1.1rem;
    animation: pulseStar 2s infinite;
}

@keyframes pulseStar {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.search-box {
    flex-grow: 1;
    min-width: 250px;
    max-width: 400px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
    padding-bottom: 80px;
}

.container > .card-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.container > .card-section:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

#favorites-card {
    grid-column: 1 / -1;
    border-color: rgba(251, 191, 36, 0.35);
    display: none;
    animation: slideDown 0.5s ease;
}

#favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    padding: 20px;
}

#favorites-list .link-item {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.card-title {
    padding: 16px 20px;
    font-weight: 800;
    color: #fff;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
}

.link-list { padding: 5px 0; }

.link-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
}

.link-item:last-child { border-bottom: none; }
.link-item:hover { background: rgba(255, 255, 255, 0.06); }

.fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #64748b;
    margin-left: 10px;
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fav-btn:hover { transform: scale(1.2); color: #94a3b8; }

.fav-btn.active {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
    animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.link-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.link-url {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: monospace;
    transition: all 0.2s;
    white-space: nowrap;
}

.link-url:hover {
    background: var(--primary);
    color: #0b1220;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.45);
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }
.hidden { display: none !important; }

@media (max-width: 768px) {
    body { padding: 15px; }
    .container { grid-template-columns: 1fr; }
    #favorites-list { grid-template-columns: 1fr; }
    .controls-wrapper { flex-direction: column; align-items: stretch; gap: 8px; }
    .guide-box { justify-content: center; font-size: 0.8rem; height: 40px; }
    .search-box { max-width: 100%; }
}
