* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(45deg, #1a1a1a, #2c1b0f);
    color: #D4AF37;
    height: 100vh;
    overflow: hidden;
}

/* إضافة تنسيق الشعار */
.logo-container {
    margin-bottom: 1.5rem;
}

.game-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #D4AF37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* الشاشات */
.screen {
    display: none;
    height: 100vh;
    padding: 1rem;
}

.screen.active {
    display: block;
}

/* تنسيق صفحة المستويات */
.levels-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

.level-card {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #D4AF37;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.level-card:not(.locked):hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.level-card.locked {
    cursor: not-allowed;
    opacity: 0.7;
}

.level-card.locked::before {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 1;
}

.level-card.locked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.level-number {
    font-size: 1.8rem;
    color: #D4AF37;
    margin-bottom: 0.5rem;
}

.level-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1rem;
}

.level-description {
    font-size: 0.9rem;
    color: #D4AF37;
    opacity: 0.8;
}

/* تصغير عنوان الصفحة الرئيسية وجعله في سطر واحد */
.small-title {
    font-size: 1.5rem;
    margin: 1rem auto;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    width: fit-content;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* الهيدر الفرعوني */
.pharaoh-header {
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 3px solid #D4AF37;
}

.header-content {
    display: flex;
    gap: 2rem;
    font-size: 1.1rem;
}

.hieroglyph-button {
    background: none;
    border: none;
    color: #D4AF37;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.hieroglyph-button:hover {
    transform: scale(1.1);
}

.developer-button {
    font-size: 2rem;
}

/* نافذة المطور */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease-out;
}

.modal-title {
    color: #D4AF37;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.developer-info {
    margin: 1.5rem 0;
    line-height: 1.8;
}

.initiative {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fff;
}

.developer-name, .developer-phone {
    font-size: 1.1rem;
    color: #D4AF37;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* لوحة اللعبة */
.game-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 130px);
    margin-bottom: 60px;
}

.events-column {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #D4AF37;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.column-title {
    text-align: center;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    color: #D4AF37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* تعديل حجم المربعات لتناسب الشاشة بدون سكرول */
.events-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow: hidden;
    max-height: 100%;
}

/* البطاقات */
.event-card {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid #D4AF37;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.event-card:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateX(5px);
}

.event-card.selected {
    background: rgba(212, 175, 55, 0.3);
    border-color: #fff;
}

/* أزرار التحكم */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.action-button {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 110px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gold-bg { background: #D4AF37; color: #000; }
.red-bg { background: #8B0000; color: #fff; }
.green-bg { background: #006400; color: #fff; }

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* شاشة البداية */
.pharaoh-frame {
    position: relative;
    border: 3px solid #D4AF37;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#start-screen {
    display: none;
    height: 100vh;
    position: relative;
}

#start-screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

#start-screen .pharaoh-frame {
    width: 90%;
    max-width: 600px;
}

.neon-gold {
    color: #D4AF37;
    text-shadow: 0 0 20px #D4AF37;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.gold-button {
    background: #D4AF37;
    color: #000;
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.gold-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #D4AF37;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .game-board {
        grid-template-columns: 1fr;
        height: calc(100vh - 180px);
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .events-column {
        padding: 0.8rem;
    }

    .event-card {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }

    .events-container {
        gap: 0.3rem;
    }

    .action-buttons {
        gap: 0.8rem;
    }

    .action-button {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        min-width: 90px;
        height: 32px;
    }

    .neon-gold {
        font-size: 1.8rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }
    .small-title {
        font-size: 1.2rem;
        margin: 0.8rem auto;
    }
    .game-logo {
        width: 120px;
        height: 120px;
    }
}
