:root {
    --color-bg: #0f0f0f;
    --color-bg-panel: #151515;
    --color-accent: #a03c3c;
    --color-accent-hover: #ff5a5a;
    --color-accent-soft: #b45050;
    --color-border: #a03c3c;
    --color-border-hover: #dc5050;
    --color-text: #e0e0e0;
    --color-text-soft: #e0c8c8;
    --color-heading: #fff;
    --color-list-bg: rgba(80, 40, 40, 0.2);
    --color-list-hover: rgba(180, 60, 60, 0.08);
    --color-footer: rgba(240, 120, 120, 0.8);

    --radius-main: 12px;
    --radius-small: 6px;

    --anim-fast: 0.1s cubic-bezier(.33, 1.02, .53, .97);
    --anim-med: 0.3s cubic-bezier(.33, 1.02, .53, .97);
    --anim-slow: 0.5s cubic-bezier(.33, 1.02, .53, .97);
}

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

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: rgb(5, 5, 5);
    color: rgb(220, 200, 200);
    font-family: monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

#canvas {
    background-color: rgb(15, 15, 15);
    border: 2px solid rgb(160, 60, 60);
    border-radius: var(--radius-main);
    width: fit-content;
    max-width: 100%;
    padding: 2rem 3rem;
    gap: 2rem;
    display: flex;
    flex-direction: column;
    animation: FadeIn var(--anim-med);
    backdrop-filter: blur(2.5px);
    background: rgba(15, 15, 15, 0.92);
}

#ascii-logo {
    font-size: 0.5rem;
    line-height: 1.2;
    text-align: center;
    background: linear-gradient(90deg, rgb(180, 60, 60), rgb(220, 80, 80), rgb(180, 60, 60));
    background-size: 200% 100%;
    animation: asciiGradient 3s linear infinite alternate;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: pre;
    user-select: none;
}

@keyframes asciiGradient {
    to {
        background-position: 100% 0;
    }
}

.divider {
    height: 1px;
    background: rgb(160, 60, 60);
    opacity: 0.6;
    width: 0;
    animation: dividerGrow var(--anim-med) 0.2s forwards;
}

@keyframes dividerGrow {
    to {
        width: 100%;
    }
}

#menu {
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
    width: 100%;
}

.menu-item {
    font-size: 0.9rem;
    color: rgb(180, 80, 80);
    border-radius: var(--radius-small);
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
    transition: background-color var(--anim-fast), color var(--anim-fast), box-shadow var(--anim-fast), transform var(--anim-fast);
    opacity: 0;
    transform: translateX(-12px);
    animation: menuFadeIn var(--anim-med) forwards;
}

.menu-item:nth-child(1) {
    animation-delay: 0.1s;
}

.menu-item:nth-child(2) {
    animation-delay: 0.2s;
}

.menu-item:nth-child(3) {
    animation-delay: 0.3s;
}

.menu-item:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes menuFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-item::before {
    content: ">";
    color: rgb(140, 60, 60);
    transition: color var(--anim-fast);
}

.menu-item:hover,
.menu-item:focus {
    background-color: rgba(200, 80, 100, 0.1);
    color: rgb(200, 60, 60);
    box-shadow: 0 0 0 2px rgba(220, 80, 80, 0.18);
}

.menu-item:hover::before,
.menu-item:focus::before {
    color: rgb(220, 60, 60);
}

.menu-item:active {
    transform: scale(0.96);
}

#panel-content {
    font-size: 0.84rem;
    line-height: 1.6;
    color: rgb(220, 200, 200);
    text-align: justify;
    max-width: 100vw;
    max-height: 360px;
    padding-right: 1rem;
    animation: FadeIn var(--anim-med);
    overflow-y: auto;
    overflow-x: clip;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    backdrop-filter: blur(2px);
    background: rgba(15, 15, 15, 0.92);
}

#panel-content * {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#panel-content::-webkit-scrollbar {
    width: 5px;
}

#panel-content::-webkit-scrollbar-track {
    background: transparent;
}

#panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(120deg, rgb(180, 60, 60), rgb(220, 80, 80));
    border-radius: 3px;
}

#panel-content strong {
    color: rgb(180, 80, 80);
}

#panel-content ul {
    display: flex;
    list-style: none;
    flex-direction: column;
    gap: 0.5rem;
}

#panel-content li {
    background: rgba(80, 40, 40, 0.2);
    border-left: 3px solid rgb(160, 80, 80);
    border-radius: var(--radius-small);
    padding: 1.25rem;
    transition: transform var(--anim-fast), background var(--anim-fast), border-left-color var(--anim-fast);
}

#button-back, .menu-back, .button-view {
    font-size: 0.75rem;
    color: rgb(180, 80, 80);
    padding: 0.6rem 1rem;
    text-decoration: none;
    border: 1px solid rgb(200, 80, 80);
    border-radius: var(--radius-small);
    transition: transform var(--anim-fast), box-shadow var(--anim-fast), color var(--anim-fast), background-color var(--anim-fast), border-color var(--anim-fast);
    display: inline-block;
}

#button-back:hover, .menu-back:hover,
.button-view:hover, .button-view:focus,
#button-back:focus, .menu-back:focus {
    background-color: rgba(180, 80, 80, 0.5);
    color: rgb(200, 80, 80);
    border-color: rgb(220, 80, 80);
    box-shadow: 0 0 0 2px rgba(220, 80, 80, 0.18);
}

#button-back:active, .menu-back:active, .button-view:active {
    transform: scale(0.96);
}

.button-view {
    display: block;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    margin-top: 0.6rem;
}

#footer {
    font-size: 0.7rem;
    border-top: 1px solid rgb(200, 80, 80);
    color: rgba(240, 120, 120, 0.8);
    opacity: 0.6;
    text-align: center;
    padding-top: 1rem;
    animation: footerFadeIn var(--anim-slow) 0.7s forwards;
}

@keyframes footerFadeIn {
    to {
        opacity: 0.6;
    }
}

.footer-strong {
    font-weight: bold;
    color: rgb(220, 80, 80);
}

#social-bar {
    position: fixed;
    bottom: 2.2rem;
    right: 2.2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: none;
    box-shadow: none;
}

#social-bar .social-link {
    pointer-events: auto;
    color: rgb(180, 80, 80);
    background: rgb(15, 15, 15);
    border-radius: var(--radius-small);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(160, 60, 60, 0.10);
    font-size: 1em;
    transition: background var(--anim-fast), color var(--anim-fast), box-shadow var(--anim-fast), transform var(--anim-fast);
    text-decoration: none;
    border: 1.5px solid rgb(160, 60, 60);
    position: relative;
    margin: 0;
    padding: 0;
}

#social-bar .social-link::after {
    content: attr(aria-label);
    position: absolute;
    right: 115%;
    top: 50%;
    transform: translateY(-50%);
    background: rgb(25, 15, 15);
    color: rgb(220, 200, 200);
    padding: 0.22em 0.7em;
    border-radius: 6px;
    border: 1px solid rgb(160, 60, 60);
    font-size: 0.78em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--anim-fast), right var(--anim-fast);
    z-index: 1001;
    box-shadow: 0 1px 4px rgba(160, 60, 60, 0.10);
    font-family: monospace;
    letter-spacing: 0.01em;
}

#social-bar .social-link:hover::after,
#social-bar .social-link:focus::after {
    opacity: 1;
    right: 125%;
}

#social-bar .social-link:hover,
#social-bar .social-link:focus {
    background: rgb(180, 60, 60);
    color: #fff;
    box-shadow: 0 2px 8px rgba(160, 60, 60, 0.18);
    transform: translateY(-1px) scale(1.07);
    border-color: rgb(220, 80, 80);
}

#social-bar .social-link:active {
    transform: scale(0.96);
}

@keyframes FadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    #panel-content {
        max-width: 100% !important;
        width: 100% !important;
        padding-right: 0;
    }

    #canvas {
        padding: 1rem;
    }

    .menu-item:hover {
        background-color: transparent;
        color: inherit;
        transform: none !important;
    }

    .menu-item:hover::before {
        color: inherit !important;
    }

    #social-bar {
        right: 0.7rem;
        bottom: 0.7rem;
        gap: 0.4rem;
    }

    #social-bar .social-link {
        width: 28px;
        height: 28px;
        font-size: 0.85em;
        border-radius: 5px;
    }

    #social-bar .social-link::after {
        font-size: 0.65em;
        padding: 0.15em 0.4em;
    }
}

body:not(:has(#menu)) #panel-content {
    max-width: 600px;
    width: 600px;
}
