:root {
    --bg-body: #0f172a;
    --bg-profile: #0b1420;
    --bg-card: #1e293b;
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-inner: rgba(15, 23, 42, 0.5);
    
    --border-color: rgba(51, 65, 85, 0.6);
    --border-hover: #94a3b8;
    
    --text-main: #cbd5e1;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    --cyan-main: #06b6d4;
    --cyan-shadow: rgba(6, 182, 212, 0.6);
    
    --emerald-main: #10b981;
    --emerald-shadow: rgba(16, 185, 129, 0.6);
    
    --rose-main: #f43f5e;
    --rose-shadow: rgba(244, 63, 94, 0.6);
    
    --amber-main: #f59e0b;
    --amber-shadow: rgba(245, 158, 11, 0.6);
    
    --yellow-star: #facc15;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth; 
}
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden; 
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

#linux-terminal-overlay {
    position: fixed;
    inset: 0;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4rem;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#linux-terminal-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.terminal-box {
    width: 100%;
    max-width: 500px;
    text-align: left;
    font-size: 1rem;
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.4);
}

.terminal-box p {
    margin-bottom: 0.2rem;
    word-break: break-all;
}

.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #00ff00;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}
.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.025em;
}
.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.profile-card {
    background-color: var(--bg-profile);
    border-radius: 0.25rem;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    margin-bottom: 3.5rem;
}

.avatar-wrapper {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
    padding: 4px;
    background: linear-gradient(135deg, #00ffff, #a855f7, #ff0080);
    box-shadow: 0 0 15px rgba(255,0,128,0.3);
    border-radius: 0.25rem;
}
.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    color: #8f98a0;
    font-size: 0.875rem;
    padding-top: 0.25rem;
}
.profile-name {
    font-size: 1.875rem;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.profile-name .dropdown-arrow {
    font-size: 10px;
    color: #6b7280;
}
.profile-details { margin-bottom: 0.75rem; }

.profile-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    min-width: 200px;
}
.games-completed-stat {
    color: var(--text-white);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.games-completed-stat .count {
    border: 2px solid var(--emerald-main);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 500;
}

.status-box {
    background-color: #121a24;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.status-box.flex-between { justify-content: space-between; }

.dot-wrapper {
    position: relative;
    display: flex;
    width: 10px;
    height: 10px;
}
.dot-ping {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #34d399;
    opacity: 0.75;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.dot-solid {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--emerald-main);
    box-shadow: 0 0 8px rgba(16,185,129,0.8);
}
.status-text-emerald { color: #34d399; font-weight: 500; letter-spacing: 0.025em; }

.dot-offline {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #6b7280;
}
.status-text-offline { color: #9ca3af; font-weight: 500; letter-spacing: 0.025em; }

.profile-buttons {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-end;
}

.btn-view-games {
    background-color: #272b38;
    color: var(--text-white);
    border: none;
    padding: 0.375rem 1rem;
    border-radius: 0.125rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: auto;
}
.btn-view-games:hover { background-color: #3d4458; }

.btn-wishlist {
    background-color: #1e3a8a;
    color: var(--text-white);
    border: none;
    padding: 0.375rem 1rem;
    border-radius: 0.125rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.2s;
    width: auto;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-wishlist:hover { background-color: #1e40af; text-decoration: none; }

.journal-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: 2rem; 
}
.section-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-accent {
    width: 8px;
    height: 28px;
    border-radius: 9999px;
    display: block;
}
.accent-cyan { background-color: var(--cyan-main); box-shadow: 0 0 10px var(--cyan-shadow); }
.accent-emerald { background-color: var(--emerald-main); box-shadow: 0 0 10px var(--emerald-shadow); }
.accent-rose { background-color: var(--rose-main); box-shadow: 0 0 10px var(--rose-shadow); }
.accent-amber { background-color: var(--amber-main); box-shadow: 0 0 10px var(--amber-shadow); }

.game-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-card {
    background-color: var(--bg-card);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-card-hover);
}
.game-card.dropped img {
    filter: grayscale(100%);
    opacity: 0.7;
}

.game-cover {
    width: 128px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(51, 65, 85, 1);
    flex-shrink: 0;
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}
.game-year {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-playing { background: rgba(6, 182, 212, 0.15); color: var(--cyan-main); border: 1px solid rgba(6, 182, 212, 0.3); animation: pulse 2s infinite; }
.badge-completed { background: rgba(16, 185, 129, 0.15); color: var(--emerald-main); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-dropped { background: rgba(244, 63, 94, 0.15); color: var(--rose-main); border: 1px solid rgba(244, 63, 94, 0.3); }

.game-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.rating-stars {
    font-size: 1.125rem;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    filter: drop-shadow(0 4px 3px rgba(0,0,0,0.07));
}
.star-full { color: var(--yellow-star); }
.star-half { color: rgba(250, 204, 21, 0.5); font-size: 0.875rem; position: relative; top: -2px; }
.star-empty { color: #475569; }

.meta-pill {
    color: var(--text-main);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background-color: var(--bg-inner);
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}
.meta-pill svg { width: 16px; height: 16px; color: var(--text-muted); }
.meta-pill.cyan svg { color: var(--cyan-main); }

.review-box {
    background-color: var(--bg-inner);
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--emerald-main);
}
.review-box.dropped { border-left-color: #475569; }
.review-text {
    color: var(--text-main);
    font-style: italic;
    font-size: 0.9375rem;
}

.progress-container { margin-top: 0.5rem; }
.progress-track {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    border-radius: 9999px;
    height: 16px;
    border: 1px solid var(--border-color);
    padding: 2px;
}
.progress-fill {
    background: linear-gradient(to right, #0891b2, #22d3ee);
    height: 100%;
    border-radius: 9999px;
    position: relative;
}
.progress-label {
    position: absolute;
    right: -12px;
    top: -24px;
    font-size: 11px;
    font-weight: 700;
    color: #67e8f9;
    background-color: var(--bg-card);
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.game-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.game-card-compact {
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease-in-out;
}
.game-card-compact:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
}
.game-cover-compact {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid rgba(51, 65, 85, 1);
    flex-shrink: 0;
}
.game-card-compact .game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}
.game-card-compact .game-header-row,
.game-card-compact .game-meta-row {
    margin-bottom: 0;
    gap: 0.5rem;
}
.game-card-compact .game-title {
    font-size: 1rem;
}
.game-card-compact .game-year {
    font-size: 0.8rem;
}
.game-card-compact .badge,
.game-card-compact .meta-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
}
.game-card-compact .meta-pill svg {
    width: 14px;
    height: 14px;
}
.game-card-compact .rating-stars {
    font-size: 0.9rem;
}
.game-card-compact .review-box {
    padding: 0.5rem;
    margin-top: 0.25rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}

.clickable-header {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}
.clickable-header:hover {
    opacity: 0.8;
}
.toggle-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    margin-left: auto;
}
.toggle-arrow.open {
    transform: rotate(180deg);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}
.endless-card {
    background-color: var(--bg-card);
    border-radius: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.endless-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-card-hover);
}
.endless-cover-wrapper {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(51, 65, 85, 1);
    overflow: hidden;
    aspect-ratio: 3 / 4;
}
.endless-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.endless-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-white);
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.endless-meta {
    margin-top: auto;
    width: 100%;
    justify-content: center;
}

@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
    .profile-card { flex-direction: column; align-items: center; text-align: center; }
    .profile-stats { align-items: center; width: 100%; }
    .profile-buttons { flex-direction: column; }
    .btn-view-games, .btn-wishlist { width: 100%; padding: 0.5rem; }
    .game-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .game-card { flex-direction: column; align-items: center; text-align: center; }
    .game-cover { width: 100px; height: auto; }
    .game-header-row, .game-meta-row { justify-content: center; }
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .review-box { text-align: left; }
}