* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #c94060;
    overflow: hidden;
    touch-action: none;
    width: 100vw;
    height: 100vh;
}

/* ── Portrait rotate overlay ─────────────────────────── */
#rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #ffb3c6 0%, #ee5d75 50%, #c94060 100%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#rotate-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 28px;
    backdrop-filter: blur(10px);
}

#rotate-icon {
    font-size: 62px;
    animation: wiggle 1.2s ease-in-out infinite;
}

/* ── CHANGE ROTATE MESSAGE TEXT HERE ── */
#rotate-text {
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    font-family: sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.4;
}

@keyframes wiggle {
    0%,100% { transform: rotate(-15deg); }
    50%      { transform: rotate(15deg); }
}

@media screen and (orientation: portrait) {
    #rotate-overlay { display: flex; }
}

/* ── Game viewport wrapper ───────────────────────────── */
.game-wrap {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ── Game world ──────────────────────────────────────── */
.game {
    height: 100vh;
    width: 2400px;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #ffb3c6 0%, #ee5d75 55%, #c94060 100%);
}

/* ── Ground bricks — only bottom 18% of screen ──────── */
.bricks {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 18vh;
    object-fit: fill;
    z-index: 1;
}

/* ── Platform ────────────────────────────────────────── */
.platform4 {
    width: 700px;
    height: 70px;
    position: absolute;
    /* placed by JS */
    image-rendering: pixelated;
    z-index: 2;
}

/* ── Player ──────────────────────────────────────────── */
.player {
    height: 140px;
    position: absolute;
    /* left/bottom placed by JS */
    transform: scaleX(1);
    image-rendering: pixelated;
    z-index: 5;        /* above clouds */
}

/* ── Popup ───────────────────────────────────────────── */
#birthday-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9998;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.popup-card {
    position: relative;
    animation: zoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-img {
    max-width: 94vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: block;
}

.popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #c94060;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10000;
}

@keyframes zoomIn {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Mobile buttons ──────────────────────────────────── */
.game-btn {
    position: fixed;
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    z-index: 1000;
    background: transparent;
    border: none;
    transition: transform 0.08s ease, opacity 0.08s ease;
}

.game-btn:active,
.game-btn.pressed {
    transform: scale(0.85);
    opacity: 0.7;
}

.game-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    pointer-events: none;
}

#btn-left  { bottom: 18px; left: 16px;  }
#btn-right { bottom: 18px; left: 108px; }
#btn-jump  { bottom: 18px; right: 16px; }