:root {
    --primary-blue: #3498db;
    --primary-green: #8bc34a;
    --primary-yellow: #ffc107;
    --primary-orange: #ff9800;
    --dark-blue: #1565c0;
    --dark-green: #558b2f;
    --dark-yellow: #ff8f00;
    --dark-orange: #e65100;
    --text-dark: #37474f;
    --text-light: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    
    --font-heading: 'Fredoka One', cursive;
    --font-body: 'Nunito', sans-serif;
    --font-arabic: 'Amiri', serif;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--primary-blue);
    font-family: var(--font-body);
    color: var(--text-dark);
}

/* Fullscreen Game Container */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-image 0.5s ease-in-out;
}

/* Common UI Elements */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

/* Title 3D Bubble Effect */
.title-main {
    font-size: 5rem;
    color: var(--primary-yellow);
    text-transform: uppercase;
    text-shadow: 
        -3px -3px 0 #fff,  
         3px -3px 0 #fff,
        -3px  3px 0 #fff,
         3px  3px 0 #fff,
         5px  5px 0 var(--dark-orange),
        -2px  8px 0 var(--dark-blue),
         2px  8px 0 var(--dark-blue);
    margin-bottom: 5px;
    text-align: center;
    line-height: 1.1;
    z-index: 10;
}

.subtitle {
    font-size: 1.5rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    background: var(--primary-green);
    padding: 8px 30px;
    border-radius: 30px;
    border: 4px solid white;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    padding: 12px 30px;
    border: 3px solid white;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0,0,0,0.2), inset 0 -3px 0 rgba(0,0,0,0.1);
    transition: all 0.1s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    text-transform: none;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2), inset 0 -1px 0 rgba(0,0,0,0.1);
}

.btn-green { background-color: var(--primary-green); box-shadow: 0 6px 0 var(--dark-green), inset 0 -3px 0 rgba(0,0,0,0.1); }
.btn-blue { background-color: var(--primary-blue); box-shadow: 0 6px 0 var(--dark-blue), inset 0 -3px 0 rgba(0,0,0,0.1); }
.btn-yellow { background-color: var(--primary-yellow); color: var(--text-dark); box-shadow: 0 6px 0 var(--dark-yellow), inset 0 -3px 0 rgba(0,0,0,0.1); }
.btn-orange { background-color: var(--primary-orange); box-shadow: 0 6px 0 var(--dark-orange), inset 0 -3px 0 rgba(0,0,0,0.1); }
.btn-red { background-color: #e74c3c; box-shadow: 0 6px 0 #c0392b, inset 0 -3px 0 rgba(0,0,0,0.1); }

/* Top HUD (Heads Up Display) */
.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 20;
}

.hud-left {
    display: flex;
    gap: 15px;
}

.hud-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-card, .stats-card {
    background: #fff8e1;
    padding: 5px 20px 5px 5px;
    border-radius: 40px;
    border: 3px solid var(--primary-yellow);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    background-size: cover;
    background-position: center;
    background-image: url('../assets/img/boy_profile.png');
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.star-icon {
    color: var(--primary-yellow);
    font-size: 1.8rem;
    text-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.anim-bounce { animation: bounce 2s infinite; }
.anim-pulse { animation: pulse 1.5s infinite; }
.anim-float { animation: float 3s ease-in-out infinite; }

/* Hidden Class */
.hidden { display: none !important; }

/* Screen Wrapper */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    padding: 80px 20px 20px 20px;
}

/* Modals */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    border: 6px solid var(--primary-blue);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: pulse 0.3s ease-out 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Arabic Text */
.arabic-text {
    font-family: var(--font-arabic);
    font-size: 2.5rem;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

/* Map Screen Specific */
.map-bg {
    background-image: url('../assets/img/bg_mainmenu.png');
    background-size: cover;
    position: relative;
    width: 100%;
    height: 100%;
}

.map-nodes {
    position: relative;
    width: 900px;
    max-width: 95%;
    height: 400px;
    margin: 20px auto;
}

.map-node {
    position: absolute;
    width: 80px;
    height: 80px;
    background: #e0e0e0;
    border: 6px solid white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0,0,0,0.4), inset 0 -5px 0 rgba(0,0,0,0.1);
    transition: transform 0.2s;
    z-index: 5;
}

.map-node.unlocked {
    background: var(--primary-orange);
}

.map-node:hover {
    transform: scale(1.1);
}

.map-node.locked {
    background: #95a5a6;
    cursor: not-allowed;
    filter: grayscale(80%);
}

.map-node span {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.map-node-label {
    position: absolute;
    bottom: -40px;
    background: var(--primary-green);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    font-family: var(--font-heading);
    border: 3px solid white;
    box-shadow: 0 4px 0 var(--dark-green);
}

/* Characters & Props Positioning */
.char-bottom-right {
    position: absolute;
    bottom: -10px;
    right: 5%;
    width: 250px;
    height: 250px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom right;
    z-index: 10;
}

.char-bottom-left {
    position: absolute;
    bottom: -10px;
    left: 5%;
    width: 250px;
    height: 250px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom left;
    z-index: 10;
}

.prop-chest {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 150px;
    height: 150px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom left;
    z-index: 10;
}

/* UI Boxes & Backgrounds */
.content-box {
    background: rgba(255, 255, 255, 0.95);
    border: 6px solid white;
    border-radius: 30px;
    padding: 20px 30px;
    width: 95%;
    max-width: 1100px;
    max-height: 85vh;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 5;
}

.parchment-bg {
    background-color: #fcf1d8;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>');
    border: 5px solid #d4a373;
    border-radius: 15px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1), inset 0 0 20px rgba(139, 69, 19, 0.1);
}

.wooden-border {
    background-color: #8d6e63;
    border: 4px solid #5d4037;
    border-radius: 15px;
    color: white;
}

.btn-back {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2rem;
    padding: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}
