.popover {
    position: fixed;
    z-index: 30000;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    min-width: 160px;
    isolation: isolate;
    contain: layout style paint;
}
/* CSS Custom Properties for Colors */
:root {
    /* Background Colors */
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-input: #303030;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;

    /* Accent Colors */
    --accent-primary: #ffffff;
    --accent-light: #dddddd;
    --accent-dark: #413f3f;

    /* Link Colors */
    --link-color: #87CEEB; /* Light blue */
    --link-visited: #87CEEB; /* Light blue for visited links */

    /* Border Colors */
    --border-primary: #ffffff;
    --border-secondary: #666666;
    --border-muted: #555555;

    /* Status Colors */
    --status-success: #ffffff;
    --status-error: #ffffff;

    /* Shadow Colors */
    --shadow-green: rgba(255, 255, 255, 0.3);
    --shadow-red: rgba(255, 255, 255, 0.4);
}

/* Import Gaegu font */
@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@300;400;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Hyperlink styles */
a:link,
a:visited {
    color: var(--link-color);
    text-decoration: none;
}

a:hover,
a:active {
    color: var(--link-color);
    text-decoration: underline;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

/* Desktop: Center the chat like a phone app */
@media (min-width: 769px) {
    .container {
        width: 33.33%;
        margin: 0 auto;
        height: 100vh;
        box-shadow: 0 0 50px var(--shadow-green);
        border-left: 2px solid var(--border-primary);
        border-right: 2px solid var(--border-primary);
        overflow: hidden; /* Prevent container from scrolling */
    }
}

/* Header */
.header {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--border-primary);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.invite-wrap { position: relative; }
.invite-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    display: none;
    flex-direction: column;
    z-index: 1002;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-radius: 8px; /* Match the soft design */
}
/* Dropdown is controlled via JS (click to open/close) */
.menu-item {
    padding: 0.5rem 0.8rem;
    background: var(--bg-input);
    color: var(--text-primary);
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 10px; /* Rounded corners for softer look */
}
.menu-item:hover {
    background: var(--bg-tertiary);
    border-radius: 10px; /* Ensure hover state also maintains rounded corners */
}

.logo {
    width: 100px;  /* Smaller logo */
    height: auto;
}

.header-right { display: flex; align-items: center; gap: 0.75rem; }

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-outside {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
}

.status-action { white-space: nowrap; }

.legal-links-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.legal-link-header {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.legal-link-header:hover {
    color: var(--link-color);
    text-decoration: underline;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #ff4444;
    border: 2px solid #ffffff;
}

.status-dot.connected {
    background: var(--status-success);
    box-shadow: 0 0 10px var(--shadow-green);
}

.status-dot.disconnected {
    background: var(--status-error);
    box-shadow: 0 0 10px var(--shadow-red);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.main-content::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden; /* Prevent container from scrolling */
}

/* Scrollable content area */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding-bottom: 60px; /* Add space at the bottom to account for fixed input */
}

.scrollable-content::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* For legal pages (about, privacy policy, etc.) where we want hidden scrollbars */
body:not(.chat-page) {
    height: 100vh;
    overflow: hidden; /* Prevent double scrollbars */
}

body:not(.chat-page) .scrollable-content {
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar */
    -ms-overflow-style: none; /* IE 10+ */
    padding-bottom: 2rem; /* Adjust for legal pages */
}

body:not(.chat-page) .scrollable-content::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

/* For legal acknowledgment overlay during initial setup - hide scrollbars */
.legal-acknowledge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 20000;
    overflow-y: auto; /* Allow scrolling for overlay content */
}

.legal-acknowledge-content {
    background: var(--bg-secondary);
    margin: 2rem auto;
    padding: 2.5rem;
    border: 2px solid var(--border-primary);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 30px var(--shadow-green);
    border-radius: 18px;
    max-height: 80vh; /* Limit height to viewport */
    overflow-y: auto; /* Enable scrolling within the content area */
    scrollbar-width: none; /* Hide scrollbar */
    -ms-overflow-style: none; /* IE 10+ */
}

.legal-acknowledge-content::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

/* Messages */
.messages {
    padding: 1rem;
    background: var(--bg-secondary);
}

.lobby-message, .waiting-message, .welcome-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
}

.lobby-message h2, .waiting-message h2, .welcome-message h2 {
    font-family: 'Gaegu', cursive;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-weight: 400;
    font-size: 1.6rem; /* Bigger font as requested */
    text-transform: lowercase; /* Changed to lowercase as requested */
    letter-spacing: 1px;
}

.lobby-message p, .waiting-message p, .welcome-message p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.instruction {
    background: var(--bg-tertiary);
    padding: 1rem;
    margin-top: 1.5rem;
    border: 2px solid var(--border-primary);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.message {
    margin-bottom: 0.5rem; /* Changed from 1.5rem to 0.5rem as requested */
    display: flex;
    flex-direction: column;
}

.message.own {
    align-items: flex-end;
    justify-content: flex-end;
}

.message.other {
    align-items: flex-start;
    justify-content: flex-start;
}

/* Position reply button correctly for each message type */
.message.own .message-wrapper {
    flex-direction: row-reverse; /* For own messages, put reply button on the left */
}

.message.other .message-wrapper {
    flex-direction: row; /* For other messages, put reply button on the right */
}

.message-content {
    max-width: 80%;
    padding: 0.6rem 1rem; /* Updated as requested */
    word-wrap: break-word;
    position: relative;
    border: 2px solid;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 15px; /* Updated as requested */
    display: flex;
    flex-direction: column;
}

.message.own .message-content {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border-color: var(--border-primary);
    box-shadow: 0 0 15px var(--shadow-green);
}

.message.other .message-content {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

/* Chat controls container */
.chat-controls {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    flex: 1; /* Take available space */
}

/* Default states - will be overridden by JavaScript */
#activeChatControls {
    display: flex;
    align-items: center;
    width: 100%;
}

#endedChatControls {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
}


/* Game area */
.game-area {
    background: var(--bg-tertiary);
    border-top: 2px solid var(--border-primary);
    border-bottom: 2px solid var(--border-primary);
    padding: 0.8rem 1rem;
    display: none;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease;
    border-radius: 12px; /* Rounded corners for softer look */
    width: 100%;
    box-sizing: border-box;
}

.game-area.open {
    display: block;
    max-height: 350px; /* Standardized height for all games */
    opacity: 1;
    transform: translateY(0);
}

.game-area.closing {
    max-height: 0;
    opacity: 0;
    transform: translateY(8px);
}

/* Standard game board container */
.game-board-container {
    width: 100%;
    max-width: 350px;
    height: 250px;
    margin: 0 auto;
    display: grid;
    place-items: center; /* Center contents */
}

/* Standard game board styling */
.game-board-standard {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 10px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 2px solid var(--border-secondary);
    box-sizing: border-box;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.game-title {
    color: var(--accent-primary);
    font-weight: 700;
}

.game-status {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Tic-Tac-Toe board styling */
.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 10px;
    box-sizing: border-box;
    align-self: center;
    justify-self: center;
    /* Make the board square by limiting both dimensions equally */
    max-width: 230px; /* Slightly less than container height to account for padding */
    max-height: 230px; /* Slightly less than container height to account for padding */
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--bg-input);
    border: 2px solid var(--border-secondary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 12px; /* Rounded corners for softer look */
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1; /* Ensure square cells */
}

.cell.win {
    background: var(--accent-light);
    color: #142814;
    border-color: var(--border-primary);
    box-shadow: 0 0 18px var(--shadow-green);
}

.cell.filled {
    cursor: default;
}

.cell:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Game icons */
.game-icon {
    font-size: 2.5rem; /* Responsive icon size */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.game-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Connect Four styles - using standardized sizing */
.connect4-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 8px;
    background: #1e5e1e; /* Green board background */
    border-radius: 10px;
    border: 3px solid #8B4513; /* Brown border */
    box-sizing: border-box;
    max-width: 290px;  /* Control width as requested */
    max-height: 250px; /* Maximize height as requested */
}

.connect4-row {
    display: contents; /* Use grid layout for children */
}

.connect4-cell {
    border-radius: 50%;
    background: #F5F5DC; /* Light beige, looks like empty slots */
    border: 2px solid #8B4513; /* Brown border */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1; /* Ensure square cells */
}

/* Poison Candy board styling */
.poison-candy-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns for 5x5 grid */
    grid-template-rows: repeat(5, 1fr); /* 5 rows for 5x5 grid */
    gap: 8px;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 10px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 2px solid var(--border-secondary);
    box-sizing: border-box;
    align-self: center;
    justify-self: center;
    /* Make the board square by limiting both dimensions equally */
    max-width: 230px; /* Slightly less than container height to account for padding */
    max-height: 230px; /* Slightly less than container height to account for padding */
}

.candy-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 2px solid var(--border-secondary);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 12px; /* Rounded corners for softer look */
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1; /* Ensure square cells */
    transition: all 0.2s ease;
}

.candy-cell:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.candy-cell.picked {
    opacity: 0.4;
    filter: grayscale(100%);
    cursor: default;
}

.candy-icon {
    width: 80%;
    height: 80%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.poison-candy-highlight {
    outline: 3px solid #ff0000; /* Red outline to highlight poison candy */
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

/* When a candy is both picked and poison, ensure the highlight remains visible */
.candy-cell.picked.poison-candy-highlight {
    outline: 3px solid #ff0000 !important; /* Red outline stays red */
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.7) !important; /* Keep red glow */
    filter: grayscale(50%)!important; 
}

.connect4-cell:hover {
    background: #e6e6c3; /* Slightly darker on hover */
    transform: scale(1.05);
}

/* Game invitation notification bubble */
.game-invite-notification {
    position: absolute;
    background: #2e2e2e; /* Green color */
    color: white;
    padding: 8px 12px;
    border-radius: 20px; /* Bubble shape */
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: pulse 1.5s infinite;
    top: -40px; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
}

/* Bubble pointer/triangle */
.game-invite-notification::after {
    content: '';
    position: absolute;
    top: 100%; /* Position below the bubble */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #2e2e2e transparent transparent transparent; /* Pointing down */
}

/* Pulse animation */
@keyframes pulse {
    0% { transform: scale(1) translateX(-50%); }
    50% { transform: scale(1.05) translateX(-50%); }
    100% { transform: scale(1) translateX(-50%); }
}

/* Mobile-specific fixes for game notification */
@media (max-width: 480px) {
    .game-invite-notification {
        font-size: 0.8rem;
        padding: 6px 10px;
        max-width: 120px; /* Prevent from being too wide on small screens */
        white-space: normal; /* Allow text wrapping if needed */
    }

    .game-invite-notification::after {
        border-width: 5px; /* Slightly smaller arrow for mobile */
    }
}

.connect4-piece {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    position: absolute;
    transition: all 0.3s ease;
}

/* Player 1 - red piece */
.connect4-piece.x {
    background: #FF4136; /* Red color for player 1 */
    border: 2px solid #cc342b; /* Darker red border */
    box-shadow: inset -3px -3px 5px rgba(0,0,0,0.3), 0 0 5px var(--shadow-green);
}

/* Player 2 - yellow piece */
.connect4-piece.o {
    background: #FFD700; /* Yellow for player 2 */
    border: 2px solid #DAA520; /* Golden border */
    box-shadow: inset -3px -3px 5px rgba(0,0,0,0.3), 0 0 5px var(--shadow-green);
}

/* Winning pieces - highlighted */
.connect4-cell.winning-piece .connect4-piece {
    animation: pulseWin 0.8s infinite alternate;
    box-shadow: inset -3px -3px 5px rgba(0,0,0,0.3), 0 0 8px #ff8c00, 0 0 15px #ff4500;
}

@keyframes pulseWin {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* System message (centered inline in chat) */
.system-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
}

.typing-indicator .typing-dots {
    display: flex;
    align-items: center;
}

.typing-indicator .typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}
.system-message .actions { margin-top: 0.4rem; display: inline-flex; gap: 0.4rem; }

.btn-inline {
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    color: var(--accent-primary);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border-radius: 10px; /* Rounded corners for softer look */
}

.btn-inline.danger {
    border-color: var(--status-error);
    color: var(--status-error);
}

.btn-inline:hover {
    background: var(--accent-light);
    color: var(--text-primary);
    box-shadow: 0 0 15px var(--shadow-green);
    transform: translateY(-1px);
}

.btn-inline:active {
    transform: translateY(0);
}

.input-wrapper.bottom-bar {
    display: flex;
    align-items: center; /* Align items vertically centered */
    background: var(--bg-tertiary); /* Restore background to make it visible */
    border-top: 2px solid var(--border-primary); /* Restore border to define it */
    flex-shrink: 0;
    z-index: 100;
    position: fixed; /* Position it at the bottom of the screen */
    bottom: 0;
    left: 50%; /* Start from center */
    transform: translateX(-50%); /* Center it properly */
    width: 33.33%; /* Match the container width */
    box-sizing: border-box; /* Include padding in width calculation */
}

.message-input-container {
    position: relative;
    flex: 1; /* Take up all available space */
    height: 100%; /* Fill the wrapper */
    width: 100%; /* Fill the wrapper */
    min-width: 0; /* Allow flex item to shrink below content size if needed */
    display: flex; /* Use flex to position game button inside */
    align-items: center; /* Center buttons vertically */
}

/* Styling for the end chat button */
#endChatButton {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
}

#endChatButton .end-chat-text {
    white-space: nowrap;
}

/* Confirmation state styling */
#endChatButton.confirmation {
    background: var(--status-error) !important; /* Red background for confirmation */
    border-color: var(--status-error) !important;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Locked state styling */
#endChatButton.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#endChatButton.cooldown {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Lock button styling */
#lockChatButton {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem;
}

#lockChatButton .lock-icon,
#lockChatButton .unlock-icon {
    font-size: 1.2rem;
    pointer-events: none; /* Ensure clicks go through to button */
}

#lockChatButton .lock-icon {
    display: inline-block;
}

#lockChatButton .unlock-icon {
    display: none;
}

#lockChatButton.hidden,
#inviteFromHeader.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    pointer-events: none;
}

#lockChatButton.visible,
#inviteFromHeader.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

#lockChatButton {
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

#inviteFromHeader {
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

#endChatButton.unlocked {
    pointer-events: auto;
}

#endChatButton.locked {
    pointer-events: none;
}

.swipe-prompt {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0.7;
    pointer-events: none;
}

.end-chat-text {
    transition: margin-left 0.3s ease;
}

/* Swipe to unlock effect */
.end-chat-wrapper:active #endChatButton:not(.unlocked) {
    cursor: grab;
}

.swipe-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    z-index: 10;
    pointer-events: none;
}

#messageInput {
    flex: 1; /* Take remaining space */
    height: 100%; /* Fill the container */
    padding: 0.6rem 50px 0.6rem 0.9rem; /* Adjust right padding to account for game button only */
    border: 0px solid var(--border-secondary); /* Border for definition */
    background: var(--bg-input); /* Use input background */
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    border-radius: 10px; /* Keep the rounded corners */
    box-sizing: border-box; /* Include padding in width/height calculation */
    min-width: 0; /* Allow to shrink if needed */
    z-index: 5; /* Lower z-index so buttons appear above text */
}

#messageInput:focus {
    border-color: var(--border-primary);
    box-shadow: 0 0 15px var(--shadow-green);
    outline: none;
}

/* Admin Panel Styles */
.admin-panel-content {
    max-width: 800px; /* Increased width for PC */
    width: 90%;
    min-width: 600px; /* Increased minimum width */
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 30px var(--shadow-green);
    max-height: 80vh; /* Increased height */
}

.admin-panel-header {
    background: var(--bg-tertiary);
    padding: 0.8rem 1rem; /* More compact */
    border-bottom: 2px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-panel-header h2 {
    margin: 0;
    color: var(--accent-primary);
    font-size: 1.2rem; /* Slightly smaller */
}

.admin-panel-body {
    padding: 1rem; /* More compact */
    max-height: calc(80vh - 70px); /* Adjusted for header height */
    overflow-y: auto; /* Enable vertical scrolling */
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* Add consistent spacing between sections */
    /* Hide scrollbars for better aesthetics */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

.admin-panel-body::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

.admin-section {
    margin: 0 0 1.2rem 0; /* Consistent spacing */
    padding: 1rem; /* More comfortable padding */
    background: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section-title {
    margin: 0 0 0.8rem 0; /* Consistent spacing */
    color: var(--accent-primary);
    font-size: 1rem; /* Slightly larger for better readability */
    font-weight: 600;
    border-bottom: 1px solid var(--border-secondary);
    padding-bottom: 0.4rem;
}

.admin-input {
    width: 100%;
    padding: 0.7rem 0.9rem; /* More comfortable padding */
    margin-bottom: 0.7rem; /* Consistent spacing */
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    font-size: 0.9rem; /* Slightly larger for better readability */
    transition: all 0.3s ease;
}

.admin-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.2); /* Better focus style */
}

.admin-action-btn {
    width: 100%;
    padding: 0.6rem 0.8rem; /* More comfortable padding */
    font-size: 0.9rem; /* Slightly larger for readability */
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid var(--border-secondary);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.admin-action-btn:hover {
    background: var(--bg-input);
    border-color: var(--accent-primary);
}

.current-partner-info {
    background: var(--bg-input);
    padding: 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

.current-partner-info p {
    margin: 0.4rem 0; /* Consistent spacing */
    font-size: 0.9rem; /* Slightly larger for readability */
    word-break: break-all; /* Handle long persistent IDs */
    padding: 0.1rem 0;
}

/* Banned Users Styles */
.banned-users-container {
    background: var(--bg-input);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    padding: 0.5rem; /* More compact */
    flex: 1; /* Allow this section to grow */
    min-height: 120px; /* Minimum height for usability */
    max-height: 250px; /* Increased max-height for better visibility */
    overflow-y: auto; /* Enable vertical scrolling */
    display: flex;
    flex-direction: column;
    /* Hide scrollbars for better aesthetics */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

.banned-users-container::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

.banned-users-header {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 0.8fr;
    padding: 0.6rem 0.8rem; /* More consistent with items */
    background: var(--bg-tertiary);
    font-weight: bold;
    border-bottom: 2px solid var(--border-secondary);
    margin-bottom: 0.3rem;
    font-size: 0.85rem; /* Slightly larger for readability */
}

.banned-user-item {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 0.8fr;
    padding: 0.6rem 0.8rem; /* More comfortable padding */
    border-bottom: 1px solid var(--border-muted);
    align-items: center;
    font-size: 0.85rem; /* Slightly larger for readability */
    transition: background-color 0.2s ease;
}

.banned-user-item:last-child {
    border-bottom: none;
}

.banned-user-item:hover {
    background-color: var(--bg-tertiary);
}

.banned-user-item .username {
    font-weight: 600;
    word-break: break-word; /* Handle long usernames */
}

.banned-user-item .persistent-id {
    font-family: monospace;
    font-size: 0.8rem; /* Slightly larger for readability */
    color: var(--text-secondary);
    word-break: break-all; /* Handle very long persistent IDs */
}

.banned-user-item .reason {
    font-size: 0.8rem; /* Slightly larger for readability */
    color: var(--text-muted);
    word-break: break-word; /* Handle long reasons */
}

.banned-user-item .banned-actions {
    text-align: center;
}

.banned-user-item .unban-btn {
    padding: 0.3rem 0.6rem; /* More compact button */
    font-size: 0.8rem; /* Slightly smaller text */
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.no-banned {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.loading-banned {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Admin Verification Modal Styles (Bank-Style) */
.verification-modal {
    max-width: 400px;
    width: 90%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 30px var(--shadow-green);
}

.verification-header {
    text-align: center;
    padding: 1.2rem 1rem 0.8rem;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-primary);
}

.verification-header h2 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.verification-instruction {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.verification-body {
    padding: 1.2rem;
}

.code-input-container {
    margin-bottom: 1.2rem;
}

.code-inputs {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.code-input {
    width: 40px;
    height: 45px;
    padding: 0;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid var(--border-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--shadow-green);
}

.code-input-helper {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.verification-actions {
    display: flex;
    gap: 0.6rem;
}

.verification-submit {
    flex: 2;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

.verification-cancel {
    flex: 1;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30000;
}

.modal-content {
    position: relative;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .admin-panel-content {
        min-width: 90%;
        width: 95%;
    }

    .code-input {
        width: 40px;
        height: 45px;
        font-size: 1.2rem;
    }

    .banned-users-header,
    .banned-user-item {
        display: block;
        text-align: center;
    }

    .banned-user-item .username::before {
        content: "Username: ";
        font-weight: bold;
    }

    .banned-user-item .persistent-id::before {
        content: "Persistent ID: ";
        font-weight: bold;
    }

    .banned-user-item .reason::before {
        content: "Reason: ";
        font-weight: bold;
    }
}

#messageInput::placeholder {
    color: var(--text-muted);
}

/* Old send button (now replaced by text version)
.send-btn {
    background: transparent;
    color: var(--accent-primary);
    border: none;
    width: auto;
    height: 100%; Match input height
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 8px; Revert to original padding
    margin: 0;
    border-radius: 12px; Revert to original border radius
    position: absolute; Position absolutely in container
    right: 0px; Adjust position on the far right
    top: 50%;
    transform: translateY(-50%);
    z-index: 10; Higher z-index than game button
    align-self: stretch; Make button stretch to match input height
}
*/

.send-btn-text {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border: 0px solid var(--border-primary);
    width: auto;
    height: 100%; /* Match input height */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 0.6rem 0.6rem; /* Adjust padding for text */
    border-radius: 10px; /* Rounded corners */
    font-family: 'Gaegu', cursive; /* Use Gaegu font as requested */
    font-size: 1rem;
    min-width: 60px; /* Minimum width for the send button */
    box-sizing: border-box; /* Include padding in width calculation */
}

.send-btn-text .fa-paper-plane {
    font-size: 1.2rem; /* Adjust icon size */
}

/* Mobile-specific styles for send button inside input */
@media (max-width: 480px) {
    .message-input-container {
        position: relative; /* Needed for absolute positioning of send button */
    }

    

    .send-btn-text {
        position: absolute;
        right: 17px; /* Position at the right edge of the input */
        top: 50%;
        transform: translateY(-50%);
        min-width: auto;
        width: 40px;
        height: 40px;
        padding: 0;
        background: transparent;
        color: var(--accent-primary);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 10; /* Ensure button is above text */
    }

    .send-btn-text.show {
        opacity: 1;
        visibility: visible;
    }
}

.invite-wrap {
    position: absolute;
    right: 17px; /* Position for game button inside input */
    top: 50%;
    transform: translateY(-50%);
    z-index: 9; /* Lower z-index than input text */
    height: 100%;
    display: flex;
    align-items: center;
}

.icon-btn {
    background: transparent;
    color: var(--accent-primary);
    border: none;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px; /* Revert to original padding */
    margin: 0;
    border-radius: 12px; /* Revert to original border radius */
    position: relative; /* Needed for absolutely positioned icons */
}

/* Base styles for game icons (send button no longer uses icons) */
.icon-btn .ri-gamepad-line,
.icon-btn .ri-gamepad-fill {
    font-size: 24px; /* Size for game button */
    pointer-events: none; /* Ensure clicks go through to the button */
    color: var(--accent-primary);
    width: 24px;
    height: 24px;
    display: inline-block;
    position: absolute;
    transition: all 0.2s ease;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    margin: 0;
}

/* Ensure only one game icon is visible at a time */
.icon-btn .ri-gamepad-line {
    opacity: 1;
}

.icon-btn .ri-gamepad-fill {
    opacity: 0;
}


/* Hover state - show fill version */
.icon-btn:hover .ri-gamepad-line {
    opacity: 0.2; /* Keep the line version slightly visible */
}

.icon-btn:hover .ri-gamepad-fill {
    opacity: 1;
    color: var(--text-primary);
}

/* Active state - keep fill version */
.icon-btn:active .ri-gamepad-fill,
.send-btn:active .ri-send-plane-fill {
    transform: translate(-50%, -50%) scale(0.95); /* Slight scale down to show active state */
}

.icon-btn:hover {
    background: var(--bg-input);
    box-shadow: 0 0 15px var(--shadow-green);
}

.icon-btn:hover i {
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.95);
}

.send-btn-text:hover {
    background: var(--accent-dark);
    color: var(--text-primary);
    box-shadow: 0 0 0px var(--shadow-green);
    border-color: var(--border-primary);
}

.send-btn-text:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Removed footer controls for minimal layout */

/* Footer */
.footer {
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.change-name-btn {
    background: var(--bg-input);
    border: 2px solid var(--border-primary);
    color: var(--accent-primary);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.change-name-btn:hover {
    background: var(--accent-light);
    color: var(--text-primary);
    box-shadow: 0 0 15px var(--shadow-green);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    isolation: isolate;
    contain: layout style paint size;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 15% auto;
    padding: 2.5rem;
    border: 2px solid var(--border-primary);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 0 30px var(--shadow-green);
    border-radius: 18px; /* More rounded for softer look */
    isolation: isolate;
    contain: layout style paint;
}

/* Smaller modal variant for quick menus */
#gameModal .modal-content {
    max-width: 360px;
    padding: 1.5rem;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#nameInput {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-secondary);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2rem;
    outline: none;
    transition: all 0.3s ease;
    border-radius: 12px; /* Rounded corners for softer look */
}

#nameInput:focus {
    border-color: var(--border-primary);
    box-shadow: 0 0 15px var(--shadow-green);
}

#nameInput::placeholder {
    color: var(--text-muted);
}

#nameError {
    color: #ff6b6b; /* Red color for error */
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none; /* Hidden by default */
    text-align: left;
    padding-left: 0.5rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: 2px solid;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 10px; /* Rounded corners for softer look */
}

.lobby-btn {
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px; /* More rounded for softer look */
}

/* Loading overlay for match finding */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20001; /* Higher than modals (z-index: 20000) */
    backdrop-filter: blur(0); /* Ensure no transparency effects */
    isolation: isolate;
    contain: layout style paint size;
}

.loading-overlay .loading-content {
    position: relative;
    z-index: 20002; /* Content above the background */
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.3);
    isolation: isolate;
    contain: layout style paint;
}


.loading-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 0 30px var(--shadow-green);
}

.loading-title {
    font-family: 'Gaegu', cursive;
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.loading-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Specific loader container for centering */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--bg-input);
    border-top: 5px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-ad-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent any overflow from ad content */
    position: relative; /* Ensure proper positioning context */
}

.loading-ad-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.cancel-loading-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
}

/* Name setup overlay */
.name-setup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.name-setup-content {
    text-align: center;
    max-width: 600px;
    width: 90%;
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 0 30px var(--shadow-green);
}

.name-setup-header img {
    width: 150px;
    margin-bottom: 1rem;
}

.name-setup-header h1 {
    font-family: 'Gaegu', cursive;
    color: var(--accent-primary);
    font-size: 2rem;
    margin: 0.5rem 0;
}

.name-setup-header p {
    color: var(--text-secondary);
    margin: 0.5rem 0 1.5rem;
}

.name-input-container {
    margin: 1.5rem 0;
}

.name-input {
    padding: 0.8rem 1rem;
    width: 100%;
    max-width: 300px;
    background: var(--bg-input);
    border: 2px solid var(--border-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    border-radius: 8px;
    outline: none;
}

.name-input:focus {
    border-color: var(--border-primary);
    box-shadow: 0 0 15px var(--shadow-green);
}

.name-setup-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-secondary);
    text-align: left;
    color: var(--text-secondary);
}

.name-setup-info h3 {
    color: var(--accent-primary);
    margin-top: 1.5rem;
}

.name-setup-info h3:first-child {
    margin-top: 0;
}

.name-setup-info a {
    color: var(--accent-primary);
    text-decoration: none;
}

.name-setup-info a:hover {
    text-decoration: underline;
}

.info-section {
    max-height: 300px;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
}

.scrolling-content {
    max-height: 300px;
    overflow-y: auto;
}

.info-page {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-muted);
}

.info-page:last-child {
    border-bottom: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature-card {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-secondary);
}

.feature-card h3 {
    color: var(--accent-primary);
    margin: 0 0 0.5rem 0;
}

.scroll-indicator {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin: 1rem 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.name-input-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-secondary);
}

/* Legal Acknowledge Screen Styles */
.legal-acknowledge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.legal-acknowledge-content {
    text-align: center;
    max-width: 800px;
    width: 90%;
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 0 30px var(--shadow-green);
}


.legal-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-secondary);
}

.legal-acknowledge-content {
    text-align: center;
    max-width: 800px;
    width: 90%;
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 0 30px var(--shadow-green);
    /* Let the page scroll naturally */
}

.legal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.legal-section h2 {
    color: var(--accent-primary);
    margin-top: 0;
    margin-bottom: 1rem;
}

.legal-navigation {
    margin-top: 1.5rem;
}

.legal-links {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.legal-page-link {
    color: var(--link-color);
    text-decoration: none;
}

.legal-page-link:hover {
    color: var(--link-color);
    text-decoration: underline;
}

.acknowledge-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    margin-right: 10px;
    height: 20px;
    width: 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-secondary);
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative; /* Needed for absolute positioning of the checkmark */
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--accent-primary);
    border-color: var(--border-primary);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
    border-color: var(--text-primary); /* Use primary text color for better visibility */
}

.checkbox-container .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 50%; /* Center horizontally */
    top: 42%;   /* Center vertically but slightly higher */
    width: 6px;
    height: 12px;
    border: solid white; /* White checkmark */
    border-width: 0 3px 3px 0;
    transform: translate(-50%, -50%) rotate(45deg); /* Center the element and rotate */
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Ensure checkbox maintains square shape on mobile */
@media (max-width: 480px) {
    .checkmark {
        flex-shrink: 0; /* Prevent shrinking */
        height: 20px !important;
        width: 20px !important;
        min-height: 20px;
        min-width: 20px;
    }
}

.btn-primary {
    background: var(--bg-input);
    color: var(--accent-primary);
    border-color: var(--border-primary);
}

.btn-primary:hover {
    background: var(--accent-light);
    color: var(--text-primary);
    box-shadow: 0 0 15px var(--shadow-green);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border-color: var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--border-secondary);
    color: var(--text-primary);
}

.btn-secondary.blocked {
    background: var(--bg-input);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tablet: Slightly wider than mobile */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        width: 50%;
        margin: 0 auto;
        border-left: 2px solid var(--border-primary);
        border-right: 2px solid var(--border-primary);
    }

    .input-wrapper.bottom-bar {
        width: 50%; /* Match container width on tablet */
        left: 50%; /* Start from center */
        transform: translateX(-50%); /* Center it properly */
    }
}

/* Mobile-first responsive design */
@media (max-width: 480px) {
    .input-wrapper.bottom-bar {
        width: 100%; /* Full width on mobile */
        max-width: 100%; /* Full width on mobile */
        left: 0; /* Reset left positioning */
        transform: none; /* Reset transform */
        padding: calc(0.8rem + env(safe-area-inset-bottom, 0)); /* Add safe area padding */
    }

    .header {
        padding: 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .status-indicator {
        font-size: 0.7rem;
    }

    .status-outside {
        right: 20px;
        top: 10px;
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }

    .messages {
        padding: 0.8rem;
        padding-bottom: 1rem; /* Small padding at bottom for last messages */
    }
    
    .welcome-message {
        padding: 1.5rem 0.8rem;
    }
    
    .welcome-message h2 {
        font-size: 1.2rem;
    }
    
    .welcome-message p {
        font-size: 0.9rem;
    }
    
    .instruction {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    
    .message-content {
        max-width: 90%;
        padding: 0.7rem 0.9rem;
        font-size: 0.9rem;
    }
    
    .input-wrapper.bottom-bar {
        padding: 0.8rem;
    }
    
    .input-wrapper {
        gap: 0.6rem;
    }
    
    #messageInput {
        padding: 0.8rem 39px 0.8rem 0.5rem;
        font-size: 0.9rem;
    }

    .send-btn {
        width: 40px;
        height: 40px;
    }
    
    .footer {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        padding: 0.8rem 1rem;
        font-size: 0.75rem;
    }
    
    .user-info {
        gap: 0.8rem;
    }
    
    .change-name-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        width: 95%;
    }
    
    .modal-content h3 {
        font-size: 1.2rem;
    }
    
    #nameInput {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    /* Hide status bar and change-name on small screens */
    .status-outside { display: none; }
    #changeName { display: none; }

    /* Use dynamic viewport height so the input isn't pushed off-screen on mobile */
    body, .container { height: 100dvh; }
    .input-wrapper.bottom-bar {
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0));
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .header {
        padding: 1.5rem 2rem;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .status-indicator {
        font-size: 0.9rem;
    }
    
    .messages {
        padding: 1.5rem;
    }
    
    .welcome-message {
        padding: 2.5rem 1.5rem;
    }
    
    .welcome-message h2 {
        font-size: 1.6rem;
    }
    
    .welcome-message p {
        font-size: 1.1rem;
    }
    
    .instruction {
        padding: 1.2rem;
        font-size: 0.95rem;
    }
    
    .message-content {
        max-width: 75%;
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }
    
    #messageInput {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .send-btn {
        width: 50px;
        height: 50px;
    }
    
    .footer {
        padding: 1.5rem 2rem;
        font-size: 0.9rem;
    }
    
    .user-info {
        gap: 1.5rem;
    }
    
    .change-name-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 2.5rem;
        max-width: 400px;
    }
    
    .modal-content h3 {
        font-size: 1.5rem;
    }
    
    #nameInput {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Scrollbar styling */
.messages::-webkit-scrollbar {
    width: 8px;
    display: none; 
}

.messages::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.messages::-webkit-scrollbar-thumb {
    background: var(--accent-light);
    border: 1px solid var(--bg-primary);
}

.messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.status-outside {
    position: fixed;
    top: 20px;
    right: 100px;
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-primary);
    border-radius: 6px;
    z-index: 1000;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-secondary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chess board styles */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    align-self: center;
    justify-self: center;
    background: #f0d9b5; /* Light brown background for chess board */
    border: 3px solid #ffffff; /* Darker brown border */
    border-radius: 8px;
    max-width: 270px; /* Control width to fit in game area */
    max-height: 270px; /* Make it square */
    place-self: center;
}

.chess-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 0; /* No rounded corners for chess squares */
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1; /* Ensure square cells */
    position: relative;
}

.chess-cell.light {
    background-color: var(--accent-light); /* Light square color */
}

.chess-cell.dark {
    background-color: var(--accent-dark); /* Dark square color */
}

.chess-cell:hover {
    box-shadow: inset 0 0 0 2px #4d7942; /* Highlight on hover */
}

.chess-cell.selected {
    box-shadow: inset 0 0 0 3px #4CAF50; /* Green highlight for selected piece */
    background-color: #a3bca3; /* Light green background for selected */
}

.chess-cell.valid-move::after {
    content: "";
    position: absolute;
    width: 25%;
    height: 25%;
    background-color: rgba(76, 175, 80, 0.5); /* Semi-transparent green */
    border-radius: 50%;
    z-index: 1;
}

.chess-cell.valid-move.has-piece::after {
    content: "";
    position: absolute;
    width: 90%;
    height: 90%;
    border: 2px solid rgba(76, 175, 80, 0.7); /* Green circle for capture move */
    border-radius: 50%;
    z-index: 1;
    box-sizing: border-box;
}

.chess-piece {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    z-index: 2; /* Above the move indicators */
    pointer-events: none; /* So it doesn't interfere with cell clicks */
}

.chess-piece i {
    font-size: 1.4em; /* Slightly smaller than container to fit nicely */
}

/* White pieces: white color with subtle shadow for definition */
.chess-piece.w-p, .chess-piece.w-r, .chess-piece.w-n, .chess-piece.w-b, .chess-piece.w-q, .chess-piece.w-k {
    color: #ffffff; /* White pieces */
}

/* Red indicator for king in check */
.chess-cell.check .chess-piece.w-k,
.chess-cell.check .chess-piece.b-k {
    animation: check-pulse 1s infinite;
    box-shadow: 0 0 10px 3px #ff0000;
}

@keyframes check-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.chess-cell.check {
    background-color: #ff6666 !important; /* Red background for check */
    animation: check-background-pulse 1s infinite;
}

@keyframes check-background-pulse {
    0% { background-color: #ff6666; }
    50% { background-color: #ff9999; }
    100% { background-color: #ff6666; }
}

.chess-piece.w-p i, .chess-piece.w-r i, .chess-piece.w-n i, .chess-piece.w-b i, .chess-piece.w-q i, .chess-piece.w-k i {
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5); /* Black shadow for white pieces */
}

/* Black pieces: black color */
.chess-piece.b-p, .chess-piece.b-r, .chess-piece.b-n, .chess-piece.b-b, .chess-piece.b-q, .chess-piece.b-k {
    color: #000000; /* Black pieces */
}

.chess-piece.b-p i, .chess-piece.b-r i, .chess-piece.b-n i, .chess-piece.b-b i, .chess-piece.b-q i, .chess-piece.b-k i {
    text-shadow: 0 0 2px rgba(255, 255, 255, 1); /* White shadow for black pieces */
}

/* Coordinates for chess board */
.chess-cell[data-file="a"], .chess-cell[data-file="b"], .chess-cell[data-file="c"],
.chess-cell[data-file="d"], .chess-cell[data-file="e"], .chess-cell[data-file="f"],
.chess-cell[data-file="g"], .chess-cell[data-file="h"] {
    position: relative;
}

.chess-cell[data-file="h"]::after {
    content: attr(data-file);
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chess-cell[data-rank="8"]::before {
    content: attr(data-rank);
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Responsive adjustments for chess */
@media (max-width: 480px) {
    .chess-board {
        max-width: 200px;
        max-height: 200px;
    }

    .chess-piece {
        font-size: 1rem;
    }
}

/* Chess board perspective for black player */
.chess-board.black-perspective {
    transform: rotate(180deg);
}

/* When board is rotated, pieces get rotated too, so rotate them back */
.chess-board.black-perspective .chess-piece {
    transform: rotate(180deg); /* Rotate pieces back to upright after board rotation */
}

/* Custom modal for blocking confirmation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    text-align: center;
}

.modal-title {
    color: var(--text-primary);
    font-size: 1.2em;
    margin-bottom: 10px;
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.modal-button.confirm {
    background: var(--status-error);
    color: #333; /* Darker text instead of white */
}

.modal-button.cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-button:hover {
    opacity: 0.9;
}

/* Settings Modal Styles */
.settings-modal {
    max-width: 600px;
    width: 90%;
    text-align: left;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-primary);
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-accent);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.block-duration-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1em;
}

/* Slider styles */
.block-duration-slider {
    width: 100%;
    height: 12px; /* Made thicker */
    -webkit-appearance: none;
    background: var(--bg-input);
    border-radius: 6px;
    outline: none;
    margin-top: 0.5rem;
}

.block-duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; /* Larger handle */
    height: 24px; /* Larger handle */
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: background 0.3s;
    border: 2px solid white; /* Add border to make it more visible */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Add shadow for better visibility */
}

.block-duration-slider::-webkit-slider-thumb:hover {
    background: var(--primary-color-dark);
}

.block-duration-slider::-moz-range-thumb {
    width: 24px; /* Larger handle */
    height: 24px; /* Larger handle */
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white; /* Add border to make it more visible */
    transition: background 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Add shadow for better visibility */
}

.block-duration-slider::-moz-range-thumb:hover {
    background: var(--primary-color-dark);
}

.blocked-users-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-blocked-users {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.blocked-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-primary);
}

.blocked-user-info {
    flex-grow: 1;
}

.blocked-user-name {
    font-weight: bold;
    color: var(--text-primary);
}

.blocked-user-time {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 2px;
}

.blocked-user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.unblock-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary); /* Use a subtle background */
    color: var(--text-primary); /* Darker text for visibility */
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.unblock-btn:hover {
    background: var(--bg-input);
    border-color: var(--primary-color);
}

/* Legal links header update for settings link */
.legal-links-header a.legal-link-header {
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 15px;
    font-size: 0.9em;
    transition: color 0.2s;
}

.legal-links-header a.legal-link-header:hover {
    color: var(--text-primary);
}

/* Reply functionality styles */
.message-wrapper {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between message content and reply button */
    width: 100%; /* Ensure full width */
}

/* Make reply button vertically centered with the message content */
.message-wrapper .reply-btn {
    align-self: center; /* Align to center to match content alignment */
    flex-shrink: 0; /* Prevent the button from shrinking */
}

.message-content {
    max-width: 80%;
    padding: 0.6rem 1rem; /* Updated as requested */
    word-wrap: break-word;
    position: relative;
    border: 2px solid;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 15px; /* Updated as requested */
}

.actual-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.message-text {
    flex: 1;
    word-break: break-word; /* Allow breaking words only when necessary */
    overflow-wrap: break-word; /* Ensure long words break properly */
    min-width: 0; /* Allow flex item to shrink below content size */
}

.reply-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem; /* Make the button bigger */
    padding: 6px 8px; /* Increase padding */
    border-radius: 6px; /* Slightly larger border radius */
    opacity: 0;
    transition: all 0.3s ease;
    align-self: center; /* Center the button vertically */
    margin-top: 0;
    flex-shrink: 0; /* Prevent reply button from shrinking */
    min-width: 36px; /* Ensure minimum size */
    min-height: 36px; /* Ensure minimum size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.message:hover .reply-btn {
    opacity: 0.7;
}

.message:hover .reply-btn:hover {
    opacity: 1;
    color: var(--text-primary);
    background: var(--bg-input);
}

.reply-indicator {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-left: 3px solid;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 8px 8px 0;
    flex-shrink: 0; /* Don't shrink the reply indicator */
}

.reply-indicator.own-reply {
    border-left-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.1);
}

.reply-indicator.other-reply {
    border-left-color: var(--border-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.quoted-message {
    font-size: 0.85rem;
}

.reply-author {
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 2px;
}

.reply-content {
    color: var(--text-secondary);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actual-message {
    margin-top: 0;
}

.message-content {
    position: relative;
}

.reply-target {
    animation: replyHighlight 2s ease;
}

@keyframes replyHighlight {
    0% { background-color: rgba(255, 255, 0, 0.2); }
    100% { background-color: var(--bg-secondary); }
}

#messageInput.replying {
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 15px var(--shadow-green);
}

/* For mobile - position reply button differently */
@media (max-width: 480px) {
    .reply-btn {
        font-size: 1.1rem; /* Slightly smaller on mobile but still visible */
        padding: 5px 7px;
        min-width: 32px;
        min-height: 32px;
    }

    .message-wrapper {
        gap: 6px;
    }

    .quoted-message {
        font-size: 0.8rem;
    }
}




.chat-container.effect-burgundy-beige {
    background-color: #180002  !important;
}

.chat-container.effect-burgundy-beige .messages {
    background-color: #180002  !important;
}

.chat-container.effect-burgundy-beige .header {
    background-color: #331818  !important;
    border-bottom: 2px solid #e8c59f !important;
}

.chat-container.effect-burgundy-beige .input-wrapper.bottom-bar {
    background-color: #331818  !important;
    border-top: 2px solid #e8c59f !important;
}

.chat-container.effect-burgundy-beige .btn-secondary{
    background: #2f0202 !important;
    color: #e8c59f  !important;
    border-color: #e8c59f !important;
}

.chat-container.effect-burgundy-beige #messageInput{
    background: #331818  !important;
    color: #e8c59f  !important;
    border-color: #e8c59f !important;
}

.chat-container.effect-burgundy-beige .icon-btn{
    color: #e8c59f  !important;
}

.chat-container.effect-burgundy-beige .ri-gamepad-line{
    color: #e8c59f  !important;
}


.chat-container.effect-burgundy-beige .ri-gamepad-fill{
    color: #e8c59f  !important;
}

.chat-container.effect-burgundy-beige .send-btn-text {
    background: #210505  !important;
    color: #e8c59f !important;
}


.chat-container.effect-burgundy-beige .menu-item {
    background: #331818  !important;
    color: #e8c59f;
}

.chat-container.effect-burgundy-beige .system-message {
    color: #d97f7f  !important;
}


.chat-container.effect-burgundy-beige .btn-inline {
    border: 2px solid #e8c59f !important;
    background: #331818 !important;
    color: #e8c59f !important;
}

.chat-container.effect-burgundy-beige .game-area {
    border-top: 2px solid  #e8c59f !important;
    border-bottom: 2px solid  #e8c59f !important;
    background: #331818 !important;
}


.chat-container.effect-burgundy-beige .cell {
    background: #331818 !important;
    border: 2px solid #e8c59f !important;
    color: #e8c59f !important;
}

.chat-container.effect-burgundy-beige .game-status {
    color: #d4af85 !important
}



.message.effect-burgundy-beige .message-content {
    color: #ffffff !important;
    background: #800020 !important;
    border-color: #e8c59f !important;
}

.message.effect-burgundy-beige .timestamp {
    color: #d4af85 !important; /* Lighter beige for timestamp */
}

.message.effect-burgundy-beige .reply-container {
    background-color: rgba(212, 175, 133, 0.3) !important; /* Translucent beige for reply box */
    border-left: 2px solid #e8c59f !important;
}

.message.effect-burgundy-beige .reply-author {
    color: #d4af85 !important;
}

.message.effect-burgundy-beige .reply-content {
    color: #d4af85 !important;
}

.message.effect-burgundy-beige a {
    color: #e8c59f !important;
}

.message.effect-burgundy-beige a:visited {
    color: #d4af85 !important;
}







/*
.message.effect-rainbow {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff) !important;
    color: white !important;
    border: 2px solid white !important;
}
*/



.message.effect-rainbow .message-content {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff) !important;
    color: white !important;
    border-color: white !important;
}

.message.effect-rainbow a,
.message.effect-rainbow .reply-content,
.message.effect-rainbow .timestamp {
    color: white !important;
}
/*
.message.effect-neon {
    background-color: #000 !important;
    color: #00ff00 !important;
    border: 2px solid #00ff00 !important;
    text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00 !important;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5) !important;
}
*/
.message.effect-neon .message-content {
    background: #000 !important;
    color: #00ff00 !important;
    border-color: #00ff00 !important;
}

/*
.message.effect-gold {
    background-color: #d4af37 !important;
    color: #000 !important;
    border: 2px solid #b8860b !important;
}
*/

.message.effect-gold .message-content {
    background: #d4af37 !important;
    color: #000 !important;
    border-color: #b8860b !important;
}
/*
.message.effect-pastel {
    background-color: #ffd1dc !important;
    color: #6a5acd !important;
    border: 2px solid #a2d2ff !important;
}
*/
.message.effect-pastel .message-content {
    background: #ffd1dc !important;
    color: #6a5acd !important;
    border-color: #a2d2ff !important;
}
/*
.message.effect-fire {
    background: #ff4500 !important; 
    color: #fff !important;
    border: 2px solid #ff8c00 !important; 
    background: linear-gradient(to bottom, #ff4500, #ff8c00) !important;
}
*/
.message.effect-fire .message-content {
    background: transparent !important;
    color: #fff !important;
    border-color: #ff8c00 !important;
}

/* New loader animation from loader.txt */
.loader {
  display: inline-flex;
  gap: 5px;
  margin: 1rem auto; /* Center the loader */
}
.loader:before,
.loader:after {
  content: "";
  width: 35px;
  aspect-ratio: 1;
  box-shadow: 0 0 0 3px inset #fff;
  animation: 2s infinite linear;
  animation-name: l3-1,l3-2;
  animation-delay: -1s,0s
}
.loader:after {
  --s: -1;
}
 @keyframes l3-1 {
  0%   {border-radius:50% 0   0   50%}
  25%  {border-radius:50% 50% 0   0  }
  50%  {border-radius:0   50% 50% 0  }
  75%  {border-radius:0   0   50% 50%}
  100% {border-radius:50% 0   0   50%}
}
 @keyframes l3-2{
  0%   {transform:scaleX(var(--s,1)) rotate(0deg)}
  100% {transform:scaleX(var(--s,1)) rotate(-360deg)}
}