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

html{
    scroll-behavior: smooth;
}

body{
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eef3f8;
    color: #222;
    line-height: 1.6;
}

::-webkit-scrollbar{
    width: 10px;
}

::-webkit-scrollbar-track{
    background: #d9e3ef;
}

::-webkit-scrollbar-thumb{
    background: #1565c0;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover{
    background: #0d47a1;
}

header{
    background: linear-gradient(135deg,#1565c0, #0d47a1);
    color: white;
    text-align: center;
    padding: 50px 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,.25);
}

header h1{
    font-size: 3rem;
    margin-bottom: 15px;
    letter-spacing:2px;
}

header p{
    margin-top:8px;
    font-size: 1.1rem;
}

nav{
    background:#263238;
    position: sticky;
    top: 0;
    z-index:999;
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
}

nav ul{
    list-style:none;
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
}

nav li{
    margin: 0;
}

nav a{
    display:block;
    padding: 18px 26px;
    color:white;
    text-decoration:none;
    transition:.3s;
    font-weight:600;
}

nav a:hover{
    background:#1976d2;
}

main{
    width:92%;
    max-width: 1350px;
    margin: 35px auto;
}

section{
    background:white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

section h2{
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color:#1565c0;
}

hr{
display:none;
}

#dashboard{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap:20px;
}

#dashboard h2{
    grid-column:1/-1;
}

#dashboard div{
    background:linear-gradient(135deg,#ffffff,#f4f8fc);
    border-left:6px solid #1565c0;
    border-radius: 15px;
    padding:22px;
    transition:.3s;
}

#dashboard div:hover{
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,.12);
}

#dashboard div h3{
    margin-bottom: 10px;
    color:#1565c0;
}

#dashboard div p{
    font-size: 1.35rem;
    font-weight: bold;
}

#money{
    color:#2e7d32;
}

#factory-level{
    color:#ff9800;
}

#electricity{
    color:#f44336;
}

#workers{
    color:#6a1b9a;
}

#reputation{
    color:#1565c0;
}

#factory{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

#factory h2{
    grid-column:1/-1;
}

#factory article{
    background:#fafcff;
    border-left:2px solid #dbe8f5;
    border-radius: 18px;
    padding:22px;
    transition:.3s;
    display:flex;
    flex-direction: column;
    justify-content: space-between;
}

#factory article:hover{
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,.12);
    border-left:2px solid #1565c0;
}

#factory article h3{
    margin-bottom: 10px;
    color:#1565c0;
    font-size: 1.4rem;
}

#factory article p{
    color: #555;
    margin-bottom: 15px;
}

#factory article ul{
    list-style:none;
    margin-bottom: 20px;
}

#factory article ul li{
    background:#eef5fc;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-weight: 500;
}

#factory button{
    width:100%;
    font-size: 1rem;
    background:#1565c0;
    color:white;
    border:none;
    padding: 10px 14px;
    border-radius: 12px;
    cursor:pointer;
    transition:.3s;
    font-weight:bold;
}

#factory button:hover{
    background:#0d47a1;
    transform:scale(1.03);
}

#upgrades{
    text-align:center;
}

#upgrades button{
    margin: 12px;
    border:none;
    font-size: 1rem;
    background:#ff9800;
    color:white;
    border:none;
    padding: 16px 22px;
    border-radius: 14px;
    cursor:pointer;
    transition:.3s;
    font-weight:bold;
}

#upgrades button:hover{
    background:#ef6c00;
    transform:translateY(-3px);
    box-shadow: 0 10px 18px rgba(0,0,0,.18);
}

#orders{
    text-align:center;
}

#activeOrder{
    font-size: 1.3rem;
    font-weight: 600;
    color:#1565c0;
    background:#eef5fc;
    border:2px dashed #90caf9;
    border-radius: 14px;
    padding: 25px;
}

#statistics{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

#statistics h2{
    grid-column:1/-1;
}

#statistics p{
    font-size: 1.1rem;
    font-weight: 600;
    background:#f7fbff;
    border-left:6px solid #1565c0;
    border-radius: 14px;
    padding: 18px;
    transition:.3s;
}

#statistics p:hover{
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,.12);
}

#statistics span{
    color:#1565c0;
    font-weight: bold;
}

#achievements ul{
    list-style:none;
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

#achievements li{
    background:linear-gradient(135deg,#fff8e1,#fff3c4);
    border-left:6px solid #ffc107;
    border-radius: 14px;
    padding: 18px;
    font-weight: 600;
    transition:.3s;
}

#achievements li:hover{
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,.12);
}

#settings{
    text-align:center;
}

#settings button{
    margin: 12px;
    border:none;
    font-size: 1rem;
    font-weight: bold;
    background:#1565c0;
    color:#ffffff;
    padding: 16px 28px;
    border-radius: 14px;
    cursor:pointer;
    transition:.3s;
}

#settings button:hover{
    background:#0d47a1;
    transform:translateY(-3px);
    box-shadow: 0 10px 18px rgba(0,0,0,.18);
}

footer{
    text-align:center;
    padding: 25px;
    background:#263238;
    color:white;
    font-size: 0.9rem;
    margin-top:50px;
}
@media (max-width:768px){

    nav ul{
        flex-direction:column;
    }

    nav a{
        text-align:center;
    }

    #dashboard,
    #factory,
    #statistics,
    #achievements ul{
        grid-template-columns:1fr;
    }

    section{
        padding:20px;
    }

    header h1{
        font-size:2.2rem;
    }

}

#robotWorkshop{
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    z-index: 1000;
}

#robotWorkshop[hidden]{
    display:none;
}

.workshop-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #263238;
    color: white;
    padding: 18px 25px;
    border-radius: 3px solid #1565c0;
}

.workshop-header h2{
    font-size: 1.8rem;
}
#closeWorkshopButton{
    background: #d32f2f;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition:.3s;
}

#closeWorkshopButton:hover{
    background: #b71c1c;
    transform: rotate(90deg);
}

.workshop-body{
    background:#f5f7fa;
    width: 100%;
    max-width: 1200px;
    height:80vh;
    display:grid;
    grid-template-columns:250px 1fr 250px;
    overflow:hidden;
    border-radius: 20px;
    box-shadow:0 20px 50px rgba(0,0,0,.35);
}

.parts-panel, .tools-panel{
    background:#eceff1;
    padding: 25px;
    overflow-y:auto;
}

.parts-panel h3, .tools-panel h3{
    margin-bottom: 20px;
    color:#1565c0;
    text-align:center;
}

.parts-panel button, .tools-panel button{
    display:block;
    width:100%;
    margin-bottom: 15px;
    padding: 14px;
    background:#1565c0;
    color:white;
    border:none;
    border-radius: 12px;
    cursor:pointer;
    transition:.3s;
    font-weight:bold;
}

.parts-panel button:hover, .tools-panel button:hover{
    background:#0d47a1;
    transform: translateY(-3px);
}

.assembly-panel{
    background:#ffffff;
    padding: 25px;
    display:flex;
    flex-direction: column;
    align-items: center;
}

.assembly-panel h3{
    margin-bottom: 20px;
    color:#1565c0;
}

#assemblyCanvas{
    flex:1;
    width:100%;
    background:repeating-linear-gradient(0deg, #f7fbff, #f7fbff 24px, #edf5fc 25px);
    border:4px dashed #90caf9;
    border-radius: 20px;
    display:flex;
    justify-content: center;
    align-items: center;
}

#robotPreview{
    width: 260px;
    height: 360px;
    border:3px dashed #1565c0;
    background: white;
    border-radius: 20px;
    display:flex;
    justify-content: center;
    align-items: center;
    font-size:4rem;
    color:#1565c0;
}

#robotPreview::before{
    content:"";
}

.robotCardInfo{
    margin-top:18px;
    border-top:2px solid #dbe8f5;
    padding-top:15px;
}

.robotCardInfo p{
    margin:8px 0;
    font-weight:600;
    color:#1565c0;
}

#upgrades + hr + h3{
    text-align:center;
    color:#1565c0;
    margin-bottom:20px;
    font-size:1.6rem;
}

#upgrades + hr + h3 + p,
#upgrades + hr + h3 + p + p,
#upgrades + hr + h3 + p + p + p,
#upgrades + hr + h3 + p + p + p + p,
#upgrades + hr + h3 + p + p + p + p + p{
    background:white;
    border-left:6px solid #1565c0;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: bold;
    box-shadow:0 5px 12px rgba(0,0,0,.08);
}

#machineLevel,
#conveyorLevel,
#solarLevel,
#toolLevel,
#workerSkill{
    color:#1565c0;
    font-weight: bold;
}

.orderCard{
    max-width:500px;
    margin:auto;
    background:white;
    border-radius:18px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
}

.orderCard h3{
    color:#1565c0;
    margin-bottom: 18px;
}

.orderCard p{
    margin: 12px  0;
    font-size: 1.05rem;
    font-weight: 600;
}

.orderCard button{
    margin-top:18px;
    width: 100%;
    padding: 14px;
    background: #43a047;
    color:white;
    border:none;
    border-radius: 12px;
    cursor:pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: .3s;
}

.orderCard button:hover{
    background: #2e7d32;
    transform: translateY(-2px);
}

#orderProgress{
    width:100%;
    height:24px;
    margin-top: 15px;
}

#assemblyProgress{
    width: 100%;
    height: 25px;
    margin: 18px 0;
}

#robotStatus,
#paintStatus,
#aiStatus,
#qualityStatus{
    font-weight: bold;
    color:#1565c0;
}

#workspaceLog{
    margin-top: 18px;
    background: white;
    border:2px dashed #90caf9;
    border-radius: 14px;
    padding:15px;
    min-height: 170px;
    overflow-y:auto;
    text-align: left;
    font-size: .95rem;
    line-height: 1.6;
}

progress{
    appearance: none;
    width: 100%;
    height: 20px;
}

progress::-webkit-progress-bar{
    background:#e3eaf3;
    border-radius: 15px;
}

progress::-webkit-progress-value{
    background: #1565c0;
    border-radius:15px;   
}

progress::-moz-progress-bar{
    background:#1565c0;
}

@media(max-width:950px){
    .workshop-body{
    grid-template-columns: 1fr;
    height:auto;
    overflow-y:auto;
}

.parts-panel,
.assembly-panel,
.tools-panel{
    width:100%;
}

#robotPreview{
    width:180px;
    height: 260px;
    font-size: 3rem;
}

}