@font-face {
    font-family: 'TrimMono-Regular';
    src: url('/assets/fonts/TrimMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TrimPoster-Regular';
    src: url('/assets/fonts/TrimPoster-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Basic mobile-friendly styles */
html,
body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on mobile */
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    margin-top: 0;
}

/* Loading screen styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #121212;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
    padding-top: 50px;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.loading-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: #f5f5f5;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.loading-bar-container {
    width: 100%;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    border-radius: 10px;
    transition: width 0.3s ease-out;
}

.loading-text {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 20px;
}

.loading-asset-name {
    font-size: 14px;
    color: #999;
    height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #4b6cb7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Simple media query for small devices */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: 0;
    }

    #game-container {
        border-radius: 0;
        /* Remove border radius on small screens */
        margin-top: 0;
    }

    canvas {
        margin-top: 0;
    }

    #loading-screen {
        padding-top: 20px;
    }

    .loading-title {
        font-size: 20px;
    }
}

/* Media query for portrait mobile phones */
@media (max-width: 767px) and (orientation: portrait) {
    body {
        padding-top: 0;
        margin-top: 0;
    }

    #game-container {
        margin-top: 0;
    }

    canvas {
        margin-top: 0;
    }
}

/* Additional mobile tweaks */
@media (max-height: 700px) {
    #loading-screen {
        padding-top: 10px;
    }

    .loading-title {
        margin-bottom: 15px;
    }

    .loading-container {
        margin-top: 0;
    }
}

/* Phaser specific canvas styles */
#game-container>canvas {
    margin-top: 0 !important;
}

/* Target phaser's canvas container */
.game-canvas-container {
    margin-top: 0 !important;
}

/* Target any centering elements Phaser might add */
#game-container>div {
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-items: flex-start !important;
}