* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: white;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background-color: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

#score-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 36px;
    font-weight: bold;
    color: black;
    text-shadow: 
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white;
    background-color: transparent;
    border: none;
    padding: 5px 15px;
    border-radius: 10px;
}

.game-area {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    background-color: white;
}

.track {
    flex: 1;
    height: 100%;
    border-right: none;
    position: relative;
}

.track:last-child {
    border-right: none;
}

#play-again-btn {
    width: 80px;
    height: 80px;
    background-color: white;
    border: 3px solid black;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    outline: none;
    transition: transform 0.2s;
    position: relative;
}

#play-again-btn:hover {
    transform: scale(1.05);
}

#play-again-btn:active {
    transform: scale(0.95);
}

#play-again-btn .play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 26px;
    border-color: transparent transparent transparent black;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
}

.black-box {
    position: absolute;
    width: 90%;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    left: 5%;
    border-radius: 5px;
    transform-origin: center;
    cursor: pointer;
}

@keyframes boxPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.black-box-appear {
    animation: boxPulse 0.3s ease-in-out;
}

.black-box-hit {
    animation: boxHit 0.2s ease-out;
    opacity: 0.7;
    transform: scale(1.2);
}

@keyframes boxHit {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.game-over-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.game-over h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.game-over p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* منع تحديد النص */
.track, #play-again-btn, .play-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* تحسين للأجهزة المحمولة */
@media (max-width: 500px) {
    .black-box {
        height: 135px;
    }
    
    #play-again-btn {
        padding: 15px 25px;
        font-size: 18px;
    }
}

@media (max-height: 600px) {
    .black-box {
        height: 90px;
    }
}

@media (orientation: landscape) {
    .game-container {
        height: 100vh;
        max-height: 100vh;
    }
}

/* إزالة تأثير تغيير الألوان عند النتيجة 20 */
/* 
@keyframes levelUp {
    0% {
        background-color: white;
    }
    50% {
        background-color: rgba(255, 0, 0, 0.2);
    }
    100% {
        background-color: white;
    }
}

.level-up {
    animation: levelUp 1s ease-in-out;
}
*/

/* قائمة البداية والخسارة */
.menu-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.menu-content {
    text-align: center;
    color: black;
    padding: 30px;
    width: 80%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-title {
    font-size: 40px;
    font-weight: 900;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-container {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.last-score {
    font-size: 60px;
    font-weight: 900;
    color: black;
    margin-bottom: 10px;
    line-height: 1;
}

.high-score {
    font-size: 24px;
    font-weight: bold;
    color: #444;
}

.high-score-player {
    font-size: 1.2em;
    color: black;
    margin-top: 5px;
    text-align: center;
}

.new-high-score {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 300;
    padding: 20px;
}

.new-high-score-value {
    font-size: 60px;
    font-weight: 900;
    color: black;
    margin-bottom: 30px;
    line-height: 1;
}

.congrats-message {
    color: black;
    font-size: 1.8em;
    margin-bottom: 40px;
    font-weight: bold;
    text-align: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 400px;
}

#player-name,
#player-instagram {
    padding: 15px;
    border: 2px solid black;
    border-radius: 5px;
    background-color: white;
    color: black;
    font-size: 1.2em;
    width: 100%;
    text-align: center;
    direction: rtl;
}

#player-name::placeholder,
#player-instagram::placeholder {
    color: #999;
}

#save-score-btn {
    background-color: black;
    color: white;
    border: 2px solid black;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s;
    width: 100%;
    max-width: 400px;
}

#save-score-btn:hover {
    background-color: white;
    color: black;
}

.play-button {
    width: 80px;
    height: 80px;
    background-color: white;
    border: 3px solid black;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    outline: none;
    transition: transform 0.2s;
    position: relative;
}

.play-button:hover {
    transform: scale(1.05);
}

.play-button:active {
    transform: scale(0.95);
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 26px;
    border-color: transparent transparent transparent black;
}

.play-text {
    font-size: 18px;
    margin-top: 10px;
    color: black;
    font-weight: bold;
}

/* أنماط بطاقة الشعار */
.logo-card {
    margin-top: 20px;
    padding: 20px;
    background-color: white;
    border: 2px solid black;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
}

.logo-card:hover {
    transform: scale(1.05);
}

.logo-image {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.logo-text {
    font-size: 18px;
    color: black;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.reset-button {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.reset-button:hover {
    background-color: #ff6666;
}

.instagram-input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.instagram-at {
    position: absolute;
    right: 15px;
    color: black;
    font-size: 1.2em;
    font-weight: bold;
    pointer-events: none;
}

#player-instagram {
    padding: 15px;
    padding-right: 35px;
    border: 2px solid black;
    border-radius: 5px;
    background-color: white;
    color: black;
    font-size: 1.2em;
    width: 100%;
    text-align: right;
    direction: ltr;
}

.error-message {
    color: black;
    font-size: 0.9em;
    margin-top: 5px;
    text-align: right;
    min-height: 20px;
}

.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
}

.confirm-content {
    text-align: center;
    padding: 30px;
    width: 100%;
    max-width: 400px;
}

.confirm-message {
    font-size: 1.3em;
    color: black;
    margin-bottom: 30px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 30px;
    border: 2px solid black;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s;
    min-width: 120px;
}

#confirm-yes {
    background-color: black;
    color: white;
}

#confirm-yes:hover {
    background-color: white;
    color: black;
}

#confirm-back {
    background-color: white;
    color: black;
}

#confirm-back:hover {
    background-color: black;
    color: white;
} 