:root {
    --bg: #fafafa;
    --bg2: #f5f5f5;
    --text: #111;
    --subtext: #555;
    --divider: #ddd;
    --fade: #fafafa;
    --card-shadow: rgba(0,0,0,0.1);
}

body.dark {
    --bg: #0f0f0f;
    --bg2: #141414;
    --text: #f1f1f1;
    --subtext: #bbbbbb;
    --divider: #333;
    --fade: #0f0f0f;
    --card-shadow: rgba(0,0,0,0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg2) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    opacity: 0;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: var(--text);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--divider);
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255,255,255,0.2);
}

body.dark .theme-toggle:hover {
    background: rgba(255,255,255,0.15);
}

.main {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto 2rem;
    padding: 2rem;
    animation: fadeIn 1s ease-out forwards;
}

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

.profile-img {
    width: 130px;
    height: 130px;
    image-rendering: pixelated;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.name {
    font-size: 2.9rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 0.5rem;
}

.about {
    font-size: 1.22rem;
    color: var(--subtext);
    margin-bottom: 2rem;
}

.links ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.links li a {
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.03);
}

body.dark .links li a {
    background: rgba(255,255,255,0.05);
}

.links li a:hover {
    background: rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

body.dark .links li a:hover {
    background: rgba(255,255,255,0.1);
}

.section-divider {
    max-width: 600px;
    margin: 4rem auto 3rem;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--divider), transparent);
}

.carousel {
    max-width: 680px;
    margin: 0 auto 5rem;
    padding: 0 2rem;
    position: relative;
}

.carousel h2 {
    font-size: 1.9rem;
    margin-bottom: 2rem;
    text-align: center;
}

.carousel-mask {
    overflow: hidden;
    position: relative;
    border-radius: 16px;
}

.carousel-mask::before,
.carousel-mask::after {
    content: "";
    position: absolute;
    top: 0;
    width: 140px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.carousel-mask::before {
    left: 0;
    background: linear-gradient(to right, var(--fade), transparent);
}

.carousel-mask::after {
    right: 0;
    background: linear-gradient(to left, var(--fade), transparent);
}

.carousel-track {
    display: flex;
    gap: 24px;
    padding: 20px 0;
}

.carousel-track a {
    display: block;
    flex: 0 0 320px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}

.carousel-track a:hover {
    transform: translateY(-12px) scale(1.04);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

body.dark .carousel-track a:hover {
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.carousel-track img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.carousel-track a:hover img {
    transform: scale(1.06);
}

.game-title {
    position: absolute;
    bottom: 50px;
    left: 16px;
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.game-visits {
    position: absolute;
    bottom: 16px;
    left: 16px;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    background: rgba(0,0,0,0.5);
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: all 0.3s ease;
}

.carousel:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-btn:hover { background: rgba(0,0,0,0.7); transform: translateY(-50%) scale(1.1); }

footer {
    max-width: 600px;
    margin: 6rem auto 2rem;
    padding: 2rem;
    text-align: center;
    color: var(--subtext);
    font-size: 0.92rem;
    border-top: 1px solid var(--divider);
}

.fun-fact {
    margin-top: 1.2rem;
    font-style: italic;
}

@media (max-width: 640px) {
    .main { margin: 2rem auto; padding: 1rem; }
    .name { font-size: 2.3rem; }
    .profile-img { width: 110px; height: 110px; }
    .carousel-track a { flex: 0 0 240px; }
    .carousel-track img { height: 240px; }
    .carousel-btn { display: none; }
}