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

:root {
    --primary: #7cb342;
    --primary-dark: #558b2f;
    --secondary: #4fc3f7;
    --dark: #2d3436;
    --light: #f5f5f5;
    --white: #ffffff;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--dark) 0%, #1a1a2e 100%);
    color: var(--white);
    padding: 60px 20px;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-photo {
    flex-shrink: 0;
}

.profile-photo img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.profile-info {
    text-align: center;
}

.profile-info h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.profile-info .title {
    font-size: 1.5rem;
    color: var(--primary);
    font-style: italic;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.social-links svg {
    width: 24px;
    height: 24px;
}

.tetris-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    font-weight: 600;
}

/* Main Content */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

section {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

section h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

/* About */
.about p {
    font-size: 1.1rem;
    color: #555;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -36px;
    top: 5px;
    width: 15px;
    height: 15px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.timeline-content h3 {
    color: var(--dark);
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.timeline-content .period {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.timeline-content .role {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-content p:last-child {
    color: #666;
}

/* Education */
.education-item h3 {
    color: var(--dark);
    font-size: 1.3rem;
}

.education-item p {
    color: #666;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.skill-category h3 {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.skill-tag:hover {
    transform: scale(1.05);
}

/* Contact */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: var(--light);
    border-radius: 10px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateX(5px);
}

.contact-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: var(--dark);
    color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-info h1 {
        font-size: 2rem;
    }

    .profile-info .title {
        font-size: 1.2rem;
    }

    .profile-photo img {
        width: 140px;
        height: 140px;
    }

    section {
        padding: 20px;
    }

    .timeline {
        padding-left: 25px;
    }

    .timeline-marker {
        left: -31px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    padding: 25px;
    position: relative;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.game-board {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 8px;
}

#tetris {
    display: block;
    border: 2px solid var(--primary);
    border-radius: 4px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-box {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    color: #fff;
}

.info-box h3 {
    color: var(--primary);
    font-size: 0.75rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.info-box .value {
    font-size: 1.5rem;
    font-weight: 700;
}

#next-piece {
    border: 2px solid var(--secondary);
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-buttons button {
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s;
}

.game-buttons button:hover {
    transform: translateY(-2px);
}

#start-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

#pause-btn {
    background: linear-gradient(135deg, var(--secondary), #0288d1);
    color: white;
}

.controls-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-top: 15px;
}

.game-over-msg {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--primary);
    color: #fff;
}

.game-over-msg.active {
    display: block;
}

.game-over-msg h3 {
    color: #ff6b6b;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.game-over-msg button {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.save-score {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.save-score input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.save-score input::placeholder {
    color: rgba(255,255,255,0.5);
}

.save-score button {
    margin: 0;
    padding: 8px 15px;
    font-size: 0.85rem;
}

.ranking-box {
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.ranking-box h3 {
    color: var(--primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
}

.ranking-box ol {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #fff;
    font-size: 0.85rem;
}

.ranking-box li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ranking-box li:last-child {
    border-bottom: none;
}

.ranking-box .rank-pos {
    color: var(--secondary);
    font-weight: 600;
    width: 25px;
}

.ranking-box .rank-name {
    flex: 1;
}

.ranking-box .rank-score {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 500px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .side-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}
