/* ==== Base Reset and 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;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* ==== 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;
    user-select: none;
    white-space: nowrap;
    z-index: 1;
}

/* ==== 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;
}

.footer a {
    color: orangered;
    text-decoration: none;
}

/* ==== Main Game Container ==== */
.center-container {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(255, 87, 51, 0.3);
    max-width: 450px;
    width: 100%;
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.title {
    font-size: 30px;
    margin-bottom: 10px;
    color: #00ff7f;
}

/* ==== Game Elements ==== */
.word-display {
    font-size: 32px;
    margin: 15px 0;
    letter-spacing: 5px;
    color: #00ff7f;
    word-wrap: break-word;
}

.incorrect-letters,
.remaining-tries {
    font-size: 16px;
    color: #ff4d4d;
    margin: 10px 0;
}

.hangman-img img {
    width: 100%;
    max-width: 140px;
    margin: 20px auto;
    display: block;
}

/* ==== Input Section ==== */
.input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

input {
    padding: 12px;
    font-size: 20px;
    width: 60px;
    text-align: center;
    border-radius: 10px;
    border: 2px solid #ccc;
    background: #fff;
    color: #000;
    transition: border-color 0.3s ease;
}

input:focus,
input:focus-visible {
    border-color: orangered;
    outline: none;
}

/* ==== Buttons ==== */
button,
.reset-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: 250px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

button:hover,
.reset-button:hover {
    background-color: #ff7043;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.reset-button {
    background-color: #007f00;
}

.reset-button:hover {
    background-color: #005f00;
}

/* ==== Result Text ==== */
.result {
    font-size: 18px;
    font-weight: 600;
    color: #00ff7f;
    margin-top: 10px;
}

/* ==== 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;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    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 Styling ==== */
@media (max-width: 768px) {
    .title { font-size: 24px; }
    .word-display { font-size: 26px; }
    input { font-size: 18px; width: 50px; }
    .incorrect-letters,
    .remaining-tries,
    .result { font-size: 14px; }
}

@media (max-width: 480px) {
    .center-container { padding: 25px; }
    .title { font-size: 22px; }
    .word-display { font-size: 20px; letter-spacing: 4px; }
    input { width: 45px; font-size: 18px; }
    button,
    .reset-button { font-size: 14px; padding: 8px 16px; }
    .footer { font-size: 12px; padding: 8px 10px; }
    .watermark { font-size: 70px; }
}
