/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #3a3a3a;
    color: white;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header Styles */
.header {
    background-color: #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #444;
    height: 54px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo {
    color: #ffcc00;
    font-weight: bold;
    text-decoration: none;
    font-size: 18px;
    margin-right: 15px;
}

.room-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #ccc;
}

.room-name {
    margin-left: 5px;
}

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

.waiting-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: absolute;
    top: 20%; /* Adjusted position */
    left: 50%;
    transform: translate(-50%, -50%);
}

.waiting-message {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #ffcc00;
}

.waiting-icon {
    margin-right: 5px;
}

.language-info {
    font-size: 14px;
    color: #ccc;
    margin-top: 10px;
}

.edit-rules-btn {
    background-color: #ffcc00;
    border: 1px solid #ffcc00;
    color: #282828;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px; /* Add margin-top to separate from language-info */
}

.edit-rules-btn:hover {
    background-color: #ffaa00;
    border: 1px solid #ffaa00;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-controls button {
    background-color: transparent;
    border: none;
    color: #ccc;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-controls button:hover {
    background-color: #444;
}

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #3a3a3a;
}

.game-content {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.game-logo-container {
    margin-bottom: 50px;
}

.game-logo {
    display: inline-block;
    position: relative;
}

.game-background {
    width: 100%;
    height: auto;
    max-width: 800px;
}

.game-actions {
    margin-top: 100px; /* Adjust margin to move button further down */
}

.join-game-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #2E7D32, 0 5px 10px rgba(0,0,0,0.2);
}

.join-game-btn:hover {
    background-color: #43A047;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #2E7D32, 0 7px 12px rgba(0,0,0,0.2);
}

.join-game-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #2E7D32, 0 3px 5px rgba(0,0,0,0.2);
}

.join-game-btn:disabled {
    background-color: #78C27A;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 0 #2E7D32, 0 5px 10px rgba(0,0,0,0.2);
}

/* Chat Panel */
.chat-panel {
    position: absolute;
    right: 0;
    top: 54px;
    bottom: 0;
    width: 280px;
    background-color: #282828;
    border-left: 1px solid #444;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.chat-input-container {
    padding: 10px;
    border-top: 1px solid #444;
}

.chat-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: white;
}

.chat-input::placeholder {
    color: #aaa;
}

.profile {
    display: none; /* Hidden initially */
    align-items: center;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    margin-top: 10px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.profile:hover {
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.profile-icon {
    width: 30px; /* Adjusted size */
    height: 30px; /* Adjusted size */
    background-color: #eee;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#username-display {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

/* Chat message styles */
.chat-message {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    text-align: left;
}

.message-timestamp {
    font-size: 12px;
    color: #ccc;
    margin-left: 10px; /* Adjusted position */
}

.message-content {
    display: flex;
    align-items: center;
}

.message-username {
    font-weight: bold;
    margin-right: 5px;
}

.message-text {
    color: white;
}

.chat-message.admin .message-username {
    color: #4CAF50;
}

.chat-message.info {
    justify-content: flex-start; /* Adjusting alignment */
    color: #00f;
    font-style: italic;
}

/* Rules Panel */
.rules-panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    background-color: #282828;
    border-right: 1px solid #444;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.rules-panel.hidden {
    display: none;
}

.rules-panel h2, .rules-panel h3, .rules-panel p {
    color: white;
    margin-bottom: 10px;
}

.rules-panel h2 {
    font-size: 24px;
}

.rules-panel h3 {
    font-size: 18px;
}

.rules-panel p {
    font-size: 14px;
}

#lives-range {
    width: 100%;
    margin-top: 10px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .nav-right {
        gap: 10px;
    }
    
    .waiting-message, .language-info {
        display: none;
    }
    
    .word-duel-logo {
        font-size: 40px;
    }
}