:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b2030;
  --border: #262c3d;
  --text: #eef1f7;
  --muted: #8b93a7;
  --accent: #ff5a36;
  --accent-hover: #ff7352;
  --ok: #2fd27a;
  --warn: #f5b942;
  --err: #ff5470;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.page-wrapper { min-height: 100svh; display: flex; flex-direction: column; }
.main { flex: 1; }
.container { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 1rem; }
.text-accent { color: var(--accent); }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(11,13,18,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.nav_inner { display: flex; align-items: center; justify-content: space-between; height: 3.75rem; }
.nav_brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.nav_logo { width: 2rem; height: 2rem; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.nav_logo svg { width: 1.2rem; height: 1.2rem; stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav_name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.nav_right { display: flex; align-items: center; gap: .5rem; }

.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 99px; }
.status_dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--warn); }
.status[data-state="online"] .status_dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,210,122,.18); }
.status[data-state="offline"] .status_dot { background: var(--err); }

.icon-btn { width: 2.25rem; height: 2.25rem; border-radius: 10px; border: 1px solid var(--border); background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 1.05rem; height: 1.05rem; stroke: var(--muted); stroke-width: 2; fill: none; }
.icon-btn:hover svg { stroke: var(--text); }

/* hero */
.hero { padding: 2.5rem 0 3rem; }
.hero_title { font-size: clamp(2rem, 8vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 .75rem; font-weight: 800; }
.hero_sub { color: var(--muted); margin: 0 0 1.75rem; max-width: 30rem; }

/* card + form */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.field { display: flex; gap: .5rem; }
.input {
  flex: 1; min-width: 0; height: 3.1rem; padding: 0 1rem; border-radius: 11px;
  background: var(--bg); border: 1px solid var(--border); outline: none; font-size: 16px; /* 16px stops iOS zoom */
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,54,.2); }
.btn { height: 3.1rem; padding: 0 1.15rem; border-radius: 11px; border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, opacity .15s; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: #3a4257; }
.btn-block { width: 100%; margin-top: .6rem; }
.msg { margin: .6rem 0 0; font-size: .875rem; color: var(--err); min-height: 0; }
.msg:empty { display: none; }
.pin_label { display: block; font-weight: 600; margin-bottom: .6rem; }
.notice p { color: var(--muted); margin: .35rem 0 .9rem; font-size: .925rem; }

/* result */
.result { padding: 0; overflow: hidden; }
.result_media { position: relative; background: #000; aspect-ratio: 16/9; }
.result_media img { width: 100%; height: 100%; object-fit: contain; }
.result_duration { position: absolute; right: .6rem; bottom: .6rem; background: rgba(0,0,0,.75); font-size: .75rem; padding: .15rem .45rem; border-radius: 6px; }
.result_duration:empty { display: none; }
.result_body { padding: 1rem; }
.result_platform { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.result_title { font-size: 1.05rem; line-height: 1.35; margin: .25rem 0 .2rem; font-weight: 650; overflow-wrap: anywhere; }
.result_uploader { margin: 0 0 .5rem; color: var(--muted); font-size: .875rem; }
.result_uploader:empty { display: none; }
.opts_label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: .9rem 0 .45rem; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .45rem; }
.opt { height: 2.75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: .9rem; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { opacity: .45; cursor: default; }
.opt small { display: block; font-size: .65rem; color: var(--muted); font-weight: 500; line-height: 1; }
.opt-best { border-color: rgba(255,90,54,.5); }

.progress { margin-top: 1rem; }
.progress_bar { height: .5rem; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress_bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s; }
.progress.is-indeterminate .progress_bar span { width: 35% !important; animation: slide 1.1s infinite ease-in-out; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.progress_meta { display: flex; justify-content: space-between; align-items: center; margin-top: .45rem; font-size: .825rem; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--err); cursor: pointer; padding: 0; font-size: .825rem; }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 1.25rem 0 calc(1.25rem + env(safe-area-inset-bottom)); font-size: .825rem; color: var(--muted); }
.footer_inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem; }

@media (min-width: 768px) {
  .hero { padding: 4.5rem 0 4rem; }
  .card { padding: 1.25rem; }
  .result { padding: 0; }
  .result_body { padding: 1.25rem; }
}
