/* ==== Reset & Layout ==== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* ==== Watermark ==== */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg);
    font-size: 100px;
    font-family: 'Times New Roman', Times, serif;
    color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 0;
    user-select: none;
    white-space: nowrap;
}

/* ==== Footer ==== */
.footer {
    position: fixed;
    bottom: 0;
    right: 0;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: orangered;
    background-color: rgba(0, 0, 0, 0.6);
    border-top-left-radius: 10px;
    z-index: 3;
    text-align: right;  /* Align text to the right */
}

.footer a {
    color: orangered;
    text-decoration: none;
}

/* ==== Game Container ==== */
.container {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(255, 87, 51, 0.3);
    max-width: 500px;
    width: 100%;
    text-align: center;
    z-index: 2;
}

h1 {
    font-size: 32px;
    color: #00ff7f;
    margin-bottom: 20px;
}

/* ==== Game Instructions ==== */
.game-container p {
    font-size: 18px;
    color: #fff;
    margin-bottom: 25px;
}

/* ==== Holes & Moles ==== */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.hole {
    width: 100px;
    height: 100px;
    background-color: #333;
    border: 3px solid #ff5733;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.mole {
    background-color: orangered;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    transition: bottom 0.3s ease;
    cursor: pointer;
}

.mole.up {
    bottom: 0;
}

/* ==== Score & Timer ==== */
#score,
#time-left {
    font-size: 24px;
    color: #00ff7f;
    margin-bottom: 20px;
}

/* ==== Buttons ==== */
button {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background-color: #ff5733;
    color: white;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
    background-color: #ff7043;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* ==== Modal Styling ==== */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.custom-modal-content {
    background: #1e1e1e;
    color: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.modal-actions {
    display: flex;
    justify-content: space-evenly;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 18px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#play-again {
    background-color: #4caf50;
    color: white;
}

#play-again:hover {
    background-color: #45a049;
}

#close-modal {
    background-color: #f44336;
    color: white;
}

#close-modal:hover {
    background-color: #e53935;
}

/* ==== Responsive ==== */

/* Tablets (Portrait and Landscape) */
@media (max-width: 768px) {
    .container {
        padding: 30px;
    }
    h1 {
        font-size: 26px;
    }
    #score {
        font-size: 20px;
    }
    .hole {
        width: 80px;
        height: 80px;
    }
    .mole {
        width: 60px;
        height: 60px;
    }
    .footer {
        font-size: 12px;
        padding: 10px 12px;
    }
    button {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* Smartphones (Portrait) */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 22px;
    }
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    button {
        font-size: 14px;
        padding: 10px 20px;
    }
    .footer {
        font-size: 12px;
        padding: 8px 10px;
    }
    .watermark {
        font-size: 70px;
    }
}
