:root{
--bg:#060f1f;
--panel:#0f172a;
--card:#111c33;
--accent:#3b82f6;
--accent2:#2563eb;
--text:#ffffff;
--muted:#9aa4b2;
}

*{
box-sizing:border-box;
font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial;
}

body{
margin:0;
background:linear-gradient(180deg,#020617 0%,#071733 100%);
color:var(--text);
min-height:100vh;
}

.app{
max-width:1100px;
margin:auto;
padding:40px 30px;
}

/* ---------- HERO SECTION ---------- */

.hero{
text-align:center;
margin-bottom:30px;
}

.hero h1{
font-size:36px;
margin-bottom:8px;
}

.subtitle{
color:var(--muted);
font-size:16px;
margin-bottom:10px;
}

.tech-info{
display:flex;
justify-content:center;
gap:18px;
flex-wrap:wrap;
font-size:13px;
color:var(--muted);
}

/* ---------- BUTTONS ---------- */

.controls{
display:flex;
justify-content:center;
gap:14px;
margin:30px 0;
flex-wrap:wrap;
}

.file-label{
background:#0b1220;
border:1px solid rgba(255,255,255,0.08);
padding:10px 14px;
border-radius:10px;
cursor:pointer;
}

.file-label input{
display:none;
}

.btn{
padding:10px 18px;
border-radius:10px;
border:none;
cursor:pointer;
font-weight:600;
transition:0.2s;
}

.btn.primary{
background:var(--accent);
color:white;
}

.btn.primary:hover{
background:var(--accent2);
transform:translateY(-2px);
}

.btn.outline{
background:transparent;
border:1px solid rgba(255,255,255,0.1);
color:white;
}

.btn.outline:hover{
background:rgba(255,255,255,0.05);
}

.hidden{
display:none;
}

/* ---------- MAIN AREA ---------- */

/* Use flex with left column (camera) flexible and right column fixed width for predictions */
.main-area{
display:flex;
justify-content:center;
align-items:flex-start;
gap:36px;
}

/* Left: camera panel should take remaining space */
.camera-panel{
flex:1 1 640px;
text-align:center;
max-width:720px;
}

/* Canvas card adapts to container */
.canvas-card{
background:rgba(255,255,255,0.04);
border:1px solid rgba(255,255,255,0.08);
backdrop-filter:blur(10px);
padding:16px;
border-radius:14px;
box-shadow:0 10px 35px rgba(0,0,0,0.4);
display:flex;
justify-content:center;
align-items:center;
}

/* make canvas responsive while keeping aspect ratio (640x480) */
canvas{
border-radius:10px;
width:100%;
max-width:640px;
height:auto;
background:white;
display:block;
}

/* Right: prediction panel fixed width */
.prediction-panel{
text-align:center;
width:320px;
flex:0 0 320px;
}

/* ---------- PREDICTION PANEL ---------- */

.prediction-box{
margin-top:10px;
padding:25px 20px;
background:rgba(255,255,255,0.04);
border-radius:14px;
border:1px solid rgba(255,255,255,0.08);
}

.prediction-letter{
font-size:70px;
font-weight:700;
color:#60a5fa;
margin-bottom:14px;
}

/* ---------- CONFIDENCE BAR ---------- */

.confidence-area{
margin-top:10px;
}

.bar-bg{
width:100%;
height:14px;
background:rgba(255,255,255,0.08);
border-radius:10px;
overflow:hidden;
}

.bar-fill{
height:100%;
width:0%;
background:linear-gradient(90deg,#3b82f6,#2563eb);
transition:width 0.3s ease;
}

.confidence-label{
margin-top:8px;
font-size:14px;
color:var(--muted);
}

/* ---------- TOP PREDICTIONS ---------- */

.top-predictions{
margin-top:20px;
font-size:14px;
color:var(--muted);
}

.top-predictions h4{
color:white;
margin-bottom:6px;
}

.top-predictions div{
padding:3px 0;
}

/* recorded word */
.recorded-word{
margin-top:12px;
color:#aee3a5;
font-weight:700;
}

/* ---------- TIP TEXT ---------- */

.tip{
margin-top:12px;
font-size:13px;
color:var(--muted);
}

/* ---------- FOOTER ---------- */

.footer{
margin-top:50px;
text-align:center;
color:var(--muted);
font-size:13px;
}

/* ---------- Responsive: stack on narrow screens ---------- */
@media (max-width: 960px) {
  .main-area{
    flex-direction:column;
    align-items:center;
  }
  .prediction-panel{
    width:100%;
    flex:0 0 auto;
    margin-top:18px;
  }
  .camera-panel{
    max-width:100%;
  }
  canvas{
    max-width:420px;
  }
}