@font-face {
    font-family: 'GameFont';
    src: url('font/font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

canvas:focus {
    outline: none;
}

html,
body {

    padding: 0;
    margin: 0;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    height: 100%;
    font-family: 'GameFont', sans-serif;
    color: white;

    cursor: url('assets/cursor.png'), auto !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'GameFont', sans-serif;
}

body {
    color: white;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}


.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 15px;
    box-sizing: border-box;
}

.level {
    font-size: 24px;
    color: white;
    text-align: center;
    flex-grow: 1;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
}

.timer,
.hint-btn,
.rocket-hint-btn,
.sound-btn {
    display: flex;
    align-items: center;
    height: 45px;
    padding-left: 45px;
    background-size: 35px 35px;
    background-repeat: no-repeat;
    background-position: left center;
    position: relative;
    flex-shrink: 0;
}

.coins-container {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 40px;
}

.coins {
    background-image: url('assets/coin.png');
    position: relative;
    background-position: left center;
    background-size: 35px 35px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
}

#coins-count {
    color: white;
    font-size: 16px;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    padding-left: 5px;
    margin-left: 35px;
}

.settings-icon {
    font-size: 30px;
    cursor: pointer;
    background-color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


.crossword-container {
    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px auto;
    min-height: 50px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.crossword-table {
    border-collapse: separate;
    border-spacing: 3px;
    margin: 0 auto;
    background: transparent;
    transform-origin: center center;
    table-layout: fixed;

    display: table;
}

.crossword-table tr {
    display: table-row;
}

.crossword-table td {
    display: table-cell;
}

.crossword-cell {
    position: relative;
    text-align: center;
    background-color: #2a2a82;
    border: 3px solid white;
    outline: 3px solid #00000023;
    outline-offset: -6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crossword-cell.empty {
    background-color: transparent;
    box-shadow: none;
    border: none;
    outline: none;
}

.crossword-cell.found {
    animation: pulse 0.5s ease;
}

.word-number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    color: white;
    font-weight: bold;
    display: none;
}

.cell-letter {
    color: white;
    transition: opacity 0.3s ease;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    /* ╨Я╤А╨╡╨┤╨╛╤В╨▓╤А╨░╤Й╨░╨╡╨╝ ╨┐╤А╨╛╨▒╨╗╨╡╨╝╤Л ╤Б ╨▓╤Л╤Б╨╛╤В╨╛╨╣ ╤Б╤В╤А╨╛╨║╨╕ */
}

/* Selected word container */
.selected-word-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    min-height: 45px;
    height: auto;
    flex-shrink: 0;
    z-index: 10;
    margin: 0 auto 5px auto;
    border-radius: 10px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: visible;
}

.selected-word {
    color: white;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    padding: 0 5px;
    height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix for portrait mode text area */
@media (orientation: portrait) and (max-width: 767px) {
    .selected-word-container {
        min-height: 35px;
    }
    
    .selected-word {
        font-size: 20px;
    }
}

.wheel-container {
    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: relative;
}


#letter-wheel {
    position: relative;
    border-radius: 50%;
    background-color: #2a2a82;
    border: 5px solid white;
    outline: 5px solid #00000023;
    outline-offset: -10px;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s ease-out;
    z-index: 30;
    touch-action: none;
    user-select: none;
}

.letter {
    position: absolute;
    background-color: transparent;
    color: white;
    border: none;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: none;
    transition: 
        transform 0.3s ease, 
        left 0.5s ease-in-out, 
        top 0.5s ease-in-out;
    transform-origin: center center;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}

/* Styling for the letter text span inside */
.letter span {
    position: relative;
    /* Needed for z-index to work */
    z-index: 3;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
}

/* Selection Indicator (the circle behind the letter) */
.selection-indicator {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ff9800;
    /* Orange indicator color */
    border-radius: 50%;
    /* Make it a circle */
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
    /* Behind the letter text */
}

.letter.selected .selection-indicator {
    opacity: 1;
    transform: scale(1);
}

.letter.selected {
    /* background-color: #ff9800; */
    /* Removed orange background from letter */
    /* color: #1c1c5c; */
    /* Remove text color change */
    box-shadow: none;
    /* Remove shadow even when selected */
    /* border-color: #ff9800; */
    /* Remove border color change */
}

/* Pop animation on click/tap */
.letter-pop {
    animation: letterPop 0.3s ease-out forwards;
}

@keyframes letterPop {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        /* Increased scale slightly */
        /* box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4); */
        /* More prominent shadow */
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); */
    }
}

/* Connection Lines */
.connection-line {
    position: absolute;
    height: 4px;
    /* Thicker lines */
    /* background-color: #ffeb3b; */
    /* Yellow color for lines */
    background-color: white;
    /* Changed to white */
    border-radius: 2px;
    transform-origin: 0 50%;
    /* box-shadow: 0 0 8px rgba(255, 235, 59, 0.7); */
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
    /* Subtle white glow */
    z-index: 1;
    /* Ensure lines are below letters */
}

/* Container for connection lines (must be positioned) */
.letter-connections {
    position: relative;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.rotate-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    z-index: 5;
}

.rotate-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.rotate-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.rotate-btn.rotating {
    animation: buttonRotate 0.5s ease-in-out;
}

@keyframes buttonRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.rotate-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ffd700;
    opacity: 0.8;
    pointer-events: none;
    z-index: 100;
    will-change: transform, opacity;
}


.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
}

.timer,
.hint-btn {
    display: flex;
    align-items: center;
    height: 40px;
    padding-left: 45px;
    background-size: 35px 35px;
    background-repeat: no-repeat;
    background-position: left center;
    position: relative;
    flex-shrink: 0;
}

.timer {
    background-image: url('assets/timer.png');
}

.timer-display {
    color: white;
    font-size: 16px;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    /* Prevent text selection and revert cursor */
    cursor: inherit;
    /* Use default body cursor (cursor.png) */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Hint button specific styles */
.hint-btn {
    background-image: url('assets/hint.png');
    background-size: 70% 70%;
    background-position: center;
    background-repeat: no-repeat;
    width: 45px;
    height: 45px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgb(255 255 255 / 30%);
    cursor: pointer;
}

/* Style for hint count text */
#hint-count,
#hint-count-portrait {
    color: white;
    font-size: 16px;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    cursor: inherit;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 2px 4px;
    min-width: 12px;
    text-align: center;
}

.hint-btn.no-hints {
    /* Remove animation */
}

.hint-btn.no-hints #hint-count,
.hint-btn.no-hints #hint-count-portrait { 
    font-size: 1.3em; 
    color: #ff9800; 
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
}

.controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 40px;
    height: 40px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.control-btn:hover {
    transform: scale(1.1);
}

/* Particle effects */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 100;
}

/* ╨Ю╨┐╤В╨╕╨╝╨╕╨╖╨╕╤А╨╛╨▓╨░╨╜╨╜╤Л╨╣ ╨║╨╛╨╜╤В╨╡╨╣╨╜╨╡╤А ╨┤╨╗╤П Canvas-╤Б╨╕╤Б╤В╨╡╨╝╤Л ╤З╨░╤Б╤В╨╕╤Ж */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 100;
    will-change: transform;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: gold;
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none;
    border: none;
    outline: none;
    box-shadow: none;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Responsive design */
@media (min-width: 768px) {
    .game-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .top-bar,
    .bottom-bar {
        width: 100%;
    }

    .crossword-container {
        width: 60%;
        height: calc(100vh - 180px);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
    }

    .wheel-container {
        width: 40%;
        height: calc(100vh - 180px);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .selected-word-container {
        position: relative;
        left: 0;
        width: 100%;
    }
    
    .crossword-cell {
        width: 50px;
        height: 50px;
        font-size: 24px;
        aspect-ratio: 1 / 1;
    }
}

@media (min-width: 1200px) {
    .crossword-cell {
        width: 55px;
        height: 55px;
        font-size: 26px;
        aspect-ratio: 1 / 1;
    }

    .letter-wheel {
        width: 350px;
        height: 350px;
    }

    .letter {
        width: 70px;
        height: 70px;
        font-size: 34px;
    }
}

/* Portrait mode optimizations */
@media (max-width: 767px) and (orientation: portrait) {
    .game-container {
        padding: 8px;
        justify-content: flex-start;
        align-items: stretch;
        overflow: hidden;
        gap: 5px;
    }
    
    .crossword-container {
        height: 60%;
        min-height: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 5px 0 0 0;
        width: 100%;
        box-sizing: border-box;
    }
        
    .wheel-container {
        height: 40%;
        width: 100%;
        margin-top: 5px; 
        margin-bottom: 5px;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 0;
        box-sizing: border-box;
        overflow: visible;
    }
    
    .selected-word-container {
        flex-shrink: 0;
        height: 30px;
        margin: 0 auto 3px auto;
    }
    
    .selected-word {
        font-size: 20px;
    }
    
    .bottom-bar {
        flex-shrink: 0;
    }
    
    .top-bar {
        flex-shrink: 0;
    }
    
    .crossword-cell {
        width: 30px;
        height: 30px;
        font-size: 16px;
        aspect-ratio: 1 / 1;
    }
    
    .letter-wheel {
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        position: relative;
        margin: 0 auto;
        flex-shrink: 1;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.6s ease-in-out;
        overflow: visible;
    }
    
    .letter {
        width: 44px;
        height: 44px;
        font-size: 20px;
        border-width: 2px;
    }
    
    .rotate-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-width: 2px;
    }
}

/* ╨Ю╤З╨╡╨╜╤М ╨╜╨╕╨╖╨║╨╕╨╣ ╨┐╨╛╤А╤В╤А╨╡╤В╨╜╤Л╨╣ ╤А╨╡╨╢╨╕╨╝ */
@media (max-width: 767px) and (orientation: portrait) and (max-height: 450px) {
    .game-container {
        padding: 5px;
        gap: 2px;
    }

    .top-bar {
        padding: 5px 8px;
    }

    .level {
        font-size: 16px;
    }

    .coins {
        width: 25px;
        height: 25px;
        background-size: 25px 25px;
    }
    
    #coins-count {
        font-size: 12px;
        margin-left: 25px;
    }

    .crossword-container {
        min-height: 40px;
        margin: 2px auto;
    }

    .wheel-container {
        min-height: 80px;
        margin: 0 auto 2px auto;
    }

    .selected-word-container {
        height: 25px;
        margin: 2px auto 2px auto;
        padding: 0 5px;
    }

    .selected-word {
        font-size: 14px;
    }

    .bottom-bar {
        padding: 5px 0;
    }

    .timer,
    .hint-btn {
        padding: 3px 8px;
    }

    .timer-icon,
    .hint-icon {
        font-size: 16px;
    }
}

@media (min-width: 390px) and (max-width: 430px) and (min-height: 840px) and (orientation: portrait) {
    .crossword-container {
        margin: 15px 0 25px 0;
    }

    .wheel-container {
        margin-top: 15px;
    }
}

@media (min-width: 601px) and (max-width: 1023px) and (orientation: portrait) {
    .game-container {
        gap: 15px;
        justify-content: space-between;
    }
    
    .crossword-container {
        margin: 20px 0;
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
        max-height: none;
        height: auto;
    }
    
    .selected-word-container {
        margin: 15px 0;
        height: 40px;
    }
    
    .selected-word {
        font-size: 26px;
    }
    
    .wheel-container {
        height: 280px;
        margin-top: 10px;
        margin-bottom: 20px;
    }
}

/* Landscape orientation */
@media (orientation: landscape) {
    .game-container {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        padding: 5px;
        overflow: hidden;
        position: relative;
    }
    
    .top-bar,
    .bottom-bar {
        position: absolute;
        width: 100%;
        z-index: 15;
        padding: 5px 10px;
    }
    
    .top-bar {
        top: 0;
        left: 0;
    }

    .bottom-bar {
        bottom: 0;
        left: 0;
    }
    
    .crossword-container {
        width: 50%;
        height: calc(100vh - 80px);
        margin: 40px auto;
        overflow: visible;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .wheel-container {
        width: 50%;
        height: calc(100vh - 80px);
        margin: 40px auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        padding-top: 0;
        overflow: visible; /* Ensure overflow is visible to not crop the wheel */
    }
    
    #letter-wheel {
        position: relative;
        margin: auto; /* Ensure it's centered */
        overflow: visible; /* Allow letters to extend beyond the wheel border */
    }
    
    .selected-word-container {
        position: relative;
        width: 90%;
        max-width: 280px;
        height: 30px;
        margin-bottom: 5px;
        z-index: 10;
        bottom: auto;
        left: auto;
    }
    
    /* ╨Ф╨╗╤П ╨╜╨╕╨╖╨║╨╕╤Е ╤Н╨║╤А╨░╨╜╨╛╨▓ */
    @media (max-height: 600px) {
        .crossword-cell {
            width: 32px;
            height: 32px;
            font-size: 16px;
            aspect-ratio: 1 / 1;
        }
        
        .letter-wheel {
            width: 200px;
            height: 200px;
        }
        
        .letter {
            width: 40px;
            height: 40px;
            font-size: 18px;
            border-width: 2px;
        }
        
        .selected-word {
            font-size: 16px;
        }
        
        .level {
            font-size: 18px;
        }
        
        .rotate-btn {
            width: 40px;
            height: 40px;
            font-size: 18px;
            border-width: 2px;
        }
        
        @media (max-height: 400px) {
            .letter-wheel {
                width: 180px;
                height: 180px;
            }

            .letter {
                width: 36px;
                height: 36px;
                font-size: 16px;
            }
        }
        
        @media (min-height: 401px) and (max-height: 500px) {
            .letter-wheel {
                width: 200px;
                height: 200px;
            }

            .letter {
                width: 40px;
                height: 40px;
                font-size: 18px;
            }
        }
        
        @media (min-height: 501px) {
            .letter-wheel {
                width: 220px;
                height: 220px;
            }

            .letter {
                width: 44px;
                height: 44px;
                font-size: 20px;
            }
        }
    }
    
    /* ╨Ф╨╗╤П ╨▒╨╛╨╗╨╡╨╡ ╨▓╤Л╤Б╨╛╨║╨╕╤Е ╤Н╨║╤А╨░╨╜╨╛╨▓ ╨▓ ╨░╨╗╤М╨▒╨╛╨╝╨╜╨╛╨╣ ╨╛╤А╨╕╨╡╨╜╤В╨░╤Ж╨╕╨╕ */
    @media (min-height: 601px) {
        .letter-wheel {
            width: 260px;
            height: 260px;
        }

        .letter {
            width: 48px;
            height: 48px;
            font-size: 22px;
        }
    }
}

/* ╨б╤А╨╡╨┤╨╜╨╕╨╡ ╤Г╤Б╤В╤А╨╛╨╣╤Б╤В╨▓╨░ */
@media (min-width: 768px) and (max-width: 1023px) {
    @media (orientation: portrait) {
        .crossword-container {
            margin: 15px 0;
            max-height: 55vh;
        }
        
        .wheel-container {
            height: 300px;
            margin: 10px 0 20px 0;
        }
        
        .letter-wheel {
            width: 270px;
            height: 270px;
        }
    }
}

/* ╨С╨╛╨╗╤М╤И╨╕╨╡ ╤Г╤Б╤В╤А╨╛╨╣╤Б╤В╨▓╨░ */
@media (min-width: 1024px) {
    .crossword-container {
        max-height: 65vh;
        margin: 20px auto;
    }
    
    .letter-wheel {
        width: 320px;
        height: 320px;
        margin: 0 auto;
    }
    
    .letter {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}

/* ╨Ф╨╗╤П ╨▒╨╛╨╗╤М╤И╨╕╤Е ╤Г╤Б╤В╤А╨╛╨╣╤Б╤В╨▓ ╨╕ ╨┐╨╗╨░╨╜╤И╨╡╤В╨╛╨▓ */
@media (min-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .crossword-container {
        margin: 15px auto;
    }
    
    .wheel-container {
        margin: 15px auto;
    }
    
    .crossword-table {
        margin: 0 auto;
    }
    
    .letter-wheel {
        margin: 0 auto;
    }
}

/* ╨Ф╨╗╤П ╨╛╤Б╨╛╨▒╨╛ ╨▒╨╛╨╗╤М╤И╨╕╤Е ╤Г╤Б╤В╤А╨╛╨╣╤Б╤В╨▓ */
@media (min-width: 1024px) {
    .crossword-container {
        max-height: 65vh;
        margin: 20px auto;
    }
    
    .wheel-container {
        margin: 20px auto;
    }
    
    .crossword-table {
        margin: 0 auto;
    }
    
    .letter-wheel {
        width: 320px;
        height: 320px;
        margin: 0 auto;
    }
}

/* ╨Ш╤Б╨┐╤А╨░╨▓╨╗╨╡╨╜╨╕╨╡ ╨┤╨╗╤П ╨┐╨╗╨░╨╜╤И╨╡╤В╨╛╨▓ */
@media (min-width: 768px) and (max-width: 1280px) {
    .game-container {
        align-items: center;
        justify-content: center;
    }
    
    .crossword-container,
    .wheel-container {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .crossword-table,
    .letter-wheel {
        margin: 0 auto;
    }
    
    /* ╨Ф╨╗╤П ╨┐╨╗╨░╨╜╤И╨╡╤В╨╛╨▓ ╨▓ ╨░╨╗╤М╨▒╨╛╨╝╨╜╨╛╨╣ ╨╛╤А╨╕╨╡╨╜╤В╨░╤Ж╨╕╨╕ */
    @media (orientation: landscape) {
        .crossword-container {
            width: 50%;
        }
        
        .wheel-container {
            width: 50%;
        }
    }
}

/* ╨Ю╨║╨╜╨╛ ╨╖╨░╨▓╨╡╤А╤И╨╡╨╜╨╕╤П ╤Г╤А╨╛╨▓╨╜╤П */
.level-complete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.level-complete-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.level-complete-overlay.hiding {
    opacity: 0;
    pointer-events: none;
}

.level-complete-modal {
    box-sizing: border-box; 
    padding: 0;

    width: calc(100% - 20px); /* 10px padding on each side */
    max-width: 380px; /* Increase max-width slightly */
    text-align: center;
    position: relative;
    animation: modalAppear 0.5s ease-out forwards;
    transform: scale(0.8);
    overflow: hidden;
    /* Add margin for vertical centering/spacing if needed */
    margin: 10px auto; 

    border-style: solid;
    border-width: 75px;
    border-image-source: url('assets/frame.png');
    border-image-slice: 75 fill;
    border-image-width: 75px;
    border-image-outset: 0;
    border-image-repeat: stretch;
}

@keyframes modalAppear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ╨Ъ╨╛╨╜╤В╨╡╨╣╨╜╨╡╤А ╨┤╨╗╤П ╨▓╨╜╤Г╤В╤А╨╡╨╜╨╜╨╡╨│╨╛ ╤Б╨╛╨┤╨╡╤А╨╢╨╕╨╝╨╛╨│╨╛ ╨╝╨╛╨┤╨░╨╗╤М╨╜╨╛╨│╨╛ ╨╛╨║╨╜╨░ */
.level-complete-modal-content {
    position: relative;
    /* ╨Ф╨╛╨▒╨░╨▓╨╗╤П╨╡╨╝ ╨╛╤В╤Б╤В╤Г╨┐╤Л ╨▓╨╜╤Г╤В╤А╨╕ */
    padding: 15px;
    /* ╨Ф╨╕╨╜╨░╨╝╨╕╤З╨╡╤Б╨║╨╕╨╣ ╨╝╨░╤Б╤И╤В╨░╨▒ ╨┤╨╗╤П ╨┐╨╛╨┤╤Б╤В╤А╨╛╨╣╨║╨╕ ╨║╨╛╨╜╤В╨╡╨╜╤В╨░ */
    transform-origin: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.level-complete-stars {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    /* ╨Ф╨╡╨╗╨░╨╡╨╝ ╨║╨╛╨╜╤В╨╡╨╣╨╜╨╡╤А ╨┤╨╗╤П ╨╖╨▓╨╡╨╖╨┤ ╨│╨╕╨▒╨║╨╕╨╝ */
    flex-shrink: 0;
}

.star {
    /* ╨Ф╨╛╨▒╨░╨▓╨╗╤П╨╡╨╝ ╨╝╨╕╨╜╨╕╨╝╨░╨╗╤М╨╜╤Л╨╣ ╤А╨░╨╖╨╝╨╡╤А ╨┤╨╗╤П ╨╖╨▓╨╡╨╖╨┤ */
    min-width: 60px;
    min-height: 60px;
    width: 60px;
    height: 60px;
    background-image: url('assets/star.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    margin: 0 5px;
    opacity: 0;
    position: relative;
    z-index: 1500;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Style for the middle star */
.star.middle {
    transform: scale(1.3);
}

.level-complete-title {
    font-size: 18px; /* Base size for landscape/desktop */
    color: white;
    margin: 10px 0;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;

    white-space: nowrap; /* Ensure single line */
    overflow: hidden;    /* Hide overflow */
    text-overflow: ellipsis; /* Add ... if text overflows */
    width: 100%; 
    height: auto; 
    min-height: 1.2em;
    flex-shrink: 0;
}

.level-complete-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: waveEffect 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
}

@keyframes waveEffect {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    50% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.level-complete-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
    animation: statsAppear 1s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    /* ╨з╤В╨╛╨▒╤Л ╨║╨╛╨╜╤В╨╡╨╜╤В ╨┐╨╛╨┤╤Б╤В╤А╨░╨╕╨▓╨░╨╗╤Б╤П ╨┐╨╛╨┤ ╨┤╨╛╤Б╤В╤Г╨┐╨╜╨╛╨╡ ╨┐╤А╨╛╤Б╤В╤А╨░╨╜╤Б╤В╨▓╨╛ */
    width: 100%;
    flex-shrink: 0;
}

@keyframes statsAppear {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 8px;
    border-radius: 10px;
    /* ╨Ф╨╛╨▒╨░╨▓╨╗╤П╨╡╨╝ ╨│╨╕╨▒╨║╨╛╤Б╤В╤М ╨┤╨╗╤П ╨░╨┤╨░╨┐╤В╨░╤Ж╨╕╨╕ */
    flex-shrink: 0;
}

/* Style for new image icons in stats */
.stat-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.stat-value {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
        -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.next-level-btn {
    background: linear-gradient(135deg, #00a1e4 0%, #0091d0 100%);
    border: none;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
    pointer-events: none;
    margin-top: 10px;
    /* ╨Ю╨▒╨╡╤Б╨┐╨╡╤З╨╕╨▓╨░╨╡╨╝ ╨│╨╕╨▒╨║╨╛╤Б╤В╤М ╨║╨╜╨╛╨┐╨║╨╕ */
    flex-shrink: 0;
    /* ╨Ф╨╗╤П ╨┐╨╛╨┤╨┤╨╡╤А╨╢╨║╨╕ ╨╛╨┤╨╜╨╛╨╣ ╤Б╤В╤А╨╛╨║╨╕ */
    white-space: nowrap;
}

/* ╨Ф╨╛╨┐╨╛╨╗╨╜╨╕╤В╨╡╨╗╤М╨╜╤Л╨╡ ╤З╨░╤Б╤В╨╕╤Ж╤Л ╨┤╨╗╤П ╨╛╨║╨╜╨░ ╨╖╨░╨▓╨╡╤А╤И╨╡╨╜╨╕╤П ╤Г╤А╨╛╨▓╨╜╤П */
.confetti {
    position: absolute;
    z-index: 999;
    /* ╨г╨▒╨╡╨┤╨╕╨╝╤Б╤П, ╤З╤В╨╛ ╨║╨╛╨╜╤Д╨╡╤В╤В╨╕ ╨╜╨╕╨╢╨╡ ╨║╨╛╨╜╤В╨╡╨╣╨╜╨╡╤А╨░ ╨╕ ╨╝╨╛╨┤╨░╨╗╤М╨╜╨╛╨│╨╛ ╨╛╨║╨╜╨░ */
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(1000px) rotate(360deg);
        opacity: 0;
    }
}

/* ╨Ь╨╡╨┤╨╕╨░-╨╖╨░╨┐╤А╨╛╤Б╤Л ╨┤╨╗╤П top-bar */
@media (max-width: 768px) {
    .top-bar {
        padding: 8px 12px;
    }
    
    .level {
        font-size: 20px;
    }
}

@media (orientation: portrait) {
    .top-bar {
        justify-content: space-between;
    }
}

@media (orientation: landscape) {
    .top-bar {
        justify-content: space-between;
    }
}

/* ╨Э╨╛╨▓╤Л╨╡ ╤Н╤Д╤Д╨╡╨║╤В╤Л ╨▓ ╤Б╤В╨╕╨╗╨╡ ╨║╨╛╨╝╨╕╨║╤Б╨░ */
.comic-burst {
    position: absolute;
    width: 80px;
    height: 80px;
    background-color: #fff000;
    border-radius: 50%;
    box-shadow: 0 0 20px #fff000;
    transform: translate(-50%, -50%);
    z-index: 90;
    pointer-events: none;
    clip-path: polygon(50% 0%, 63% 25%, 87% 17%, 75% 40%, 100% 50%,
        75% 60%, 87% 83%, 63% 75%, 50% 100%, 37% 75%, 
            13% 83%, 25% 60%, 0% 50%, 25% 40%, 13% 17%, 37% 25%);
}

.comic-star {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffff00;
    transform: translate(-50%, -50%);
    z-index: 91;
    pointer-events: none;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
            50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.comic-cloud {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 89;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}

.comic-cloud::before,
.comic-cloud::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background-color: white;
}

.comic-cloud::before {
    width: 25px;
    height: 25px;
    top: -10px;
    left: 5px;
}

.comic-cloud::after {
    width: 30px;
    height: 30px;
    top: 0;
    left: -15px;
}

.rotate-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #2a3682;
}

/* ╨Р╨╜╨╕╨╝╨░╤Ж╨╕╤П ╤Н╨╗╨░╤Б╤В╨╕╨║╨╕ ╨┤╨╗╤П ╨║╨╜╨╛╨┐╨║╨╕ rotate-btn */
@keyframes elastic {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
    }

    40% {
        transform: translate(-50%, -50%) scale(1.2);
    }

    60% {
        transform: translate(-50%, -50%) scale(0.9);
    }

    80% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.rotate-btn.elastic {
    animation: elastic 0.8s ease-in-out;
}

@media (min-width: 768px),
(orientation: landscape) {
    .wheel-container {
        justify-content: center;
    }
    
    .selected-word-container {
        flex-shrink: 0;
        margin: 10px auto 10px auto;
        height: 35px;
    }
    
    .letter-wheel {
        margin: 0 auto;
    }
}

/* ╨Ю╨║╨╜╨╛ ╨╖╨░╨▓╨╡╤А╤И╨╡╨╜╨╕╤П ╤Г╤А╨╛╨▓╨╜╤П - ╨Р╨┤╨░╨┐╤В╨░╤Ж╨╕╤П ╨┤╨╗╤П Landscape ╨╜╨░ ╤В╨╡╨╗╨╡╤Д╨╛╨╜╨░╤Е */
@media (orientation: landscape) and (max-height: 500px) {
    .level-complete-modal {
        max-height: 90vh;
        /* Increase width for short landscape screens */
        width: 75%; 
        max-width: 500px; /* Allow more max width */
        border-width: 50px;
        border-image-slice: 50 fill;
        border-image-width: 50px;
    }

    .level-complete-modal-content {
        padding: 5px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 5px;
        overflow: hidden;
        align-items: center;
    }

    .level-complete-stars {
        margin-bottom: 5px;
        grid-column: 1 / span 2;
    }

    .level-complete-title {
        /* Slightly smaller font for short landscape */
        font-size: clamp(0.7rem, 2.5vw, 1.1rem); 
        margin: 3px 0;
        grid-column: 1 / span 2;
    }

    .level-complete-stats {
        gap: 2px;
        margin: 3px 0;
        grid-column: 1;
    }

    .next-level-btn {
        padding: 5px 12px;
        font-size: clamp(0.8rem, 2.5vw, 0.9rem);
        margin-top: 5px;
        min-height: 30px;
        grid-column: 2;
        align-self: center;
        justify-self: center;
    }

    .stat {
        padding: 3px 5px;
        gap: 3px;
    }

    .stat-icon-img {
        width: 14px;
        height: 14px;
    }

    .stat-value {
        font-size: clamp(0.7rem, 2vw, 0.8rem);
    }
}

/* General landscape rule for width adjustment */
@media (orientation: landscape) and (min-height: 501px) {
    .level-complete-modal {
         /* Allow more width on taller landscape screens/PCs */
        width: 60%; /* Wider percentage */
        max-width: 550px; /* Increase max width further */
    }
    
    .level-complete-title {
        /* Ensure base font size is adequate */
         font-size: clamp(0.8rem, 2.8vw, 1.4rem); 
    }
}

/* ╨Ф╨╛╨▒╨░╨▓╨╗╤П╨╡╨╝ ╨╛╨▒╤Й╨╕╨╡ ╤Б╤В╨╕╨╗╨╕ ╨┤╨╗╤П ╤Б╨╝╨░╤А╤В╤Д╨╛╨╜╨╛╨▓ ╨▓ ╨┐╨╛╤А╤В╤А╨╡╤В╨╜╨╛╨╣ ╨╛╤А╨╕╨╡╨╜╤В╨░╤Ж╨╕╨╕ */
@media (orientation: portrait) and (max-width: 480px) {
    .level-complete-modal {
        /* Keep calc for width, adjust max-width if necessary */
        width: calc(100% - 20px);
        max-width: 350px; /* Can keep this smaller for narrow phones */
        border-width: 60px;
        border-image-slice: 60 fill;
        border-image-width: 60px;
        /* Keep padding inside content */
    }

    .level-complete-modal-content {
        padding: 10px;
    }

    .level-complete-title {
        /* More aggressive scaling for portrait */
        font-size: clamp(0.7rem, 4.5vw, 1.3rem);
        margin-bottom: 8px; /* Slightly less margin */
    }

    .star {
        min-width: 50px;
        min-height: 50px;
        width: 50px;
        height: 50px;
    }
}

/* Add specific rule for very narrow screens like iPhone SE */
@media (max-width: 375px) and (orientation: portrait) {
    .level-complete-title {
        font-size: 0.8rem; /* Use a smaller fixed size */
    }
}

.transition-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #00507a;
    pointer-events: auto; 
    z-index: 20000; 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

/* ╨Э╨╛╨▓╨░╤П ╨░╨╜╨╕╨╝╨░╤Ж╨╕╤П Bounce */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ╨б╤В╨╕╨╗╨╕ ╨┤╨╗╤П ╨╛╨║╨╜╨░ ╨┐╨╛╨║╤Г╨┐╨║╨╕ ╨┐╨╛╨┤╤Б╨║╨░╨╖╨╛╨║ - ╨┐╨╛╨╗╨╜╨╛╤Б╤В╤М╤О ╨╛╨▒╨╜╨╛╨▓╨╗╨╡╨╜╨╜╤Л╨╡ */
.buy-hints-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.buy-hints-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.buy-hints-overlay.hiding {
    opacity: 0;
    transition: opacity 0.3s ease;
}


.buy-hints-modal {
    box-sizing: border-box;
    padding: 0;
    width: 85%;
    max-width: 350px;
    max-height: 85vh;
    text-align: center;
    position: relative;
    overflow: visible;
    transform: scale(0.9);
    transition: transform 0.3s ease;

    border-style: solid;
    border-width: 60px;
    border-image-source: url('assets/frame.png');
    border-image-slice: 60 fill;
    border-image-width: 60px;
    border-image-outset: 0;
    border-image-repeat: stretch;
}

.buy-hints-overlay.active .buy-hints-modal {
    transform: scale(1);
}

/* ╨Ъ╨╛╨╜╤В╨╡╨╣╨╜╨╡╤А ╨┤╨╗╤П ╨▓╨╜╤Г╤В╤А╨╡╨╜╨╜╨╡╨│╨╛ ╤Б╨╛╨┤╨╡╤А╨╢╨╕╨╝╨╛╨│╨╛ */
.buy-hints-content {
    position: relative;
    padding: 15px;
    transform-origin: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    margin-bottom: 0;
    overflow: visible;
    max-height: none;
}

.buy-hints-title {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    color: white;
    margin: 5px 0 15px 0;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    text-align: center;
    width: 100%;
}

.hints-items-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
    margin-bottom: 15px;
    overflow: visible;
}

.hint-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background-color: rgb(255 255 255 / 30%);
    border-radius: 30px;
    width: 100%;
    gap: 5px;
}


.hint-icon-large {
    width: 45px;
    height: 45px;
    margin: 0;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
    user-drag: none;
}


.hint-count-display {
    font-size: clamp(0.8rem, 2.8vw, 1rem);
    margin: 0;
    text-align: center;
    flex-grow: 0;
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
        -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
}

/* ╨б╤В╨╕╨╗╤М ╨┤╨╗╤П ╨║╨╜╨╛╨┐╨║╨╕ ╨┐╨╛╨║╤Г╨┐╨║╨╕ ╤Б╨╛ ╨▓╤Б╤В╤А╨╛╨╡╨╜╨╜╨╛╨╣ ╤Ж╨╡╨╜╨╛╨╣ */
.buy-hint-button,
.buy-rocket-hint-button,
.buy-hammer-hint-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 10px;
    background-color: #ff9800;
    color: white;
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
        -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
    cursor: pointer;
    border: none;
    border-style: solid;
    border-width: 24px;
    border-image-source: url('assets/button.png');
    border-image-slice: 56 fill;
    border-image-width: auto;
    border-image-outset: 0;
    border-image-repeat: stretch;
    box-sizing: border-box;
    max-width: 130px;
    width: 120px;
    flex-shrink: 0;
    transform-origin: center;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.buy-hint-button:hover,
.buy-rocket-hint-button:hover,
.buy-hammer-hint-button:hover {
    filter: brightness(1.1);
}

.buy-hint-button:active,
.buy-rocket-hint-button:active,
.buy-hammer-hint-button:active {
    filter: brightness(0.9);
}

.buy-hint-button.disabled,
.buy-rocket-hint-button.disabled,
.buy-hammer-hint-button.disabled {
    filter: grayscale(80%) brightness(0.8);
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* ╨б╤В╨╕╨╗╤М ╨┤╨╗╤П ╤Ж╨╡╨╜╤Л ╨▓╨╜╤Г╤В╤А╨╕ ╨║╨╜╨╛╨┐╨║╨╕ */
.hint-price {
    font-weight: bold;
    color: white;
    white-space: nowrap;
}

/* ╨б╤В╨╕╨╗╤М ╨┤╨╗╤П ╨╕╨║╨╛╨╜╨║╨╕ ╨╝╨╛╨╜╨╡╤В╤Л ╨▓╨╜╤Г╤В╤А╨╕ ╨║╨╜╨╛╨┐╨║╨╕ */
.coin-icon-small {
    width: 20px;
    height: 20px;
    background: url('assets/coin.png') no-repeat center center;
    background-size: contain;
    display: inline-block;
    flex-shrink: 0;
    margin-left: 3px;
}

/* ╨Ъ╨╜╨╛╨┐╨║╨░ ╨╖╨░╨║╤А╤Л╤В╤М */
.close-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    background-color: #777;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    color: white;
    text-shadow:
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
        -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
    width: 80%;
    padding: 6px 12px;
    font-size: clamp(0.8rem, 3vw, 1rem);
    cursor: pointer;
    
    border-style: solid;
    border-width: 28px;
    border-image-source: url('assets/button.png');
    border-image-slice: 56 fill;
    border-image-width: auto;
    border-image-outset: 0;
    border-image-repeat: stretch;
    box-sizing: border-box;
    transform-origin: center;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.close-btn:hover {
    filter: brightness(1.1);
}

.close-btn:active {
    filter: brightness(0.9);
}


@media (max-width: 480px) {
    .buy-hints-modal {
        width: 85%;
        border-width: 40px;
        overflow: visible;
        max-height: none;
    }

    .buy-hints-content {
        padding: 10px;
        overflow: visible;
        max-height: none;
    }

    .hint-icon-large {
        width: 45px;
        height: 45px;
    }
    
    .hints-items-container {
        gap: 15px;
    }
    
    .hint-count-display {
        font-size: clamp(0.7rem, 2.5vw, 0.9rem);
        margin: 0;
        flex-basis: 80px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        font-size: clamp(0.65rem, 2.3vw, 0.8rem);
        padding: 3px 6px;
        border-width: 20px;
        max-width: 110px;
        width: 100px;
        margin: 0;
    }
}


@media (min-width: 768px) {
    .buy-hints-modal {
        max-width: 400px;
        border-width: 40px;
        overflow: visible;
        max-height: none;
    }

    .buy-hints-content {
        overflow: visible;
        max-height: none;
    }

    .hints-items-container {
        flex-direction: column;
        gap: 20px;
        overflow: visible;
    }

    .hint-item {
        width: 100%;
    }

    .hint-icon-large {
        width: 45px;
        height: 45px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        max-width: 140px;
        width: 130px;
        padding: 4px 8px;
        border-width: 24px;
    }
}

/* ╨б╤В╨╕╨╗╨╕ ╨┤╨╗╤П ╤З╨░╤Б╤В╨╕╤Ж ╨╖╨▓╨╡╨╖╨┤ */
.star-particle {
    position: absolute;
    background-color: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 10px 4px rgba(255, 215, 0, 0.8);
    /* ╨г╨▓╨╡╨╗╨╕╤З╨╕╨▓╨░╨╡╨╝ ╤А╨░╨╖╨╝╨╡╤А ╨╕ ╤П╤А╨║╨╛╤Б╤В╤М ╤Б╨▓╨╡╤З╨╡╨╜╨╕╤П */
    z-index: 2000;
    pointer-events: none;
    /* ╨Ф╨╛╨▒╨░╨▓╨╗╤П╨╡╨╝ ╤Н╤Д╤Д╨╡╨║╤В ╤А╨░╨┤╤Г╨╢╨╜╨╛╨│╨╛ ╤Б╨▓╨╡╤З╨╡╨╜╨╕╤П */
    animation: starParticleGlow 0.6s ease-out alternate infinite;
}

/* ╨Р╨╜╨╕╨╝╨░╤Ж╨╕╤П ╤Б╨▓╨╡╤З╨╡╨╜╨╕╤П ╨┤╨╗╤П ╤З╨░╤Б╤В╨╕╤Ж ╨╖╨▓╨╡╨╖╨┤ */
@keyframes starParticleGlow {
    0% {
        box-shadow: 0 0 8px 2px rgba(255, 215, 0, 0.7);
    }

    100% {
        box-shadow: 0 0 12px 6px rgba(255, 215, 0, 0.9);
    }
}

/* Styles for confetti */
.confetti {
    position: absolute;
    z-index: 999;
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(1000px) rotate(360deg);
        opacity: 0;
    }
}

.letter-wheel.rotating .letter {
    pointer-events: none !important;
    cursor: default !important;
}

/* Disable letter interaction when rotating */
.letter.rotating {
    pointer-events: none !important;
    cursor: default !important;
}

/* ╨Ъ╨╜╨╛╨┐╨║╨░ ╨▓ ╨╜╨╡╨░╨║╤В╨╕╨▓╨╜╨╛╨╝ ╤Б╨╛╤Б╤В╨╛╤П╨╜╨╕╨╕ - ╨▒╨╗╨╛╨║╨╕╤А╤Г╨╡╤В ╤В╨╛╨╗╤М╨║╨╛ ╨║╨╗╨╕╨║╨╕, ╤Б╨╛╤Е╤А╨░╨╜╤П╨╡╤В ╨▓╨╜╨╡╤И╨╜╨╕╨╣ ╨▓╨╕╨┤ */
.rotate-btn.inactive {
    pointer-events: none;
    /* ╨С╨╗╨╛╨║╨╕╤А╤Г╨╡╤В ╤Б╨╛╨▒╤Л╤В╨╕╤П ╨║╨╗╨╕╨║╨░ */
    cursor: default !important;
    /* ╨Я╤А╨╡╨┤╨╛╤В╨▓╤А╨░╤Й╨░╨╡╤В ╤Б╨╝╨╡╨╜╤Г ╨║╤Г╤А╤Б╨╛╤А╨░ ╨┐╤А╨╕ ╨╜╨░╨▓╨╡╨┤╨╡╨╜╨╕╨╕ */
}

/* ╨г╨╗╤Г╤З╤И╨╡╨╜╨╜╤Л╨╡ ╤Б╤В╨╕╨╗╨╕ ╨┤╨╗╤П ╨╝╨╛╨╜╨╡╤В ╨┐╤А╨╕ ╨╝╨░╨╗╨╡╨╜╤М╨║╨╕╤Е ╤Н╨║╤А╨░╨╜╨░╤Е */
.coins {
    background-image: url('assets/coin.png');
    position: relative;
}

#coins-count {
    color: white;
    font-size: 16px;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ╨Р╨┤╨░╨┐╤В╨░╤Ж╨╕╤П ╨┤╨╗╤П ╨╝╨░╨╗╤Л╤Е ╤Н╨║╤А╨░╨╜╨╛╨▓: ╨╝╨╡╨╜╤М╤И╨╡ ╨╛╤В╤Б╤В╤Г╨┐ ╨┤╨╗╤П ╨╝╨╛╨╜╨╡╤В */
@media (max-width: 480px) {
    .coins {
        padding-left: 0;
        background-size: 30px 30px;
        width: 30px;
        height: 30px;
    }

    #coins-count {
        font-size: 14px;
        padding-left: 5px;
        margin-left: 30px;
    }
}

/* ╨Р╨┤╨░╨┐╤В╨░╤Ж╨╕╤П ╨┤╨╗╤П ╨╛╤З╨╡╨╜╤М ╨╝╨░╨╗╨╡╨╜╤М╨║╨╕╤Е ╤Н╨║╤А╨░╨╜╨╛╨▓ (iPhone SE ╨╕ ╤В.╨┐.) */
@media (max-width: 375px) {
    .coins {
        width: 28px;
        height: 28px;
        background-size: 28px 28px;
    }

    #coins-count {
        font-size: 13px;
        padding-left: 3px;
        margin-left: 28px;
    }
}

/* ╨Я╨╛╤А╤В╤А╨╡╤В╨╜╨░╤П ╨╛╤А╨╕╨╡╨╜╤В╨░╤Ж╨╕╤П ╨┤╨╗╤П ╤В╨╡╨╗╨╡╤Д╨╛╨╜╨╛╨▓ */
@media (max-width: 767px) and (orientation: portrait) {
    .coins {
        width: 30px;
        height: 30px;
        background-size: 30px 30px;
    }
    
    #coins-count {
        margin-left: 30px;
    }

    .top-bar {
        padding: 5px 10px;
    }
}

/* ╨Ю╤З╨╡╨╜╤М ╨╜╨╕╨╖╨║╨╕╨╡ ╤Н╨║╤А╨░╨╜╤Л ╨▓ ╨┐╨╛╤А╤В╤А╨╡╤В╨╜╨╛╨╝ ╤А╨╡╨╢╨╕╨╝╨╡ (╤Б╤В╨░╤А╤Л╨╡ iPhone ╨╕ ╤В.╨┐.) */
@media (max-width: 767px) and (orientation: portrait) and (max-height: 450px) {
    .coins {
        width: 25px;
        height: 25px;
        background-size: 25px 25px;
    }
    
    #coins-count {
        font-size: 12px;
        margin-left: 25px;
    }

    .crossword-container {
        min-height: 40px;
        margin: 2px auto;
    }

    .wheel-container {
        min-height: 80px;
        margin: 0 auto 2px auto;
    }

    .selected-word-container {
        height: 25px;
        margin: 2px auto 2px auto;
        padding: 0 5px;
    }

    .selected-word {
        font-size: 16px;
    }

    .bottom-bar {
        padding: 5px 0;

    }

    .timer,
    .hint-btn {
        padding: 3px 8px;
    }

    .timer-icon,
    .hint-icon {
        font-size: 16px;
    }
}

/* --- Button 9-Patch Styling --- */

/* Common styles for 9-patch buttons */
.button-9patch {
    border: none;
    padding: 4px 12px;
    color: white;
    cursor: pointer;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    background-color: transparent;
    background-clip: padding-box;
    position: relative;

    border-style: solid;
    border-width: 28px;
    border-image-source: url('assets/button.png');
    border-image-slice: 56 fill;
    border-image-width: auto;
    border-image-outset: 0;
    border-image-repeat: stretch;
    box-sizing: border-box;

    box-shadow: none;
    line-height: 1.2;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    
    transform-origin: center;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Remove hover/active background changes, keep transforms */
.button-9patch:hover {
    filter: brightness(1.1);
}

.button-9patch:active {
    filter: brightness(0.9);
}

/* Apply common style to specific buttons */
.next-level-btn,
.buy-hints-buttons .buy-btn,
.buy-hints-buttons .cancel-btn {
    /* Inherit from .button-9patch */
}

/* Specific button overrides if needed */
.next-level-btn {
    font-size: clamp(1rem, 4vw, 1.25rem);
    /* Keep responsive font */
    opacity: 0;
    /* Keep initial state */
    pointer-events: none;
    /* Keep initial state */
    margin-top: 10px;
    width: auto;
    /* Let button size itself based on content + padding */
}

.buy-hints-buttons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    /* Reduced gap */
    margin-top: 15px;
    /* Reduced margin */
}

.cancel-btn,
.buy-btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 4px 6px;
    min-height: 32px;
    /* Reduced minimum height */
    border-width: 25px;
}

.buy-btn.disabled {
    /* How to show disabled state with border-image? Use opacity or filter */
    filter: grayscale(80%) brightness(0.8);
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}


.button-9patch.hover-scale {
    filter: brightness(1.1);
}


.hint-btn,
.rocket-hint-btn,
.sound-btn,
.button-9patch,
.letter,
.rotate-btn,
.piggy-bank {
    cursor: url('assets/cursor-2.png'), pointer !important;
}


.hint-btn span,
.rocket-hint-btn span,
.timer span {
    cursor: inherit;
}

/* ╨Р╨╜╨╕╨╝╨░╤Ж╨╕╤П ╨┤╨╗╤П ╨┐╨╛╨║╤Г╨┐╨║╨╕ ╨┐╨╛╨┤╤Б╨║╨░╨╖╨╛╨║ */
.hint-btn.hint-purchased,
.rocket-hint-btn.rocket-hint-purchased,
.hammer-hint-btn.hammer-hint-purchased,
.buy-hint-button.hint-purchased,
.buy-rocket-hint-button.rocket-hint-purchased,
.buy-hammer-hint-button.hammer-hint-purchased {
    animation: brightnessChange 0.8s ease;
}

@keyframes brightnessChange {
    0% {
        filter: brightness(1);
    }
    20% {
        filter: brightness(1.3);
    }
    100% {
        filter: brightness(1);
    }
}

.buy-hint-button.disabled,
.buy-rocket-hint-button.disabled,
.buy-hammer-hint-button.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5) brightness(0.8);
}

/* ╨Р╨╜╨╕╨╝╨░╤Ж╨╕╤П ╨┤╨╗╤П ╨╗╨╕╤Б╤В╤М╨╡╨▓ ╨╕ ╤Б╨╜╨╡╨│╨░ ╤Б ╨▓╤А╨░╤Й╨╡╨╜╨╕╨╡╨╝ */
@keyframes fall-rotate {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(105vh) rotate(360deg);
        opacity: 0;
    }
}

/* ╨Ф╨╛╨┐╨╛╨╗╨╜╨╕╤В╨╡╨╗╤М╨╜╤Л╨╡ ╨░╨╜╨╕╨╝╨░╤Ж╨╕╨╕ ╨┤╨╗╤П ╤А╨░╨╖╨╜╤Л╤Е ╤Г╨│╨╗╨╛╨▓ ╨▓╤А╨░╤Й╨╡╨╜╨╕╤П ╨╗╨╕╤Б╤В╤М╨╡╨▓ */
@keyframes fall-rotate-45 {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(105vh) rotate(45deg);
        opacity: 0;
    }
}

@keyframes fall-rotate-90 {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(105vh) rotate(90deg);
        opacity: 0;
    }
}

@keyframes fall-rotate-180 {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(105vh) rotate(180deg);
        opacity: 0;
    }
}

@keyframes fall-rotate-270 {
    from {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    to {
        transform: translateY(105vh) rotate(270deg);
        opacity: 0;
    }
}

/* ╨Р╨╜╨╕╨╝╨░╤Ж╨╕╤П ╨┤╨╗╤П ╨┤╨╛╨╢╨┤╤П ╨▒╨╡╨╖ ╨▓╤А╨░╤Й╨╡╨╜╨╕╤П */
@keyframes fall-straight {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(105vh);
        opacity: 0;
    }
}

/* ╨б╤В╨╕╨╗╤М ╨┤╨╗╤П ╨▓╤Б╨╡╤Е ╨┐╨╛╨│╨╛╨┤╨╜╤Л╤Е ╤З╨░╤Б╤В╨╕╤Ж */
.weather-particle {
    position: absolute;
    top: -60px;
    pointer-events: none;
    z-index: -10;
    /* ╨Х╤Й╨╡ ╨╜╨╕╨╢╨╡, ╤З╤В╨╛╨▒╤Л ╨│╨░╤А╨░╨╜╤В╨╕╤А╨╛╨▓╨░╨╜╨╜╨╛ ╨▒╤Л╤В╤М ╨┐╨╛╨┤ ╨▓╤Б╨╡╨╝╨╕ ╤Н╨╗╨╡╨╝╨╡╨╜╤В╨░╨╝╨╕ */
    will-change: transform, opacity;
    /* ╨Ю╨┐╤В╨╕╨╝╨╕╨╖╨░╤Ж╨╕╤П ╨░╨╜╨╕╨╝╨░╤Ж╨╕╨╕ */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ╨С╨░╨╖╨╛╨▓╤Л╨╡ ╤Ж╨▓╨╡╤В╨░ (╨Ы╨╡╤В╨╛ - ╤Б╨┤╨╡╨╗╨░╨╡╨╝ ╨╖╨╡╨╗╨╡╨╜╤Л╨╝) */
.theme-sunny .crossword-cell:not(.empty) {
    background-color: #4CAF50;
}

/* ╨Ч╨╡╨╗╨╡╨╜╤Л╨╣ */
.theme-sunny #letter-wheel {
    background-color: #4CAF50;
}

.theme-sunny body {
    background-color: #81C784;
}

/* ╨б╨▓╨╡╤В╨╗╨╛-╨╖╨╡╨╗╨╡╨╜╤Л╨╣ ╤Д╨╛╨╜ */

/* ╨в╨╡╨╝╨░ ╨Ф╨╛╨╢╨┤╤П (╨б╨╡╤А╨╛-╤Б╨╕╨╜╨╕╨╣) */
.theme-rainy .crossword-cell:not(.empty) {
    background-color: #546E7A;
}

/* ╨в╨╡╨╝╨╜╤Л╨╣ ╤Б╨╡╤А╨╛-╤Б╨╕╨╜╨╕╨╣ */
.theme-rainy #letter-wheel {
    background-color: #546E7A;
}

.theme-rainy body {
    background-color: #78909C;
}

/* ╨С╨╛╨╗╨╡╨╡ ╤Б╨▓╨╡╤В╨╗╤Л╨╣ ╤Б╨╡╤А╨╛-╤Б╨╕╨╜╨╕╨╣ ╤Д╨╛╨╜ */

/* ╨в╨╡╨╝╨░ ╨б╨╜╨╡╨│╨░ (╨У╨╛╨╗╤Г╨▒╨╛╨╣/╨б╨╕╨╜╨╕╨╣) */
.theme-snowy .crossword-cell:not(.empty) {
    background-color: #42A5F5;
}

/* ╨п╤А╨║╨╛-╨│╨╛╨╗╤Г╨▒╨╛╨╣ */
.theme-snowy #letter-wheel {
    background-color: #42A5F5;
}

.theme-snowy body {
    background-color: #90CAF9;
}

/* ╨в╨╡╨╝╨░ ╨Ю╤Б╨╡╨╜╨╕ (╨Ю╤А╨░╨╜╨╢╨╡╨▓╤Л╨╣/╨Ъ╨╛╤А╨╕╤З╨╜╨╡╨▓╤Л╨╣) */
.theme-autumn .crossword-cell:not(.empty) {
    background-color: #e77700;
}

.theme-autumn #letter-wheel {
    background-color: #e77700;
}

.theme-autumn body {
    background-color: #FFAB91;
}


.transition-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #00507a;
    pointer-events: auto; 
    z-index: 20000; 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.transition-mask.out .mask-hole {
    width: 0;
    height: 0;
}

.transition-mask.in .mask-hole {
    width: 200vmax;
    height: 200vmax;
}


/* ╨Э╨╛╨▓╨░╤П ╨░╨╜╨╕╨╝╨░╤Ж╨╕╤П Bounce */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ╨Ю╨▒╤Й╨╕╨╡ ╤Б╤В╨╕╨╗╨╕ ╨┤╨╗╤П ╤Д╨╛╨╜╨╛╨▓╨╛╨│╨╛ ╨╕╨╖╨╛╨▒╤А╨░╨╢╨╡╨╜╨╕╤П */
body:before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    z-index: -1;
    transition: background-image 0.5s ease-in-out;
}

body.theme-sunny:before {
    background-image: url('assets/bg/summer/summer-background.png');
}

body.theme-rainy:before {
    background-image: url('assets/bg/rainy/rainy-background.png');
}

body.theme-snowy:before {
    background-image: url('assets/bg/winter/winter-background.png');
}

body.theme-autumn:before {
    background-image: url('assets/bg/autumn/autumn-background.png');
}

@media (min-width: 1024px) {
    body:before {
        background-size: cover;
    }
}

@media (max-width: 1023px) {
    body:before {
        background-size: cover;
}
}

@media (orientation: landscape) {
    body:before {
        background-size: cover;
        background-position: center center;
    }
}

#weather-particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.bottom-bar,
.bottom-bar * {
    pointer-events: auto !important;
}

/* ╨н╤Д╤Д╨╡╨║╤В ╨┤╨╗╤П ╨║╨╛╨┐╨╕╨╗╨║╨╕ */
.piggy-bank-effect {
    position: absolute;
    width: 80px;
    height: 80px;
    background-color: #ff9800;
    /* ╨Ю╤А╨░╨╜╨╢╨╡╨▓╤Л╨╣ ╤Ж╨▓╨╡╤В */
    border-radius: 50%;
    box-shadow: 0 0 20px #ffd700;
    /* ╨Ч╨╛╨╗╨╛╤В╨╕╤Б╤В╨╛╨╡ ╤Б╨▓╨╡╤З╨╡╨╜╨╕╨╡ */
    transform: translate(-50%, -50%);
    z-index: 90;
    pointer-events: none;
    clip-path: polygon(50% 0%, 63% 25%, 87% 17%, 75% 40%, 100% 50%,
            75% 60%, 87% 83%, 63% 75%, 50% 100%, 37% 75%, 
            13% 83%, 25% 60%, 0% 50%, 25% 40%, 13% 17%, 37% 25%);
    animation: piggyBankEffect 0.6s ease-out forwards;
}

/* ╨Ь╨░╨╗╨╡╨╜╤М╨║╨╕╨╡ ╤З╨░╤Б╤В╨╕╤Ж╤Л ╨┤╨╗╤П ╤Н╤Д╤Д╨╡╨║╤В╨░ ╨║╨╛╨┐╨╕╨╗╨║╨╕ */
.piggy-coin-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    /* ╨Ч╨╛╨╗╨╛╤В╨╛╨╣ */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 91;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    animation: piggyParticleFloat 0.8s ease-out forwards;
}

@keyframes piggyBankEffect {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
}

    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

@keyframes piggyParticleFloat {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x-offset)), calc(-50% + var(--y-offset))) scale(0.2);
        opacity: 0;
    }
}

/* Rocket hint button specific styles */
.rocket-hint-btn {
    background-image: url('assets/rocket.png');
    background-size: 70% 70%;
    background-position: center;
    background-repeat: no-repeat;
    width: 45px;
    height: 45px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgb(255 255 255 / 30%);
    cursor: pointer;
}

/* Style for rocket hint count text */
#rocket-hint-count,
#rocket-hint-count-portrait {
    color: white;
    font-size: 16px;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    cursor: inherit;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 2px 4px;
    min-width: 12px;
    text-align: center;
}

.rocket-hint-btn.no-hints {
    /* Remove animation */
}

.rocket-hint-btn.no-hints #rocket-hint-count,
.rocket-hint-btn.no-hints #rocket-hint-count-portrait { 
    font-size: 1.3em; 
    color: #ff9800; 
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
}

/* Rocket effect animation */
.rocket-effect {
    position: absolute;
    background-color: rgba(255, 150, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 150, 0, 0.8);
    z-index: 10;
    pointer-events: none;
}

.rocket-effect.animate {
    animation: rocketTravel 1s ease-out forwards;
}

@keyframes rocketTravel {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
} 


.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Desktop/Landscape: Hints in center of bottom bar */
@media (min-width: 768px), (orientation: landscape) {
    .bottom-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Hint buttons container for center positioning */
    .hints-container {
        display: flex;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        gap: 15px;
    }
    
    .timer {
        margin-right: auto;
    }
}

/* Portrait mode: Hints next to wheel */
@media (max-width: 767px) and (orientation: portrait) {
    .game-container {
        /* ... existing code ... */
    }

    /* Hide bottom bar in portrait */
    .bottom-bar {
        display: none;
    }

    /* Move hints next to wheel in portrait mode */
    .wheel-container {
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
        /* Changed from center to space-between for layout */
        justify-content: space-between; 
        gap: 5px; /* Reduced gap slightly */
    }
    
    /* Timer container on left */
    .timer-container.portrait-timer {
        display: flex; /* Make it visible */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 20%; /* Adjust width */
        gap: 5px;
    }
    
    /* Wheel and selected word in center */
    .wheel-components {
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Adjusted width to make space */
        width: 60%; 
    }
    
    /* Hints container on right */
    .hints-container.portrait-hints { /* Added specificity */
        display: flex; /* Make sure it's flex */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 15px;
        /* Adjusted width */
        width: 20%; 
    }
    
    /* Hide hints from bottom bar in portrait mode */
    .bottom-bar .hint-btn,
    .bottom-bar .rocket-hint-btn {
        display: none;
    }
    
    /* Style for hint buttons in wheel area */
    .hints-container.portrait-hints .hint-btn, /* Added specificity */
    .hints-container.portrait-hints .rocket-hint-btn { /* Added specificity */
        margin: 5px 0;
    }

    /* Style the portrait timer */
    .timer.portrait {
        margin: 5px 0;
        height: 45px;
        background-position: center;
        padding-left: 0;
        justify-content: center;
        width: 45px; /* Match hint button size */
        position: relative; /* Needed for absolute positioning of span */
    }

    .timer-display.portrait-timer-display {
        position: absolute;
        bottom: -15px; /* Position below icon */
        font-size: 12px;
        left: 50%;
        transform: translateX(-50%);
        color: white;
        text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
        white-space: nowrap;
    }
}

/* Small screens in portrait mode adjustments */
@media (max-width: 480px) and (orientation: portrait) {
    .timer-container.portrait-timer {
        width: 15%; /* Adjust for smaller screens */
    }
    
    .wheel-components {
        width: 70%; /* Adjust for smaller screens */
    }
    
    .hints-container.portrait-hints {
        width: 15%; /* Adjust for smaller screens */
    }
}

/* Portrait-specific hint container styles */
.portrait-hints {
    display: none;
}

/* Portrait-specific timer container styles */
.portrait-timer {
    display: none; /* Hide portrait timer by default */
}

/* Landscape-specific hint container styles */
.landscape-hints {
    display: flex;
}

/* Show/hide appropriate hint containers based on orientation */
@media (max-width: 767px) and (orientation: portrait) {
    .portrait-hints {
        display: flex;
    }
    
    .landscape-hints {
        display: none;
    }
    
    /* Style hints in portrait mode */
    .portrait-hints .hint-btn,
    .portrait-hints .rocket-hint-btn,
    .portrait-hints .hammer-hint-btn {
        margin: 5px 0;
        height: 45px;
        background-position: center;
        padding-left: 0;
        justify-content: center;
        width: 45px;
        position: relative;
    }
    
    .portrait-hints span {
        position: absolute;
        bottom: -15px;
        font-size: 16px;
        right: 0;
        left: auto;
        transform: none;
        color: white;
        text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000;
        white-space: nowrap;
    }
}

/* Responsive tweaks for portrait hints on very small screens */
@media (max-width: 360px) and (orientation: portrait) {
    .wheel-components {
        width: 80%;
    }
    
    .portrait-hints .hint-btn,
    .portrait-hints .rocket-hint-btn,
    .portrait-hints .hammer-hint-btn {
        width: 45px;
        height: 45px;
        background-size: 45px 45px;
    }
    }

/* Specific font size for narrow portrait devices */
@media (max-width: 480px) and (orientation: portrait) {
    .level-complete-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .buy-hints-modal {
        width: 85%;
        border-width: 40px;
        overflow: visible;
        max-height: none;
    }

    .buy-hints-content {
        padding: 10px;
        overflow: visible;
        max-height: none;
    }

    .hint-icon-large {
        width: 45px;
        height: 45px;
    }
    
    .hints-items-container {
        gap: 15px;
    }
    
    .hint-count-display {
        font-size: clamp(0.7rem, 2.5vw, 0.9rem);
        margin: 0;
        flex-basis: 80px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        font-size: clamp(0.65rem, 2.3vw, 0.8rem);
        padding: 3px 6px;
        border-width: 20px;
        max-width: 110px;
        width: 100px;
        margin: 0;
    }
}


@media (orientation: landscape) and (max-height: 500px) {
    .buy-hints-modal {
        max-height: 90vh;
        width: 75%; 
        max-width: 500px;
        border-width: 40px;
    }

    .buy-hints-content {
        padding: 10px;
        overflow: visible;
    }
    
    .hints-items-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-bottom: 10px;
        max-height: none;
        overflow: visible;
    }
    
    .buy-hints-title {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        margin-bottom: 10px;
    }
    
    /* Keep the same layout as portrait mode for hint items */
    .hint-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background-color: rgb(255 255 255 / 30%);
        border-radius: 30px;
        width: 100%;
        gap: 5px;
    }
    
    /* Make sure all buttons have the same size */
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        max-width: 90px;
        width: 90px;
        margin: 0;
        border-width: 18px;
        font-size: clamp(0.65rem, 2vw, 0.75rem);
    }
}

/* ╨Ф╨╗╤П ╨╛╤З╨╡╨╜╤М ╨╝╨░╨╗╨╡╨╜╤М╨║╨╕╤Е ╤Н╨║╤А╨░╨╜╨╛╨▓ */
@media (max-height: 500px) and (orientation: landscape),
(max-width: 375px) {
    .buy-hints-modal {
        border-width: 40px;
        overflow: visible;
    }

    .buy-hints-content {
        padding: 8px;
        overflow: visible;
        max-height: none;
    }

    .buy-hints-title {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
        margin-bottom: 8px;
    }

    .hint-icon-large {
        width: 45px;
        height: 45px;
    }

    .hint-count-display {
        font-size: clamp(0.65rem, 2vw, 0.8rem);
        margin: 0;
        flex-basis: 70px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button,
    .close-btn {
        font-size: clamp(0.6rem, 2vw, 0.7rem);
        padding: 2px 4px;
        border-width: 16px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        max-width: 90px;
        width: 80px;
        margin: 0;
    }
    
    .close-btn {
        margin-top: 8px;
    }
}


.hammer-hint-btn {
    background-image: url('assets/hammer.png');
    background-size: 70% 70%;
    background-position: center;
    background-repeat: no-repeat;
    width: 45px;
    height: 45px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgb(255 255 255 / 30%);
    cursor: pointer;
}

/* Style for hammer hint count text */
#hammer-hint-count,
#hammer-hint-count-portrait {
    color: white;
    font-size: 16px;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    cursor: inherit;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 2px 4px;
    min-width: 12px;
    text-align: center;
}

.hammer-hint-btn.no-hints {
    /* Remove animation */
}

.hammer-hint-btn.no-hints #hammer-hint-count,
.hammer-hint-btn.no-hints #hammer-hint-count-portrait { 
    font-size: 1.3em; 
    color: #ff9800; 
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
}

/* Hammer effect animation */
.hammer-effect {
    position: absolute;
    z-index: 10000;
    pointer-events: none;
    transform-origin: center;
    transform: scaleX(-1); /* Mirror the hammer horizontally */
}

.hammer-effect.animate {
    animation: hammerHit 0.5s ease-out forwards;
}

@keyframes hammerHit {
    0% {
        transform: scaleX(-1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scaleX(-1) rotate(-30deg);
        opacity: 1;
    }
    50% {
        transform: scaleX(-1) rotate(-90deg);
        opacity: 1;
    }
    100% {
        transform: scaleX(-1) rotate(-90deg);
        opacity: 0;
    }
}

/* Apply custom pointer cursor to interactive elements - add hammer */
.hint-btn,
.rocket-hint-btn,
.hammer-hint-btn,
.sound-btn,
.button-9patch,
.letter,
.rotate-btn,
.piggy-bank {
    cursor: url('assets/cursor-2.png'), pointer !important;
}

/* Add hammer purchasing style */
.hint-btn.hint-purchased,
.rocket-hint-btn.rocket-hint-purchased,
.hammer-hint-btn.hammer-hint-purchased,
.buy-hint-button.hint-purchased,
.buy-rocket-hint-button.rocket-hint-purchased,
.buy-hammer-hint-button.hammer-hint-purchased {
    animation: brightnessChange 0.8s ease;
}

.buy-hint-button.disabled,
.buy-rocket-hint-button.disabled,
.buy-hammer-hint-button.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5) brightness(0.8);
}

/* Flash effect when a cell is hit by hammer */
.hammer-hit {
    position: relative;
}

.hammer-hit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    border-radius: 8px;
    animation: hammerHitFlash 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes hammerHitFlash {
    0% {
        background-color: rgba(255, 255, 255, 0.8);
        box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.8);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}


@media (max-height: 400px) and (orientation: landscape) {
    .buy-hints-modal {
        border-width: 40px;
        max-height: none;
        width: 65%;
        max-width: 400px;
        margin: auto;
        overflow: visible;
    }

    .buy-hints-content {
        padding: 5px;
        max-height: none;
        overflow: visible;
    }

    .buy-hints-title {
        font-size: clamp(0.7rem, 2vw, 0.8rem);
        margin: 0 0 5px 0;
    }

    .hints-items-container {
        gap: 5px;
        margin-bottom: 5px;
    }

    .hint-item {
        padding: 2px;
        border-radius: 15px;
        min-height: 0;
    }

    .hint-icon-large {
        width: 30px;
        height: 30px;
    }

    .hint-count-display {
        font-size: clamp(0.55rem, 1.8vw, 0.65rem);
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        max-width: 65px;
        width: 60px;
        border-width: 12px;
        font-size: clamp(0.5rem, 1.5vw, 0.6rem);
        padding: 1px 2px;
        min-height: 20px;
        height: auto;
    }
    
    .close-btn {
        margin-top: 5px;
        padding: 1px 2px;
        font-size: clamp(0.6rem, 1.8vw, 0.7rem);
        width: 60%;
        border-width: 14px;
        min-height: 24px;
        height: auto;
    }

    .coin-icon-small {
        width: 14px;
        height: 14px;
    }
}

@media (min-height: 401px) and (max-height: 500px) and (orientation: landscape) {
    .buy-hints-modal {
        max-height: none;
        width: 70%; 
        max-width: 450px;
        border-width: 40px;
        margin: auto;
        overflow: visible;
    }

    .buy-hints-content {
        padding: 8px;
        max-height: none;
        overflow: visible;
    }
    
    .hints-items-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .buy-hints-title {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        margin-bottom: 8px;
    }
    
    .hint-item {
        padding: 3px 5px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        max-width: 80px;
        width: 80px;
        margin: 0;
        border-width: 16px;
        font-size: clamp(0.6rem, 1.8vw, 0.7rem);
    }
    
    .close-btn {
        margin-top: 8px;
        width: 70%;
    }
}

@media (min-height: 501px) and (orientation: landscape) {
    .buy-hints-modal {
        max-height: none;
        width: 75%; 
        max-width: 500px;
        border-width: 40px;
    }

    .buy-hints-content {
        padding: 10px;
        overflow: visible;
    }
    
    .hints-items-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-bottom: 10px;
        max-height: none;
        overflow: visible;
    }
    
    .buy-hints-title {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        margin-bottom: 10px;
    }
    
    .hint-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background-color: rgb(255 255 255 / 30%);
        border-radius: 30px;
        width: 100%;
        gap: 5px;
    }
    
    .buy-hint-button,
    .buy-rocket-hint-button,
    .buy-hammer-hint-button {
        max-width: 90px;
        width: 90px;
        margin: 0;
        border-width: 18px;
        font-size: clamp(0.65rem, 2vw, 0.75rem);
    }
}

.shop-btn {
    background-image: url('assets/shop.png');
    background-size: 70% 70%;
    background-position: center;
    background-repeat: no-repeat;
    width: 45px;
    height: 45px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgb(255 255 255 / 30%);
    cursor: pointer;
    margin-right: 10px;
}

.shop-btn.portrait-shop {
    margin: 5px 0;
    position: relative;
}

@media (max-width: 767px) and (orientation: portrait) {
    .bottom-bar .shop-btn {
        display: none;
    }
    
    .portrait-shop {
        display: block;
    }
}

@media (min-width: 768px), (orientation: landscape) {
    .portrait-shop {
        display: none;
    }
}

/* Bounce animation for hint buttons when used */
@keyframes buttonBounce {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.2);
    }
    60% {
        transform: scale(0.9);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.hint-btn.bounce,
.rocket-hint-btn.bounce,
.hammer-hint-btn.bounce {
    animation: buttonBounce 0.5s ease-in-out;
}

/* Add bounce animation for hint icons in shop */
@keyframes iconBounce {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.3);
    }
    60% {
        transform: scale(0.9);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.hint-icon-large.bounce {
    animation: iconBounce 0.5s ease-in-out;
}

.sound-btn {
    display: flex;
    align-items: center;
    width: 35px;
    height: 35px;
    z-index: 2;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 5px;
}


.sound-btn.sound-on {
    background-image: url('assets/sound_on.png');
}

.sound-btn.sound-off {
    background-image: url('assets/sound_off.png');
}

.sound-btn.bounce {
    animation: buttonBounce 0.5s ease;
}

@keyframes buttonBounce {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Game Complete Overlay Styles - based on Level Complete styles */
.game-complete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.game-complete-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.game-complete-overlay.hiding {
    opacity: 0;
    pointer-events: none;
}

.game-complete-modal {
    width: 80%;
    max-width: 400px;
    min-height: 250px;
    box-sizing: border-box;
    border: 60px solid transparent;
    border-image: url('assets/frame.png') 60 fill;
    border-image-slice: 60 fill;
    border-image-width: 60px;
    border-image-outset: 0;
    animation: modalAppear 0.5s ease-out forwards;
    position: relative;
    z-index: 10001;
    overflow: hidden;
}

.game-complete-modal-content {
    position: relative;
    padding: 15px;
    transform-origin: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-complete-stars {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.game-complete-title {
    font-size: 18px;
    color: white;
    margin: 10px 0;
    text-shadow:
        -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
        -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000;
    white-space: nowrap;
    text-overflow: ellipsis;
    height: auto;
    min-height: 1.2em;
    flex-shrink: 0;
}

.game-complete-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    width: 100%;
}

.game-complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 250px;
    margin-top: 10px;
}

.rate-game-btn, .reset-progress-btn {
    padding: 8px 16px;
    font-size: 14px;
    color: white;
    background-color: transparent;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: transform 0.2s;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    
    border-style: solid;
    border-width: 28px;
    border-image-source: url('assets/button.png');
    border-image-slice: 56 fill;
    border-image-width: auto;
    border-image-outset: 0;
    border-image-repeat: stretch;
    box-sizing: border-box;
}

.rate-game-btn:hover, .reset-progress-btn:hover {
    filter: brightness(1.1);
}

.rate-game-btn.hover-scale, .reset-progress-btn.hover-scale {
    filter: brightness(1.1);
}

/* Media queries for game complete modal */
@media (orientation: landscape) and (max-height: 500px) {
    .game-complete-modal {
        max-height: 90vh;
        width: 75%;
        max-width: 500px;
        border-width: 50px;
        border-image-slice: 50 fill;
        border-image-width: 50px;
    }

    .game-complete-modal-content {
        padding: 5px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        overflow: hidden;
    }

    .game-complete-title {
        font-size: clamp(0.7rem, 2.5vw, 1.1rem);
        margin: 3px 0;
    }

    .game-complete-stats {
        gap: 5px;
        margin: 3px 0;
        width: 100%;
    }

    .game-complete-buttons {
        width: 100%;
        max-width: 250px;
        gap: 8px;
        margin-top: 5px;
    }
    
    .rate-game-btn, .reset-progress-btn {
        padding: 5px 10px;
        font-size: clamp(0.7rem, 2vw, 0.9rem);
        border-width: 20px;
    }

    .stat {
        padding: 3px 5px;
        gap: 3px;
    }

    .stat-icon-img {
        width: 14px;
        height: 14px;
    }

    .stat-value {
        font-size: clamp(0.7rem, 2vw, 0.8rem);
    }
}

@media (orientation: landscape) and (min-height: 501px) {
    .game-complete-modal {
        width: 60%;
        max-width: 550px;
    }
    
    .game-complete-title {
        font-size: clamp(0.8rem, 2.8vw, 1.4rem);
    }
}

@media (orientation: portrait) and (max-width: 480px) {
    .game-complete-modal {
        width: calc(100% - 20px);
        max-width: 350px;
        border-width: 60px;
        border-image-slice: 60 fill;
        border-image-width: 60px;
    }

    .game-complete-modal-content {
        padding: 10px;
    }

    .game-complete-title {
        font-size: clamp(0.7rem, 4.5vw, 1.3rem);
        margin-bottom: 8px;
    }
}

@media (max-width: 375px) and (orientation: portrait) {
    .game-complete-title {
        font-size: 0.8rem;
    }
}

/* ╨Ю╤З╨╡╨╜╤М ╨╜╨╕╨╖╨║╨╕╨╡ ╤Н╨║╤А╨░╨╜╤Л ╨▓ ╨░╨╗╤М╨▒╨╛╨╝╨╜╨╛╨╝ ╤А╨╡╨╢╨╕╨╝╨╡ */
@media (orientation: landscape) and (max-height: 400px) {
    .game-complete-modal {
        border-width: 50px;
        max-height: 95vh;
    }

    .game-complete-modal-content {
        padding: 3px;
        gap: 3px;
    }

    .game-complete-title {
        font-size: clamp(0.7rem, 2vw, 0.9rem);
        margin: 2px 0;
    }

    .game-complete-stats {
        gap: 3px;
        margin: 2px 0;
    }

    .game-complete-buttons {
        gap: 5px;
        margin-top: 3px;
    }
    
    .rate-game-btn, .reset-progress-btn {
        padding: 3px 6px;
        font-size: clamp(0.6rem, 1.8vw, 0.8rem);
        border-width: 16px;
        min-height: 24px;
    }

    .stat {
        padding: 2px 3px;
        gap: 2px;
    }

    .stat-icon-img {
        width: 12px;
        height: 12px;
    }

    .stat-value {
        font-size: clamp(0.6rem, 1.8vw, 0.7rem);
    }
}
.tutorial-cursor {
    pointer-events: none;
    position: absolute;
    z-index: 1000;
    width: 100px;
    height: 100px;
    animation: cursor-pulse 1.5s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 5px rgb(255, 255, 255));
}

.tutorial-highlight {
    animation: highlight-pulse 0.8s infinite alternate;
    box-shadow: 0 0 20px 10px rgba(255, 215, 0);
    z-index: 10;
    transform: scale(1.15);
    transition: transform 0.3s ease;
}

@keyframes cursor-pulse {
    0% { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1.05); opacity: 1; }
}

@keyframes highlight-pulse {
    0% { box-shadow: 0 0 10px 5px rgba(255, 215, 0); }
    100% { box-shadow: 0 0 25px 12px rgba(255, 215, 0, 0); }
}
