:root {
    --bg-color: #0f0e17;
    --card-bg: rgba(21, 20, 36, 0.8);
    --text-color: #fffffe;
    --accent-color: #ff8906;
    --link-text-color: #ffeeee;
}

body {
    font-family: 'Comfortaa', cursive;
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-color);
    overflow:auto;
}


#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}


.container {
    width: 100%;
    max-width: 550px;
    padding: 20px;
    animation: fadeIn 1.5s ease-out;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(7px);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

p {
    margin: 10px 0 20px;
    font-weight: 300;
    opacity: 0.9;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.avatar {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.avatar.active {
    opacity: 1;
}

#dynamic-text {
    min-height: 1em;
    color: var(--accent-color);
}

#dynamic-text::after {
    content: "|";
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


.rpc-skeleton {
    display: flex;
    gap: 12px;
    padding: 12px;
    animation: pulse 1.5s infinite;
}

.skeleton-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background: #36393f;
}

.skeleton-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.skeleton-line {
    height: 12px;
    background: #36393f;
    border-radius: 4px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

.discord-rpc-widget {
    background: #2f3136;
    padding: 16px;
    margin-top: 20px;
    border-left: 4px solid #5865f2;
    animation: fadeIn 0.5s ease-out;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 200px;
    border-radius: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: var(--color-text-secondary);
    font-family: 'JetBrains Mono', monospace;
    transition: background-color 0.3s ease;
    overflow: hidden;
}

.discord-rpc-widget .rpc-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

#discord-loading {
    color: var(--color-maroon-light);
    font-style: italic;
}

#discord-offline-fallback {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8em;
    line-height: 1.1;
    color: var(--color-text-secondary);
    text-align: center;
    white-space: pre;
    padding: 10px;
    opacity: 0.7;
    margin: auto;
}

.discord-rpc-widget .rpc-activities-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    overflow-y: auto;
    flex-grow: 1;
}

.discord-rpc-widget .rpc-activity {
    background-color: rgba(0, 0, 0, 0.15);
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-size: 1em;
    flex-shrink: 0;
}

.discord-rpc-widget .rpc-activity-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 80px;
    flex-shrink: 0;
    text-align: center;
}
.discord-rpc-widget .rpc-activity-icon {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}
.discord-rpc-widget .rpc-activity-type {
    font-size: 0.8em;
    color: var(--color-text-secondary);
    line-height: 1.1;
}

.discord-rpc-widget .rpc-activity-details {
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-grow: 1;
    overflow: hidden;
    min-width: 0;
}

.discord-rpc-widget .rpc-activity-name,
.discord-rpc-widget .rpc-activity-detail,
.discord-rpc-widget .rpc-activity-state {
    color: var(--color-text-secondary);
    font-size: 0.95em;
    line-height: 1.3;
    width: 100%;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.discord-rpc-widget .rpc-activity-name {
    font-weight: bold;
    color: var(--color-text-primary);
}

.discord-rpc-widget .rpc-custom-status,
.discord-rpc-widget .rpc-no-activity {
    font-style: italic;
    color: var(--color-text-primary);
    padding: 5px 0;
    text-align: left;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    margin-top: 5px;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .card .discord-rpc-widget {
        width: 100%;
        flex-grow: 0;
        min-width: unset;

        margin-top: 0;
    }
    .discord-rpc-widget {
        font-size: 0.85em;
    }
    .discord-rpc-widget .rpc-activity {
        font-size: 0.85em;
    }
    .discord-rpc-widget .rpc-activity-name,
    .discord-rpc-widget .rpc-activity-detail,
    .discord-rpc-widget .rpc-activity-state {
         font-size: 0.9em;
    }
}


.discord-rpc-widget .rpc-activity-icon-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: rgba(50, 40, 45, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 1.5em;
    flex-shrink: 0;
}
.discord-rpc-widget .rpc-activity-icon-placeholder::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f11b";
    opacity: 0.6;
}


.discord-rpc-widget .yandexmusic-progress-container {
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;

    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease-out, max-height 0.3s ease-out, margin-top 0.3s ease-out;
}
.discord-rpc-widget .rpc-activity-details:has(.yandexmusic-progress-container #yandexmusic-timestamps:not(:empty)) .yandexmusic-progress-container {
    opacity: 1;
    max-height: 50px;
}


.discord-rpc-widget .yandexmusic-progress-bar {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    height: 6px;
    overflow: hidden;
    width: 100%;
}

.discord-rpc-widget .yandexmusic-progress-inner {
    background-color: #fdca22;
    height: 100%;
    width: 0%;
    border-radius: 3px;
}

.discord-rpc-widget .yandexmusic-timestamps {
    font-size: 0.8em;
    color: var(--color-text-secondary);
    margin-top: 4px;
    text-align: left;
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
    min-height: 1em;
}

.discord-rpc-widget .rpc-activity-timestamp-container {
    margin-top: 4px;
    transition: opacity 0.3s ease-out;
}
.discord-rpc-widget .rpc-activity-details:has(.rpc-activity-timestamp-container .rpc-activity-timestamp:not(:empty):not(:contains('Загрузка...'))) .rpc-activity-timestamp-container {
    opacity: 1;
    max-height: 30px;
}

.discord-rpc-widget .rpc-activity-timestamp {
    font-size: 0.85em;
    color: var(--color-text-secondary);
    font-style: italic;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
    min-height: 1.2em;
}

.discord-rpc-link {
  color: var(--link-text-color);
  text-decoration: underline;
}

.discord-rpc-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.discord-rpc-link:visited {
  color: var(--link-text-color);
}

.rpc-activity-header::after {
    content: attr(alt);
    position:fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    width: max-content;
    max-width: 200px;
    text-align: center;
    margin-bottom: 10px;
}

.rpc-activity-header:hover::after,
.rpc-activity-header:hover::before {
    opacity: 2;
    visibility: visible;
    transform: translateY(-30px);
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    position: relative;
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.social-btn, .info-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 18px;
    text-decoration: none;
}

.social-btn:hover, .info-btn:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.social-btn::after, .info-btn::after {
    content: attr(alt);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    width: max-content;
    max-width: 200px;
    text-align: center;
    margin-bottom: 10px;
}

.social-btn::before, .info-btn::before {
    content: "";
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent;
    opacity: 0;
    transition: all 0.3s ease;
}

.social-btn:hover::after,
.social-btn:hover::before,
.info-btn:hover::after,
.info-btn:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: 100%;
}

.info-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.info-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: #1e1f26;
    padding: 25px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.popup-text {
    margin-top: 15px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .buttons-container {
        gap: 10px;
    }

    .social-btn, .info-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

.social-btn[href*="t.me/"] {
    background: #0088cc;
}

.social-btn[href*="github.com"] {
    background: #333;
}

.social-btn[href^="mailto:"] {
    background: #ea4335;
}

.social-btn[href*="last.fm"] {
    background: #d51007;
}

.social-btn[href*="tiktok.com"] {
    background: #000;
}

#discord-copy-btn {
    background: linear-gradient(135deg, #5865F2 0%, #8146FF 100%);
}

.info-btn {
    background: #4a4a4a;
}

.social-btn:hover,
.info-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-btn[href*="tiktok.com"]:hover::before {
    opacity: 0.6;
}



.projects-container {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    flex-grow: 1;
}

.project-card {
    background: #161a25;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.project-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.project-content {
    flex: 1;
}

.project-title {
    margin: 0 0 10px 0;
    color: var(--accent-color);
}

.project-description {
    margin: 0 0 15px 0;
    font-size: 14px;
    opacity: 0.9;
}

.project-buttons {
    display: flex;
    gap: 10px;
}

.project-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-bg);
    color: white;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.project-button:hover {
    transform: scale(1.1);
    text-decoration: none;
}

.project-button::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    white-space: nowrap;
}

.project-button:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

.github-btn { background: #333; }
.telegram-btn { background: #0088cc; }
.website-btn { background: #4CAF50; }

@media (max-width: 768px) {
    .projects-container {
        grid-template-columns: 1fr;
    }
}
