@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background: #050505;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.arcade-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    max-height: 800px;
    width: 100%;
    perspective: 1000px;
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.instructions-panel {
    width: 280px;
    background: #0f0f11;
    border: 4px solid #333;
    padding: 20px;
    color: #fff;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-right: 40px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    opacity: 1;
    transform: translateX(0) scale(1) rotateY(0deg);
}

.instructions-panel::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 20px;
    height: 20px;
    border-top: 4px solid #f97316;
    border-left: 4px solid #f97316;
}

.arcade-wrapper.playing .instructions-panel {
    width: 0;
    padding: 0;
    margin-right: 0;
    opacity: 0;
    border-width: 0;
    transform: translateX(150px) scale(0.8) rotateY(-45deg);
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    max-height: 800px;
    background: #0f0f11;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 10;
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.arcade-wrapper.playing .game-container {
    box-shadow: 0 0 100px rgba(249, 115, 22, 0.3);
    transform: scale(1.02);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10;
    background: #0f0c29;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 99;
}

.game-sound-hud {
    position: absolute;
    top: 60px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.volume-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 12px;
}

.volume-group i {
    width: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.volume-group i:hover {
    color: #f97316;
    transform: scale(1.2);
}

.volume-group i.is-muted {
    color: #ef4444 !important;
    position: relative;
}

.volume-group i.fa-music.is-muted::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ef4444;
    transform: rotate(-45deg);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #f97316;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.score-board {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    color: white;
    font-size: 12px;
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
    z-index: 30;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

#get-ready-screen {
    background: rgba(0, 0, 0, 0.3);
}

.floating-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 18px;
    color: #fff;
    text-shadow: 4px 4px 0 #000;
    animation: floatVertical 2s infinite ease-in-out;
    text-align: center;
}

@keyframes floatVertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

h1 {
    color: #f97316;
    text-shadow: 3px 3px 0 #000;
    font-size: 24px;
    text-align: center;
    line-height: 1.5;
}

p {
    color: #fff;
    font-size: 10px;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.5;
}

.retro-btn {
    background: #f97316;
    border: 4px solid #fff;
    color: #000;
    padding: 15px 20px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 5px 5px 0 #000;
    transition: 0.1s;
    text-transform: uppercase;
    font-weight: bold;
}

.retro-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 1px 1px 0 #000;
}

.retro-btn.blue-btn {
    background: #3b82f6;
    border-color: #fff;
    margin-top: 5px;
    font-size: 10px;
    padding: 10px 15px;
}

.back-link {
    color: #aaa;
    text-decoration: none;
    font-size: 10px;
    margin-top: 10px;
    border-bottom: 1px dashed #aaa;
    transition: color 0.2s;
}

.back-link:hover {
    color: #fff;
}

.leaderboard-container {
    width: 80%;
    height: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    margin: 20px 0;
    overflow-y: auto;
    padding: 10px;
}

.lb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.2);
    font-size: 10px;
    color: #fff;
}

.lb-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-rank {
    color: #f97316;
    width: 20px;
}

.lb-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #fff;
}

.lb-name {
    color: #ccc;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-score {
    color: #ffd700;
}

.leaderboard-container::-webkit-scrollbar {
    width: 4px;
}

.leaderboard-container::-webkit-scrollbar-thumb {
    background: #f97316;
}

.inst-header {
    color: #f97316;
    font-size: 18px;
    text-shadow: 2px 2px 0 #000;
    border-bottom: 2px dashed #333;
    padding-bottom: 15px;
}

.inst-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    color: #aaa;
}

.key-icon {
    border: 2px solid #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 10px;
    color: #fff;
    box-shadow: 0 4px 0 #333;
}

.mouse-icon {
    font-size: 20px;
    color: #fff;
    animation: pulse 2s infinite;
}

.inst-list {
    list-style: none;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.inst-list li {
    font-size: 10px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

.inst-footer {
    margin-top: auto;
    font-size: 8px;
    color: #555;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@media (max-width: 900px) {
    .arcade-wrapper {
        flex-direction: column-reverse;
        gap: 20px;
        width: 100%;
    }
    .instructions-panel {
        display: none;
    }
    .game-container {
        max-height: 100%;
        border-radius: 0;
    }
}

#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #050505;
    z-index: 99999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.oo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.oo-icon-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.oo-phone {
    font-size: 4rem;
    color: #f97316;
    position: relative;
    z-index: 2;
    animation: rotate-phone-meta 2s ease-in-out infinite;
}

.oo-arrow {
    position: absolute;
    font-size: 7rem;
    color: rgba(249, 115, 22, 0.2);
    z-index: 1;
    animation: rotate-arrow-spin 2s linear infinite;
}

#orientation-overlay h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    margin-bottom: 15px;
    color: #fff;
    padding: 0 20px;
    line-height: 1.5;
}

#orientation-overlay p {
    font-size: 12px;
    color: #aaa;
    padding: 0 20px;
}

@keyframes rotate-phone-meta {
    0% { transform: rotate(-90deg); }
    40%, 100% { transform: rotate(0deg); }
}

@keyframes rotate-arrow-spin {
    0% { transform: rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: rotate(360deg); opacity: 0; }
}

@media screen and (orientation: landscape) {
    #orientation-overlay {
        display: flex !important;
    }
}

@media screen and (min-width: 1025px) {
    #orientation-overlay {
        display: none !important;
    }
}

/* Добавь это в конец файла */

.jumping-pause-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 32px;
    color: #f97316;
    text-shadow: 5px 5px 0 #000;
    animation: pauseJump 0.6s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

@keyframes pauseJump {
    from { 
        transform: translateY(0) scaleX(1.1); 
    }
    to { 
        transform: translateY(-30px) scaleX(0.9); 
        text-shadow: 5px 35px 10px rgba(0,0,0,0.4);
    }
}

#pause-screen {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 40; /* Выше всех остальных экранов */
}