:root {
  --bg: #0f1115;
  --bg2: #141824;
  --card: #171a21;
  --border: #262b36;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --err: #ff6b6b;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% -10%, #1c2740 0%, transparent 55%),
    radial-gradient(1000px 600px at 110% 10%, #241a33 0%, transparent 50%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------- boot */

.boot-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.boot-mark {
  width: 74px; height: 74px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  background: linear-gradient(160deg, #4f8cff, #3358c4);
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}

/* -------------------------------------------------------------- home */

.home { max-width: 720px; margin: 0 auto; padding: 56px 24px 80px; }
.home-head { text-align: center; margin-bottom: 40px; }
.home-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.home-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.home-loading, .home-error {
  text-align: center; color: var(--muted); font-size: 14px; margin-top: 24px;
}
.home-error { color: var(--err); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 26px 18px;
  justify-items: center;
}

.tile {
  border: 0; background: none; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  width: 96px;
}
.tile-icon {
  width: 72px; height: 72px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile-emoji { font-size: 34px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.tile-label { font-size: 13px; color: var(--text); text-align: center; line-height: 1.25; }
.tile:hover .tile-icon { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 30px rgba(0,0,0,.5); }
.tile:active .tile-icon { transform: scale(.96); }

/* --------------------------------------------------------- converter view */

.view { max-width: 520px; margin: 0 auto; padding: 24px 20px 80px; }
.view-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; min-height: 40px;
}
.view-head h1 { flex: 1; margin: 0; font-size: 19px; font-weight: 600; text-align: center; }
.view-spacer { width: 96px; flex: none; }
.back {
  width: 96px; flex: none;
  border: 0; background: none; cursor: pointer;
  color: var(--accent); font-size: 15px;
  display: flex; align-items: center; gap: 2px;
  padding: 6px 0;
}
.back .chev { font-size: 24px; line-height: 1; margin-top: -2px; }
.back:hover { opacity: .8; }

/* ------------------------------------------------------------- tool card */

.tool {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.tool-lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
  display: block;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: rgba(79,140,255,.06); }
.drop-icon { font-size: 34px; margin-bottom: 10px; }
.drop-big { font-size: 15px; font-weight: 500; }
.drop-small { font-size: 13px; color: var(--muted); margin-top: 4px; }
.drop input[type=file] { display: none; }

.status {
  margin-top: 20px; font-size: 14px; min-height: 20px;
  display: none; align-items: center; gap: 10px; line-height: 1.4;
}
.status.show { display: flex; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool-foot { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .home { padding-top: 40px; }
}
