:root {
    --panel-bg: #1f2937;
    --text-color: #e5e7eb;
    --text-muted: #9ca3af;
    --vibrant-blue: #3b82f6;
    --vibrant-purple: #8b5cf6;
    --vibrant-gold: #f59e0b;
    --chat-bubble-other: #374151;
    --spotify-green: #1db954;
    --soundcloud-orange: #ff5500;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #111827);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    margin: 0;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
/* استایل بج لول */
.level-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 800;
    margin: 0 4px;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.15);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header */
.gapmap-header {
    background: rgba(31, 41, 55, 0.85);
    backdrop-filter: blur(12px);
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    position: fixed;
    top: 0; left: 0; right: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.header-title { font-weight: 900; font-size: 1.1rem; color: var(--vibrant-purple); text-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 70px 15px 130px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Messages */
.message-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-row.self { flex-direction: row-reverse; }

.avatar-container {
    position: relative;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}
.avatar-container:active { transform: scale(0.95); }

.user-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255,255,255,0.1);
}

.user-frame {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 140%; height: 140%;
    pointer-events: none;
    z-index: 2;
}

.message-content {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.user-info {
    font-size: 0.75rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.message-row.self .user-info { justify-content: flex-end; }

.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-row.other .message-bubble {
    background-color: var(--chat-bubble-other);
    border-top-right-radius: 2px;
    border: 1px solid rgba(255,255,255,0.05);
}

.message-row.self .message-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-top-left-radius: 2px;
    color: white;
}

/* VIP & BADGE STYLING */
.vip-badge {
    color: #ffd700;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    animation: bounce 2s infinite, glow 2s infinite alternate;
    font-size: 0.9rem;
    margin-left: 3px;
    vertical-align: middle;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}
@keyframes glow {
    from { text-shadow: 0 0 5px #ffd700; }
    to { text-shadow: 0 0 15px #ffed4a, 0 0 10px #ffd700; }
}

.verified-badge { color: var(--vibrant-blue); font-size: 0.85rem; vertical-align: middle; }

.mentionable-username {
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    position: relative;
    display: inline-block;
}
.mentionable-username:hover {
    color: var(--vibrant-blue);
}

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

/* Input Area */
.input-area {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(15px);
    padding: 10px 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
}

.chat-input {
    flex: 1;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 12px;
    border-radius: 25px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input:focus {
    border-color: var(--vibrant-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.send-btn {
    background: var(--vibrant-purple);
    color: white;
    border: none;
    width: 45px; height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}
.send-btn:active { transform: scale(0.9); }

.music-btn, .game-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    width: 45px; height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af;
}
.music-btn.active, .music-btn:hover { color: var(--spotify-green); background: rgba(29, 185, 84, 0.1); border-color: var(--spotify-green); }
.game-btn.active, .game-btn:hover { color: #f59e0b; background: rgba(245, 158, 11, 0.1); border-color: #f59e0b; }

/* Modals Modernized */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 25px;
    border-radius: 24px;
    width: 85%; max-width: 380px;
    text-align: right;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-modal { background: rgba(255,255,255,0.1); border: none; color: white; width: 30px; height: 30px; border-radius: 50%; display:flex; align-items:center; justify-content:center; cursor: pointer; transition: 0.2s; }
.close-modal:hover { background: #ef4444; transform: rotate(90deg); }

/* Custom Confirm Modal */
.confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
}
.confirm-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    flex: 1;
}
.btn-yes { background: var(--vibrant-purple); color: white; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-yes:active { transform: scale(0.95); }
.btn-no { background: rgba(255,255,255,0.1); color: white; }
.btn-no:hover { background: rgba(255,255,255,0.2); }

/* User Menu */
#user-menu-modal .modal-content { text-align: center; padding: 30px 20px; }
.user-menu-avatar { border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.user-menu-name { font-size: 1.3rem; font-weight: 900; color: white; margin-top: 10px; }
.user-menu-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.user-action-btn {
    flex: 1; padding: 12px; border-radius: 15px; border: none; cursor: pointer;
    font-family: inherit; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform 0.2s;
}
.user-action-btn:active { transform: scale(0.95); }
.btn-mention { background: #374151; color: white; border: 1px solid rgba(255,255,255,0.1); }
.btn-profile { background: var(--vibrant-purple); color: white; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }

/* VIP & Music */
.vip-desc-text {
    font-size: 0.9rem; color: #d1d5db; line-height: 1.6; margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05); padding: 12px; border-radius: 12px;
    border-right: 3px solid var(--vibrant-purple);
}
.vip-buy-container { text-align: center; padding: 10px; }
.vip-lock-icon { font-size: 3.5rem; color: #fbbf24; margin-bottom: 15px; animation: bounce 2s infinite; display: inline-block; }
.btn-buy-vip {
    background: linear-gradient(90deg, #fbbf24, #d97706); color: #1f2937; font-weight: 900;
    width: 100%; padding: 14px; border: none; border-radius: 16px; font-size: 1rem; cursor: pointer;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3); transition: transform 0.2s;
    text-decoration: none; display: inline-block; box-sizing: border-box; margin-top: 15px;
}
.btn-buy-vip:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(245, 158, 11, 0.5); }

.music-platforms { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.platform-btn {
    padding: 15px 5px; border: none; border-radius: 14px; color: white; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-family: inherit; transition: transform 0.2s; font-size: 0.85rem; font-weight: 500;
}
.platform-btn:active { transform: scale(0.95); }
.platform-btn.spotify { background: var(--spotify-green); background: linear-gradient(45deg, #1db954, #1ed760); }
.platform-btn.soundcloud { background: var(--soundcloud-orange); background: linear-gradient(45deg, #ff5500, #ff7700); }
.platform-btn.direct { background: var(--vibrant-blue); background: linear-gradient(45deg, #2563eb, #3b82f6); }

.btn-confirm-share {
    margin-top: 15px; width: 100%; background: var(--vibrant-purple); color: white;
    padding: 12px; border: none; border-radius: 12px; cursor: pointer; font-weight: bold;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Game Items */
.game-link-btn {
    position: relative; padding: 15px; border: none; border-radius: 16px; color: white; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: inherit;
    transition: transform 0.2s; font-size: 1rem; text-decoration: none; margin-bottom: 0; font-weight: bold;
}
.game-link-btn:active { transform: scale(0.98); }
.game-link-btn.karting { background: linear-gradient(135deg, #be185d, #db2777); box-shadow: 0 8px 20px rgba(219, 39, 119, 0.3); }
.game-link-btn.character { background: linear-gradient(135deg, #4f46e5, #6366f1); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }

.game-badge {
    position: absolute; top: 10px; left: 10px; background-color: #ef4444; color: white;
    font-size: 0.75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); display: none; animation: bounce 2s infinite;
}

.game-invite-card {
    background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; padding: 15px; margin-top: 5px; text-align: center;
}
.game-invite-header { font-weight: bold; margin-bottom: 8px; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.game-invite-btn {
    display: inline-block; padding: 8px 16px; border-radius: 10px; text-decoration: none;
    color: white; font-size: 0.85rem; font-weight: bold; transition: 0.2s; margin-top: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.game-invite-btn:active { transform: scale(0.95); }

/* RPS & Dice */
.rps-options { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }
.rps-btn {
    width: 70px; height: 70px; border-radius: 50%; border: none; font-size: 2rem;
    cursor: pointer; transition: transform 0.2s, background 0.3s;
    background: rgba(255,255,255,0.1); color: white; display: flex; align-items: center; justify-content: center;
}
.rps-btn:active { transform: scale(0.9); }
.rps-btn.rock { border: 2px solid #fca5a5; }
.rps-btn.paper { border: 2px solid #93c5fd; }
.rps-btn.scissors { border: 2px solid #86efac; }
.rps-result-card {
    background: linear-gradient(135deg, #1e1b4b, #312e81); border: 1px solid #4f46e5;
    border-radius: 16px; padding: 15px; text-align: center; box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
.rps-vs { font-size: 1.5rem; font-weight: 900; color: #fbbf24; margin: 5px 0; }
.rps-winner-text { color: #4ade80; font-weight: bold; margin-top: 8px; animation: bounce 1s infinite; }

.dice-invite-card {
    background: linear-gradient(135deg, #be123c, #881337); border: 1px solid #fb7185;
    border-radius: 16px; padding: 15px; text-align: center; box-shadow: 0 8px 20px rgba(225, 29, 72, 0.3);
}
.dice-result-card {
    background: #374151; border: 1px solid #6b7280; border-radius: 16px; padding: 15px; text-align: center;
}
.dice-icon { font-size: 2rem; margin: 5px; color:white; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5)); }
.dice-header { color: #fecdd3; font-weight: bold; font-size: 0.95rem; margin-bottom: 8px; }
.dice-vs-container { display: flex; justify-content: space-around; align-items: center; margin: 15px 0; }
.dice-player-col { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 0.85rem; }
.dice-winner-tag { 
    background: #10b981; color: white; padding: 4px 12px; border-radius: 20px; 
    font-size: 0.8rem; font-weight: bold; display: inline-block; margin-top: 5px; 
    animation: bounce 1s infinite;
}
.dice-loser-tag { color: #ef4444; font-weight: bold; font-size: 0.8rem; margin-top: 5px; }

.loading-overlay {
    position: fixed; inset: 0; background: #111827;
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}

#toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 350px;
}
.toast {
    background: rgba(31, 41, 55, 0.95); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15); color: white; padding: 14px 18px;
    border-radius: 14px; font-size: 0.9rem; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideInDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.error { border-left: 4px solid #ef4444; }
.toast.success { border-left: 4px solid #10b981; }
.toast.info { border-left: 4px solid #3b82f6; }

@keyframes slideInDown { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadeOut { to { opacity: 0; transform: scale(0.9); } }

/* --- GAMING ARENA & ANIMATIONS --- */
.gaming-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 5000;
    display: none; flex-direction: column; justify-content: center; align-items: center;
    backdrop-filter: blur(10px);
}

.result-modal-content {
    text-align: center; transform: scale(0); transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255,255,255,0.05); padding: 40px; border-radius: 30px; border: 1px solid rgba(255,255,255,0.1);
    max-width: 90%;
}
.result-modal-content.show { transform: scale(1); }
.result-title { font-size: 2.5rem; font-weight: 900; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.result-win { color: #4ade80; text-shadow: 0 0 20px #4ade80; }
.result-lose { color: #ef4444; text-shadow: 0 0 20px #ef4444; }
.result-draw { color: #9ca3af; text-shadow: 0 0 20px #9ca3af; }
.result-vs-text { font-size: 1.1rem; color: white; margin-bottom: 25px; opacity: 0.9; }
.close-game-btn {
    margin-top: 20px; padding: 12px 30px; border-radius: 50px; border: none;
    font-size: 1.1rem; font-weight: bold; cursor: pointer;
    background: white; color: black; box-shadow: 0 0 15px rgba(255,255,255,0.5);
    transition: 0.2s;
}
.close-game-btn:hover { transform: scale(1.1); box-shadow: 0 0 25px rgba(255,255,255,0.8); }

/* 3D Dice */
.dice-scene { width: 120px; height: 120px; perspective: 600px; display: none; margin-bottom: 40px; }
.cube {
    width: 100%; height: 100%; position: relative; transform-style: preserve-3d;
    transform: translateZ(-60px); transition: transform 2.5s ease-out;
}
.cube.rolling { animation: spinDice 0.5s infinite linear; }
.cube__face {
    position: absolute; width: 120px; height: 120px; border: 4px solid white;
    background: rgba(255, 255, 255, 0.95); box-shadow: inset 0 0 30px rgba(0,0,0,0.2);
    font-size: 50px; display: flex; justify-content: center; align-items: center; color: black;
    border-radius: 16px;
}
.cube__face--1  { transform: rotateY(  0deg) translateZ(60px); }
.cube__face--2  { transform: rotateY( 90deg) translateZ(60px); }
.cube__face--3  { transform: rotateY(180deg) translateZ(60px); }
.cube__face--4  { transform: rotateY(-90deg) translateZ(60px); }
.cube__face--5  { transform: rotateX( 90deg) translateZ(60px); }
.cube__face--6  { transform: rotateX(-90deg) translateZ(60px); }

@keyframes spinDice {
    0% { transform: translateZ(-60px) rotateX(0deg) rotateY(0deg); }
    100% { transform: translateZ(-60px) rotateX(360deg) rotateY(360deg); }
}

/* RPS Hands */
.rps-battle-scene { display: none; gap: 50px; align-items: center; margin-bottom: 40px; }
.rps-hand { font-size: 7rem; color: #fbbf24; }
.rps-hand.left { transform: scaleX(-1) rotate(90deg); }
.rps-hand.right { transform: rotate(-90deg); }
.rps-hand.shaking { animation: shakeHands 0.5s infinite alternate; }

.rps-hand.left.shaking { animation: shakeLeft 0.5s infinite; }
.rps-hand.right.shaking { animation: shakeRight 0.5s infinite; }
@keyframes shakeLeft { 0% { transform: scaleX(-1) rotate(90deg); } 50% { transform: scaleX(-1) rotate(70deg); } 100% { transform: scaleX(-1) rotate(90deg); } }
@keyframes shakeRight { 0% { transform: rotate(-90deg); } 50% { transform: rotate(-70deg); } 100% { transform: rotate(-90deg); } }

