.rpg-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    flex: 1;
    padding: 10px;
    display: flex;
    justify-content: center;
    background: linear-gradient(90deg, #1a1a2e, #0a0a0f);
    z-index: 10;
}

.rpg-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.rpg-menu > li > a {
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    padding: 12px 18px;
    border-radius: 5px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-menu > li > a {
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    padding: 10px 18px;
    border-radius: 5px;
    position: relative;
    display: flex;
    align-items: center;
}

.sub-menu > li > a:hover {
    color: #ff00ff;
    text-shadow: 0px 0px 10px #ff00ff;
}

.rpg-menu > li.has-dropdown > a::after {
    content: "▼";
    font-size: 12px;
    color: #ff00ff;
    margin-left: 5px;
    transition: 0.3s;
}

.rpg-menu > li:hover > a::after {
    transform: rotate(180deg);
}

.rpg-menu > li > a:hover {
    color: #ff00ff;
    text-shadow: 0px 0px 10px #ff00ff;
}

.rpg-menu li:hover > ul {
    display: block;
}

.rpg-menu li ul {
    display: none;
		list-style: none;
    position: absolute;
    top: 50px;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.95);
    border-radius: 5px;
    min-width: 180px;
    box-shadow: 0px 4px 15px rgba(255, 0, 255, 0.3);
    padding: 10px 0;
}

/* --- Dropdown Submenu Positioning --- */

@media (max-width: 900px) {
    .rpg-menu > .has-dropdown > .sub-menu {
        left: 100px !important;
        right: auto;
        top: 100%;
    }
}
/* --- End Dropdown Submenu Positioning --- */

/* LOGIN & JOIN BUTTONS */
.header-buttons {
    display: flex;
    gap: 15px;
		position: fixed;
	  z-index: 15;
		margin-top: 10px;
		right: 20px;
}

.login-btn, .join-btn {
    padding: 10px 15px;
    border-radius: 25px;
    text-transform: uppercase;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
		margin-top: 2px;
    box-shadow: 0px 4px 25px rgba(255, 0, 255, 0.3);
}

.login-btn {
    background: #ff00ff;
    color: white;
}

.login-btn:hover {
    background: limegreen;
}

.join-btn {
    background: limegreen;
    color: black;
    border: 2px solid transparent;
}

.join-btn:hover {
    background: #ff44ff;
}

/* Register Button */
.register-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #9333ea, #6366f1);
    color: white;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}
/* Admin Page Styles */
.wrap h1 {
    color: #ff00ff;
}

/* Logout Button */
.logout-button,
.logout-button::after {
 padding: 2px 6px;
 font-size: 12px;
 background: linear-gradient(45deg, transparent 5%, #ff013c 5%);
 border: 0;
 color: #fff;
 letter-spacing: 3px;
 line-height: 1;
 box-shadow: 6px 0px 0px #ff00ff,  0px 4px 15px rgba(255, 0, 255, 0.3);
 outline: transparent;
 position: relative;
}

.logout-button::after {
 --slice-0: inset(50% 50% 50% 50%);
 --slice-1: inset(80% -6px 0 0);
 --slice-2: inset(50% -6px 30% 0);
 --slice-3: inset(10% -6px 85% 0);
 --slice-4: inset(40% -6px 43% 0);
 --slice-5: inset(80% -6px 5% 0);
 content: "HOVER ME";
 display: block;
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 background: linear-gradient(45deg, transparent 3%, #00e6f6 3%, #00e6f6 5%, #ff013c 5%);
 text-shadow: -3px -3px 0px #f8f005, 3px 3px 0px #00e6f6;
 clip-path: var(--slice-0);
}

.logout-button:hover::after {
 animation: 1s glitch;
 animation-timing-function: steps(2, end);
}

/* NOTIFICATION BELL & FRIEND REQUEST POPUP */
.notification-bell {
    background: none;
    border: none;
    cursor: pointer;
    color: #ff00ff;
    font-size: 20px;
    position: relative;
    transition: color 0.2s;
    margin-right: 10px;
    outline: none;
    display: flex;
    align-items: center;
}

.notification-bell:hover {
    color: #fff;
    text-shadow: 0 0 8px #ff00ff;
}

#friend-requests-badge {
    background: #ff00ff;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    padding: 2px 6px;
    position: absolute;
    top: -6px;
    right: -6px;
    font-weight: bold;
    box-shadow: 0 0 8px #ff00ff;
    z-index: 2;
}

.notification-popup {
    position: absolute;
    min-width: 330px;
  	margin-top: 150px;
    margin-left: -300px;
    background: rgba(10,10,20,0.98);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(255,0,255,0.25);
    border: 1px solid #ff00ff;
    z-index: 100;
    padding: 0;
    animation: fadeIn 0.2s;
}

.popup-header {
    background: linear-gradient(90deg, #1a1a2e, #ff00ff);
    color: #fff;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    text-align: center;
    font-size: 15px;
    letter-spacing: 1px;
}

.notif-section{
    margin-left: 15px;
}

#friend-requests-list {
    padding: 10px 0;
    max-height: 250px;
    overflow-y: auto;
}

.friend-request-item {
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,0,255,0.07);
    font-size: 13px;
}

.friend-request-item .accept-btn{
    width: auto;
}

.friend-request-item:last-child {
    border-bottom: none;
}

.request-username {
    color: #ff80ff;
    font-weight: 600;
}

.accept-btn, .reject-btn {
    background: none;
    border: 1px solid #ff00ff;
    color: #ff00ff;
    border-radius: 5px;
    padding: 3px 10px;
    margin-left: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.accept-btn:hover {
    background: limegreen;
    color: #fff;
    border-color: limegreen;
}

.reject-btn:hover {
    background: #ff013c;
    color: #fff;
    border-color: #ff013c;
}

.loading, .empty, .error {
    color: #ff80ff;
    text-align: center;
    padding: 12px 0;
    font-size: 13px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    background: rgba(20, 20, 40, 0.9);
    border-left: 4px solid #ff00ff;
    border-radius: 4px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

/*LOGIN*/ 
.form {
    position: relative;
    display: block;
    padding: 2.2rem;
    background: linear-gradient(14deg, rgba(36, 0, 36, 0.8) 0%, rgba(65, 24, 65, 0.7) 66%, 
              rgb(99, 20, 76) 100%), radial-gradient(circle, rgba(36, 0, 36, 0.5) 0%, 
              rgba(53, 15, 53, 0.2) 65%, rgba(28, 14, 29, 0.9) 100%);
    border: 2px solid #fff;
    -webkit-box-shadow: rgba(255, 0, 255, 0.6) 0px 0px 50px -15px;
    box-shadow: rgba(255, 0, 255, 0.6) 0px 0px 50px -15px;
    overflow: hidden;
    z-index: +1;
}
  
/*--------signup section---------*/
  
.signup-link {
    color: #ff80ff;
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: center;
    font-family: monospace;
}
  
.signup-link a {
    color: #ffccff;
    text-decoration: none;
}
  
.up:hover {
    text-decoration: underline;
    color: #ff00ff;
}
  
/*--------header section-----------*/
  
.form-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-family: monospace;
    font-weight: 600;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(255, 0, 255, 0.7);
    animation-duration: 1.5s;
    overflow: hidden;
    transition: .12s;
}
  
.form-title span {
    animation: flickering 2s linear infinite both;
}
  
.title-2 {
    display: block;
    margin-top: -0.5rem;
    font-size: 2.1rem;
    font-weight: 800;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    -webkit-text-stroke: #fff 0.1rem;
    letter-spacing: 0.2rem;
    color: transparent;
    position: relative;
    text-shadow: 0px 0px 16px #ff80ff;
}
  
.title-2 span::before,
.title-2 span::after {
    content: '—';
}
  
@keyframes flickering {
    0% { text-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff; }
    50% { text-shadow: 0 0 2px #ff00ff, 0 0 5px #ff00ff; }
    100% { text-shadow: 0 0 8px #ff00ff, 0 0 15px #ff00ff; }
}
  
/*---------shooting stars-----------*/
  
.bg-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    animation: animateBg 50s linear infinite;
}
  
@keyframes animateBg {
    0%,100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.2);
    }
}
  
.star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ff00ff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 0, 255, 0.1),
                0 0 0 8px rgba(255, 0, 255, 0.1),
                0 0 20px rgba(255, 0, 255, 0.1);
    animation: animate 3s linear infinite;
}
  
.star::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, #ff00ff, transparent);
}
  
@keyframes animate {
    from {
        transform: rotate(315deg) translateX(0);
        opacity: 1;
    }
    70% {
          opacity: 1;
    }
    70% {
        opacity: 1;
    }
    to {
        transform: rotate(315deg) translateX(-1000px);
        opacity: 0;
    }
}
  
.star:nth-child(1) {
    top: 0;
    right: 0;
    left: initial;
    animation-delay: 0s;
    animation-duration: 1s;
}
  
.star:nth-child(2) {
    top: 0;
    right: 100px;
    left: initial;
    animation-delay: 0.2s;
    animation-duration: 3s;
}
  
.star:nth-child(3) {
    top: 0;
    right: 220px;
    left: initial;
    animation-delay: 2.75s;
    animation-duration: 2.75s;
}
  
.star:nth-child(4) {
    top: 0;
    right: -220px;
    left: initial;
    animation-delay: 1.6s;
    animation-duration: 1.6s;
}

/* --- Enhanced Mobile Styles for Header --- */
@media (max-width: 900px) {
    .rpg-nav {
        padding: 12px 2vw;
        min-height: 60px;
    }
    .rpg-menu > li > a {
        font-size: 1.08em;
        padding: 0.7em 0.4em;
    }
    .rpg-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
        padding: 0.5em 0;
    }
    .header-buttons {
        gap: 10px;
    }
    .login-btn, .join-btn {
        padding: 8px 12px;
    }
}

@media (max-width: 600px) {
    .rpg-nav {
        padding: 6px 1vw;
        min-height: 44px;
    }
    .rpg-menu > li > a {
        font-size: 1em;
        padding: 0.5em 0.2em;
    }
    .rpg-menu {
        padding: 0.3em 0;
        gap: 0.2em;
    }
    .header-buttons {
        gap: 5px;
    }
    .login-btn, .join-btn {
        padding: 6px 10px;
    }
}
/* --- End Enhanced Mobile Styles for Header --- */

/* --- Header Status Group (Timer & Bell) --- */
.header-status-group {
    display: flex;
    align-items: center;
    gap: 1.1em;
    margin-left: 1em;
    z-index: 120;
}
.header-timer {
    color: #ff80ff;
    font-size: 1em;
    text-shadow: 0 0 8px #ff00ff88;
    font-weight: 600;
    letter-spacing: 1px;
}
.header-notification-bell {
    position: relative;
    display: flex;
    align-items: center;
}
.header-notification-bell .notification-bell {
    background: none;
    border: none;
    font-size: 1.3em;
    color: #fff;
    cursor: pointer;
    margin-left: 0.2em;
    padding: 0.1em 0.25em;
    border-radius: 6px;
    transition: background 0.2s;
}
.header-notification-bell .notification-bell:active {
    background: rgba(255,0,255,0.07);
}

@media (max-width: 900px) {
    .header-status-group {
        gap: 0.7em;
        margin-left: 0.3em;
    }
    .header-timer {
        font-size: 0.97em;
    }
    .header-notification-bell .notification-bell {
        font-size: 1.15em;
        padding: 0.1em 0.18em;
    }
}
@media (max-width: 600px) {
    .header-status-group {
        gap: 0.4em;
        margin-left: 10em;
    }
    .header-timer {
        font-size: 0.92em;
    }
}
/* --- End Header Status Group --- */

/* --- Mobile Dropdown Menu Styles --- */
@media (max-width: 900px) {
    .menu-dropdown-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 2em;
        color: #fff;
        cursor: pointer;
        margin-left: auto;
        z-index: 102;
        padding: 0.1em 0.4em;
    }
    .menu-dropdown-icon {
        pointer-events: none;
    }
    .menu-hide-on-mobile {
        display: none !important;
    }
    .rpg-menu.menu-mobile-active .menu-hide-on-mobile {
        display: block !important;
        background: rgba(18,18,30,0.97);
        border-radius: 10px;
        margin: 0.2em 0;
        box-shadow: 0 2px 8px rgba(255,0,255,0.07);
        width: 100%;
        text-align: left;
    }
    .rpg-menu.menu-mobile-active {
        position: absolute;
        left: 0;
        top: 100%;
        width: 100vw;
        background: rgba(18,18,30,0.97);
        border-radius: 0 0 18px 18px;
        box-shadow: 0 8px 32px rgba(255,0,255,0.14);
        z-index: 101;
        padding: 1em 0 1.3em 0;
        display: block;
        transition: all 0.25s cubic-bezier(.4,2,.6,1);
    }
}
@media (max-width: 600px) {
    .menu-dropdown-btn {
        font-size: 1.5em;
        padding: 0.1em 0.2em;
    }
    .rpg-menu.menu-mobile-active {
        padding: 0.7em 0 1em 0;
    }
}
/* --- End Mobile Dropdown Menu Styles --- */

/* --- Hide Menu Toggle on Desktop --- */
@media (min-width: 901px) {
    .menu-dropdown-btn {
        display: none !important;
    }
    .friends-close-btn{
        display: none !important;
    }
}

/* --- Mobile Header Button Styles --- */
@media (max-width: 900px) {
    .header-buttons {
        display: flex;
        flex-direction: row;
        justify-content: left;
        align-items: center;
        width: 95%;
        gap: 0.7em;
        margin: 0.3em 0 0.2em 0;
        padding: 0 0.3em;
    }
    .login-btn, .join-btn {
        width: auto;
        min-width: 0;
        font-size: 1em;
        padding: 0.2em 0.3em;
        border-radius: 7px;
        margin: 0;
        text-align: center;
        box-sizing: border-box;
    }
    .join-btn {
        margin-left: 0.4em;
    }
}
@media (max-width: 600px) {
    .header-buttons {
        gap: 0.4em;
        padding: 0 0.1em;
    }
    .login-btn, .join-btn {
        font-size: 0.98em;
        padding: 0.1em 0.1em;
        border-radius: 6px;
    }
}

/* --- Sidebar Toggle Button Fix --- */
@media (max-width: 900px) {
    .sidebar-toggle {
        position: fixed;
        left: 0.2em;
        top: 0.7em;
        z-index: 130;
        background: none;
        border: none;
        color: #fff;
        font-size: 2em;
        padding: 0.1em 0.2em;
        cursor: pointer;
        transition: background 0.2s;
    }
    .sidebar-toggle:active {
        background: rgba(255,0,255,0.07);
        border-radius: 8px;
    }
}
@media (max-width: 600px) {
    .sidebar-toggle {
        font-size: 1.5em;
        top: 0.4em;
        left: 0.1em;
    }
}
/* --- End Sidebar Toggle Button Fix --- */

/* --- Friends Sidebar Close Button --- */
@media (max-width: 900px) {
    .friends-sidebar .friends-close-btn {
        display: flex;
        position: absolute;
        top: 0.7em;
        right: 0.7em;
        z-index: 130;
        background: none;
        border: none;
        color: #fff;
        font-size: 2em;
        padding: 0.1em 0.2em;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.2s;
    }
    .friends-sidebar .friends-close-btn:active {
        background: rgba(0,255,255,0.10);
    }
}
@media (max-width: 600px) {
    .friends-sidebar .friends-close-btn {
        font-size: 1.5em;
        top: 0.4em;
        right: 0.3em;
    }
}
/* --- End Friends Sidebar Close Button --- */

/* --- Friends Sidebar Button (Mobile) --- */
@media (max-width: 900px) {
    .friends-sidebar-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.65em;
        margin-left: 0.5em;
        cursor: pointer;
        z-index: 102;
        padding: 0.1em 0.4em;
        transition: background 0.2s;
    }
    .friends-sidebar-btn:active {
        background: rgba(0,255,255,0.08);
    }
    .friends-sidebar-icon {
        pointer-events: none;
    }
}
@media (min-width: 901px) {
    .friends-sidebar-btn {
        display: none !important;
    }
}
/* --- End Friends Sidebar Button (Mobile) --- */