@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0f172a 100%);
    color: #f8fafc;
    position: relative;
}
body {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    opacity: 0.7;
    background: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(0,255,255,0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(0,200,255,0.4), transparent),
        radial-gradient(1px 1px at 160px 30px, rgba(255,0,150,0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    z-index: 0;
    animation: drift 60s linear infinite;
}
@keyframes drift { 0% { transform: translateX(0); } 100% { transform: translateX(-200px); } }
.wrapper {
    margin: auto;
    width: 90%;
    max-width: 900px;
    padding: 48px 0;
    animation: fadeIn 1.5s ease-out;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 96px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.welcome-text { font-size: clamp(2.5rem, 8vw, 4.5rem); font-weight: 700; margin-bottom: 1rem; line-height: 1.1; letter-spacing: -0.02em; }
.name { background: linear-gradient(135deg, #00c8ff, #ff00aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow { from { filter: brightness(1); } to { filter: brightness(1.3); } }
h2 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 600; margin: 1rem 0; letter-spacing: -0.01em; }
.dot { color: #00c8ff; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.description { font-size: 1.2rem; color: #94a3b8; margin-bottom: 2rem; line-height: 1.6; }
.game-hint { margin: 2rem 0; }
.game-hint p { font-family: 'JetBrains Mono', monospace; color: #fbbf24; font-weight: 600; font-size: 1.1rem; }
kbd { background: #1e293b; color: #f8fafc; padding: 6px 12px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-weight: 700; border: 1px solid #334155; box-shadow: 0 2px 4px rgba(0,0,0,0.3); font-size: 1rem; }
.play-game-btn { display: none; margin: 1.5rem 0; padding: 1rem 2.5rem; font-size: 1.2rem; font-weight: bold; border-radius: 50px; background: linear-gradient(135deg, #00c8ff, #ff00aa); color: #fff; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 200, 255, 0.12); transition: background 0.2s; z-index: 10; }
.play-game-btn:hover, .play-game-btn:active { background: linear-gradient(135deg, #ff00aa, #00c8ff); }
.mobile-only { display: none; }
@media (max-width: 768px) {
    .play-game-btn, .mobile-only { display: block; }
    body { justify-content: flex-start; align-items: stretch; }
    .wrapper { width: 100%; min-height: unset; padding: 24px 0; margin-top: 0; align-items: stretch; }
}
.projects-section { margin: 2.5rem 0; width: 100%; }
.loading { color: #94a3b8; font-style: italic; padding: 2rem; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.repo-card { padding: 1.5rem; background: rgba(30, 41, 59, 0.6); backdrop-filter: blur(10px); border: 1px solid #334155; border-radius: 12px; text-decoration: none; color: inherit; transition: all 0.3s ease; text-align: left; }
.repo-card:hover { background: rgba(30, 41, 59, 0.8); transform: translateY(-3px); border-color: #00c8ff; box-shadow: 0 10px 25px rgba(0, 200, 255, 0.15); }
.repo-name { font-weight: 600; color: #f8fafc; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; }
.repo-description { font-size: 0.9rem; color: #94a3b8; line-height: 1.5; margin-bottom: 1rem; }
.repo-stats { display: flex; gap: 1rem; font-size: 0.8rem; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.repo-language { display: flex; align-items: center; gap: 0.3rem; }
.language-dot { width: 8px; height: 8px; border-radius: 50%; }
.social-links { margin-top: 2rem; }
.github-link { display: inline-flex; align-items: center; gap: 0.8rem; padding: 1rem 2rem; background: rgba(255, 255, 255, 0.05); color: #f8fafc; text-decoration: none; border-radius: 50px; border: 1px solid #334155; font-weight: 600; transition: all 0.3s ease; font-size: 1.1rem; }
.github-link:hover { background: rgba(255, 255, 255, 0.1); border-color: #00c8ff; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 200, 255, 0.2); }
/* --- Game Styles --- */
.game-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #0f172a; z-index: 1000; display: none; }
.game-container.show { display: block; }
#gameCanvas { width: 100%; height: 100%; display: block; }
.game-ui { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.game-header { position: absolute; top: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-start; }
.game-info { background: rgba(15, 23, 42, 0.8); padding: 1rem; border-radius: 10px; border: 1px solid #00c8ff; backdrop-filter: blur(10px); }
.game-title { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700; color: #00c8ff; margin-bottom: 0.5rem; }
.game-stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat { font-family: 'JetBrains Mono', monospace; font-size: 1rem; color: #f8fafc; font-weight: 600; }
.close-btn { width: 40px; height: 40px; border-radius: 50%; background: #ef4444; border: none; color: white; font-size: 1.5rem; font-weight: bold; cursor: pointer; pointer-events: all; transition: all 0.3s ease; }
.close-btn:hover { background: #dc2626; transform: scale(1.1); }
.game-instructions { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #94a3b8; font-family: 'JetBrains Mono', monospace; text-align: center; font-size: 0.9rem; background: rgba(15, 23, 42, 0.8); padding: 1rem; border-radius: 10px; backdrop-filter: blur(10px); }
/* --- Game Over --- */
.game-over { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); display: none; justify-content: center; align-items: center; pointer-events: all; }
.game-over.show { display: flex; }
.game-over-content { background: rgba(30, 41, 59, 0.9); padding: 3rem; border-radius: 20px; border: 1px solid #334155; text-align: center; max-width: 400px; backdrop-filter: blur(20px); }
.game-over-content h3 { font-size: 2rem; margin-bottom: 1.5rem; color: #ef4444; }
.game-over-content p { margin: 1rem 0; font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; color: #f8fafc; }
.new-record { color: #10b981; font-weight: 700; margin: 1rem 0; display: none; animation: celebrate 0.6s ease-in-out; }
.new-record.show { display: block; }
@keyframes celebrate { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.game-over-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; }
.game-over-buttons button { padding: 1rem 2rem; border: none; border-radius: 10px; font-family: 'Inter', sans-serif; font-weight: 600; cursor: pointer; transition: all 0.3s ease; font-size: 1rem; }
#restartGame { background: #10b981; color: white; }
#restartGame:hover { background: #059669; transform: translateY(-2px); }
#menuGame { background: #334155; color: #f8fafc; border: 1px solid #475569; }
#menuGame:hover { background: #475569; transform: translateY(-2px); }
#backToMenu, #backToHomeMenu { background: #334155; color: #f8fafc; border: 1px solid #475569; }
#backToMenu:hover, #backToHomeMenu:hover { background: #475569; transform: translateY(-2px); }

.game-menu {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.97);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1010;
}
.game-menu.show { display: flex; }
.game-menu-content {
    background: rgba(30, 41, 59, 0.99);
    padding: 2rem 2rem 2rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 32px rgba(0,0,0,0.4);
    min-width: 260px;
}
.game-list {
    margin: 1.2rem 0 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.menu-btn {
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    background: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-btn:hover { background: #475569; }

.touch-controls {
    display: none;
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
}
.touch-controls.show { display: flex; gap: 2rem; }
.touch-btn {
    padding: 1rem 1.6rem;
    border-radius: 12px;
    background: #00c8ff;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,200,255,0.12);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}
.touch-btn:active, .touch-btn:hover {
    background: #00c8ffcc;
}
@media (max-width: 768px) {
    .project-grid { grid-template-columns: 1fr; }
    .game-header { flex-direction: column; gap: 1rem; align-items: center; }
    .game-stats { justify-content: center; }
    .game-over-content, .game-menu-content { margin: 1rem; padding: 2rem; }
    .game-over-buttons { flex-direction: column; }
}