@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

* {
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body {
    margin: 40px;
    background: linear-gradient(
        45deg,
        #ff006e 0%,
        #8338ec 12.5%,
        #3a86ff 25%,
        #06ffa5 37.5%,
        #ffbe0b 50%,
        #fb5607 62.5%,
        #ff006e 75%,
        #c77dff 87.5%,
        #7209b7 100%
    );
    background-size: 800% 800%;
    animation: rainbowShift 6s ease infinite;
    color: #fff;
    font-family: "Press Start 2P", monospace;
    text-align: center;
    min-height: 100vh;
    padding: 30px 20px 20px 20px;
    line-height: 1.6;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.left-panel,
.right-panel {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: flex-start;
}

.center-panel {
    flex: 0 0 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    align-self: flex-start;
}

.panel-title {
    font-size: 15px;
    margin: 0 0 15px 0;
    text-shadow: 1px 0px 0px #ff006e, 2px 0px 0px #8338ec, 3px 0px 0px #3a86ff;
    animation: pixelBounce 2s infinite;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 2;
}

.game-title {
    font-size: 20px;
    text-shadow: 2px 0px 0px #ff006e, 4px 0px 0px #8338ec, 6px 0px 0px #3a86ff, 8px 0px 0px #06ffa5;
    margin: 0 0 15px 0;
    animation: pixelBounce 1.5s infinite;
    letter-spacing: 1px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.7;
    text-align: center;
    padding: 15px;
}

#levelSystem,
#ranking {
    margin-top: 0;
}

#game {
    margin-top: 0;
}

#info {
    margin-top: 15px;
    font-size: 11px;
    text-shadow: 1px 0px 0px #ff006e, 2px 0px 0px #8338ec, 3px 0px 0px #3a86ff;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 0, 110, 0.3) 0px,
        rgba(255, 0, 110, 0.3) 4px,
        rgba(131, 56, 236, 0.3) 4px,
        rgba(131, 56, 236, 0.3) 8px,
        rgba(58, 134, 255, 0.3) 8px,
        rgba(58, 134, 255, 0.3) 12px,
        rgba(6, 255, 165, 0.3) 12px,
        rgba(6, 255, 165, 0.3) 16px
    );
    padding: 12px 24px;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px #000;
    letter-spacing: 1px;
    animation: infoPulse 2s steps(4) infinite;
    width: 100%;
    line-height: 1.4;
}

.sound-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.sound-btn {
    width: 50px;
    height: 50px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff006e, #8338ec);
    color: #fff;
    font-family: "Press Start 2P", monospace;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
    animation: soundBtnPulse 2s ease-in-out infinite alternate;
}

.sound-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
}

.sound-btn.muted {
    background: linear-gradient(45deg, #666, #999);
    animation: none;
}

@keyframes soundBtnPulse {
    from {
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
    }

    to {
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
    }
}

.collision-effect {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 0, 110, 0.8), rgba(255, 69, 0, 0.6), transparent);
    animation: collisionExplosion 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

@keyframes collisionExplosion {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(3) rotate(360deg);
        opacity: 0;
    }
}

.particle-effect {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ff006e;
    border-radius: 50%;
    animation: particleExplosion 1s ease-out forwards;
    pointer-events: none;
    z-index: 99;
}

@keyframes particleExplosion {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0) translateX(var(--dx)) translateY(var(--dy));
        opacity: 0;
    }
}

.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%,
    100% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(-5px);
    }

    20% {
        transform: translateX(5px);
    }

    30% {
        transform: translateX(-3px);
    }

    40% {
        transform: translateX(3px);
    }

    50% {
        transform: translateX(-2px);
    }

    60% {
        transform: translateX(2px);
    }

    70% {
        transform: translateX(-1px);
    }

    80% {
        transform: translateX(1px);
    }

    90% {
        transform: translateX(-1px);
    }
}

.info-box {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    padding: 12px;
    border-radius: 8px;
    line-height: 2;
    /* margin-bottom: 10px; */
}

.info-box-title {
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 2;
}

.info-box-content {
    font-size: 10px;
    line-height: 2.3;
}

@keyframes rainbowShift {
    0% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 100% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    75% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 50%;
    }
}

h1 {
    font-size: 20px;
    text-shadow: 2px 0px 0px #ff006e, 4px 0px 0px #8338ec, 6px 0px 0px #3a86ff, 8px 0px 0px #06ffa5;
    margin-bottom: 20px;
    animation: pixelBounce 1.5s infinite;
    letter-spacing: 2px;
}

@keyframes pixelBounce {
    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    25% {
        transform: translateY(-8px) scale(1.05);
    }

    50% {
        transform: translateY(-4px) scale(1.02);
    }

    75% {
        transform: translateY(-2px) scale(1.01);
    }
}

#game {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 10px auto;
    border: 8px solid #fff;
    background: repeating-linear-gradient(
        0deg,
        #ff9a8b 0px,
        #ff9a8b 4px,
        #a8e6cf 4px,
        #a8e6cf 8px,
        #ffd93d 8px,
        #ffd93d 12px,
        #74b9ff 12px,
        #74b9ff 16px,
        #fd79a8 16px,
        #fd79a8 20px
    );
    overflow: hidden;
    box-shadow: 0 0 0 4px #000, 0 0 20px rgba(255, 0, 110, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    image-rendering: pixelated;
}

#player {
    position: absolute;
    bottom: 10px;
    width: 30px;
    height: 30px;
    background: linear-gradient(
        45deg,
        #ff006e 0%,
        #ff006e 25%,
        #8338ec 25%,
        #8338ec 50%,
        #3a86ff 50%,
        #3a86ff 75%,
        #06ffa5 75%,
        #06ffa5 100%
    );
    background-size: 8px 8px;
    border: 3px solid #fff;
    left: 0;
    box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 1);
    animation: playerPixelGlow 1s steps(4) infinite;
    image-rendering: pixelated;
}

@keyframes playerPixelGlow {
    0% {
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 1);
        background-position: 0px 0px;
    }

    25% {
        box-shadow: 0 0 0 2px #000, 0 0 20px rgba(131, 56, 236, 1);
        background-position: 2px 2px;
    }

    50% {
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(58, 134, 255, 1);
        background-position: 4px 4px;
    }

    75% {
        box-shadow: 0 0 0 2px #000, 0 0 20px rgba(6, 255, 165, 1);
        background-position: 6px 6px;
    }
}

.box {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    top: 0;
    box-shadow: 0 0 0 2px #000;
    animation: boxPixelSpin 2s steps(8) infinite;
    image-rendering: pixelated;
}

.box:nth-child(odd) {
    background: repeating-conic-gradient(
        from 0deg,
        #ff006e 0deg 45deg,
        #ffbe0b 45deg 90deg,
        #fb5607 90deg 135deg,
        #8338ec 135deg 180deg,
        #3a86ff 180deg 225deg,
        #06ffa5 225deg 270deg,
        #c77dff 270deg 315deg,
        #7209b7 315deg 360deg
    );
}

.box:nth-child(even) {
    background: repeating-linear-gradient(
        45deg,
        #ff006e 0px,
        #ff006e 5px,
        #ffbe0b 5px,
        #ffbe0b 10px,
        #fb5607 10px,
        #fb5607 15px,
        #8338ec 15px,
        #8338ec 20px
    );
}

@keyframes boxPixelSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    12.5% {
        transform: rotate(45deg) scale(1.1);
    }

    25% {
        transform: rotate(90deg) scale(1);
    }

    37.5% {
        transform: rotate(135deg) scale(1.1);
    }

    50% {
        transform: rotate(180deg) scale(1);
    }

    62.5% {
        transform: rotate(225deg) scale(1.1);
    }

    75% {
        transform: rotate(270deg) scale(1);
    }

    87.5% {
        transform: rotate(315deg) scale(1.1);
    }

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

@keyframes boxPixelWobble {
    0% {
        transform: translateX(0px) rotate(0deg);
    }

    16.67% {
        transform: translateX(-4px) rotate(-5deg);
    }

    33.33% {
        transform: translateX(4px) rotate(5deg);
    }

    50% {
        transform: translateX(-2px) rotate(-3deg);
    }

    66.67% {
        transform: translateX(2px) rotate(3deg);
    }

    83.33% {
        transform: translateX(-1px) rotate(-1deg);
    }

    100% {
        transform: translateX(0px) rotate(0deg);
    }
}

@keyframes boxPixelPulse {
    0% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.2) rotate(90deg);
    }

    50% {
        transform: scale(0.8) rotate(180deg);
    }

    75% {
        transform: scale(1.1) rotate(270deg);
    }

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

@keyframes boxPixelShake {
    0% {
        transform: translate(0px, 0px) rotate(0deg);
    }

    12.5% {
        transform: translate(-2px, -2px) rotate(45deg);
    }

    25% {
        transform: translate(2px, -2px) rotate(90deg);
    }

    37.5% {
        transform: translate(-2px, 2px) rotate(135deg);
    }

    50% {
        transform: translate(2px, 2px) rotate(180deg);
    }

    62.5% {
        transform: translate(-2px, -2px) rotate(225deg);
    }

    75% {
        transform: translate(2px, -2px) rotate(270deg);
    }

    87.5% {
        transform: translate(-2px, 2px) rotate(315deg);
    }

    100% {
        transform: translate(0px, 0px) rotate(360deg);
    }
}

#info {
    margin-top: 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.8;
    text-shadow: 2px 0px 0px #ff006e, 4px 0px 0px #8338ec, 6px 0px 0px #3a86ff;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 0, 110, 0.4) 0px,
        rgba(255, 0, 110, 0.4) 4px,
        rgba(131, 56, 236, 0.4) 4px,
        rgba(131, 56, 236, 0.4) 8px,
        rgba(58, 134, 255, 0.4) 8px,
        rgba(58, 134, 255, 0.4) 12px,
        rgba(6, 255, 165, 0.4) 12px,
        rgba(6, 255, 165, 0.4) 16px
    );
    padding: 15px 30px;
    border: 3px solid #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    animation: infoPulse 2s steps(4) infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#info .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

#info .stat-value {
    color: #06ffa5;
    text-shadow: 1px 1px 0px #000, 0 0 10px #06ffa5;
    font-size: 18px;
    min-width: 40px;
    text-align: center;
}

.info-box-content ul {
    display: block;
    list-style-type: disc;
    margin-block-start: 1em;
    margin-block-end: 1em;
    padding-inline-start: 24px;
    unicode-bidi: isolate;
    text-align: left;
}

@keyframes infoPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

#ranking h2 {
    font-size: 12px;
    margin: 0 0 15px 0;
    text-shadow: 1px 0px 0px #ff006e, 2px 0px 0px #8338ec, 3px 0px 0px #3a86ff;
    animation: pixelBounce 2s infinite;
}

#rankingList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 0px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 1px;
    image-rendering: pixelated;
}

.rank-item:nth-child(1) {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 215, 0, 0.3) 0px,
        rgba(255, 215, 0, 0.3) 2px,
        rgba(255, 255, 255, 0.2) 2px,
        rgba(255, 255, 255, 0.2) 4px
    );
    border-color: #ffd700;
    animation: goldGlow 2s ease-in-out infinite alternate;
}

.rank-item:nth-child(2) {
    background: repeating-linear-gradient(
        45deg,
        rgba(192, 192, 192, 0.3) 0px,
        rgba(192, 192, 192, 0.3) 2px,
        rgba(255, 255, 255, 0.2) 2px,
        rgba(255, 255, 255, 0.2) 4px
    );
    border-color: #c0c0c0;
}

.rank-item:nth-child(3) {
    background: repeating-linear-gradient(
        45deg,
        rgba(205, 127, 50, 0.3) 0px,
        rgba(205, 127, 50, 0.3) 2px,
        rgba(255, 255, 255, 0.2) 2px,
        rgba(255, 255, 255, 0.2) 4px
    );
    border-color: #cd7f32;
}

@keyframes goldGlow {
    from {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }

    to {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

.rank-number {
    font-weight: bold;
    min-width: 25px;
    text-align: left;
}

.rank-name {
    flex: 1;
    text-align: center;
    margin: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score {
    font-weight: bold;
    min-width: 60px;
    text-align: right;
    color: #06ffa5;
    text-shadow: 1px 1px 0px #000;
}

#levelSystem {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 215, 0, 0.2) 0px,
        rgba(255, 215, 0, 0.2) 4px,
        rgba(255, 140, 0, 0.2) 4px,
        rgba(255, 140, 0, 0.2) 8px,
        rgba(255, 69, 0, 0.2) 8px,
        rgba(255, 69, 0, 0.2) 12px,
        rgba(255, 20, 147, 0.2) 12px,
        rgba(255, 20, 147, 0.2) 16px
    );
    border: 4px solid #ffd700;
    box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 215, 0, 0.6);
    padding: 15px;
    width: 100%;
    animation: levelGlow 3s ease-in-out infinite alternate;
}

#ranking {
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 0, 110, 0.2) 0px,
        rgba(255, 0, 110, 0.2) 4px,
        rgba(131, 56, 236, 0.2) 4px,
        rgba(131, 56, 236, 0.2) 8px,
        rgba(58, 134, 255, 0.2) 8px,
        rgba(58, 134, 255, 0.2) 12px,
        rgba(6, 255, 165, 0.2) 12px,
        rgba(6, 255, 165, 0.2) 16px
    );
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px #000;
    padding: 15px;
    width: 100%;
}

/* iPad Mini and large tablets - use mobile layout */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 15px 10px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        max-width: 700px;
        width: 100%;
        position: relative;
        margin-top: 70px;
        display: flex;
        justify-content: center;
    }

    .left-panel,
    .right-panel,
    .center-panel {
        max-width: 600px;
        width: 100%;
        margin: 0 auto;
        text-align: center;
    }

    .left-panel,
    .right-panel {
        order: 2;
    }

    .center-panel {
        order: 1;
        padding: 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .left-panel .sound-controls {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: none;
        padding: 0;
        border: none;
        margin: 0;
    }

    #game {
        width: 100%;
        max-width: 550px;
        height: 550px;
        margin: 0 auto;
    }

    .game-title {
        font-size: 22px;
        height: 50px;
        line-height: 1.4;
        padding: 20px;
        text-align: center;
    }

    .panel-title {
        height: 40px;
        line-height: 1.4;
        font-size: 16px;
        text-align: center;
    }

    .sound-controls {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .sound-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .center-panel {
        order: 1;
        padding: 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .controls-info-row {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 500px;
        margin: 20px auto 0 auto;
        gap: 15px;
    }

    #info {
        flex-direction: row;
        gap: 15px;
        font-size: 13px;
        padding: 12px 18px;
        text-align: center;
        flex: 1;
        justify-content: space-around;
        width: max-content;
    }

    #info .stat-item {
        justify-content: center;
        padding: 6px 10px;
        flex-direction: row;
        gap: 4px;
    }

    #info .stat-value {
        font-size: 15px;
    }

    .mobile-controls {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin: 0;
        flex: 1;
        margin-bottom: 20px;
    }

    .touch-btn {
        width: 70px;
        height: 70px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(45deg, #ff006e, #8338ec);
        color: #fff;
        font-family: "Press Start 2P", monospace;
        font-size: 28px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
        user-select: none;
        touch-action: manipulation;
    }

    .touch-btn:active {
        transform: scale(0.95);
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
    }
}

@media (max-width: 1024px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 100vh;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .left-panel,
    .right-panel,
    .center-panel {
        flex: none;
        width: 100%;
        max-width: 500px;
    }

    #game {
        width: 100%;
        max-width: 450px;
        height: 500px;
    }

    .game-title {
        font-size: 16px;
        height: 35px;
        line-height: 1.3;
        text-align: center;
    }

    .panel-title {
        height: 35px;
        line-height: 1.4;
        text-align: center;
    }

    .sound-controls {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .sound-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px 50px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 100vh;
    }

    .game-container {
        gap: 10px;
        max-width: 100%;
        width: 100%;
        position: relative;
        margin-top: 70px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .left-panel,
    .right-panel,
    .center-panel {
        max-width: 100%;
        width: 100%;
    }

    .left-panel,
    .right-panel {
        order: 2;
    }

    .center-panel {
        order: 1;
        padding: 15px;
    }

    .left-panel .sound-controls {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: none;
        padding: 0;
        border: none;
        margin: 0;
    }

    #game {
        width: 100%;
        max-width: 700px;
        height: 500px;
        margin: 0 auto;
    }

    .game-title {
        font-size: 14px;
        line-height: 1.2;
        padding: 10px;
        text-align: center;
    }

    .panel-title {
        font-size: 12px;
        height: auto;
        line-height: 1.3;
        margin-bottom: 10px;
        margin-top: 20px;
        text-align: center;
    }

    .info-box-content {
        font-size: 10px;
        line-height: 1.6;
    }

    .controls-info-row {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        width: 100%;
        max-width: max-content;
        margin: 20px auto 0 auto;
        gap: 10px;
    }

    #info {
        flex-direction: row;
        gap: 5px;
        font-size: 10px;
        padding: 10px 15px;
        order: 2;
    }

    #info .stat-item {
        justify-content: left;
        padding: 6px 10px;
        max-width: 100%;
    }

    #info .stat-value {
        font-size: 12px;
    }

    .sound-controls {
        gap: 6px;
        margin-top: 10px;
        margin-bottom: 20px;
    }

    .sound-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .mobile-controls {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 10px;
        margin-bottom: 20px;
        order: 1;
    }

    .touch-btn {
        width: 60px;
        height: 60px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(45deg, #ff006e, #8338ec);
        color: #fff;
        font-family: "Press Start 2P", monospace;
        font-size: 24px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
        user-select: none;
        touch-action: manipulation;
    }

    .touch-btn:active {
        transform: scale(0.95);
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
    }
}

@media (min-width: 570px) and (max-width: 768px) {
    .game-title {
        font-size: 16px;
        line-height: 1.4;
        padding: 15px;
        text-align: center;
    }
    .panel-title {
        font-size: 14px;
        height: auto;
        line-height: 1.3;
        margin-bottom: 10px;
        margin-top: 20px;
        text-align: center;
    }
    .info-box-content {
        font-size: 12px;
        line-height: 1.6;
    }

    .controls-info-row {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100%;
        margin-top: 20px; /* Adjusted for better spacing */
    }

    #info {
        flex-direction: row;
        gap: 5px;
        font-size: 10px;
        padding: 10px 15px;
        order: 2;
    }
    #info .stat-item {
        justify-content: left;
        padding: 6px 10px;
        max-width: 100%;
    }
    #info .stat-value {
        font-size: 12px;
    }
    .sound-controls {
        gap: 6px;
        margin-top: 10px;
        margin-bottom: 20px;
    }
    .sound-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ============================== */

@media (min-width: 361px) and (max-width: 569px) {
    body {
        padding: 15px 30px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .game-container {
        gap: 10px;
        max-width: 100%;
        width: 100%;
        position: relative;
        margin-top: 70px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .left-panel,
    .right-panel,
    .center-panel {
        max-width: 100%;
        width: 100%;
    }

    .left-panel,
    .right-panel {
        order: 2;
    }

    .center-panel {
        order: 1;
        padding: 15px;
    }

    .left-panel .sound-controls {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: none;
        padding: 0;
        border: none;
        margin: 0;
    }

    #game {
        width: 100%;
        max-width: 600px;
        height: 500px;
        margin: 0 auto;
    }

    .game-title {
        font-size: 11px;
        line-height: 1.5;
        padding: 10px;
        text-align: center;
    }

    .panel-title {
        font-size: 11px;
        height: auto;
        line-height: 1.3;
        margin-bottom: 10px;
        margin-top: 20px;
        text-align: center;
    }

    .info-box-content {
        font-size: 10px;
        line-height: 1.6;
    }

    .controls-info-row {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: max-content;
        margin-top: 20px; /* Adjusted for better spacing */
    }

    #info {
        flex-direction: column; /* Changed to row for better layout */
        gap: 5px; /* Reduced gap */
        font-size: 10px;
        padding: 10px 15px;
        order: 2;
        margin-top: 10px;
    }
    #info .stat-item {
        justify-content: left;
        padding: 6px 10px;
        max-width: 100%;
    }
    #info .stat-value {
        font-size: 12px;
    }
    .sound-controls {
        gap: 6px;
        margin-top: 10px;
        margin-bottom: 20px;
    }
    .sound-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .mobile-controls {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 10px;
        margin-bottom: 20px;
        order: 1;
    }
    .touch-btn {
        width: 60px;
        height: 60px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(45deg, #ff006e, #8338ec);
        color: #fff;
        font-family: "Press Start 2P", monospace;
        font-size: 24px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
        user-select: none;
        touch-action: manipulation;
    }

    .touch-btn:active {
        transform: scale(0.95);
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
    }
    .info-box {
        padding: 10px;
        margin-bottom: 10px;
    }
    .info-box-content {
        font-size: 10px;
        line-height: 1.6;
    }
    .info-box-title {
        font-size: 12px;
        margin-bottom: 8px;
    }
}

/* ============================= */

/* Very small mobile devices */
@media (max-width: 360px) {
    body {
        padding: 10px 20px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 100vh;
    }

    .game-container {
        gap: 8px;
        max-width: 100%;
        width: 100%;
        position: relative;
        margin-top: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .left-panel .sound-controls {
        position: fixed;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: none;
        padding: 0;
        border: none;
        margin: 0;
    }

    .sound-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    #game {
        width: 100%;
        max-width: 100%;
        height: 350px;
        margin: 0 auto;
    }

    .game-title {
        font-size: 12px;
        line-height: 1.1;
        padding: 8px;
        text-align: center;
    }

    .panel-title {
        font-size: 10px;
        height: auto;
        line-height: 1.2;
        margin-bottom: 8px;
        margin-top: 15px;
        text-align: center;
    }

    .controls-info-row {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: max-content;
        margin: 15px auto 0 auto;
        gap: 8px;
    }

    #info {
        flex-direction: column;
        gap: 4px;
        font-size: 9px;
        padding: 8px 12px;
        order: 2;
    }

    #info .stat-item {
        justify-content: center;
        padding: 4px 8px;
        flex-direction: row;
        gap: 6px;
    }

    #info .stat-value {
        font-size: 11px;
    }

    .info-box {
        margin-bottom: 20px;
    }

    .mobile-controls {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin: 0;
        order: 1;
        margin-bottom: 20px;
    }

    .touch-btn {
        width: 50px;
        height: 50px;
        border: 2px solid #fff;
        border-radius: 50%;
        background: linear-gradient(45deg, #ff006e, #8338ec);
        color: #fff;
        font-family: "Press Start 2P", monospace;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 0 0 1px #000, 0 0 10px rgba(255, 0, 110, 0.6);
        user-select: none;
        touch-action: manipulation;
    }

    .touch-btn:active {
        transform: scale(0.95);
        box-shadow: 0 0 0 1px #000, 0 0 15px rgba(255, 0, 110, 1);
    }

    .info-box {
        padding: 8px;
        margin-bottom: 8px;
    }

    .info-box-content {
        font-size: 8px;
        line-height: 1.4;
    }

    .info-box-title {
        font-size: 10px;
        margin-bottom: 6px;
    }
}

/* Large tablets in landscape mode (iPad Air, iPad Pro, Galaxy Tab, etc.) */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    body {
        padding: 10px;
        background-size: 400% 400%;
        margin: 0 10px;
    }

    /* Use desktop layout structure but scaled down */
    .game-container {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 15px;
        /* max-width: 100vw; */
        width: 100%;
        max-width: max-content;
        margin: 0 auto;
        margin-top: 50px;
        padding: 0 5px;
        transform-origin: top center;
    }

    .left-panel,
    .right-panel {
        flex: 0 0 240px;
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-self: flex-start;
    }

    .center-panel {
        flex: 0 0 350px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        align-self: flex-start;
    }

    .left-panel .sound-controls {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 15px;
        position: static;
        transform: none;
        z-index: auto;
        background: none;
        padding: 0;
        border: none;
    }

    .sound-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(45deg, #ff006e, #8338ec);
        color: #fff;
        font-family: "Press Start 2P", monospace;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
        animation: soundBtnPulse 2s ease-in-out infinite alternate;
    }

    .sound-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
    }

    .sound-btn.muted {
        background: linear-gradient(45deg, #666, #999);
        animation: none;
    }

    #game {
        position: relative;
        width: 450px;
        height: 450px;
        margin: 5px auto;
    }

    .game-title {
        font-size: 16px;
        text-shadow: 2px 0px 0px #ff006e, 4px 0px 0px #8338ec, 6px 0px 0px #3a86ff,
            8px 0px 0px #06ffa5;
        margin: 0 0 10px 0;
        animation: pixelBounce 1.5s infinite;
        letter-spacing: 1px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.5;
        text-align: center;
        padding: 10px;
    }

    .panel-title {
        font-size: 13px;
        margin: 0 0 10px 0;
        text-shadow: 1px 0px 0px #ff006e, 2px 0px 0px #8338ec, 3px 0px 0px #3a86ff;
        animation: pixelBounce 2s infinite;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.8;
    }

    /* Stack info and controls vertically under game */
    .controls-info-row {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin-top: 10px;
        gap: 12px;
    }

    #info {
        flex-direction: row;
        gap: 5px;
        font-size: 14px;
        font-weight: bold;
        line-height: 1.6;
        text-shadow: 2px 0px 0px #ff006e, 4px 0px 0px #8338ec, 6px 0px 0px #3a86ff;
        background: repeating-linear-gradient(
            90deg,
            rgba(255, 0, 110, 0.4) 0px,
            rgba(255, 0, 110, 0.4) 4px,
            rgba(131, 56, 236, 0.4) 4px,
            rgba(131, 56, 236, 0.4) 8px,
            rgba(58, 134, 255, 0.4) 8px,
            rgba(58, 134, 255, 0.4) 12px,
            rgba(6, 255, 165, 0.4) 12px,
            rgba(6, 255, 165, 0.4) 16px
        );
        padding: 12px 20px;
        border: 3px solid #fff;
        border-radius: 8px;
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 255, 255, 0.6);
        letter-spacing: 1px;
        animation: infoPulse 2s steps(4) infinite;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 450px;
        max-width: 450px;
        order: 1;
        margin-bottom: 20px;
    }

    #info .stat-item {
        display: flex;
        align-items: center;
        gap: 6px;
        background: rgba(0, 0, 0, 0.3);
        padding: 6px 10px;
        border-radius: 6px;
        border: 2px solid rgba(255, 255, 255, 0.5);
        width: 100%;
        max-width: 100%;
    }

    #info .stat-value {
        color: #06ffa5;
        text-shadow: 1px 1px 0px #000, 0 0 10px #06ffa5;
        font-size: 16px;
        min-width: 35px;
        text-align: center;
    }

    .mobile-controls {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin: 0;
        width: 100%;
        max-width: 450px;
        order: 2;
    }

    .touch-btn {
        width: 60px;
        height: 60px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(45deg, #ff006e, #8338ec);
        color: #fff;
        font-family: "Press Start 2P", monospace;
        font-size: 24px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.6);
        user-select: none;
        touch-action: manipulation;
    }

    .touch-btn:active {
        transform: scale(0.95);
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
    }

    .info-box {
        padding: 10px;
        margin-bottom: 10px;
    }

    .info-box-content {
        font-size: 9px;
        line-height: 1.5;
    }

    .info-box-title {
        font-size: 11px;
        margin-bottom: 8px;
    }
}

/* Hide mobile controls on desktop only */
@media (min-width: 1367px) {
    .mobile-controls {
        display: none;
    }
}

@keyframes levelGlow {
    from {
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 215, 0, 0.6);
    }

    to {
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 215, 0, 1);
    }
}

#levelInfo {
    margin-bottom: 15px;
}

.level-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    gap: 10px;
}

.level-icon {
    font-size: 20px;
    animation: starTwinkle 2s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.2) rotate(90deg);
    }

    50% {
        transform: scale(1) rotate(180deg);
    }

    75% {
        transform: scale(1.2) rotate(270deg);
    }
}

.level-text {
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 0px 0px #ffd700, 2px 0px 0px #ff8c00, 3px 0px 0px #ff4500;
    animation: levelPulse 2s ease-in-out infinite;
}

@keyframes levelPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.exp-container {
    text-align: center;
}

.exp-label {
    font-size: 12px;
    margin-bottom: 5px;
    color: #ffd700;
    text-shadow: 1px 1px 0px #000;
    line-height: 1.7;
}

#levelBenefits {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.benefit-item {
    font-size: 9px;
    padding: 8px 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 0px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 4px;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 0px #000;
    line-height: 1.4;
}

.exp-bar {
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.3) 0px,
        rgba(0, 0, 0, 0.3) 2px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(255, 255, 255, 0.1) 4px
    );
    border: 2px solid #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.exp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd700, #ff8c00, #ff4500, #ff1493);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.exp-fill::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: expShimmer 2s infinite;
}

@keyframes expShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

#rankingList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 0px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 14px;
    font-size: 10px;
    letter-spacing: 1px;
    image-rendering: pixelated;
    line-height: 1.3;
}

@keyframes levelUpAnimation {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.2) rotate(5deg);
    }

    50% {
        transform: scale(1.1) rotate(-5deg);
    }

    75% {
        transform: scale(1.15) rotate(3deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.level-up {
    animation: levelUpAnimation 1s ease-in-out;
}

.player-shielded {
    box-shadow: 0 0 0 2px #000, 0 0 15px rgba(0, 255, 255, 1), 0 0 25px rgba(0, 255, 255, 0.8),
        0 0 35px rgba(0, 255, 255, 0.6) !important;
    animation: shieldPulse 1s ease-in-out infinite alternate !important;
}

@keyframes shieldPulse {
    from {
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(0, 255, 255, 1), 0 0 25px rgba(0, 255, 255, 0.8),
            0 0 35px rgba(0, 255, 255, 0.6);
    }

    to {
        box-shadow: 0 0 0 2px #000, 0 0 20px rgba(0, 255, 255, 1), 0 0 35px rgba(0, 255, 255, 1),
            0 0 50px rgba(0, 255, 255, 0.8);
    }
}

/* Particle trail animations */
.trail-particle {
    image-rendering: pixelated;
}

@keyframes trailFade {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.8);
    }

    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* Difficulty selector styles */
.difficulty-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.difficulty-btn {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 0px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    color: #fff;
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 0px #000;
    user-select: none;
}

.difficulty-btn:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.difficulty-btn.active {
    background: linear-gradient(45deg, #ff006e, #8338ec);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.6);
    animation: difficultyPulse 2s ease-in-out infinite alternate;
}

@keyframes difficultyPulse {
    from {
        box-shadow: 0 0 15px rgba(255, 0, 110, 0.6);
    }

    to {
        box-shadow: 0 0 25px rgba(255, 0, 110, 1);
    }
}

.difficulty-info {
    text-align: center;
    font-size: 8px;
    line-height: 1.6;
    color: #06ffa5;
    text-shadow: 1px 1px 0px #000;
}

/* Bouncing obstacles special styling */
.bouncing-box {
    border: 3px solid #ff006e !important;
    box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.8) !important;
    animation: bouncingBoxGlow 1s ease-in-out infinite alternate !important;
}

@keyframes bouncingBoxGlow {
    from {
        box-shadow: 0 0 0 2px #000, 0 0 15px rgba(255, 0, 110, 0.8);
        border-color: #ff006e;
    }

    to {
        box-shadow: 0 0 0 2px #000, 0 0 25px rgba(255, 0, 110, 1);
        border-color: #ff4081;
    }
}

/* Score popup animation */
@keyframes scorePopup {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8);
    }
}

/* Scatter effect animations */
.scatter-fragment {
    image-rendering: pixelated;
}

@keyframes scatterFragment {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    20% {
        opacity: 1;
        transform: translate(calc(var(--dx) * 0.3), calc(var(--dy) * 0.3))
            rotate(calc(var(--rotation) * 0.3)) scale(1.1);
    }

    60% {
        opacity: 0.8;
        transform: translate(calc(var(--dx) * 0.8), calc(var(--dy) * 0.8))
            rotate(calc(var(--rotation) * 0.8)) scale(0.9);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) rotate(var(--rotation)) scale(0.3);
    }
}

.scatter-bounce {
    image-rendering: pixelated;
}

@keyframes scatterBounce {
    0% {
        opacity: 1;
        transform: scale(0);
        border-width: 2px;
    }

    30% {
        opacity: 0.8;
        transform: scale(1.5);
        border-width: 3px;
    }

    70% {
        opacity: 0.4;
        transform: scale(2.5);
        border-width: 1px;
    }

    100% {
        opacity: 0;
        transform: scale(4);
        border-width: 0px;
    }
}

/* Share Modal Styles */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.share-modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 4px solid #fff;
    border-radius: 15px;
    padding: 25px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.6);
    font-family: "Press Start 2P", monospace;
    color: #fff;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
}

.share-header h3 {
    font-size: 14px;
    margin: 0;
    color: #ffd700;
    text-shadow: 2px 2px 0px #000;
}

.close-btn {
    background: #ff006e;
    border: 2px solid #fff;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ff4081;
    transform: scale(1.1);
}

.share-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.share-stat {
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 0px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    line-height: 1.6;
}

.stat-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 16px;
}

.stat-label {
    color: #ccc;
    font-size: 8px;
}

.stat-value {
    color: #06ffa5;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 0px #000;
    min-width: 60px;
    text-align: right;
}

.share-stat:nth-child(4) .stat-value {
    font-size: 10px; /* Smaller font for difficulty to prevent overlap */
}

.game-link-section {
    margin-bottom: 20px;
}

.game-link-section label {
    display: block;
    font-size: 8px;
    margin-bottom: 8px;
    color: #ffd700;
}

.game-link-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.game-link-container input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    padding: 8px;
    line-height: 1.4;
}

.game-link-container input:focus {
    outline: none;
    border-color: #06ffa5;
    box-shadow: 0 0 10px rgba(6, 255, 165, 0.3);
}

.copy-game-link-btn {
    background: linear-gradient(45deg, #06ffa5, #00d084);
    border: 2px solid #fff;
    border-radius: 6px;
    color: #fff;
    padding: 8px 12px;
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.copy-game-link-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(6, 255, 165, 0.8);
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.share-btn {
    background: linear-gradient(45deg, #ff006e, #8338ec);
    border: 2px solid #fff;
    border-radius: 8px;
    color: #fff;
    padding: 12px;
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.share-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.8);
}

.twitter-btn {
    background: linear-gradient(45deg, #1da1f2, #0d8bd9);
}
.instagram-btn {
    background: linear-gradient(45deg, #e4405f, #833ab4);
}
.facebook-btn {
    background: linear-gradient(45deg, #1877f2, #0d5aa7);
}
.threads-btn {
    background: linear-gradient(45deg, #000, #333);
}
.copy-btn {
    background: linear-gradient(45deg, #06ffa5, #00d084);
}

.share-message {
    margin-top: 15px;
}

.share-message label {
    display: block;
    font-size: 8px;
    margin-bottom: 8px;
    color: #ffd700;
}

.share-message textarea {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    padding: 8px;
    resize: vertical;
    line-height: 1.4;
}

.share-message textarea:focus {
    outline: none;
    border-color: #06ffa5;
    box-shadow: 0 0 10px rgba(6, 255, 165, 0.3);
}

/* Game Over Modal Animation */
@keyframes gameOverModalAnimation {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-100px) rotate(-5deg);
        filter: blur(10px);
    }

    30% {
        opacity: 0.3;
        transform: scale(0.9) translateY(-30px) rotate(2deg);
        filter: blur(5px);
    }

    60% {
        opacity: 0.7;
        transform: scale(1.05) translateY(10px) rotate(-1deg);
        filter: blur(2px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotate(0deg);
        filter: blur(0px);
    }
}

/* Link Section Glow Animation */
@keyframes linkSectionGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 215, 0, 0.1);
        border-color: rgba(255, 215, 0, 0.6);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), inset 0 0 30px rgba(255, 215, 0, 0.3);
        border-color: rgba(255, 215, 0, 1);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 215, 0, 0.1);
        border-color: rgba(255, 215, 0, 0.6);
    }
}

/* Shimmer Effect Animation */
@keyframes shimmer {
    0% {
        left: -100%;
        opacity: 0;
    }

    20% {
        left: -50%;
        opacity: 1;
    }

    80% {
        left: 100%;
        opacity: 1;
    }

    100% {
        left: 150%;
        opacity: 0;
    }
}

/* Score Text Pulse Animation */
@keyframes scoreTextPulse {
    0% {
        transform: scale(1.1);
        text-shadow: 2px 2px 0px #000, 0 0 15px rgba(255, 0, 110, 0.8),
            0 0 25px rgba(255, 0, 110, 0.6), 0 0 35px rgba(255, 0, 110, 0.4);
        box-shadow: 0 0 10px rgba(255, 0, 110, 0.3);
    }

    100% {
        transform: scale(1.15);
        text-shadow: 2px 2px 0px #000, 0 0 20px rgba(255, 0, 110, 1),
            0 0 35px rgba(255, 0, 110, 0.8), 0 0 45px rgba(255, 0, 110, 0.6);
        box-shadow: 0 0 20px rgba(255, 0, 110, 0.6);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .share-modal-content {
        max-width: 350px;
        padding: 20px;
    }

    .share-header h3 {
        font-size: 12px;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }

    .share-stats {
        grid-template-columns: 1fr;
    }
}
