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

body {
    background: #f5f3ef;
    color: #1a1a1a;
    font-family: 'Space Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background sketches */
.bg-sketches {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-sketch {
    position: absolute;
    opacity: 0.08;
    filter: grayscale(100%);
}

.bg-sketch.s1 {
    top: 5%;
    left: -5%;
    width: 350px;
    transform: rotate(-8deg);
}

.bg-sketch.s2 {
    top: 15%;
    right: -3%;
    width: 300px;
    transform: rotate(5deg);
}

.bg-sketch.s3 {
    bottom: 10%;
    left: 2%;
    width: 280px;
    transform: rotate(3deg) scaleX(-1);
}

main {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
}

h1 {
    font-family: 'Caveat', cursive;
    font-size: clamp(4rem, 15vw, 9rem);
    font-weight: 700;
    color: #2a2a2a;
    margin-bottom: 2rem;
    line-height: 0.9;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0.1em;
    left: -5%;
    width: 110%;
    height: 0.15em;
    background: #e8c547;
    z-index: -1;
    transform: rotate(-1deg);
}

.main-art {
    position: relative;
    margin-bottom: 2rem;
    display: inline-block;
}

.main-art img {
    width: 100%;
    max-width: 750px;
    border: 3px solid #2a2a2a;
    box-shadow: 8px 8px 0 #2a2a2a;
    background: #fff;
}

.ticker {
    font-family: 'Caveat', cursive;
    font-size: 4rem;
    font-weight: 700;
    color: #2a2a2a;
    margin: 2rem 0;
    letter-spacing: 0.05em;
}

.ca {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    border: 2px dashed #888;
    background: rgba(255,255,255,0.9);
}

.ca code {
    font-size: 0.75rem;
    color: #444;
    word-break: break-all;
}

.ca button {
    background: #2a2a2a;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.ca button:hover {
    transform: rotate(-2deg) scale(1.05);
}

.artist-credit {
    display: inline-block;
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #1a8cd8;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid #1a8cd8;
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.8);
    transition: all 0.2s;
}

.artist-credit:hover {
    background: #1a8cd8;
    color: #fff;
}

/* Meme Generator */
.meme-generator {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255,255,255,0.95);
    border: 3px solid #2a2a2a;
    box-shadow: 6px 6px 0 #2a2a2a;
}

.meme-generator h2 {
    font-family: 'Caveat', cursive;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.meme-generator p {
    color: #666;
    margin-bottom: 1.5rem;
}

.generator-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.upload-btn {
    background: #e8c547;
    color: #2a2a2a;
    padding: 0.75rem 1.5rem;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    cursor: pointer;
    border: 2px solid #2a2a2a;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: #d4b13d;
    transform: rotate(-1deg);
}

.download-btn {
    background: #2a2a2a;
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    cursor: pointer;
    border: 2px solid #2a2a2a;
    transition: all 0.2s;
}

.download-btn:hover:not(:disabled) {
    background: #444;
    transform: rotate(1deg);
}

.download-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tile-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.8);
    border: 2px solid #ccc;
    user-select: none;
}

.tile-toggle input {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.canvas-container {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

#memeCanvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #ccc;
}

.site-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed #ccc;
}

.site-footer p {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: #555;
}

.site-footer a {
    color: #1a8cd8;
    text-decoration: none;
    font-weight: 700;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    main {
        padding: 2rem 1rem;
    }
    
    .ca {
        flex-direction: column;
    }
    
    .bg-sketch {
        opacity: 0.05;
    }
    
    .bg-sketch.s1, .bg-sketch.s3 {
        display: none;
    }

    .meme-generator {
        padding: 1.5rem 1rem;
    }

    .generator-controls {
        flex-direction: column;
        align-items: center;
    }
}
