* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #e5e5e5;
    font-family: 'Courier New', Courier, monospace;
    color: #111;
    touch-action: none; 
    overscroll-behavior: none;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(229, 229, 229, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-box {
    background: #fff;
    border: 2px solid #111;
    width: 90%;
    max-width: 450px;
    box-shadow: 8px 8px 0px #111;
}

.modal-header {
    background: #ff5000;
    color: #fff;
    font-weight: bold;
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 2px solid #111;
    letter-spacing: 1px;
}

.modal-body {
    padding: 20px;
    font-size: 13px;
    line-height: 1.6;
}

.instructions {
    margin-top: 15px;
    background: #f4f4f4;
    padding: 15px;
    border: 1px solid #ddd;
    color: #333;
    font-size: 12px;
}

.te-btn {
    width: 100%;
    background: #111;
    color: #fff;
    border: none;
    border-top: 2px solid #111;
    padding: 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.te-btn:hover {
    background: #ff5000;
}

.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 280px;
    background: #fff;
    border: 2px solid #111;
    box-shadow: 4px 4px 0px #111;
    pointer-events: auto;
    z-index: 10;
}

.hud-title {
    background: #111;
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.hud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 2px solid #111;
}

.hud-cell {
    padding: 10px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-cell:last-child {
    border-right: none;
}

.hud-cell .label {
    font-size: 10px;
    color: #888;
    margin-bottom: 4px;
}

.hud-cell .val {
    font-size: 14px;
    font-weight: bold;
    color: #111;
}

.hud-footer {
    padding: 8px 12px;
    font-size: 10px;
    background: #f4f4f4;
}

.hud-footer a {
    color: #ff5000;
    text-decoration: none;
    font-weight: bold;
}

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

/* mobile specific optimizations */
@media (max-width: 768px) {
    .modal-box {
        max-height: 90vh;
        overflow-y: auto;
    }
    .hud {
        top: auto;
        bottom: 15px;
        left: 5%;
        width: 90%;
        box-shadow: 2px 2px 0px #111;
    }
    .hud-cell {
        padding: 6px;
    }
    .hud-cell .val {
        font-size: 12px;
    }
}