@font-face {
    font-family: 'PublicPixel';
    src: url('../fonts/PublicPixel.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    background-color: #1a1a2e;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    margin: 0;
    padding: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#siteCredit {
    margin-top: 14px;
    font-family: 'PublicPixel', 'VT323', monospace;
    font-size: 26px;
    color: #88BBFF;
    text-decoration: none;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(85, 136, 204, 0.5);
    opacity: 0.9;
    transition: opacity 0.2s, color 0.2s;
}

#siteCredit:hover {
    opacity: 1;
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

#mobileControls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

#mobileControls button {
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    color: #FFF;
    font-size: 28px;
    width: 70px;
    height: 70px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

#mobileControls button:active {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.6);
}

.dpad {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: grid;
    grid-template-columns: 70px 70px 70px;
    grid-template-rows: 70px 70px 70px;
    gap: 4px;
    direction: ltr;
}

.dpad button:nth-child(1) { grid-column: 2; grid-row: 1; }
.dpad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.dpad button:nth-child(3) { grid-column: 3; grid-row: 2; }
.dpad button:nth-child(4) { grid-column: 2; grid-row: 3; }

.action-buttons {
    position: fixed;
    bottom: 30px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.action-buttons button {
    width: 70px;
    height: 50px;
    font-size: 16px;
}

.action-buttons .btn-enter {
    width: 80px;
    height: 60px;
    background: rgba(50,150,50,0.3);
    border-color: rgba(100,255,100,0.4);
    font-size: 14px;
}

.action-buttons .btn-esc {
    width: 55px;
    height: 40px;
    background: rgba(150,50,50,0.2);
    border-color: rgba(255,100,100,0.3);
    font-size: 12px;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    #mobileMsg { display: flex !important; }
    #gameCanvas { display: none !important; }
}

/* Mobile - portrait friendly */
@media (max-width: 900px) {
    #gameCanvas { width: 100vw !important; height: 60vh !important; }
    .dpad { bottom: 10px; left: 15px; }
    .action-buttons { bottom: 20px; right: 15px; }
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    background-color: #58A828;
    border: 4px solid #333;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 10px rgba(100, 100, 150, 0.3);
}
