:root{
    --bg:#0b0f19;
    --panel:#111827;
    --panel-2:#0f172a;
    --text:#e5e7eb;
    --muted:#94a3b8;
    --border:rgba(255,255,255,.10);
    --shadow:0 10px 35px rgba(0,0,0,.45);
    --radius:18px;

    --accentA: rgba(59,130,246,.18);
    --accentB: rgba(168,85,247,.16);
    --badgeA: rgba(59,130,246,.25);
    --badgeB: rgba(168,85,247,.14);
}

*{ box-sizing:border-box; }
body{
    margin:0;
    font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,"Apple Color Emoji","Segoe UI Emoji";
    background:
    radial-gradient(1200px 700px at 20% 10%, var(--accentA), transparent 55%),
    radial-gradient(900px 600px at 80% 20%, var(--accentB), transparent 50%),
    var(--bg);
    color:var(--text);
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:20px;
}

.app{
    width:min(1100px,100%);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    overflow:hidden;
}

header{
    padding:14px 16px;
    display:flex;
    gap:14px;
    align-items:flex-end;
    justify-content:space-between;
    background: rgba(17, 24, 39, .65);
    border-bottom:1px solid var(--border);
    flex-wrap:wrap;
}

header h1{ margin:0; font-size:18px; letter-spacing:.2px; }
header .sub{ margin:0; color:var(--muted); font-size:13px; }

.topControls{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}

main{ padding:20px; }

.panel{
    background: rgba(17,24,39,.55);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.row{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
}

.row.left{
    justify-content:flex-start;
}

button, select, input[type="number"]{
    appearance:none;
    border:1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    color: var(--text);
    padding: 10px 14px;
    border-radius: 14px;
    font-weight:600;
    letter-spacing:.2px;
    transition: transform .06s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}

button{ cursor:pointer; user-select:none; }
button:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.18); }
button:active{ transform: translateY(0px); }
button:disabled{ opacity:.45; cursor:not-allowed; transform:none; }

select{ cursor:pointer; }
input[type="number"]{ width:120px; }

input[type="file"]{
    width:100%;
    padding:14px;
    border-radius:14px;
    border:1px dashed rgba(255,255,255,.20);
    background: rgba(15,23,42,.55);
    color: var(--muted);
    font-weight:500;
}

.muted{ color:var(--muted); font-size:13px; margin-top:8px; }
.grid{ display:grid; gap:16px; }

.compare{
    display:grid;
    grid-template-columns: 1fr 140px 1fr;
    gap:16px;
    align-items:stretch;
    margin-top:16px;
}
@media (max-width: 920px){
    .compare{ grid-template-columns: 1fr; }
    .vs{ order:2; }
    .leftCard{ order:1; }
    .rightCard{ order:3; }
}

.card{
    background: rgba(15,23,42,.55);
    border:1px solid var(--border);
    border-radius: var(--radius);
    padding:14px;
    min-height:360px;
    display:grid;
    grid-template-rows: 1fr auto auto;
    gap:12px;
}

.imgWrap{
    border-radius: 14px;
    overflow:hidden;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.25);
    display:grid;
    place-items:center;
    min-height:260px;
}

.card img{
    max-width:100%;
    max-height:420px;
    display:block;
    object-fit:contain;
}

.labelRow{
    display:flex;
    justify-content:space-between;
    gap:10px;
    align-items:center;
    color:var(--muted);
    font-size:12px;
}

.vs{
    display:grid;
    place-items:center;
    gap:10px;
    padding:10px 0;
}

.vsBadge{
    width:86px;
    height:86px;
    border-radius:999px;
    display:grid;
    place-items:center;
    border:1px solid rgba(255,255,255,.15);
    background: radial-gradient(circle at 30% 30%, var(--badgeA), var(--badgeB));
    font-weight:900;
    letter-spacing:1px;
}

.pill{
    font-size:12px;
    color:var(--muted);
    border:1px solid rgba(255,255,255,.14);
    padding:6px 10px;
    border-radius:999px;
    background: rgba(0,0,0,.18);
    backdrop-filter: blur(6px);
}

.hint{ color:var(--muted); font-size:12px; text-align:center; }

.thumbs{
    margin-top:14px;
    display:grid;
    gap:10px;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.thumb{
    border-radius:14px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.12);
    background: rgba(15,23,42,.45);
    aspect-ratio: 1 / 1;
    display:grid;
    place-items:center;
    position:relative;
}
.thumb img{ width:100%; height:100%; object-fit:cover; }
.thumb .idx{
    position:absolute;
    top:8px; left:8px;
    font-size:12px;
    font-weight:800;
    background: rgba(0,0,0,.45);
    border:1px solid rgba(255,255,255,.14);
    padding:4px 8px;
    border-radius:999px;
    backdrop-filter: blur(6px);
}

.thumb .removeBtn{
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

.thumb .removeBtn:hover{
  opacity: 0.75;
}



.hidden{ display:none !important; }

.settingsGrid{
    display:grid;
    gap:12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top:14px;
}
.setting{
    border:1px solid rgba(255,255,255,.12);
    border-radius:16px;
    padding:12px;
    background: rgba(15,23,42,.35);
}
.setting label{
    display:block;
    font-size:12px;
    color: var(--muted);
    margin-bottom:8px;
    font-weight:700;
    letter-spacing:.2px;
}
.setting .inline{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}

.btnRow{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
    margin-top:12px;
}

/* theme helper (for white/light themes) */
body.theme-light{
    --border: rgba(0,0,0,.12);
    --shadow: 0 10px 35px rgba(0,0,0,.15);
}

/* NAVBAR */
.navbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(17,24,39,.65);
  backdrop-filter: blur(8px);
}

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

.brand{
  font-weight:900;
  letter-spacing:.4px;
}

.nav-links{
  display:flex;
  gap:6px;
}

.nav-link{
  background:none;
  border:none;
  padding:8px 12px;
  border-radius:10px;
  color:var(--muted);
  font-weight:700;
  cursor:pointer;
}

.nav-link:hover{
  color:var(--text);
}

.nav-link.active{
  color:var(--text);
  background: rgba(255,255,255,.08);
}

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

/* PAGES */
.page{
  display:none;
}

.page.active{
  display:block;
}

.pagePanel{
  max-width:800px;
  margin:0 auto;
}

.pagePanel h2{
  margin-top:0;
}

.pagePanel h3{
  margin-top:24px;
}

.pagePanel details{
  border-bottom:1px solid var(--border);
  padding:10px 0;
}

.pagePanel summary{
  cursor:pointer;
  font-weight:700;
}
