.cp-wrapper{
    max-width:1200px;
    margin:60px auto;
    padding:20px;
}

.cp-wrapper h2{
    font-size:36px;
    margin-bottom:30px;
}

.cp-problem-list{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:30px;
    margin-top:40px;
}

.cp-problem-card{
    background:#fff;
    padding:25px;
    border-radius:15px;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.cp-problem-card h3{
    margin-bottom:15px;
}

.cp-meta{
    display:flex;
    gap:15px;
    margin:20px 0;
}

.cp-meta span{
    padding:6px 14px;
    background:#f2f4f8;
    border-radius:30px;
    font-size:13px;
}

.cp-btn{
    display:inline-block;
    padding:12px 20px;
    background:#2563eb;
    color:#fff;
    border-radius:8px;
    text-decoration:none;
}

.cp-submissions{
    max-width:1000px;
    margin:60px auto;
    padding:20px;
}

.cp-submissions h2{
    font-size:36px;
    margin-bottom:30px;
}

.cp-submissions table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.cp-submissions thead{
    background:#2563eb;
    color:#fff;
}

.cp-submissions th,
.cp-submissions td{
    padding:18px;
    text-align:left;
    border-bottom:1px solid #eee;
}

.cp-submissions tbody tr:hover{
    background:#f8fafc;
}

.cp-submissions td:nth-child(2){
    font-weight:600;
}

.cp-leaderboard{
    max-width:1000px;
    margin:60px auto;
    padding:20px;
}

.cp-leaderboard h2{
    font-size:36px;
    margin-bottom:30px;
}

.cp-leaderboard table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.cp-leaderboard thead{
    background:#111827;
    color:#fff;
}

.cp-leaderboard th,
.cp-leaderboard td{
    padding:18px;
    border-bottom:1px solid #eee;
}



/* Popup Overlay */
#cp-user-popup{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

/* Popup Box */

.cp-popup-box{
    position:relative;
    width: 420px;
    background: #ffffff;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 25px 60px rgba(0,0,0,.18);
    animation: cpFade .25s ease;
}

#cp-close-popup{

    position:absolute;

    top:15px;

    right:15px;

    width:36px;

    height:36px;

    border:none;

    border-radius:50%;

    background:#f3f4f6;

    color:#374151;

    font-size:24px;

    cursor:pointer;

    transition:.3s;

    display:flex;

    align-items:center;

    justify-content:center;

}

#cp-close-popup:hover{

    background:#ef4444;

    color:#fff;

    transform:rotate(90deg);

}

/* Heading */
.cp-popup-box h3{
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* Inputs */
.cp-popup-box input{
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 15px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: .25s;
}

.cp-popup-box input:focus{
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Button */
#cp_start_problem{
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: .3s;
}

#cp_start_problem:hover{
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37,99,235,.25);
}

/* Animation */
@keyframes cpFade{
    from{
        opacity: 0;
        transform: translateY(20px);
    }
    to{
        opacity: 1;
        transform: translateY(0);
    }
}



/* =====================================
   CODE COMPILER UI
=====================================*/

.cp-compiler{
    width:100%;
    max-width:1600px;
    margin:40px auto;
    padding:20px;
}

/* Header */

.cp-header{

    display:flex;
    justify-content:space-between;
    align-items:center;

    margin-bottom:25px;

}

.cp-title h2{

    font-size:40px;
    margin:0;
    font-weight:700;

}

.cp-badges{

    display:flex;
    gap:12px;
    margin-top:15px;

}

.cp-badges span{

    padding:8px 18px;
    border-radius:40px;
    font-size:14px;
    font-weight:600;

}

.cp-difficulty{

    background:#dcfce7;
    color:#15803d;

}

.cp-language{

    background:#dbeafe;
    color:#2563eb;

}

/* Layout */

.cp-layout{

    display:grid;
    grid-template-columns:40% 60%;
    gap:25px;

}

/* LEFT */

.cp-left{

    background:white;

    border-radius:18px;

    overflow:hidden;

    box-shadow:0 20px 45px rgba(0,0,0,.08);

}

.cp-tabs{

    display:flex;

    border-bottom:1px solid #eee;

}

.cp-tabs button{

    flex:1;

    padding:18px;

    border:none;

    background:white;

    cursor:pointer;

    font-size:15px;

    font-weight:600;

    transition:.3s;

}

.cp-tabs button:hover{

    background:#f8fafc;

}

.cp-tabs .active{

    color:#2563eb;

    border-bottom:3px solid #2563eb;

}

.cp-description-card{

    padding:28px;

    line-height:1.8;

    font-size:16px;

}

/* RIGHT */

.cp-right{

    display:flex;

    flex-direction:column;

    background:white;

    border-radius:18px;

    overflow:hidden;

    box-shadow:0 20px 45px rgba(0,0,0,.08);

}

.cp-editor-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:18px 24px;

    background:#111827;

    color:white;

    font-weight:600;

}

.cp-editor{
    overflow:auto;

    height:520px;

    background:#1e293b;

}

#cp-code{
    width:100%;
    height:550px;
    display:none;
}

#monaco-editor{
    width:100%;
    height:550px;
}


/* ===========================
   BUTTONS
=========================== */

.cp-buttons{
    display:flex;
    gap:15px;
    padding:20px;
    background:#fff;
    border-top:1px solid #e5e7eb;
}

#cp-run-btn,
#cp-submit-btn{

    flex:1;

    border:none;

    padding:16px;

    border-radius:12px;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

    transition:.3s;

}

#cp-run-btn{

    background:#2563eb;

    color:white;

}

#cp-run-btn:hover{

    transform:translateY(-2px);

    box-shadow:0 15px 30px rgba(37,99,235,.25);

}

#cp-submit-btn{

    background:#22c55e;

    color:white;

}

#cp-submit-btn:hover{

    transform:translateY(-2px);

    box-shadow:0 15px 30px rgba(34,197,94,.25);

}

.cp-console{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:25px;

    margin-top:25px;

}

.cp-console-box{

    background:#111827;

    border-radius:18px;

    overflow:hidden;

}

.cp-console-box h4{

    margin:0;

    padding:18px;

    background:#0f172a;

    color:white;

}

.cp-console-box pre{

    margin:0;

    padding:22px;

    min-height:150px;

    color:#22c55e;

    font-size:15px;

    font-family:Consolas;

}

.cp-action-btn{

    background:#2563eb;

    color:white;

    border:none;

    border-radius:10px;

    padding:12px 20px;

    cursor:pointer;

    font-weight:600;

    transition:.3s;

}

.cp-action-btn:hover{

    transform:translateY(-2px);

}

@media(max-width:1100px){

.cp-layout{

grid-template-columns:1fr;

}

.cp-console{

grid-template-columns:1fr;

}

}

.cp-tab-content{
    display:none;
    animation:.25s fadeIn;
}

.cp-tab-content.active{
    display:block;
}

.cp-description-card{
    padding:30px;
    height:560px;
    overflow:auto;
    line-height:1.8;
}

.cp-tabs button{

    flex:1;
    cursor:pointer;
    transition:.25s;

}

.cp-tabs button.active{

    color:#2563eb;
    border-bottom:3px solid #2563eb;
    font-weight:700;

}

@keyframes fadeIn{

from{
opacity:0;
transform:translateY(8px);
}

to{
opacity:1;
transform:translateY(0);
}

}

/*==========================
 Problem Info Cards
==========================*/

.cp-problem-info{

display:flex;
gap:12px;
margin-bottom:18px;

}

.cp-info-card{

flex:1;

background:#c7e7ff;

padding:15px;

border-radius:14px;

box-shadow:0 10px 25px rgba(0,0,0,.06);

text-align:center;

}

.cp-info-card span{

display:block;

font-size:12px;

color:#64748b;

margin-bottom:6px;

}

.cp-info-card strong{

font-size:18px;

}

.cp-description-card{

background:#fff;

border-radius:16px;

padding:25px;

height:620px;

overflow:auto;

box-shadow:0 15px 35px rgba(0,0,0,.08);

border-left:5px solid blue;

border-right:5px solid blue;

/*padding:25px;*/

line-height:1.8;

font-size:16px;

}

.cp-description-card h3{

margin-top:25px;

color:#111827;

}

.cp-description-card pre{

background:#0f172a;

color:#fff;

padding:18px;

border-radius:10px;

overflow:auto;

}

.cp-description-card ul{

padding-left:20px;

}

.cp-description-card li{

margin-bottom:10px;

}

.cp-tab-content{

display:none;

}

.cp-tab-content.active{

display:block;

animation:fadeIn .3s;

}

@keyframes fadeIn{

from{

opacity:0;
transform:translateY(8px);

}

to{

opacity:1;
transform:translateY(0);

}

}

.cp-leader-stats{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:20px;
margin:30px 0;
}

.cp-stat-card{
background:#fff;
padding:25px;
border-radius:16px;
text-align:center;
box-shadow:0 10px 30px rgba(0,0,0,.08);
}

.cp-stat-card h3{
font-size:34px;
margin:0;
color:#2563eb;
}

.cp-stat-card p{
margin-top:8px;
color:#666;
font-weight:600;
}

.cp-top3{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:25px;
margin:40px 0;
}

.cp-top-card{
background:linear-gradient(135deg,#2563eb,#1e3a8a);
color:#fff;
padding:30px;
border-radius:20px;
text-align:center;
box-shadow:0 20px 40px rgba(37,99,235,.2);
}

.cp-medal{
font-size:48px;
margin-bottom:10px;
}

.cp-top-card h3{
margin:10px 0;
color:#fff;
}

.cp-top-card p{
opacity:.9;
}

.cp-top-xp{
margin-top:15px;
font-size:22px;
font-weight:bold;
}

@media(max-width:768px){

.cp-leader-stats{
grid-template-columns:repeat(2,1fr);
}

.cp-top3{
grid-template-columns:1fr;
}

}

/*==============================
LEADERBOARD HERO
==============================*/

.cp-leader-hero{

display:flex;

justify-content:space-between;

align-items:center;

padding:40px;

background:linear-gradient(135deg,#2563eb,#1d4ed8);

border-radius:22px;

color:#fff;

margin-bottom:35px;

overflow:hidden;

}

.cp-leader-left h1{

font-size:42px;

margin:0;

color:#fff;

}

.cp-leader-left p{

margin-top:15px;

font-size:17px;

opacity:.9;

max-width:550px;

}

.cp-rank-circle{

width:120px;

height:120px;

background:rgba(255,255,255,.15);

border:4px solid rgba(255,255,255,.2);

border-radius:50%;

display:flex;

align-items:center;

justify-content:center;

font-size:42px;

font-weight:bold;

backdrop-filter:blur(12px);

}

.cp-leader-stats{

display:grid;

grid-template-columns:repeat(4,1fr);

gap:20px;

margin:35px 0;

}

.cp-stat-card{

display:flex;

align-items:center;

gap:18px;

background:#fff;

padding:24px;

border-radius:18px;

box-shadow:0 10px 30px rgba(0,0,0,.08);

transition:.3s;

}

.cp-stat-card:hover{

transform:translateY(-6px);

}

.cp-stat-icon{

width:60px;

height:60px;

background:#eff6ff;

border-radius:50%;

display:flex;

justify-content:center;

align-items:center;

font-size:28px;

}

.cp-stat-card h2{

margin:0;

font-size:30px;

color:#111827;

}

.cp-stat-card span{

color:#6b7280;

font-size:14px;

}

.cp-search-box{

margin:40px 0;

}

.cp-search-box input{

width:100%;

padding:18px 24px;

border-radius:14px;

border:2px solid #e5e7eb;

font-size:16px;

outline:none;

transition:.3s;

}

.cp-search-box input:focus{

border-color:#2563eb;

box-shadow:0 0 0 4px rgba(37,99,235,.1);

}

@media(max-width:991px){

.cp-leader-hero{

flex-direction:column;

text-align:center;

gap:30px;

}

.cp-leader-stats{

grid-template-columns:repeat(2,1fr);

}

}

@media(max-width:600px){

.cp-leader-stats{

grid-template-columns:1fr;

}

}

/*==========================
TOP PODIUM
==========================*/

.cp-podium{

display:flex;

justify-content:center;

align-items:flex-end;

gap:25px;

margin:60px 0;

}

.cp-podium-card{

flex:1;

max-width:320px;

background:#fff;

border-radius:22px;

padding:35px 25px;

text-align:center;

box-shadow:0 15px 40px rgba(0,0,0,.08);

transition:.35s;

position:relative;

overflow:hidden;

}

.cp-podium-card:hover{

transform:translateY(-10px);

}

.cp-podium-card.first{

background:linear-gradient(135deg,#2563eb,#1e3a8a);

color:#fff;

transform:scale(1.08);

}

.cp-podium-card.second{

margin-top:70px;

}

.cp-podium-card.third{

margin-top:90px;

}

.cp-avatar{

width:90px;

height:90px;

border-radius:50%;

background:#2563eb;

color:#fff;

font-size:34px;

font-weight:700;

display:flex;

align-items:center;

justify-content:center;

margin:auto;

margin-bottom:18px;

}

.cp-podium-card.first .cp-avatar{

background:#fff;

color:#2563eb;

}

.cp-medal{

font-size:46px;

margin-bottom:12px;

}

.cp-crown{

position:absolute;

top:12px;

right:18px;

font-size:36px;

animation:crownFloat 2s infinite;

}

.cp-podium-card h3{

margin:10px 0;

font-size:24px;

}

.cp-podium-card p{

margin:0;

font-size:14px;

opacity:.85;

word-break:break-all;

}

.cp-xp{

display:inline-block;

margin-top:18px;

padding:10px 18px;

background:#facc15;

color:#111827;

font-weight:700;

border-radius:30px;

}

.cp-podium-card.first .cp-xp{

background:#fff;

}

@keyframes crownFloat{

0%{

transform:translateY(0);

}

50%{

transform:translateY(-8px);

}

100%{

transform:translateY(0);

}

}

@media(max-width:900px){

.cp-podium{

flex-direction:column;

align-items:center;

}

.cp-podium-card{

max-width:100%;

margin-top:0!important;

}

.cp-podium-card.first{

transform:none;

}

}

/* ==========================================
   COMPLETE MOBILE RESPONSIVE
========================================== */

@media (max-width: 991px){

    .cp-wrapper,
    .cp-submissions,
    .cp-leaderboard,
    .cp-compiler{
        padding:15px;
        margin:25px auto;
    }

    .cp-header{
        flex-direction:column;
        align-items:flex-start;
        gap:15px;
    }

    .cp-title h2{
        font-size:30px;
    }

    .cp-badges{
        flex-wrap:wrap;
        gap:10px;
    }

    .cp-problem-list{
        grid-template-columns:repeat(2,1fr);
    }

    .cp-layout{
        grid-template-columns:1fr;
        gap:20px;
    }

    .cp-console{
        grid-template-columns:1fr;
    }

    .cp-editor,
    #cp-code,
    #monaco-editor{
        height:450px;
    }

}

@media (max-width:768px){

    .cp-wrapper h2,
    .cp-submissions h2,
    .cp-leaderboard h2{
        font-size:28px;
    }

    .cp-problem-list{
        grid-template-columns:1fr;
    }

    .cp-problem-card{
        padding:20px;
    }

    .cp-meta{
        flex-wrap:wrap;
        gap:8px;
    }

    .cp-btn{
        width:100%;
        text-align:center;
    }

    .cp-popup-box{
        width:calc(100% - 30px);
        padding:22px;
        border-radius:15px;
    }

    .cp-popup-box h3{
        font-size:22px;
    }

    .cp-problem-info{
        flex-direction:column;
    }

    .cp-info-card{
        width:100%;
    }

    .cp-tabs{
        overflow-x:auto;
        white-space:nowrap;
        scrollbar-width:none;
    }

    .cp-tabs::-webkit-scrollbar{
        display:none;
    }

    .cp-tabs button{
        flex:none;
        min-width:130px;
        font-size:14px;
        padding:16px;
    }

    .cp-description-card{
        height:auto;
        max-height:420px;
        padding:18px;
        font-size:15px;
    }

    .cp-editor,
    #cp-code,
    #monaco-editor{
        height:380px;
    }

    .cp-buttons{
        flex-direction:column;
        padding:15px;
        gap:12px;
    }

    #cp-run-btn,
    #cp-submit-btn{
        width:100%;
        padding:15px;
        font-size:15px;
    }

    .cp-console-box pre{
        font-size:14px;
        min-height:120px;
        overflow:auto;
        white-space:pre-wrap;
        word-break:break-word;
    }

    .cp-submissions table,
    .cp-leaderboard table{
        display:block;
        overflow-x:auto;
        white-space:nowrap;
    }

}

@media (max-width:480px){

    .cp-title h2{
        font-size:24px;
    }

    .cp-badges span{
        font-size:12px;
        padding:6px 12px;
    }

    .cp-problem-card{
        padding:16px;
    }

    .cp-description-card{
        padding:15px;
        font-size:14px;
    }

    .cp-description-card pre{
        padding:12px;
        font-size:12px;
    }

    .cp-editor,
    #cp-code,
    #monaco-editor{
        height:320px;
    }

    .cp-console-box h4{
        font-size:15px;
        padding:14px;
    }

    .cp-console-box pre{
        font-size:13px;
        padding:15px;
    }

    .cp-info-card strong{
        font-size:16px;
    }

}

.cp-problem-list{

display:grid;

grid-template-columns:repeat(auto-fit,minmax(340px,1fr));

gap:30px;

margin-top:40px;

}

.cp-problem-card{

    background:#fff;

    border-radius:22px;

    padding:28px;

    border:1px solid #edf2f7;

    box-shadow:0 18px 45px rgba(20,30,55,.08);

    transition:.35s;

    display:flex;

    flex-direction:column;

    justify-content:space-between;

    min-height:340px;

}

.cp-problem-card:hover{

    transform:translateY(-10px);

    box-shadow:0 30px 60px rgba(37,99,235,.18);

}

.cp-card-top{

display:flex;

justify-content:space-between;

align-items:center;

margin-bottom:20px;

}

.cp-problem-icon{

font-size:48px;

}

.cp-level{

padding:8px 16px;

border-radius:30px;

font-size:14px;

font-weight:700;

}

.cp-level.easy{

background:#dcfce7;

color:#15803d;

}

.cp-level.medium{

background:#fef3c7;

color:#b45309;

}

.cp-level.hard{

background:#fee2e2;

color:#dc2626;

}

.cp-problem-card h3{

font-size:32px;

margin:0 0 18px;

font-weight:800;

}

.cp-problem-card p{

color:#64748b;

line-height:1.8;

font-size:16px;

margin-bottom:30px;

flex:1;

}

.cp-card-footer{

display:flex;

justify-content:space-between;

align-items:center;

margin-top:auto;

}

.cp-lang{

padding:10px 18px;

background:#eef4ff;

color:#2563eb;

font-weight:700;

border-radius:40px;

}

.cp-btn{

padding:14px 26px;

background:linear-gradient(135deg,#2563eb,#1d4ed8);

color:#fff;

border:none;

border-radius:12px;

font-weight:700;

cursor:pointer;

transition:.3s;

}

.cp-btn:hover{

transform:translateY(-3px);

}

@media(max-width:1024px){

.cp-problem-list{

grid-template-columns:repeat(2,1fr);

}

}

@media(max-width:768px){

.cp-problem-list{

grid-template-columns:1fr;

}

.cp-problem-card{

min-height:auto;

}

.cp-card-footer{

flex-direction:column;

gap:20px;

align-items:flex-start;

}

.cp-btn{

width:100%;

}

}