/* Reset box-sizing for all elements */
* {
    box-sizing: border-box;
}

/* General body styling */
body {
    background: #0a0a24;
    padding: 10px;
    font-family: Arial, sans-serif;
    margin: 0;
    font-size: 1rem;
}

/* Page container */
.page {
    width: 95%;
    max-width: 850px;
    margin: 20px auto;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 20px;
}

/* Titles and text color */
.title {
    color: #e5549a;
    text-align: center;
}

.text-colour {
    color: white;
}

/* Chat container */
#chatContainer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* stack online list on small screens */
    margin-bottom: 10px;
}

/* Chat area */
#chat {
    flex: 1;
    min-width: 200px;
    height: 300px;
    overflow-y: auto;
    border: 3px solid #ccc;
    padding: 10px;
    background: #272d49;
    border-radius: 5px;
}

/* Online users area */
#online {
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border: 3px solid #ccc;
    background: #272d49;
    padding: 5px;
    border-radius: 5px;
}

#onlineHeader {
    font-weight: bold;
    margin-bottom: 5px;
}

#online button {
    display: block;
    width: 100%;
    cursor: pointer;
    user-select: none;
    padding: 5px 10px;
    text-align: left;
    margin-bottom: 5px;
}

/* User box */
.userBox {
    padding: 10px;
    border-bottom: 2px solid #ddd;
    cursor: pointer;
    user-select: none;
    background: #272d49;
    transition: background 0.2s;
    color: white;
}

.userBox:hover {
    background: #7ca1b2;
}

/* Chat form */
#chatForm {
    display: flex;
    gap: 5px;
    width: 100%;
    flex-wrap: nowrap;
}

#msg {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    font-size: 1rem;
}

#sendBtn {
    background-color: #529fe8;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

#sendBtn:hover {
    background-color: #1669c1;
    transform: scale(1.05);
}
#sendBtn:active {
    transform: scale(0.95);
}

/* Player details form */
#details, #name {
    margin-top: 10px;
    display: block;
}

#detailsBtn {
    margin-top: 10px;
    background-color: #529fe8;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, transform 0.2s;
}

#detailsBtn:hover {
    background-color: #1669c1;
    transform: scale(1.05);
}
#detailsBtn:active {
    transform: scale(0.95);
}

/* Gender buttons */
#genderContainer .gender-btn {
    background-color: #f1f3f4;
    color: #333;
    border: 1px solid #ccc;
    padding: 5px 12px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease-in-out;
}

#genderContainer .gender-btn.selected {
    background-color: #529fe8;
    color: white;
    border-color: #417ac1;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    transform: translateY(2px);
}

#genderContainer .gender-btn:not(.selected):hover {
    background-color: #e0e4e7;
}

/* For large screens */
@media (min-width: 1024px) {
    
    body{
        
        background:#0a0a24;
        padding: 20px;
        font-family: Arial;
        
    }
    
    .page {
        width: 8.5in;             /* page width */
        height: 11in;          /* page height */
        margin: 40px auto 0 auto; /* top margin separates from previous page, auto horizontal centering */
        background: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        border-radius: 4px;
        box-sizing: border-box;
        outline: none;
        position: relative;
    }
    
    
    #online {
        width: 200px;           /* fixed width */
        max-height: 400px;
        overflow-y: auto;
        border: 3px solid #ccc;
        background: #272d49;
        padding: 0;
    }
    
    #online button {
        display: inline-block;  /* natural width */
        cursor: pointer;        /* hand cursor */
        user-select: none;      /* prevent text selection */
        padding: 5px 10px;      /* optional padding */
        box-sizing: border-box; /* include padding in size */
        text-align: left;       /* optional, align text nicely */
    }
    
    .text-colour {
        color: white;
    }
    
    .title{
        
        color: #e5549a;
    
    }
    
    #chatContainer {
        display: flex;
        gap: 20px; /* space between chat and online list */
    }
    #chat {
        flex: 1;               /* take remaining space */
        width: 1000px;
        height: 400px;
        overflow-y: auto;
        border: 3px solid #ccc;
        padding: 10px;
        box-sizing: border-box;
        background: #272d49;
        margin-bottom: 10px;
    }
    
    .userBox {
        padding: 10px;
        border-bottom: 2px solid #ddd;
        cursor: pointer;
        user-select: none;
        background: #272d49;
        transition: background 0.2s;
        color: white;
    }
    
    .userBox:hover {
        background: #7ca1b2;
    }
    
    #onlineHeader {
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    #sendBtn {
        background-color: #529fe8;
        width: 80px;
        height: 40px;
        color: white;
        border: none;
        border-radius: 10px;       /* makes it rounded */
        padding: 7px 20px;
        cursor: pointer;
        font-weight: bold;
        transition: background 0.3s, transform 0.2s;
    }
    
    #sendBtn:hover {
        background-color: #1669c1;
        transform: scale(1.05);
    }
    #sendBtn:active {
        transform: scale(0.95);
    }
    
    #msg {
        width: 860px;
        padding: 10px;
        border-radius: 5px;
        margin-bottom: 20px;
    }
    
    #details {
        
        font-weight: bold;
    }
    
    #name {
        margin-bottom: 10px;
    }
    
    #detailsBtn {
        margin-top: 20px;  
        background-color: #529fe8;
        color: white;
        border: none;
        border-radius: 10px;       /* makes it rounded */
        padding: 7px 20px;
        cursor: pointer;
        font-weight: bold;
        transition: background 0.3s, transform 0.2s;
    }
    
    #detailsBtn:hover {
        background-color: #1669c1;
        transform: scale(1.05);
    }
    #detailsBtn:active {
        transform: scale(0.95);
    }
    
    #genderContainer .gender-btn {
        background-color: #f1f3f4;  /* light grey */
        color: #333;
        border: 1px solid #ccc;
        padding: 5px 12px;
        margin-left: 5px;
        border-radius: 4px;
        cursor: pointer;
        user-select: none;
        transition: all 0.1s ease-in-out;
    }
    
    /* Pressed / selected button style */
    #genderContainer .gender-btn.selected {
        background-color: #529fe8;  /* blue */
        color: white;
        border-color: #417ac1;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); /* pressed effect */
        transform: translateY(2px); /* moves it down slightly */
    }
    
    /* Hover effect for unselected buttons */
    #genderContainer .gender-btn:not(.selected):hover {
        background-color: #e0e4e7;
    }
    
    #chatForm {
        display: flex;
        gap: 5px; /* optional spacing between input and button */
        width: 100%; /* make form full width */
    }

}

/* For small screens */
@media(max-width: 600px){
    /* Reset box-sizing for all elements */
    * {
        box-sizing: border-box;
    }
    
    /* General body styling */
    body {
        background: #0a0a24;
        padding: 10px;
        font-family: Arial, sans-serif;
        margin: 0;
        font-size: 1rem;
    }
    
    /* Page container */
    .page {
        width: 95%;
        max-width: 850px;
        margin: 20px auto;
        background: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        border-radius: 4px;
        padding: 20px;
    }
    
    /* Titles and text color */
    .title {
        color: #e5549a;
        text-align: center;
    }
    
    .text-colour {
        color: white;
    }
    
    /* Chat container */
    #chatContainer {
        display: flex;
        gap: 10px;
        flex-wrap: wrap; /* stack online list on small screens */
        margin-bottom: 10px;
    }
    
    /* Chat area */
    #chat {
        flex: 1;
        min-width: 200px;
        height: 300px;
        overflow-y: auto;
        border: 3px solid #ccc;
        padding: 10px;
        background: #272d49;
        border-radius: 5px;
    }
    
    /* Online users area */
    #online {
        width: 200px;
        max-height: 300px;
        overflow-y: auto;
        border: 3px solid #ccc;
        background: #272d49;
        padding: 5px;
        border-radius: 5px;
    }
    
    #onlineHeader {
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    #online button {
        display: block;
        width: 100%;
        cursor: pointer;
        user-select: none;
        padding: 5px 10px;
        text-align: left;
        margin-bottom: 5px;
    }
    
    /* User box */
    .userBox {
        padding: 10px;
        border-bottom: 2px solid #ddd;
        cursor: pointer;
        user-select: none;
        background: #272d49;
        transition: background 0.2s;
        color: white;
    }
    
    .userBox:hover {
        background: #7ca1b2;
    }
    
    /* Chat form */
    #chatForm {
        display: flex;
        gap: 5px;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    #msg {
        flex: 1;
        padding: 10px;
        border-radius: 5px;
        font-size: 1rem;
    }
    
    #sendBtn {
        background-color: #529fe8;
        color: white;
        border: none;
        border-radius: 10px;
        padding: 10px 20px;
        font-weight: bold;
        cursor: pointer;
        transition: background 0.3s, transform 0.2s;
    }
    
    #sendBtn:hover {
        background-color: #1669c1;
        transform: scale(1.05);
    }
    #sendBtn:active {
        transform: scale(0.95);
    }
    
    /* Player details form */
    #details, #name {
        margin-top: 10px;
        display: block;
    }
    
    #detailsBtn {
        margin-top: 10px;
        background-color: #529fe8;
        color: white;
        border: none;
        border-radius: 10px;
        padding: 10px 20px;
        cursor: pointer;
        font-weight: bold;
        transition: background 0.3s, transform 0.2s;
    }
    
    #detailsBtn:hover {
        background-color: #1669c1;
        transform: scale(1.05);
    }
    #detailsBtn:active {
        transform: scale(0.95);
    }
    
    /* Gender buttons */
    #genderContainer .gender-btn {
        background-color: #f1f3f4;
        color: #333;
        border: 1px solid #ccc;
        padding: 5px 12px;
        margin-left: 5px;
        border-radius: 4px;
        cursor: pointer;
        user-select: none;
        transition: all 0.1s ease-in-out;
    }
    
    #genderContainer .gender-btn.selected {
        background-color: #529fe8;
        color: white;
        border-color: #417ac1;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
        transform: translateY(2px);
    }
    
    #genderContainer .gender-btn:not(.selected):hover {
        background-color: #e0e4e7;
    }
    
    
}