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

body {
    background: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Arial', sans-serif;
}

#gameCanvas {
    display: block;
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

#menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    z-index: 10;
}

#menu h1 {
    font-size: 72px;
    color: #FF3333;
    text-shadow:
        0 0 30px rgba(255, 0, 0, 0.5),
        0 4px 0 #880000,
        0 5px 0 #660000;
    letter-spacing: 10px;
    margin-bottom: 50px;
    font-family: 'Impact', 'Arial Black', sans-serif;
}

#diff-label {
    color: #FF8844;
    font-size: 22px;
    letter-spacing: 4px;
    margin-bottom: 18px;
    font-family: 'Impact', 'Arial Black', sans-serif;
}

#diff-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.diff-btn {
    padding: 14px 36px;
    font-size: 24px;
    background: linear-gradient(180deg, #444, #222);
    color: #FFF;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 3px;
    font-weight: bold;
    font-family: 'Impact', 'Arial Black', sans-serif;
    transition: all 0.2s;
    outline: none;
}

.diff-btn:active {
    transform: scale(0.95);
}

.diff-btn[data-diff="easy"] {
    border-color: #44CC44;
    color: #44CC44;
}
.diff-btn[data-diff="easy"]:hover {
    background: linear-gradient(180deg, #44CC44, #228822);
    color: #000;
    box-shadow: 0 0 20px rgba(68, 204, 68, 0.5);
    transform: scale(1.08);
}

.diff-btn[data-diff="medium"] {
    border-color: #CCCC44;
    color: #CCCC44;
}
.diff-btn[data-diff="medium"]:hover {
    background: linear-gradient(180deg, #CCCC44, #888822);
    color: #000;
    box-shadow: 0 0 20px rgba(204, 204, 68, 0.5);
    transform: scale(1.08);
}

.diff-btn[data-diff="hard"] {
    border-color: #CC4444;
    color: #CC4444;
}
.diff-btn[data-diff="hard"]:hover {
    background: linear-gradient(180deg, #CC4444, #882222);
    color: #FFF;
    box-shadow: 0 0 20px rgba(204, 68, 68, 0.5);
    transform: scale(1.08);
}

#controls-info {
    margin-top: 50px;
    color: #999;
    text-align: center;
}

#controls-info h3 {
    color: #FF6666;
    margin-bottom: 12px;
    font-size: 20px;
    letter-spacing: 3px;
}

#controls-info p {
    margin: 6px 0;
    font-size: 16px;
    letter-spacing: 1px;
}

.hidden {
    display: none !important;
}

/* ============================================================
   FULLSCREEN BUTTON
   ============================================================ */
#fs-btn {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 25;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(0,0,0,0.45);
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

#fs-btn:hover {
    background: rgba(0,0,0,0.7);
    color: #FFF;
}

/* ============================================================
   MOBILE TOUCH CONTROLS
   ============================================================ */
#touch-controls {
    display: none;                      /* hidden by default; shown via JS on touch devices */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    padding: 10px 20px 20px;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 20;
    pointer-events: none;              /* let taps pass through the container gap */
    -webkit-user-select: none;
    user-select: none;
}

#touch-controls.visible {
    display: flex;
}

/* ---- D-Pad (left side) ---- */
#dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
}

.dpad-mid {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dpad-center {
    width: 48px;
    height: 48px;
}

.dpad-btn {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dpad-btn:active, .dpad-btn.pressed {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.6);
    color: #FFF;
}

/* ---- Action buttons (right side) ---- */
#action-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    pointer-events: auto;
}

.action-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Impact', 'Arial Black', sans-serif;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* A = Punch (blue) */
.action-btn[data-action="a"] {
    background: rgba(34,85,204,0.3);
    border-color: rgba(68,130,255,0.6);
    color: #6EB5FF;
}
.action-btn[data-action="a"]:active,
.action-btn[data-action="a"].pressed {
    background: rgba(34,85,204,0.6);
    color: #FFF;
}

/* B = Kick (green) */
.action-btn[data-action="b"] {
    background: rgba(34,160,34,0.3);
    border-color: rgba(68,204,68,0.6);
    color: #6EDD6E;
}
.action-btn[data-action="b"]:active,
.action-btn[data-action="b"].pressed {
    background: rgba(34,160,34,0.6);
    color: #FFF;
}

/* C = Power (orange) */
.action-btn[data-action="c"] {
    background: rgba(204,100,0,0.3);
    border-color: rgba(255,150,50,0.6);
    color: #FFB855;
}
.action-btn[data-action="c"]:active,
.action-btn[data-action="c"].pressed {
    background: rgba(204,100,0,0.6);
    color: #FFF;
}

/* ---- Responsive scaling for small phones ---- */
@media (max-width: 480px) {
    #touch-controls { height: 150px; padding: 8px 12px 14px; }
    .dpad-btn { width: 44px; height: 44px; font-size: 18px; }
    .dpad-center { width: 40px; height: 40px; }
    .action-btn { width: 50px; height: 50px; font-size: 16px; }
}

@media (max-height: 400px) {
    #touch-controls { height: 130px; padding: 6px 12px 10px; }
    .dpad-btn { width: 38px; height: 38px; font-size: 16px; }
    .dpad-center { width: 34px; height: 34px; }
    .action-btn { width: 44px; height: 44px; font-size: 14px; }
}
