* { margin: 0; padding: 0; box-sizing: border-box; }

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;600&display=swap');

:root {
    --bg-color: #050505;
    --accent-color: #00ffc4;
    --panel-bg: rgba(10, 10, 10, 0.8);
    --border-color: #222;
    --node-grey: #5c5c61; 
}

body {
    background-color: var(--bg-color);
    color: #ffffff;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

#canvas-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
    background: var(--bg-color);
}

.terminal-nav {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 0 auto; 
    padding: 12px 20px;
    
    background: rgba(25, 25, 25, 0.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.terminal-prompt {
    color: #666;
    margin-right: 10px;
    user-select: none;
}

.terminal-text {
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.terminal-cursor {
    display: inline-block;
    width: 9px;
    height: 16px;
    background-color: var(--accent-color);
    margin-left: 8px;
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.main-site-container {
    position: relative; z-index: 10;
    max-width: 1200px; margin: 0 auto; 
    padding: 20px 20px 40px 20px;
    min-height: 100vh;
    display: flex; flex-direction: row; gap: 40px;
}

.profile-content { flex: 2; min-width: 300px; }

h1 { font-size: 3.5rem; font-weight: 700; letter-spacing: -2px; line-height: 1.1; margin-bottom: 0.5rem; color: #f0f0f0; }
h2 { font-size: 1.2rem; font-weight: 400; letter-spacing: 1px; color: var(--accent-color); margin-bottom: 2rem; }

.section-title { 
    font-size: 1.5rem; font-weight: 700; margin-top: 3rem; margin-bottom: 1rem; 
    text-transform: uppercase; letter-spacing: 2px; color: #fff; 
    border-bottom: 1px solid var(--border-color); padding-bottom: 10px;
}

.interactive-title {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    width: 100%;
}

.interactive-title:hover {
    color: var(--accent-color);
    transform: translateX(10px) scale(1.02);
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 255, 196, 0.3);
}

.text-block p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 1rem; color: #ccc; }

.links a { 
    color: #888; text-decoration: none; margin-right: 20px; 
    font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s; 
}
.links a:hover { color: var(--accent-color); text-shadow: 0 0 8px rgba(0, 255, 196, 0.4); }

.skills-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.skills-list li { 
    background: rgba(20, 20, 20, 0.8); border: 1px solid #333; padding: 5px 10px; 
    font-size: 0.8rem; color: #fff; transition: all 0.2s;
}
.skills-list li:hover { border-color: var(--accent-color); color: var(--accent-color); }

.project-card { border-left: 2px solid #333; padding-left: 15px; margin-bottom: 20px; transition: border-color 0.3s; }
.project-card:hover { border-left-color: var(--accent-color); }
.project-card h3 { font-size: 1.1rem; margin-bottom: 5px; color: #fff; }
.project-card p { color: #888; font-size: 0.9rem; }

.sidebar {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 20px; max-width: 280px; min-width: 280px; align-self: flex-start;
}

.sidebar-panel {
    width: 100%; background: var(--panel-bg); 
    border: 1px solid var(--border-color); backdrop-filter: blur(5px); padding: 10px;
    display: flex; flex-direction: column; align-items: center;
}

.map-panel-container {
    padding: 0;
    background: transparent;
    border: none;
    height: auto; 
    width: 100%;
}

.map-widget {
    width: 100%;
    height: 350px; 
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    position: relative;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.map-widget.expanded {
    position: fixed;
    top: 20px;
    left: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    z-index: 9999;
    box-shadow: 0 0 0 100vmax rgba(0,0,0,0.9);
    background: #050505;
    border: 1px solid var(--accent-color);
}

.widget-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.03);
}

.widget-title {
    font-family: inherit; font-size: 0.75rem; color: #888;
    font-weight: 700; letter-spacing: 1px;
}

.btn-expand {
    background: transparent; border: 1px solid #333; color: #888;
    cursor: pointer; padding: 4px 8px; font-family: inherit;
    font-size: 0.7rem; transition: 0.2s;
}
.btn-expand:hover { color: var(--accent-color); border-color: var(--accent-color); }

#graph-view {
    flex: 1; width: 100%; height: 100%;
    background: rgba(20, 20, 20, 0.5);
    overflow: hidden; cursor: grab; position: relative;
}
#graph-view:active { cursor: grabbing; }

.widget-footer {
    padding: 5px 10px; border-top: 1px solid var(--border-color);
    font-size: 0.6rem; color: #555; text-align: center;
    background: rgba(0,0,0,0.4);
}

svg { display: block; width: 100%; height: 100%; }

.node circle.dot {
    fill: var(--node-grey); 
    stroke: var(--bg-color); 
    stroke-width: 1.5px;
    transition: all 0.2s ease;
}

.node:hover circle.dot {
    fill: var(--accent-color);
    stroke: #fff;
    filter: drop-shadow(0 0 5px var(--accent-color));
}

.node circle.hit-area {
    fill: transparent;
    stroke: none;
    cursor: pointer;
}

.node text {
    font-family: inherit;
    fill: #777;
    pointer-events: none;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
}
.node:hover text { fill: #fff; }

.link { stroke: #444; stroke-opacity: 0.4; stroke-width: 1px; transition: stroke-width 0.3s; }


.game-selector {
    position: relative; width: 100%; text-align: center; margin-bottom: 15px; z-index: 50;
    border-bottom: 1px solid #222; padding-bottom: 10px;
}
.current-game { font-size: 1.2rem; color: #ffffff; font-weight: 700; letter-spacing: 2px; cursor: pointer; }
.current-game::after { content: ' ▼'; font-size: 0.8em; opacity: 0.7; color: #fff; }
.game-options {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    background: #000; border: 1px solid #333; width: 100%;
}
.game-selector:hover .game-options { display: block; }
.option { padding: 10px; color: #888; cursor: pointer; }
.option:hover { background: #111; color: #fff; }

.game-container-wrapper { width: 100%; display: flex; flex-direction: column; align-items: center; }

.game-board-wrapper {
    position: relative; margin: 0 auto 15px auto;
    border: 1px solid #333; background-color: rgba(0, 0, 0, 0.5); overflow: hidden;
}
.tetris-size { width: 240px; height: 400px; }
.chess-size { width: 240px; height: 240px; }

#tetris-container { display: block; width: 100%; }
canvas#tetris { display: block; width: 100%; height: 100%; }

#chess-container { display: none; width: 100%; }
#board {
    width: 100%; height: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}

.square {
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    position: relative;
}
.square.light { background-color: rgba(255, 255, 255, 0.1); }
.square.dark { background-color: transparent; }
.square.selected { background-color: rgba(0, 255, 196, 0.2) !important; }
.square.highlight { background-color: rgba(0, 255, 196, 0.1) !important; }

.piece { 
    font-size: 18px; position: relative; z-index: 5; 
    cursor: pointer; user-select: none; line-height: 1;
    display: flex; justify-content: center; align-items: center; 
}
.piece.white { color: #fff; }
.piece.black { color: #888; text-shadow: 0 0 2px #000; }

.chess-hint-dot { 
    width: 6px; height: 6px; background: rgba(150, 150, 150, 0.6); 
    border-radius: 50%; position: absolute; 
    top: 50%; left: 50%; transform: translate(-50%, -50%); 
    pointer-events: none; z-index: 4;
}

.chess-info { width: 240px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
#pgn {
    height: 60px; font-size: 0.7rem; color: var(--accent-color); border: 1px solid #333; 
    padding: 5px; background: #050505; font-family: monospace;
}
.chess-controls { display: flex; gap: 5px; }
.btn {
    background: #111; border: 1px solid #333; color: #ccc;
    padding: 5px; flex: 1; font-size: 0.7rem; cursor: pointer;
}
.btn:hover { border-color: var(--accent-color); color: var(--accent-color); }

.transparent-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: transparent; z-index: 30; display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 15px;
}
.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(2px);
    z-index: 30; display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 15px;
}
.overlay-btn { 
    border: 1px solid var(--accent-color); color: var(--accent-color); 
    padding: 8px 16px; background: transparent; cursor: pointer; font-family: inherit;
    font-weight: bold; letter-spacing: 1px; transition: 0.2s;
}
.overlay-btn:hover { background: var(--accent-color); color: #000; }

.ui-panel { display: flex; justify-content: space-around; margin-bottom: 10px; }
.label { font-size: 0.6rem; color: #888; display: block; }
.value { font-size: 1.2rem; color: #fff; }
.instructions { font-size: 0.65rem; color: #666; text-align: center; }

.contact-widget { width: 100%; display: flex; flex-direction: column; gap: 10px; position: relative; }
.contact-widget input {
    background: transparent; border: none; border-bottom: 1px solid #333;
    padding: 8px 0; color: #fff; font-family: inherit; outline: none;
}
.contact-widget input:focus { border-bottom-color: var(--accent-color); }

.message-container {
    position: relative; width: 100%; height: 100px;
    border: 1px solid #333; background: #080808; margin-top: 5px;
}
.message-container textarea {
    width: 100%; height: 100%; background: transparent; border: none;
    resize: none; padding: 10px; color: #fff; font-family: inherit; outline: none;
}
.send-mini-btn {
    position: absolute; bottom: 5px; right: 5px;
    background: #111; border: 1px solid #333; color: #888;
    padding: 4px 10px; font-size: 0.7rem; cursor: pointer; transition: 0.2s;
}
.send-mini-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
.send-mini-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sent-overlay {
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); border: 1px solid #000000;
    flex-direction: column; justify-content: center; align-items: center; z-index: 50;
    padding: 20px; text-align: center;
}

@media (max-width: 900px) {
    .main-site-container { flex-direction: column; }
    .profile-content { order: 2; padding-bottom: 100px; }
    .sidebar { order: 1; width: 100%; max-width: 100%; align-self: center; }
    .map-panel-container { height: 350px; }
}

.node.dimmed, .link.dimmed {
    opacity: 0.1;
    filter: grayscale(100%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.node.active circle.dot {
    fill: var(--accent-color);
    stroke: #fff;
    filter: drop-shadow(0 0 8px var(--accent-color));
}

.node.active text {
    fill: #fff;
    font-weight: 700;
}

.link.active {
    stroke: var(--accent-color);
    stroke-opacity: 0.8;
    stroke-width: 1.5px;
}

.node.fixed circle.dot {
    stroke: var(--accent-color);
    stroke-width: 2px;
    fill: #222; 
}