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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #00ff00;
    min-height: 100vh; /* Fallback for older browsers */
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    padding: 20px;
    padding: max(10px, 4vw);
    -webkit-tap-highlight-color: rgba(0, 255, 0, 0.3);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.project-container {
    max-width: 1200px;
    margin: 0 auto;
}

.project-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #00ff00;
    padding-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

.back-link {
    display: inline-block;
    color: #00ff00;
    text-decoration: none;
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    margin-bottom: 15px;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 15px);
    border: 1px solid #00ff00;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px #00ff00;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 255, 0, 0.3);
}

.back-link:hover {
    background-color: #00ff00;
    color: #000;
    box-shadow: 0 0 15px #00ff00;
    transform: translateX(-5px);
}

.project-title {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: clamp(2rem, 5vw, 3rem);
    color: #00ff00;
    text-shadow:
        0 0 10px #00ff00,
        0 0 20px #00ff00;
    letter-spacing: 0.1em;
}

.project-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sketch-wrapper {
    position: relative;
    width: 100%;
}

.sketch-container {
    width: 100%;
    background: #000;
    border: 3px solid #00ff00;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
    padding: 20px;
    padding: max(10px, 3vw);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    min-height: clamp(300px, 60vh, 500px);
    position: relative;
}

.sketch-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Fullscreen styles */
.sketch-container:fullscreen {
    padding: 0;
    border: none;
    box-shadow: none;
    background: #000;
}

.sketch-container:-webkit-full-screen {
    padding: 0;
    border: none;
    box-shadow: none;
    background: #000;
}

.sketch-container:-ms-fullscreen {
    padding: 0;
    border: none;
    box-shadow: none;
    background: #000;
}

.sketch-container:fullscreen .fullscreen-btn,
.sketch-container:-webkit-full-screen .fullscreen-btn,
.sketch-container:-ms-fullscreen .fullscreen-btn {
    top: 20px;
    right: 20px;
}

.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    top: max(10px, 2vw);
    right: max(10px, 2vw);
    background: rgba(0, 255, 0, 0.2);
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px;
    padding: clamp(8px, 2vw, 12px);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 255, 0, 0.3);
}

.fullscreen-btn:hover {
    background: rgba(0, 255, 0, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
    transform: scale(1.1);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn svg {
    width: 24px;
    height: 24px;
}

.project-info {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ff00;
    padding: 25px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.project-info h2 {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 1.2rem;
    color: #00ff00;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #00ff00;
}

.project-info p {
    font-size: clamp(0.9rem, 3vw, 1rem);
    line-height: 1.6;
    color: #00ff00;
    opacity: 0.9;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .project-container {
        width: 100%;
    }

    .project-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .project-main {
        gap: 20px;
        gap: clamp(15px, 4vw, 20px);
    }

    .sketch-container {
        padding: 10px;
        padding: max(8px, 2vw);
        min-height: clamp(250px, 50vh, 400px);
        border-width: 2px;
    }

    .project-info {
        padding: 20px;
        padding: clamp(15px, 4vw, 20px);
    }

    .project-info h2 {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
        margin-bottom: 12px;
    }

    .project-info h3 {
        font-size: clamp(0.8rem, 3vw, 1rem);
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .project-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .project-title {
        font-size: clamp(1.2rem, 6vw, 2rem);
    }

    .back-link {
        font-size: 0.8rem;
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .sketch-container {
        padding: 8px;
        min-height: clamp(200px, 45vh, 300px);
    }

    .fullscreen-btn {
        padding: 8px;
        top: 8px;
        right: 8px;
    }

    .fullscreen-btn svg {
        width: 20px;
        height: 20px;
    }

    .project-info {
        padding: 15px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .back-link {
        min-height: 44px;
        min-width: 44px;
    }

    .fullscreen-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .back-link:active {
        transform: scale(0.95);
    }

    .fullscreen-btn:active {
        transform: scale(0.9);
    }
}
