@font-face {
    font-family: 'Minecraft-Title';
    src: url('Minecraft-Title.ttf') format('truetype');
}

@font-face {
    font-family: 'MinecraftStandard';
    src: url('MinecraftStandard.ttf') format('truetype');
}

@font-face {
    font-family: 'MinecraftStandardBold';
    src: url('MinecraftStandardBold.ttf') format('truetype');
}

:root {
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;

    --mc-green: #FFBF00;
    --mc-green-hover: #ffcc33;
    --mc-green-border: #cc9900;
    
    --mc-green-bright: #ffe680;

    --font-main: 'MinecraftStandard', sans-serif;
    --font-heading: 'MinecraftStandardBold', sans-serif;
    --font-title: 'Minecraft-Title', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 900;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.text-highlight {
    color: var(--mc-green-bright);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(18, 18, 18, 0.95);
    padding: 5px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-video {
    height: 90px;
    width: auto;
    display: block;
    /* Améliorations de rendu pour un aspect plus HD */
    image-rendering: high-quality;
    transform: translateZ(0);
    /* Force l'accélération matérielle */
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px var(--mc-green-border);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--mc-green);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--mc-green-bright);
}

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--mc-green);
    color: white;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 4px;
    border-bottom: 4px solid var(--mc-green-border);
    box-shadow: 0 4px 15px rgba(60, 133, 39, 0.3);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.85);
}

.btn-primary:hover {
    background-color: var(--mc-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(60, 133, 39, 0.5);
}

.btn-primary:active {
    transform: translateY(2px);
    border-bottom: 2px solid var(--mc-green-border);
}

.btn-discord {
    background-color: #5865F2;
    color: white;
    border-bottom: 4px solid #4752C4;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
    flex-direction: row;
    gap: 15px;
}

.btn-discord:hover {
    background-color: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.btn-discord:active {
    transform: translateY(2px);
    border-bottom: 2px solid #4752C4;
}

.discord-icon {
    height: 55px; /* Logo Discord beaucoup plus gros */
    width: auto;
}

.btn-large {
    padding: 16px 40px;
}

.btn-large .btn-text {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.btn-large .btn-subtext {
    font-size: 0.9rem;
    font-weight: 400;
    font-family: var(--font-main);
    opacity: 0.8;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--mc-green);
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-outline:hover {
    background: var(--mc-green);
    color: white;
}

/* Hero Section */
.hero {
    position: relative;
    height: calc(100vh - 60px);
    min-height: 700px;
    margin: 30px 8%;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(18, 18, 18, 0.3) 0%, rgba(18, 18, 18, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInDown 1s ease-out;
}

.hero-title-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

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

.nav-action .btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.hero-logo-container {
    position: absolute;
    right: 105%; /* Décale le logo complètement à gauche du titre */
    top: 50%;
    transform: translateY(-50%) translateZ(0) scale(1);
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.hero-logo-container:hover {
    transform: translateY(-50%) translateZ(0) scale(1.08); /* Grossit légèrement de 8% */
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.7)); /* Ombre plus prononcée au survol */
}

.hero-logo-video {
    display: block;
    height: 250px; /* Taille augmentée */
    width: auto;
    image-rendering: high-quality;
    pointer-events: none; /* Empêche les overlays de survol du navigateur */
}

.hero-title {
    font-family: var(--font-title);
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    font-weight: normal;
    /* Title font already thick */
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Server Status Indicator */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    cursor: default;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.server-status:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #55ff55;
    border-radius: 50%;
    box-shadow: 0 0 8px #55ff55;
    position: relative;
    display: inline-block;
}

.status-dot.pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: inherit;
    animation: statusPing 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    box-shadow: 0 0 8px inherit;
}

@keyframes statusPing {
    75%, 100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Games Section */
.games-section {
    padding: 100px 20px;
    background-color: var(--bg-primary);
    position: relative;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 60px;
    text-transform: uppercase;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.game-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px; /* Réduit la taille de la case */
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--mc-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(60, 133, 39, 0.3);
}

.game-card:hover::before {
    transform: scaleX(1);
}

.game-icon-img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-bottom: 25px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
    transform: scale(1.4); /* Rend l'image géante */
    transition: transform 0.3s ease;
}

.game-card:hover .game-icon-img {
    transform: scale(1.55); /* Zoom supplémentaire au survol */
}

.game-card h3 {
    font-size: 1.4rem; /* Titre réduit pour éviter que ça ne dépasse */
    margin-bottom: 15px;
    color: var(--text-primary);
}

.game-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* CTA Section */
.cta-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.cta-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background-color: #0a0a0a;
    padding: 60px 20px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 10px;
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.link-group h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
}

.link-group a {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.link-group a:hover {
    color: var(--mc-green-bright);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #666;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auraPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 191, 0, 0.8);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255, 191, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 191, 0, 0);
    }
}

@keyframes blurCircleGrow {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}

.clicked-aura {
    animation: auraPulse 0.6s ease-out;
}

.clicked-aura::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background-color: var(--mc-green-bright);
    border-radius: 50%;
    filter: blur(5px);
    transform: translate(-50%, -50%) scale(0);
    animation: blurCircleGrow 0.6s ease-out;
    pointer-events: none;
    z-index: -1;
}

/* Auth & Profile Pages */
.auth-section {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
    background: radial-gradient(circle at center, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.auth-card h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--mc-green);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.forgot-password {
    color: var(--mc-green);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.auth-separator {
    margin: 25px 0;
    position: relative;
    text-align: center;
}

.auth-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.auth-separator span {
    position: relative;
    background: var(--bg-secondary);
    padding: 0 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    z-index: 2;
}

.btn-google {
    background: white;
    color: #333;
    width: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
}

.btn-google:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}

.auth-footer {
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--mc-green);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-title-container {
        flex-direction: column;
    }
    
    .hero-logo-video {
        position: static;
        transform: scale(1);
        height: 180px;
        margin-bottom: 10px;
    }

    .hero-logo-video:hover {
        transform: scale(1.08);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        margin: 15px 4%;
        height: calc(100vh - 30px);
        min-height: 550px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .hero-logo-video {
        height: 120px;
    }

    .btn-large {
        padding: 12px 20px;
    }

    .btn-large .btn-text {
        font-size: 1.1rem;
    }

    .games-section {
        padding: 60px 15px;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .game-card {
        padding: 15px;
    }

    .game-icon-img {
        width: 100%;
        height: 100px;
        object-fit: contain;
        transform: scale(1.4);
        margin-bottom: 20px;
    }

    .game-card h3 {
        font-size: 1rem; /* Titre encore plus réduit sur mobile */
        margin-bottom: 8px;
    }

    .game-card p {
        font-size: 0.85rem;
    }

    .cta-section {
        padding: 50px 15px;
    }

    .cta-content h2 {
        font-size: 1.8rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 30px;
    }

    .footer-links {
        flex-direction: column;
        gap: 20px;
    }
}

/* Page Standard Layouts */
.page-header {
    padding-top: 150px;
    padding-bottom: 40px;
    text-align: center;
    background: radial-gradient(circle at center, var(--bg-tertiary) 0%, var(--bg-primary) 70%);
}

.page-header-img {
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.rules-section {
    padding: 40px 20px 100px;
    max-width: 900px;
    margin: 0 auto;
}

.rules-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
    line-height: 1.6;
}

.rule-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 25px;
    border-left: 4px solid var(--mc-green);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.rule-item h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.rule-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.rule-item p:last-child {
    margin-bottom: 0;
}

.rule-item-warning {
    border-left-color: #ff5555;
}

.rule-item-warning h3 {
    color: #ff5555;
}

/* Override rules section to use standard Inter font instead of Minecraft font */
.rules-section,
.rules-section h3,
.rules-section p {
    font-family: 'Inter', sans-serif !important;
}

/* ==========================================================================
   Classement (Leaderboard) Styles
   ========================================================================== */

.leaderboard-section {
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.current-player-rank {
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-out;
    font-family: 'Inter', sans-serif !important;
}

.current-player-rank .rank-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: var(--mc-gold);
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800;
}

.current-player-rank .rank-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif !important;
    font-weight: normal;
}

.current-player-rank .rank-stats {
    display: flex;
    gap: 15px;
    font-family: 'Inter', sans-serif !important;
}

.current-player-rank span {
    font-family: 'Inter', sans-serif !important;
}

.leaderboard-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-group label {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.filter-select {
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.filter-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.filter-select:focus {
    border-color: var(--mc-green);
    box-shadow: 0 0 10px rgba(255, 191, 0, 0.2);
}

.leaderboard-container {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 18px 25px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-table td {
    padding: 16px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.col-rank { width: 80px; text-align: center; }
.col-player { width: 40%; }
.col-coins { width: 25%; }
.col-credits { width: 25%; }

.rank-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #111;
    font-size: 1rem;
    text-align: center;
}

.rank-badge.gold { background: linear-gradient(135deg, #ffd700, #ffb300); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
.rank-badge.silver { background: linear-gradient(135deg, #e0e0e0, #9e9e9e); box-shadow: 0 0 15px rgba(224, 224, 224, 0.4); }
.rank-badge.bronze { background: linear-gradient(135deg, #ff8a65, #d84315); box-shadow: 0 0 15px rgba(255, 138, 101, 0.4); }

.player-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-head {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    image-rendering: pixelated;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.player-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .current-player-rank {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .col-credits {
        display: none; /* Hide credits on very small screens to fit */
    }
}

/* ==========================================================================
   News Section Styles
   ========================================================================== */
.news-section {
    padding: 100px 20px;
    background-color: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.news-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(255, 191, 0, 0.15);
    border-color: rgba(255, 191, 0, 0.3);
}

.news-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image {
    transform: scale(1.08);
}

.news-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--mc-green-bright);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.news-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-body h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.3;
}

.news-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Admin News Management CSS */
.admin-news-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

@media (max-width: 992px) {
    .admin-news-layout {
        grid-template-columns: 1fr;
    }
}

.admin-form-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    font-family: 'Inter', sans-serif;
}

.admin-form-card h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    margin-bottom: 25px;
}

.admin-list-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.admin-list-card h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    margin-bottom: 25px;
}

.admin-news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-news-item {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    align-items: center;
}

.admin-news-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.admin-news-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
    background: #000;
}

.admin-news-info {
    padding: 15px 20px;
    flex-grow: 1;
    min-width: 0;
}

.admin-news-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Inter', sans-serif;
}

.admin-news-info .date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.admin-news-actions {
    display: flex;
    gap: 10px;
    padding-right: 20px;
}

.btn-admin {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-transform: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    border: none;
}

.btn-admin-edit {
    background: var(--mc-green);
    color: white;
}

.btn-admin-edit:hover {
    background: var(--mc-green-hover);
}

.btn-admin-delete {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.3);
}

.btn-admin-delete:hover {
    background: rgba(255, 85, 85, 0.3);
}

.live-preview-container {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.live-preview-container h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   Shop Section & Premium Cards Styles
   ========================================================================== */
.shop-section {
    padding: 280px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

.shop-tabs {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
}

.shop-tab-btn {
    background: #1e1e1e;
    border: 4px solid #000000;
    color: var(--text-secondary);
    padding: 30px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
    width: 320px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 3px 3px 0px rgba(255, 255, 255, 0.05), inset -3px -3px 0px rgba(0, 0, 0, 0.3);
}

.shop-tab-btn:hover {
    transform: translateY(-6px);
    background: #252525;
    border-color: #ffffff;
    color: var(--text-primary);
}

.shop-tab-btn.grades-tab.active {
    border-color: #ff5555;
    background: #251b1b;
}

.shop-tab-btn.currency-tab.active {
    border-color: #fff000;
    background: #25251b;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    animation: fadeInDown 0.4s ease-out;
}

.shop-grid.hidden {
    display: none;
}

.shop-card {
    background: #1e1e1e;
    border-radius: 0px;
    border: 4px solid #000000;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: inset 3px 3px 0px rgba(255, 255, 255, 0.05), inset -3px -3px 0px rgba(0, 0, 0, 0.3);
}

/* Réduire la longueur des cartes de monnaie (Elyths & Edialyths) sur PC */
#grid-currency .shop-card {
    padding: 20px;
}
#grid-currency .shop-icon-container {
    margin-bottom: 15px;
    width: 150px;
    height: 150px;
}
#grid-currency .description {
    height: auto;
    margin-bottom: 15px;
}
#grid-currency .features-list {
    margin: 0 0 15px;
}
#grid-currency .price {
    margin-bottom: 15px;
    margin-top: auto;
}

.shop-card:hover {
    transform: translateY(-6px);
    border-color: #ffffff;
}

.shop-card-vip {
    border-color: #000000;
}

.shop-card-vip:hover {
    border-color: #ff5555;
}

.shop-card-divin {
    border-color: #000000;
}

.shop-card-divin:hover {
    border-color: var(--mc-green-bright);
}

.shop-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 2.2rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.shop-card-vip .shop-icon-container {
    background: rgba(255, 85, 85, 0.05);
    border-color: rgba(255, 85, 85, 0.1);
}

.shop-card-divin .shop-icon-container {
    background: rgba(255, 230, 128, 0.05);
    border-color: rgba(255, 230, 128, 0.1);
}

.shop-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
}

.shop-card .description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font-main);
    line-height: 1.5;
    margin-bottom: 20px;
    height: auto;
    overflow: hidden;
}

.view-advantages-btn {
    display: none;
}

.shop-card .features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px;
    text-align: left;
    width: 100%;
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.shop-card .features-list li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.shop-card .features-list li:last-child {
    border-bottom: none;
}

.shop-card .features-list li::before {
    content: '✔';
    color: var(--mc-green);
    font-weight: bold;
}

.shop-card-vip .features-list li::before {
    color: #ff5555;
}

.shop-card-divin .features-list li::before {
    color: var(--mc-green-bright);
}

.shop-card .price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-family: var(--font-heading);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.shop-card .price span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.shop-card .btn,
#buy-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    color: #ffffff !important;
    background: #3c8527 !important;
    border: 3px solid #000000 !important;
    border-radius: 0px !important;
    box-shadow: inset 0 3px 0 #5ca33e, inset 0 -3px 0 #2a5e1b !important;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.85);
    transition: all 0.15s ease;
    cursor: pointer;
}

.shop-card .btn:hover,
#buy-form .btn:hover {
    background: #479a32 !important;
    transform: translateY(-2px);
}

.shop-card .btn:active,
#buy-form .btn:active {
    transform: translateY(1px);
}

/* Avatar dans la navigation */
.nav-avatar {
    width: 36px;
    height: 36px;
    border: 2px solid var(--mc-green);
    box-shadow: 0 0 10px rgba(255, 191, 0, 0.3);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-avatar:hover {
    transform: scale(1.1);
    border-color: var(--mc-green-bright) !important;
    box-shadow: 0 0 15px rgba(255, 191, 0, 0.6) !important;
}

.hidden {
    display: none !important;
}

.btn-back-mc {
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    border: 3px solid #000000;
    background: #1e1e1e;
    border-radius: 0px;
    font-family: var(--font-heading);
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-back-mc:hover {
    background: #252525;
    border-color: #ffffff;
    transform: translateY(-2px);
}

/* Badges de Cartes Boutique */
.shop-card.has-badge {
    padding-top: 65px;
}

.card-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: bold;
    color: #000000;
    border-bottom: 4px solid #000000;
    text-transform: uppercase;
}

.badge-populaire {
    background: #ffbf00;
}

.badge-deal {
    background: #00e5ff;
}

/* Bordures spécifiques aux cartes avec badges */
.shop-card.card-populaire {
    border-color: #ffbf00 !important;
}

.shop-card.card-populaire:hover {
    border-color: #ffbf00 !important;
    box-shadow: 0 0 25px rgba(255, 191, 0, 0.7) !important;
    transform: translateY(-5px);
}

.shop-card.card-deal {
    border-color: #00e5ff !important;
}

.shop-card.card-deal:hover {
    border-color: #00e5ff !important;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.7) !important;
    transform: translateY(-5px);
}

#shop-category-title {
    font-size: 3rem;
}

/* ==========================================================================
   Mobile Responsiveness & Burger Menu
   ========================================================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1000;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Mobile Adjustments */
@media screen and (max-width: 900px) {
    /* Navbar */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #121212;
        flex-direction: column;
        align-items: center;
        padding: 20px 0 85px; /* Augmenté pour faire de la place pour le bouton/avatar */
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
        z-index: 1000;
        gap: 20px; /* Légèrement réduit pour être plus compact */
    }
    
    .navbar.mobile-active .nav-links {
        display: flex;
    }

    .nav-action {
        display: none; /* Cache le bouton se connecter/profil dans la barre du haut sur petit écran */
    }
    
    .navbar.mobile-active .nav-action {
        display: flex;
        position: absolute;
        top: 330px; /* Déplacé vers le bas pour ne pas chevaucher le bouton Support */
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001;
    }

    .navbar.mobile-active .nav-action a {
        margin-right: 0 !important; /* Centrer l'avatar proprement sur mobile */
    }

    /* Burger Animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Hero Section */
    .hero-title {
        font-size: 2.8rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    /* Global Padding */
    .section-container {
        padding: 60px 15px;
    }
    
    /* Footer */
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }
    .footer-brand {
        max-width: 100%;
    }
    .footer-links {
        width: 100%;
        justify-content: space-around;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

@media screen and (max-width: 600px) {
    /* Shop / Boutique: 2x2 Grid for Cards */
    .shop-section {
        padding: 180px 10px 40px;
    }
    
    .shop-tabs {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
    }
    
    .shop-tab-btn {
        width: 90%;
        max-width: 280px;
        padding: 20px;
        box-sizing: border-box;
    }
    
    .shop-tab-btn img {
        width: 100px !important;
        height: 100px !important;
    }
    
    /* Titre de catégorie dynamique */
    #shop-category-title {
        font-size: 1.8rem !important;
    }
    
    /* La demande: "les cases boutique et nos jeux 2 par 2 et plus petites" */
    #grid-grades, #grid-currency, #grid-boosts {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .shop-card .features-list {
        display: none !important;
    }

    .view-advantages-btn {
        display: block !important;
        font-family: var(--font-heading);
        font-size: 0.65rem;
        color: var(--mc-green);
        text-decoration: underline;
        cursor: pointer;
        margin-top: 5px;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
        text-align: center;
        width: 100%;
        line-height: 1.3;
    }

    .view-advantages-btn:hover {
        color: var(--mc-green-bright);
    }
    
    .shop-card {
        padding: 12px 8px;
    }
    
    .shop-card.has-badge {
        padding-top: 35px;
    }
    
    .card-badge {
        height: 22px;
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .shop-icon-container {
        width: 45px;
        height: 45px;
        margin-bottom: 8px;
    }

    .shop-icon-container img {
        width: 45px !important;
        height: 45px !important;
    }
    
    .shop-card h3 {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    
    .shop-card .description {
        font-size: 0.72rem;
        line-height: 1.2;
        margin-bottom: 10px;
        height: auto;
    }
    
    .shop-card .price {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }
    
    .shop-card .price span {
        font-size: 0.75rem;
    }
    
    .shop-card .btn {
        padding: 8px 4px;
        font-size: 0.8rem;
        width: 100%;
        min-height: 36px;
    }
    
    /* Games Grid */
    .games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Masquer la description des mini-jeux sur mobile */
    .game-card p {
        display: none !important;
    }
    
    /* Classement & Support */
    .leaderboard-container {
        overflow-x: auto;
    }
    .support-section, .admin-section {
        padding: 120px 10px 40px;
    }
}

/* --- Panier (Cart) --- */
#cart-floating-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 990;
    transition: transform 0.2s ease, background 0.2s, border-color 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

#cart-floating-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--mc-green);
}

.cart-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff5555;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #121212;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.7);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--mc-green-bright);
}

.close-cart {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-cart:hover {
    color: #ff5555;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.cart-item-info h4 {
    margin: 0 0 5px;
    font-size: 1rem;
    color: var(--text-primary);
}

.cart-item-price {
    color: var(--mc-green);
    font-weight: bold;
    font-size: 1.1rem;
}

.cart-item-remove {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ff5555;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.cart-item-remove:hover {
    opacity: 1;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-primary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
    font-family: var(--font-heading);
}

#cart-total-price {
    color: var(--mc-green-bright);
}

/* =============================================
   MESSAGERIE PRIVEE + LISTE D'AMIS
   ============================================= */

.messaging-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    height: 500px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-primary, #0a0a0a);
}

.friends-panel {
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
}

.friends-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.friends-hint {
    font-size: 0.68rem;
    color: #888;
    font-weight: 400;
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.friends-loading, .friends-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.82rem;
    line-height: 1.7;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    margin: 2px 6px;
    position: relative;
}

.friend-item:hover { background: rgba(255,255,255,0.06); }
.friend-item.active { background: rgba(255,191,0,0.1); }

.friend-head {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.friend-info { flex: 1; min-width: 0; }

.friend-name {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-last-msg {
    display: block;
    font-size: 0.72rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.friend-unread { color: #55ff55; font-size: 0.7rem; flex-shrink: 0; }

.chat-area {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.08);
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #888;
    text-align: center;
}

.chat-placeholder-icon { font-size: 3rem; opacity: 0.4; }

.chat-panel {
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    image-rendering: pixelated;
}

.chat-header-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-empty {
    text-align: center;
    color: #888;
    font-size: 0.88rem;
    margin: auto;
}

.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 80%;
}

.msg-mine { align-self: flex-end; }
.msg-theirs { align-self: flex-start; }

.msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.msg-bubble-wrap { display: flex; flex-direction: column; gap: 3px; }
.msg-mine .msg-bubble-wrap { align-items: flex-end; }

.msg-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.86rem;
    line-height: 1.5;
    word-break: break-word;
    max-width: 280px;
}

.msg-mine .msg-bubble {
    background: linear-gradient(135deg, #ffbf00, #ff8800);
    color: #000;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.msg-theirs .msg-bubble {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.msg-meta {
    font-size: 0.68rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}

.msg-status { font-size: 0.66rem; color: #55bfff; }

.chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 9px 16px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus { border-color: rgba(255,191,0,0.5); }

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ffbf00, #ff8800);
    color: #000;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.chat-send-btn:hover { transform: scale(1.1); }

/* ---- Notification Badge ---- */
.notif-btn-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

#notif-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    background: #ff5555;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #0a0a0a;
    animation: pulse-badge 1.5s infinite;
    z-index: 10;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@media (max-width: 600px) {
    .messaging-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 180px 1fr;
        height: 580px;
    }
    .friends-panel {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .friends-list { overflow-x: auto; display: flex; flex-direction: row; gap: 4px; padding: 6px; }
    .friend-item { min-width: 80px; flex-direction: column; text-align: center; gap: 4px; margin: 0; }
    .friend-last-msg { display: none; }
}