body { 
    font-family: 'Arial', sans-serif; 
    background-color: #f0f4f8; 
    margin: 0; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    min-height: 100vh;
    background-image: url('../background.jpeg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
}

.content-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
    box-sizing: border-box;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 100%;
    margin-right: 20px;
    pointer-events: none;
    overflow: hidden;
}

.game-image {
    width: 100%;
    height: auto;
    display: flex;
    pointer-events: none;
}

.grid {
    position: absolute;
    left: 50%;
    top: 68%; 
    transform: translate(-50%, -60%); 
    display: grid;
    grid-template-columns: repeat(3, 120px); 
    grid-template-rows: repeat(3, 120px);
    grid-gap: 15px;
    pointer-events: none;
    z-index: 1;
}

.grid div {
    width: 120px; 
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    pointer-events: none; 
    background-color: rgba(180, 181, 181, 0.653);
    border-radius: 20%;
}

.grid-item {
    width: 170px;
    height: 170px;
    display: inline-block;
    background-color: #f0f0f0; 
    pointer-events: none;
}

.right-section {
    display: flex;
    position: absolute;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #c5c5c5df;
    border-radius: 10px;
    padding: 20px;
    z-index: 30;
    width: 500px;
    top: 30%;
    opacity: 1; 
    transition: opacity 0.5s ease-in-out;
}

.right-section.hide {
    opacity: 0; 
}

form { 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

input, button { 
    padding: 10px; 
    margin-top: 10px; 
    border-radius: 5px; 
    border: none;
}

input { 
    width: 200px;
}

#homepage{
    display: none;
}

button { 
    background-color: #007BFF; 
    color: white; 
    cursor: pointer;
}

button:hover { 
    background-color: #0056b3; 
}

p { 
    color: #333;
}

.h1kazi{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 19px;
    color : #f0f4f8;
    background-color: #4b30ff;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

#myCanvas {
    position: absolute;
    left: 49.5%;
    top: 64%;
    transform: translate(-50%, -50%); 
    cursor: none; 
    z-index: 2;
    width: 100%;
    max-width: 420px;
    height: auto;
    /* background: #b0b0b0;  Gray overlay removed */
}

#kazancmesaj{
    display: none; 
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-weight: bold;
    font-size: 20px;
    text-align: center;
    pointer-events: none;
}

#kazancmesaj.visible {
    opacity: 1;
}

.custom-cursor {
    width: 50px; 
    height: 50px;
    background-image: url('../cursor.png'); 
    background-size: cover;
    z-index: 9999;
    pointer-events: none;
    position: fixed;
}

#erasedPercentage{
    display: none;
    pointer-events: none;
}

.winning {
    position: relative; 
    background-color: rgba(222, 184, 13, 0);
    border-radius: 50%;
    border: 4px solid #f0f4f8;
    pointer-events: none;
    z-index: 2;
    width: 100px; 
    height: 100px; 
}

.winning::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(222, 184, 13);
    border-radius: 40%;
    box-shadow: 0 0 10px 5px rgba(222, 184, 13, 0.5);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: -1;
    pointer-events: none;
}

.winning:hover::after {
    opacity: 1; 
}

.winning::after {
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px 5px rgba(222, 184, 13, 0);
        opacity: 0;
    }
    to {
        box-shadow: 0 0 20px 10px rgba(222, 184, 13, 0.903);
        opacity: 1;
    }
}

.loss-image {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    display: block;
}

/* Mobile Responsive Styles */
@media (max-width: 480px) {
    .content-container {
        padding: 5px;
    }

    .game-container {
        max-width: 100%;
    }

    .grid {
        gap: 3px;
        width: 80%;
    }

    #myCanvas {
        width: 80%;
    }

    .right-section {
        padding: 10px;
    }

    input, button {
        padding: 10px;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .game-container {
        height: auto;
    }
    
    #myCanvas {
        height: auto;
    }
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .custom-cursor {
        display: none;
    }
}

