/* Save this as dungeon-wall.css */
body {
  background-color: #181818;
  background-image: url('/images/dungeon-wall.png');
  background-repeat: repeat;
  background-size: 400px 400px;
}

* {
    box-sizing: border-box;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 7%;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #75603c;
}

.logo {
    color: #d2ae70;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 4px;
}

.login-button {
    color: #e8dfc8;
    text-decoration: none;
    border: 1px solid #c49a53;
    padding: 12px 28px;
    letter-spacing: 2px;
}
.logout-form {
    margin: 0;
}

.logout-link {
    background: none;
    border: none;
    color: #d5a34f;
    font-size: 16px;
    cursor: pointer;
    letter-spacing: 2px;
    font-family: inherit;
}

.logout-link:hover {
    color: #ffffff;
}

.login-button:hover {
    background: #c49a53;
    color: #181818;
}

.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
}

.subtitle {
    color: #d2ae70;
    letter-spacing: 6px;
}

.hero h1 {
    font-size: clamp(48px, 8vw, 95px);
    color: #eee2c9;
    text-shadow: 4px 4px 8px #000;
    margin: 20px 0;
}

.description {
    color: #d0c7b8;
    font-size: 18px;
    line-height: 1.7;
}

.enter-button {
    margin-top: 35px;
    padding: 18px 45px;
    background: #852626;
    border: 2px solid #c49a53;
    color: white;
    text-decoration: none;
    letter-spacing: 3px;
    font-weight: bold;
    transition: 0.3s;
}

.enter-button:hover {
    background: #c49a53;
    color: #181818;
    transform: translateY(-3px);
}

.footer-text {
    margin-top: 60px;
    color: #c49a53;
    font-size: 11px;
    letter-spacing: 3px;
}


/* Login Page */

.login-page {
    min-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;

}

.login-container {
    width: 100%;
    max-width: 460px;
    padding: 45px 40px;
    text-align: center;

    background: rgba(15, 15, 15, 0.94);
    border: 1px solid #75603c;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
}

.login-container h1 {
    color: #eee2c9;
    font-size: 30px;
    letter-spacing: 3px;
    margin: 20px 0;
}

.login-description {
    color: #b8b0a0;
    margin-bottom: 35px;
}

.form-group {
    text-align: left;
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #d2ae70;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    background: #252525;
    border: 1px solid #75603c;
    color: #eee2c9;
    font-size: 15px;
    outline: none;
}

.form-group select {
    width: 100%;
    padding: 14px;
    background: #252525;
    border: 1px solid #75603c;
    color: #eee2c9;
    font-size: 15px;
}

.form-group input:focus {
    border-color: #c49a53;
}

.form-group input::placeholder {
    color: #77716a;
}

.login-container .enter-button {
    width: 100%;
    cursor: pointer;
    font-size: 14px;
}

.register-link {
    margin-top: 30px;
    color: #b8b0a0;
    font-size: 14px;
}

.register-link a {
    color: #d2ae70;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: #827969;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 2px;
}

.back-link:hover {
    color: #d2ae70;
}

@media (max-width: 500px) {
    .login-container {
        padding: 35px 22px;
    }

    .login-container h1 {
        font-size: 24px;
    }
}



.alert-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.alert-box {
    background: #211b17;
    border: 2px solid #a87938;
    padding: 30px;
    width: 350px;
    max-width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 0 20px rgba(168, 121, 56, 0.4);
}

.alert-box h2 {
    color: #d5a34f;
    margin-bottom: 15px;
    font-size: 24px;
}

.alert-box p {
    color: #e5d8c5;
    margin-bottom: 25px;
    font-size: 16px;
}

.alert-box button {
    cursor: pointer;
    width: 100%;
}

.navbar nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-username {
    color: #d5a34f;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
}

.logout-form {
    margin: 0;
}

.navbar nav a,
.navbar nav a:visited {
    color: #d5a34f;
    text-decoration: none;
    letter-spacing: 2px;
}

.navbar nav a:hover {
    color: #ffffff;
}

.password-requirements {
    margin-top: 10px;
    text-align: left;
}

.requirement {
    color: #ff3333;
    font-size: 13px;
    margin: 5px 0;
    transition: color 0.2s ease;
}

.requirement.valid {
    color: #00cc66;
}

/* below is css for lobby page */


/* ============================= */
/* GAME ROOMS PAGE               */
/* ============================= */

.rooms-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 50px 7%;
}

/* Rooms Header */

.create-room-header {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 50px;
    gap: 20px;
}

.rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    gap: 20px;
}

.rooms-header h1, .create-room-header h1 {
    color: #eee2c9;
    font-size: 38px;
    letter-spacing: 5px;
    text-shadow: 3px 3px 6px #000;
    margin: 0;
}

/* Create Room Button */

.create-room-button {
    padding: 16px 30px;
    background: #852626;
    border: 2px solid #c49a53;
    color: white;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
}

.create-room-button:hover {
    background: #c49a53;
    color: #181818;
    transform: translateY(-3px);
}

/* Active Rooms Section */

.active-rooms-section {
    width: 100%;
}

.active-rooms-heading {
    margin-bottom: 25px;
}

.active-rooms-heading h2 {
    color: #d2ae70;
    font-size: 25px;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.active-rooms-heading p {
    color: #b8b0a0;
    font-size: 14px;
}

/* Scrollable Container */

.rooms-container {
    height: 600px;
    overflow-y: auto;
    overflow-x: hidden;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #75603c;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
}

/* Custom Scrollbar */

.rooms-container::-webkit-scrollbar {
    width: 10px;
}

.rooms-container::-webkit-scrollbar-track {
    background: #181818;
}

.rooms-container::-webkit-scrollbar-thumb {
    background: #75603c;
    border-radius: 5px;
}

.rooms-container::-webkit-scrollbar-thumb:hover {
    background: #c49a53;
}

/* Four Column Grid */

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

/* Individual Room Card */

.room-card {
    background: rgba(35, 30, 25, 0.95);
    border: 1px solid #75603c;
    padding: 10px;
    text-align: center;
    transition: 0.3s;
    min-width: 0;
}

.room-card:hover {
    border-color: #c49a53;
    box-shadow: 0 0 15px rgba(196, 154, 83, 0.25);
    transform: translateY(-3px);
}

.room-action {
    padding: 10px 16px;
    background: #852626;
    border: 1px solid #c49a53;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.room-action:hover { background: #c49a53; color: #181818; }

/* Room Status */

.room-status {
    padding: 10px 5px;
    margin-bottom: 10px;

    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;

    text-transform: uppercase;
}

.room-status.waiting {
    background: rgba(46, 100, 55, 0.35);
    color: #8bc995;
    border: 1px solid #426c48;
}

.room-status.started {
    background: rgba(133, 38, 38, 0.35);
    color: #e58c8c;
    border: 1px solid #852626;
}

/* Room Image */

.room-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border: 1px solid #75603c;
}

.room-card .lobby-map-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #111;
    border: 1px solid #75603c;
    image-rendering: pixelated;
}

/* Room Name */

.room-card h3 {
    color: #d2ae70;
    font-size: 16px;
    letter-spacing: 2px;
    margin: 15px 0 8px;

    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    min-height: 40px;
}

/* Player Count */

.player-count {
    color: #b8b0a0;
    font-size: 13px;
    margin-bottom: 8px;
}


/* ============================= */
/* RESPONSIVE DESIGN              */
/* ============================= */

@media (max-width: 1100px) {
    .rooms-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .rooms-page {
        padding: 35px 5%;
    }

    .rooms-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rooms-header h1 {
        font-size: 28px;
    }

    .rooms-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .rooms-container {
        height: 550px;
        padding: 12px;
    }
}

@media (max-width: 400px) {
    .rooms-grid {
        grid-template-columns: 1fr;
    }
}

/* above is css for lobby page */

.map-preview-wrap { margin: 16px auto; max-width: 800px; padding: 10px; background: rgba(0,0,0,.7); border: 1px solid #75603c; }
.map-preview-wrap canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.map-preview-wrap p { color: #cdb98f; margin: 8px 0 0; }
.map-preview-wrap + p { color: #cdb98f; }
#host-map-controls label { color: #d2ae70; }
#host-map-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px; }
#host-map-controls input { width: 180px; padding: 10px; color: #eee2c9; background: #252525; border: 1px solid #75603c; }
#host-map-controls[hidden], #start-match[hidden] { display: none; }

/* below is css for create room page */


/* ============================= */
/* CREATE ROOM PAGE              */
/* ============================= */

.create-room-form {
    width: 100%;
    max-width: 500px;
    margin: 50px auto;
    padding: 45px 40px;

    display: flex;
    flex-direction: column;
    gap: 20px;

    background: rgba(15, 15, 15, 0.94);
    border: 1px solid #75603c;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
}

.game-room-container {
    width: 100%;
    max-width: 800px;
    min-height: 500px;
    margin: 50px auto;
    padding: 60px 50px;

    display: flex;
    flex-direction: column;
    gap: 20px;

    background: rgba(15, 15, 15, 0.94);
    border: 1px solid #75603c;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
}

.game-room-container * {
    color: rgb(255, 245, 226);
}

.game-room-container .room-name-label {
    color: #d2ae70;
    font-size: 25px;
    letter-spacing: 2px;
    font-weight: bold;
}

.create-room-form label {
    color: #d2ae70;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: bold;
}

.create-room-form input {
    width: 100%;
    padding: 15px;

    background: #252525;
    border: 1px solid #75603c;
    color: #eee2c9;

    font-size: 15px;
    outline: none;
}

.create-room-form input:focus {
    border-color: #c49a53;
}

.create-room-form input::placeholder {
    color: #77716a;
}

/* Create Room Submit Button */

.create-room-form .create-room-button {
    width: 100%;
    margin-top: 15px;
}

@media (max-width: 500px) {
    .create-room-form {
        padding: 30px 22px;
    }
}

/* above is css for create room page */

.create-room-form .room-name-label {
    font-size: 25px;
}

