body{
  background-color: #f9f9f9 ;
    overflow-x: hidden;
}

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


img {
    display: none;
}

#main-container {
    background-color: #e8e8e8 ;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas-container {
    display: block;
    position: relative;
    height: 90%; /* default */
    width: auto;  /* default */
}

/* When height > width (portrait) */
@media (max-aspect-ratio: 1/1) {
    #canvas-container {
        width: 90%;
        height: auto;
    }
}

/* When width >= height (landscape) */
@media (min-aspect-ratio: 1/1) {
    #canvas-container {
        height: 90%;
        width: auto;
    }
}

canvas {
    display: block;
    max-height: 100%;
    max-width: 100%;
}

/* Loading screen overlay — only covers canvas */
#loading-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-family: 'Helvetica Neue', sans-serif;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #ddd;
    border-top: 4px solid #555;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-size: 1.1rem;
    color: #444;
    letter-spacing: 1px;
}

.dots::after {
    content: '';
    display: inline-block;
    animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}






#touch-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    pointer-events: none; /* let clicks pass through except buttons */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 10px;
    user-select: none;
    z-index: 1000;
}

.touch-zone {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 60px;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
    margin: 0 5px;

    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}

/* Jump button on bottom left */
#touch-jump {
    order: 1;
}

/* Container for left/right buttons on bottom right */
#move-buttons {
    order: 2;
    display: flex;
    pointer-events: auto;
}

/* Smaller margin between left and right */
#touch-left, #touch-right {
    font-size: 60px;
    width: 100px;
    height: 100px;
}
#touch-left{
    margin-right: 40px;
}

/* Highlight when active */
.touch-zone.active {
    background: rgba(255, 255, 255, 0.7);
    color: black;
}


