/* DENDY + MATRIX STYLE                        */
/* ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');


.puzzle_piece,
.puzzle_piece img,
.puzzle_cell,
.puzzle_cell img,
.puzzle_grid,
.puzzle_pieces,
.puzzle_area * {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
    -webkit-user-drag: element !important;
    user-drag: element !important;
}

@media (pointer: coarse) {
    .puzzle_piece,
    .puzzle_piece img,
    .puzzle_cell,
    .puzzle_area * {
        -webkit-user-select: auto !important;
        -moz-user-select: auto !important;
        -ms-user-select: auto !important;
        user-select: auto !important;
        -webkit-touch-callout: default !important;
    }
}

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

body {
    background: #0a0a0a;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 480px;
    width: 100%;
    background: #0d0d0d;
    border: 2px solid #4FC3F7;
    padding: 20px 18px 16px;
    min-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
.header_title {
    font-size: 0.85rem;
    color: #FF6B35;
    letter-spacing: 2px;
}
.header_progress {
    margin: 6px 0 10px;
}
.progress_text {
    color: #4FC3F7;
    font-size: 0.6rem;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 1px;
    opacity: 0.6;
}
.progress_bar {
    width: 100%;
    height: 4px;
    background: #1a1a1a;
    border: 1px solid #222;
}
.progress_fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4FC3F7, #FF6B35);
    transition: width 0.5s ease;
}

.header_stats {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding: 0 4px;
}
.stats_lives {
    font-size: 0.9rem;
    color: #FFD700;
    letter-spacing: 2px;
    opacity: 0.7;
}
.stats_timer {
    font-size: 0.9rem;
    color: #4FC3F7;
    letter-spacing: 1px;
    opacity: 0.7;
    font-family: 'Share Tech Mono', monospace;
}
.stats_timer.warning {
    color: #FF6B35;
    opacity: 1;
    animation: timer_pulse 0.5s ease-in-out infinite;
}
.stats_timer.paused {
    opacity: 0.3;
    animation: none;
}

@keyframes timer_pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== PLAYER ===== */
.dendy_player {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 20;
}
.dendy_play_btn {
    background: transparent;
    border: 1px solid #4FC3F7;
    color: #4FC3F7;
    padding: 2px 10px;
    font-size: 0.7rem;
    opacity: 0.6;
}
.dendy_play_btn:hover {
    opacity: 1;
    background: rgba(79, 195, 247, 0.05);
}
.dendy_play_btn.playing {
    border-color: #FF6B35;
    color: #FF6B35;
    opacity: 1;
}

/* ===== КНОПКА ПАУЗЫ ===== */
.pause_btn {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 20;
    background: transparent;
    border: 1px solid #333;
    color: #555;
    padding: 2px 8px;
    font-size: 0.55rem;
    transition: all 0.3s ease;
}
.pause_btn:hover {
    border-color: #4FC3F7;
    color: #4FC3F7;
}
.pause_btn.paused {
    border-color: #FF6B35;
    color: #FF6B35;
}

/* ===== ПАУЗА ОВЕРЛЕЙ ===== */
.pause_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}
.pause_overlay.active {
    display: flex;
}
.pause_title {
    font-size: 2.5rem;
    color: #4FC3F7;
    letter-spacing: 4px;
    margin-bottom: 10px;
    animation: pause_pulse 1.5s ease-in-out infinite;
}
@keyframes pause_pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}
.pause_sub {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
    letter-spacing: 2px;
}
.pause_continue {
    background: transparent;
    border: 1px solid #4FC3F7;
    color: #4FC3F7;
    padding: 10px 32px;
    font-size: 0.8rem;
    font-family: 'Share Tech Mono', monospace;
}
.pause_continue:hover {
    background: rgba(79, 195, 247, 0.05);
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    position: relative;
}
.screen.active {
    display: flex;
}

/* ===== WELCOME ===== */
.welcome_block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 20px 10px;
    text-align: center;
    flex: 1;
}

.welcome_icon {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 8px;
    animation: icon_pulse 2s ease-in-out infinite;
}
@keyframes icon_pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.welcome_title {
    font-size: 1.6rem;
    color: #4FC3F7;
    letter-spacing: 4px;
    margin-bottom: 20px;
    font-weight: 400;
}

.welcome_desc {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    background: rgba(79, 195, 247, 0.03);
    border: 1px solid rgba(255, 107, 53, 0.08);
    border-radius: 4px;
    margin-bottom: 28px;
    max-width: 340px;
    width: 100%;
    overflow: hidden;
}

.desc_left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 12px 16px 12px 20px;
    width: 110px;
    flex-shrink: 0;
    flex-grow: 0;
    border-right: 1px solid rgba(255, 107, 53, 0.05);
}

.desc_right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 20px 12px 16px;
    width: 170px;
    flex-shrink: 0;
    flex-grow: 0;
}

.desc_left .desc_item {
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 0.5px;
    padding: 2px 0;
    white-space: nowrap;
    text-align: right;
    line-height: 1.4;
}
.desc_right .desc_item {
    font-size: 0.7rem;
    color: #aaa;
    letter-spacing: 0.5px;
    padding: 2px 0;
    white-space: nowrap;
    text-align: left;
    line-height: 1.4;
}
.desc_right .desc_item b {
    color: #4FC3F7;
    font-weight: 400;
}

.btn_primary {
    background: transparent;
    border: 1px solid #FF6B35;
    color: #FF6B35;
    padding: 12px 40px;
    font-size: 0.9rem;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 3px;
    margin-top: 8px;
    transition: all 0.2s ease;
}
.btn_primary:hover {
    background: rgba(255, 107, 53, 0.05);
}

/* ===== BUTTONS ===== */
.btn_next_wrapper {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px 0;
    flex-shrink: 0;
    min-height: 44px;
    margin-top: auto;
}

.btn_next {
    background: transparent;
    border: 1px solid #4FC3F7;
    color: #4FC3F7;
    padding: 6px 24px;
    font-size: 0.7rem;
    display: none;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.btn_next.visible {
    display: inline-block !important;
}

.btn_next:hover {
    background: rgba(79, 195, 247, 0.05);
}

/* ============================================ */
/* ===== ВСТУПЛЕНИЕ (ДЛЯ ВСЕХ УРОВНЕЙ) ===== */
/* ============================================ */
.level_intro {
    background: rgba(255, 107, 53, 0.03);
    border: 1px solid rgba(255, 107, 53, 0.08);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
    text-align: center;
    flex-shrink: 0;
}
.level_intro_text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.intro_emoji {
    font-size: 1.8rem;
    display: block;
    animation: intro_pulse 1.5s ease-in-out infinite;
}
@keyframes intro_pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.intro_title {
    font-size: 0.8rem;
    color: #FF6B35;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
}
.intro_sub {
    font-size: 0.65rem;
    color: #4FC3F7;
    letter-spacing: 1px;
    opacity: 0.8;
}
.intro_sub b {
    color: #FFD700;
}
.level_intro_line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FF6B35, transparent);
    margin: 4px auto 0;
}

/* ============================================ */
/* ===== УРОВЕНЬ 1: ЯБЛОЧКО ===== */
/* ============================================ */
.fullscreen_area {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.image_wrap {
    border: 1px solid #222;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.image_main {
    width: 100%;
    height: auto;
    display: block;
}

.quote_text {
    font-size: 0.7rem;
    line-height: 1.5;
    color: #4FC3F7;
    text-align: center;
    padding: 6px 10px;
    margin: 4px 0 4px;
    letter-spacing: 1px;
    opacity: 0.6;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    min-height: 30px;
}

/* === ЯБЛОЧКО === */
.apple_rolling {
    position: absolute;
    font-size: 1.6rem;
    user-select: none;
    z-index: 100;
    transition: all 0.15s ease;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.03);
    padding: 2px 4px;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.01);
    border: 1px solid transparent;
    line-height: 1;
    pointer-events: auto;
}
.apple_rolling.rolling {
    animation: apple_roll 0.4s ease-in-out;
}
.apple_rolling.stopped {
    animation: none;
    border-color: rgba(255, 107, 53, 0.1);
}
.apple_rolling.glow {
    border-color: #FFD700 !important;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.15) !important;
    background: rgba(255, 215, 0, 0.03) !important;
}
.apple_rolling.caught {
    animation: apple_caught 0.4s ease forwards !important;
    pointer-events: none;
}

@keyframes apple_roll {
    0% { transform: translateX(0) rotate(0deg) scale(1); }
    25% { transform: translateX(20px) rotate(90deg) scale(1.03); }
    50% { transform: translateX(-12px) rotate(180deg) scale(0.97); }
    75% { transform: translateX(15px) rotate(270deg) scale(1.01); }
    100% { transform: translateX(0) rotate(360deg) scale(1); }
}

@keyframes apple_caught {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 1; border-color: #FFD700; box-shadow: 0 0 40px rgba(255, 215, 0, 0.2); }
    100% { transform: scale(0); opacity: 0; }
}

/* === КОРЗИНКА И СЧЁТЧИК === */
.basket_wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    flex-shrink: 0;
    z-index: 5;
    pointer-events: none;
}

.basket {
    font-size: 2.5rem;
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.1);
    animation: basket_float 2s ease-in-out infinite;
    user-select: none;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}
@keyframes basket_float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.basket.catch {
    animation: basket_catch 0.3s ease;
}
@keyframes basket_catch {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.3)); }
    100% { transform: scale(1); }
}

.apple_counter {
    font-size: 1rem;
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(4px);
    pointer-events: none;
    user-select: none;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.apple_counter.complete {
    font-size: 1.5rem;
    color: #FF6B35;
    border-color: #FF6B35;
    background: rgba(255, 107, 53, 0.1);
    padding: 8px 24px;
    border-width: 2px;
    box-shadow: 0 0 60px rgba(255, 107, 53, 0.2);
    animation: counter_complete_pulse 0.8s ease-in-out infinite;
}

@keyframes counter_complete_pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); text-shadow: 0 0 60px rgba(255, 107, 53, 0.3); }
}

.basket.hidden,
.apple_counter.hidden {
    display: none !important;
}

/* === ЛИМОНЫ (НА ПЕРВЫЙ ПЛАН) === */
.lemon_bg {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
}

.lemon {
    position: fixed;
    font-size: 1rem;
    opacity: 0.08;
    color: #FFD700;
    animation: lemon_float 8s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes lemon_float {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(20px, -25px) rotate(90deg) scale(1.1); }
    50% { transform: translate(-15px, 20px) rotate(180deg) scale(0.9); }
    75% { transform: translate(25px, -10px) rotate(270deg) scale(1.05); }
}

/* ============================================ */
/* ===== УРОВЕНЬ 2: ПАЗЛ ===== */
/* ============================================ */
.puzzle_area {
    margin: 4px 0;
    padding: 10px;
    border: 1px solid rgba(255, 107, 53, 0.05);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    flex: 1;
}
.puzzle_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(79, 195, 247, 0.05);
    padding: 2px;
    background: rgba(79, 195, 247, 0.01);
    max-width: 100%;
    position: relative;
}
.puzzle_cell {
    background: rgba(79, 195, 247, 0.02);
    border: 1px dashed rgba(79, 195, 247, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    min-height: 40px;
    border-radius: 4px;
}
.puzzle_cell .cell_number {
    color: rgba(79, 195, 247, 0.05);
    font-size: 1.2rem;
    font-weight: 700;
}
.puzzle_cell.filled {
    border-color: rgba(255, 107, 53, 0.1);
    border-style: solid;
    background: transparent;
}
.puzzle_cell.filled .cell_number {
    display: none;
}
.puzzle_cell.highlight {
    border-color: #4FC3F7;
    background: rgba(79, 195, 247, 0.03);
}
.puzzle_cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.puzzle_pieces {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    aspect-ratio: 1 / 1;
    padding: 4px;
    background: rgba(255, 107, 53, 0.01);
    border: 1px solid rgba(255, 107, 53, 0.03);
    max-width: 100%;
}
.puzzle_piece {
    background: rgba(79, 195, 247, 0.02);
    border: 1px solid rgba(79, 195, 247, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    min-height: 40px;
    cursor: grab;
    user-select: none;
    transition: transform 0.2s ease;
    border-radius: 4px;
}
.puzzle_piece:hover {
    background: rgba(79, 195, 247, 0.04);
    border-color: rgba(79, 195, 247, 0.08);
}
.puzzle_piece.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.puzzle_piece.placed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}
.puzzle_piece img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.puzzle_complete {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    animation: fade_in 0.5s ease;
    border-radius: 8px;
    padding: 20px;
}
.puzzle_complete_img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    border: 2px solid #FF6B35;
    box-shadow: 0 0 60px rgba(255, 107, 53, 0.1);
    animation: zoom_in 0.6s ease;
}
@keyframes fade_in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoom_in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.puzzle_status {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 6px 0 2px;
    font-size: 0.65rem;
    color: #4FC3F7;
    letter-spacing: 1px;
    opacity: 0.5;
    flex-shrink: 0;
}
.puzzle_status .complete {
    color: #FF6B35;
    opacity: 1;
}
#puzzle_result {
    color: #FF6B35;
}

/* ============================================ */
/* ===== УРОВЕНЬ 3: КИРПИЧИ ===== */
/* ============================================ */
.countdown_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    pointer-events: none;
}
.countdown_overlay.hidden {
    display: none;
}
.countdown_text {
    font-size: 5rem;
    color: #FF6B35;
    text-shadow: 0 0 60px rgba(255, 107, 53, 0.1);
    animation: countdown_pulse 0.7s ease;
}
@keyframes countdown_pulse {
    0% { transform: scale(1.8); opacity: 0; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.countdown_text.start {
    font-size: 2.5rem;
    color: #4FC3F7;
}

.brick_wall {
    aspect-ratio: 1.8 / 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0px;
    max-width: 100%;
    margin: 4px auto;
    padding: 0px;
    background: #0a0a14;
    border: 2px solid #1a1a2e;
    flex: 1;
}
.brick {
    background: #1a1a2a;
    border: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    user-select: none;
    min-height: 20px;
    position: relative;
    margin: 0; 
}
.brick[data-row="3"] { background: #2a1a1a; border-color: #3a2a2a; }
.brick[data-row="2"] { background: #1a1a2a; border-color: #2a2a3a; }
.brick[data-row="1"] { background: #1a2a1a; border-color: #2a3a2a; }
.brick[data-row="0"] { background: #2a2a1a; border-color: #3a3a2a; }
.brick .brick_hits { 
    display: none; 
    color: rgba(255,255,255,0.15); 
    font-size: 0.5rem; 
    position: absolute; 
    bottom: 2px; 
    right: 4px; 
}
.brick.needs_hits .brick_hits { display: block; }
.brick:hover { filter: brightness(1.3); }
.brick.hit_1 { filter: brightness(0.7); }
.brick.hit_2 { filter: brightness(0.5); }
.brick.broken { 
    animation: brick_break 0.2s ease forwards; 
    pointer-events: none; 
}
@keyframes brick_break { 
    0% { transform: scale(1); opacity: 1; } 
    100% { transform: scale(0); opacity: 0; } 
}
.brick.has_letter {
    background: #FFD700 !important;
    border-color: #FFD700 !important;
    animation: letter_reveal 0.4s ease forwards;
    filter: none !important;
}
@keyframes letter_reveal {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.brick.has_letter .brick_letter { 
    color: #0a0a0a; 
    font-size: 1.4rem; 
    font-weight: 700;
}
.brick_letter { display: none; }
.brick.has_letter .brick_letter { display: block; }
.brick.has_letter .brick_hits { display: none !important; }

.brick_score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 4px auto 2px;
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #1a1a1a;
    font-size: 0.6rem;
    color: #4FC3F7;
    letter-spacing: 1px;
    opacity: 0.5;
    flex-shrink: 0;
}
.brick_score .found { color: #FFD700; opacity: 1; }
.brick_score .complete { color: #FF6B35; opacity: 1; }

/* ============================================ */
/* ===== УРОВЕНЬ 4: РЫБАЛКА ===== */
/* ============================================ */
.fishing_game {
    position: relative;
    margin: 6px 0;
    border: 1px solid #1a1a2e;
    background: #0a0a1a;
    overflow: hidden;
    height: 240px;
}
.water_container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a1a, #0a1a2a 50%, #0a2a3a 100%);
    overflow: hidden;
}
.fishing_bg { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0.2; 
    z-index: 0; 
}
.fishing_area { 
    position: relative; 
    width: 100%; 
    height: 100%; 
    z-index: 2; 
    overflow: hidden; 
}
.wave {
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: 30%;
    background: repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(79, 195, 247, 0.02) 30px, rgba(79, 195, 247, 0.02) 60px);
    border-radius: 50% 50% 0 0;
    animation: wave_move 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
.wave2 { animation-delay: 2s; opacity: 0.5; height: 20%; }
@keyframes wave_move { 0%, 100% { transform: translateX(0) scaleY(1); } 50% { transform: translateX(5%) scaleY(0.8); } }

/* ===== РЫБКИ ===== */
.fish_item {
    position: absolute;
    font-size: 1.2rem;
    user-select: none;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.03);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 2;
    cursor: pointer;
}
.fish_item .fish_emoji { 
    font-size: 0.9rem; 
    opacity: 0.5; 
}
.fish_item .fish_letter { 
    font-size: 0.8rem; 
    font-weight: 700; 
    color: #FFD700; 
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3); 
    display: none; 
}
.fish_item.has_letter .fish_letter { 
    display: inline; 
}
/* УБИРАЕМ ОБВОДКУ У ЗОЛОТЫХ РЫБОК */
.fish_item.has_letter { 
    border: 1px solid rgba(79, 195, 247, 0.03) !important; 
    background: rgba(0, 0, 0, 0.2) !important;
    box-shadow: none !important;
}
.fish_item.has_letter .fish_emoji {
    opacity: 1 !important;
    color: #FFD700 !important;
}
.fish_item:hover { 
    transform: scale(1.05) !important; 
    border-color: rgba(79, 195, 247, 0.1); 
}
.fish_item.caught { 
    animation: fish_caught 0.5s ease forwards !important; 
    pointer-events: none; 
}

@keyframes fish_caught {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.8) rotate(20deg); opacity: 1; border-color: #FF6B35; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

.fishing_rod { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 10; 
}
.rod_line { 
    position: absolute; 
    width: 1px; 
    background: rgba(79, 195, 247, 0.05); 
    pointer-events: none; 
    z-index: 11; 
}
.rod_hook {
    position: absolute;
    font-size: 1.2rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: #4FC3F7;
    opacity: 0.3;
    z-index: 12;
}
.rod_hook.hooked { animation: hook_catch 0.3s ease; }
@keyframes hook_catch {
    0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.8) rotate(30deg); opacity: 1; color: #FF6B35; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.3; }
}

.fishing_score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #1a1a1a;
    font-size: 0.6rem;
    color: #4FC3F7;
    margin-top: 2px;
    z-index: 5;
    letter-spacing: 1px;
    opacity: 0.5;
    flex-shrink: 0;
}
.fishing_score .caught { color: #FF6B35; opacity: 1; }
.fishing_score .complete { color: #FF6B35; opacity: 1; }

/* ============================================ */
/* ===== ФИНАЛ (MATRIX) - ПАФОСНО ===== */
/* ============================================ */
.final_matrix {
    position: relative;
    min-height: 450px;
    overflow: hidden;
    background: #0a0a0a;
    border: 2px solid #00ff41;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    box-shadow: 0 0 80px rgba(0, 255, 65, 0.15), inset 0 0 80px rgba(0, 255, 65, 0.03);
}

.matrix_rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    overflow: hidden;
    color: #00ff41;
    font-size: 0.8rem;
    line-height: 1.2;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    z-index: 1;
}

.final_content_matrix {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    width: 100%;
}

/* ===== БУКВЫ K I I T O S - ПОЯВЛЯЮТСЯ КРАСИВО ===== */
.final_letters_matrix {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.final_letter_matrix {
    font-size: 4.5rem;
    color: #00ff41;
    display: inline-block;
    opacity: 0;
    transform: scale(0.1) rotate(-30deg) translateY(-50px);
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.05);
    font-weight: 900;
    letter-spacing: 4px;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.final_letter_matrix.show {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateY(0);
    text-shadow: 
        0 0 60px rgba(0, 255, 65, 0.6),
        0 0 120px rgba(0, 255, 65, 0.3),
        0 0 200px rgba(0, 255, 65, 0.1);
    animation: letter_pulse 1.5s ease-in-out infinite;
}

.final_letter_matrix.show:nth-child(1) { color: #00ff41; }
.final_letter_matrix.show:nth-child(2) { color: #33ff66; }
.final_letter_matrix.show:nth-child(3) { color: #66ff99; }
.final_letter_matrix.show:nth-child(4) { color: #99ffcc; }
.final_letter_matrix.show:nth-child(5) { color: #ccffdd; }
.final_letter_matrix.show:nth-child(6) { color: #00ff41; }

@keyframes letter_pulse {
    0%, 100% { 
        text-shadow: 0 0 40px rgba(0, 255, 65, 0.4), 0 0 80px rgba(0, 255, 65, 0.2);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 80px rgba(0, 255, 65, 0.8), 0 0 160px rgba(0, 255, 65, 0.4), 0 0 240px rgba(0, 255, 65, 0.2);
        transform: scale(1.05);
    }
}

.final_divider_matrix { 
    width: 120px; 
    height: 2px; 
    background: linear-gradient(90deg, transparent, #00ff41, #66ff99, #00ff41, transparent); 
    margin: 20px auto; 
    opacity: 0.6;
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.2);
}

/* ===== ТЕКСТ - ВИДЕН СРАЗУ ===== */
.final_message_matrix { 
    margin: 10px 0 15px; 
    width: 100%; 
    position: relative; 
    z-index: 10; 
}

.final_text_matrix {
    font-size: 1.2rem;
    line-height: 2.4;
    color: #00ff41;
    opacity: 1 !important;
    transform: translateY(0) !important;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(0, 255, 65, 0.1);
    padding: 0 10px;
}

.final_text_matrix .highlight_matrix { 
    color: #FFD700; 
    text-shadow: 0 0 60px rgba(255, 215, 0, 0.3), 0 0 120px rgba(255, 215, 0, 0.1);
    font-size: 1.4rem;
}

.final_text_matrix .highlight_matrix_2 { 
    color: #FF6B35; 
    text-shadow: 0 0 60px rgba(255, 107, 53, 0.3), 0 0 120px rgba(255, 107, 53, 0.1);
    font-size: 1.3rem;
}

.final_text_matrix .unique_matrix { 
    color: #FFD700; 
    font-size: 1.3rem; 
    display: inline-block;
    animation: unique_glow 2s ease-in-out infinite;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

@keyframes unique_glow {
    0%, 100% { 
        text-shadow: 0 0 40px rgba(255, 215, 0, 0.2), 0 0 80px rgba(255, 215, 0, 0.05);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 80px rgba(255, 215, 0, 0.4), 0 0 160px rgba(255, 215, 0, 0.15);
        transform: scale(1.03);
    }
}

.final_music { 
    margin-top: 15px; 
    position: relative; 
    z-index: 10; 
}

.btn_restart_matrix {
    background: transparent;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 10px 32px;
    font-size: 0.7rem;
    margin-top: 10px;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.05);
}
.btn_restart_matrix:hover { 
    background: rgba(0, 255, 65, 0.05);
    box-shadow: 0 0 60px rgba(0, 255, 65, 0.15);
    border-color: #66ff99;
}


/* ============================================ */
/* ===== GAMEOVER ===== */
/* ============================================ */
.gameover_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}
.gameover_overlay.active { display: flex; }
.gameover_title {
    font-size: 2rem;
    color: #FF6B35;
    letter-spacing: 4px;
    margin-bottom: 10px;
    animation: gameover_pulse 1s ease-in-out infinite;
}
@keyframes gameover_pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.95); } }
.gameover_sub { color: #888; font-size: 0.8rem; margin-bottom: 20px; letter-spacing: 2px; }
.btn_retry {
    background: transparent;
    border: 1px solid #FF6B35;
    color: #FF6B35;
    padding: 10px 32px;
    font-size: 0.8rem;
    letter-spacing: 2px;

}
.btn_retry:hover { background: rgba(255, 107, 53, 0.05); }

/* ============================================ */
/* ===== FOOTER ===== */
/* ============================================ */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #1a1a1a;
    flex-shrink: 0;
}
.footer p { color: #2a2a2a; font-size: 0.45rem; letter-spacing: 3px; }

/* ============================================ */
/* ===== CURSORS ===== */
/* ============================================ */
.cursor_dendy {
    position: fixed;
    pointer-events: none !important;
    z-index: 9998;
    font-size: 1rem;
    color: #4FC3F7;
    transform: translate(-50%, -50%);
    display: none;
    opacity: 0.3;
}
.cursor_dendy.active { display: block; }
.cursor_hammer {
    position: fixed;
    pointer-events: none !important;
    z-index: 9999;
    font-size: 1.6rem;
    transform: translate(-50%, -50%);
    display: none;
    opacity: 0.4;
    color: #FF6B35;
}
.cursor_hammer.active { display: block; }
.cursor_hammer.hit { animation: hammer_hit 0.12s ease; }
@keyframes hammer_hit {
    0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    50% { transform: translate(-50%, -50%) scale(1.4) rotate(-20deg); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.4; }
}

/* ============================================ */
/* ===== RESPONSIVE ===== */
/* ============================================ */
@media (max-width: 480px) {
    body {
        padding: 4px;
        min-height: 100vh;
        align-items: center;
    }

    .container {
        padding: 8px 6px 6px;
        min-height: 95vh;
        border-width: 2px;
        border-radius: 12px;
        max-width: 100%;
    }

    .header {
        margin-bottom: 2px;
    }
    .header_title {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }
    .header_progress {
        margin: 2px 0 4px;
    }
    .progress_text {
        font-size: 0.4rem;
        margin-bottom: 2px;
    }
    .progress_bar {
        height: 2px;
    }
    .header_stats {
        margin-top: 2px;
    }
    .stats_lives {
        font-size: 0.5rem;
    }
    .stats_timer {
        font-size: 0.5rem;
    }

    .dendy_play_btn {
        font-size: 0.4rem;
        padding: 1px 6px;
        border-width: 1px;
    }
    
    .pause_btn {
        font-size: 0.4rem;
        padding: 1px 6px;
    }

    .welcome_block {
        min-height: 50vh;
        padding: 4px 2px;
        justify-content: center;
    }
    .welcome_icon {
        font-size: 2.5rem;
        margin-bottom: 4px;
    }
    .welcome_title {
        font-size: 0.9rem;
        letter-spacing: 2px;
        margin-bottom: 8px;
    }
    .welcome_desc {
        max-width: 220px;
        padding: 0;
        margin-bottom: 10px;
        border-radius: 3px;
    }
    .desc_left {
        width: 60px;
        padding: 4px 6px 4px 10px;
        gap: 1px;
    }
    .desc_right {
        width: 100px;
        padding: 4px 10px 4px 6px;
        gap: 1px;
    }
    .desc_left .desc_item {
        font-size: 0.4rem;
        padding: 1px 0;
        letter-spacing: 0.2px;
    }
    .desc_right .desc_item {
        font-size: 0.4rem;
        padding: 1px 0;
        letter-spacing: 0.2px;
    }
    .desc_right .desc_item b {
        font-size: 0.4rem;
    }
    .btn_primary {
        padding: 6px 16px;
        font-size: 0.6rem;
        letter-spacing: 2px;
        margin-top: 4px;
        border-width: 1px;
    }

    .fullscreen_area {
        min-height: 150px;
    }
    .apple_rolling {
        font-size: 1.2rem;
        padding: 1px 2px;
    }
    .lemon {
        font-size: 0.6rem;
    }
    .image_main {
        
        object-fit: cover;
    }
    .quote_text {
        font-size: 0.45rem;
        padding: 2px 4px;
        margin: 2px 0 4px;
        min-height: 20px;
    }
    
    .basket_wrapper {
        padding: 2px 0;
    }
    .basket {
        font-size: 1.8rem;
    }
    .apple_counter {
        font-size: 0.65rem;
        padding: 2px 10px;
        margin-top: 1px;
    }
    .apple_counter.complete {
        font-size: 1rem;
        padding: 4px 14px;
    }
    
    .btn_next_wrapper {
        padding: 6px 0 2px 0;
        min-height: 32px;
    }
    .btn_next {
        font-size: 0.5rem;
        padding: 4px 14px;
    }
    
    .level_intro {
        padding: 4px 8px;
        margin-bottom: 4px;
    }
    .intro_emoji {
        font-size: 1.2rem;
    }
    .intro_title {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    .intro_sub {
        font-size: 0.45rem;
    }

    .puzzle_area {
        padding: 4px;
        min-height: 150px;
        gap: 4px;
    }
    .puzzle_grid {
        gap: 2px;
        padding: 2px;
        border-width: 1px;
    }
    .puzzle_cell {
        min-height: 22px;
    }
    .puzzle_cell .cell_number {
        font-size: 0.6rem;
    }
    .puzzle_pieces {
        gap: 2px;
        padding: 2px;
    }
    .puzzle_piece {
        min-height: 22px;
    }
    .puzzle_status {
        font-size: 0.4rem;
        margin: 2px 0;
        gap: 8px;
    }
    .puzzle_complete {
        padding: 6px;
    }
    .puzzle_complete_img {
        max-width: 70%;
        max-height: 70%;
        border-width: 1px;
    }

    .countdown_text {
        font-size: 2.2rem;
    }
    .countdown_text.start {
        font-size: 1.2rem;
    }
    .brick_wall {
        gap: 1px;
        padding: 3px;
        margin: 2px auto;
        border-width: 1px;
    }
    .brick {
        min-height: 8px;
        font-size: 0.35rem;
        border-width: 1px;
    }
    .brick.has_letter .brick_letter {
        font-size: 0.5rem;
    }
    .brick .brick_hits {
        font-size: 0.3rem;
    }
    .brick_score {
        font-size: 0.4rem;
        padding: 2px 6px;
        margin: 2px auto;
    }

    .fishing_game {
        height: 150px;
        margin: 2px 0;
        border-width: 1px;
    }
    .fish_item {
        font-size: 0.7rem;
        padding: 1px 3px;
    }
    .fish_item .fish_emoji {
        font-size: 0.5rem;
    }
    .fish_item .fish_letter {
        font-size: 0.4rem;
    }
    .rod_hook {
        font-size: 0.8rem;
    }
    .fishing_score {
        font-size: 0.4rem;
        padding: 2px 6px;
        margin-top: 2px;
        border-width: 1px;
    }

    /* ФИНАЛ */
    .final_matrix {
        min-height: 300px;
        border-width: 1px;
    }
    .final_letter_matrix {
        font-size: 1.8rem;
        gap: 4px;
    }
    .final_text_matrix {
        font-size: 0.7rem;
        line-height: 1.8;
        padding: 0 6px;
    }
    .unique_matrix {
        font-size: 0.7rem;
    }
    .final_divider_matrix {
        width: 40px;
        margin: 8px auto;
    }
    .btn_restart_matrix {
        font-size: 0.45rem;
        padding: 4px 12px;
        border-width: 1px;
    }

    .gameover_title {
        font-size: 1.2rem;
    }
    .gameover_sub {
        font-size: 0.55rem;
        margin-bottom: 10px;
    }
    .btn_retry {
        font-size: 0.55rem;
        padding: 6px 16px;
        border-width: 1px;
    }
    
    .pause_title {
        font-size: 1.6rem;
    }
    .pause_sub {
        font-size: 0.6rem;
    }
    .pause_continue {
        font-size: 0.6rem;
        padding: 6px 20px;
    }

    .footer {
        padding-top: 4px;
        margin-top: 4px;
    }
    .footer p {
        font-size: 0.35rem;
    }

    .cursor_dendy,
    .cursor_hammer {
        display: none !important;
    }
    body {
        cursor: auto !important;
    }
    .brick,
    .fish_item,
    .apple_rolling,
    .puzzle_piece,
    .btn_primary,
    .btn_next,
    .dendy_play_btn,
    .btn_restart,
    .btn_retry,
    .btn_restart_matrix,
    .pause_btn,
    .pause_continue {
        cursor: pointer !important;
        touch-action: manipulation;
    }
}