body {
    background: #f5f4ef;
    color: #1a1a1a;
    font-family: "Crimson Text", serif;
    margin: 0;
    overflow: hidden;
}

/* Add grain texture matching main site */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-canvas {
    display: block;
    cursor: crosshair;
}

.ui-overlay {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.8rem 2rem;
    border: 1px solid rgba(26, 26, 26, 0.1);
    border-radius: 50px; /* Pill shape */
    text-align: center;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9rem;
    color: #4a4a4a;
}

.timer {
    font-weight: bold;
    color: #1a1a1a;
    min-width: 60px;
    text-align: left;
}

.back-link {
    position: absolute;
    top: 30px;
    left: 30px;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid rgba(26,26,26,0.1);
    border-radius: 8px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    background: #fff;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    text-align: center;
    z-index: 100;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    display: none;
    min-width: 320px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.visible {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal h2 {
    font-family: "Crimson Text", serif;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    text-align: left;
}

.contact-list li {
    padding: 0.8rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.contact-list li:last-child {
    border-bottom: none;
}

.contact-list a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
}

.contact-list a:hover {
    text-decoration: underline;
}

.modal button {
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: "IBM Plex Mono", monospace;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.modal button:hover {
    opacity: 0.9;
}

.find-me-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    pointer-events: none;
    padding: 0 20px 1.25rem;
    text-align: center;
}

.find-me-footer .site-footer-quote {
    margin: 0;
    opacity: 0.45;
    font-size: 0.8rem;
    font-style: italic;
    font-family: "Crimson Text", serif;
}

.find-me-footer .site-footer-marginalia {
    margin-top: 0.5rem;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.58rem;
    opacity: 0.28;
    line-height: 1.45;
}

@media (max-width: 600px) {
    .back-link {
        top: 14px;
        left: 14px;
        padding: 0.45rem 0.75rem;
        font-size: 0.72rem;
    }

    .ui-overlay {
        top: auto;
        bottom: max(18px, env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 28px);
        max-width: 22rem;
        padding: 0.55rem 1rem;
        gap: 0.75rem;
        font-size: 0.72rem;
        justify-content: center;
        border-radius: 999px;
    }

    .timer {
        min-width: 52px;
        font-size: 0.72rem;
    }

    .modal {
        min-width: 0;
        width: calc(100% - 28px);
        max-width: 20rem;
        padding: 1.5rem 1.25rem;
    }

    .modal h2 {
        font-size: 1.5rem;
    }

    .find-me-footer {
        padding: 0 14px max(1rem, env(safe-area-inset-bottom));
    }

    .find-me-footer .site-footer-marginalia {
        font-size: 0.5rem;
        overflow-wrap: anywhere;
    }
}
