body{
margin:0;
font-family:'Segoe UI', Roboto, Arial, sans-serif;
background:linear-gradient(135deg,#020617,#020617,#0f172a);
color:white;
}

header{
display:flex;
align-items:center;
justify-content:center;
padding:18px 20px;
background:rgba(10,15,30,0.85);
backdrop-filter:blur(12px);
box-shadow:0 4px 18px rgba(0,0,0,0.5);
position:sticky;
top:0;
z-index:100;
}

.header-left{
position:absolute;
left:20px;
}

.logo{
height:48px;
}

.header-center{
text-align:center;
}

header h1{
margin:0;
font-size:26px;
font-weight:600;
}

header p{
opacity:0.7;
margin-top:4px;
font-size:14px;
}

/* Main Container */
.container{
max-width:1250px;
margin:auto;
padding:20px;
}

/* Card */
.card{
background:#0f172a;
padding:20px;
margin-bottom:22px;
border-radius:16px;
box-shadow:
0 6px 20px rgba(0,0,0,0.6),
inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Control Panel */
.controls h2{
margin-top:0;
margin-bottom:18px;
}

.controls .row{
display:grid;
grid-template-columns:180px 1fr;
align-items:center;
gap:15px;
margin-bottom:14px;
}

label{
font-size:14px;
opacity:0.85;
font-weight:500;
}

select{
width:100%;
padding:12px;
border-radius:10px;
border:none;
background:#1e293b;
color:white;
font-size:14px;
outline:none;
transition:0.2s;
}

select:hover{
background:#334155;
}

/* Buttons */
.button-group{
display:grid;
grid-template-columns:1fr 1fr;
gap:14px;
margin-top:12px;
}

button{
padding:13px;
border:none;
border-radius:12px;
background:linear-gradient(135deg,#22c55e,#16a34a);
color:white;
font-weight:600;
cursor:pointer;
transition:0.25s;
box-shadow:0 4px 12px rgba(0,0,0,0.4);
}

button:hover{
transform:translateY(-2px);
box-shadow:0 6px 16px rgba(0,0,0,0.6);
}

button:active{
transform:scale(0.98);
}

/* Grid */
#grid{
display:grid;
grid-template-columns:repeat(10,1fr);
gap:4px;
width:100%;
max-width:620px;
margin:20px auto;
}

/* Cells */
.cell{
aspect-ratio:1;
background:#334155;
display:flex;
align-items:center;
justify-content:center;
font-size:10px;
text-align:center;
padding:2px;
border-radius:6px;
transition:0.2s;
box-shadow:inset 0 1px 0 rgba(255,255,255,0.05);
}

.cell:hover{
background:#475569;
}

.blocked{
background:#e5e7eb;
color:black;
}

.start{
background:#16a34a;
}

.goal{
background:#dc2626;
}

.best-path{
background:#22c55e;
}

/* Table */
table{
width:100%;
border-collapse:collapse;
margin-top:12px;
border-radius:10px;
overflow:hidden;
}

th,td{
padding:12px;
text-align:center;
font-size:14px;
}

th{
background:#1e293b;
font-weight:600;
}

tr:nth-child(even){
background:#020617;
}

tr:nth-child(odd){
background:#0f172a;
}

/* Conclusion */
#conclusionText{
margin-top:12px;
line-height:1.6;
opacity:0.95;
font-size:15px;
}

/* Footer */
footer{
background:#020617;
padding:18px 20px;
margin-top:40px;
border-top:1px solid #1e293b;
}

.footer-content{
max-width:1250px;
margin:auto;
display:flex;
justify-content:space-between;
gap:20px;
flex-wrap:wrap;
font-size:14px;
opacity:0.85;
}

.footer-content div{
flex:1;
min-width:220px;
}

.footer-left{
text-align:left;
}

.footer-center{
text-align:center;
}

.footer-right{
text-align:right;
}

/*Mobile Response*/
@media(max-width:768px){

header{
flex-direction:column;
}

.header-left{
position:static;
margin-bottom:8px;
}

.logo{
height:40px;
}

header h1{
font-size:20px;
}

.controls .row{
grid-template-columns:1fr;
}

.button-group{
grid-template-columns:1fr;
}

.cell{
font-size:8px;
}

.footer-left,
.footer-center,
.footer-right{
text-align:center;
}
}
