
.qf-app {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #22c55e;
  --accent2: #38bdf8;
  --danger: #ef4444;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 20px 50px rgba(0,0,0,0.35);
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text);
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 45%, #020617 100%);
  box-sizing: border-box;
}

.qf-app * { box-sizing: border-box; }

.qf-shell {
  width: 100%;
  max-width: 720px;
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.qf-shell h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  text-align: center;
  color: var(--text);
}

.qf-shell .subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

.qf-shell .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.qf-shell .card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.qf-shell .label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.qf-shell input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  outline: none;
  font-size: 1rem;
}

.qf-shell input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.qf-shell .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.qf-shell button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 1rem;
  cursor: pointer;
  color: white;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.qf-shell button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.qf-shell .btn-primary { background: linear-gradient(135deg, #16a34a, #22c55e); }
.qf-shell .btn-secondary { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.qf-shell .btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); }

.qf-shell .result {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.qf-shell .big-number {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 4px;
  color: var(--accent);
}

.qf-shell .direction-text {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 10px;
}

.qf-shell .small {
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.qf-shell .status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.qf-shell .status.error {
  color: #fecaca;
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.10);
}

.qf-shell .compass-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}

.qf-shell .compass {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08) 0 4px, transparent 5px),
    radial-gradient(circle at center, rgba(255,255,255,0.03) 0 40%, transparent 41%),
    linear-gradient(135deg, rgba(56,189,248,0.10), rgba(34,197,94,0.08));
  border: 1px solid var(--border);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.25);
}

.qf-shell .compass::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.15);
}

.qf-shell .north {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.95rem;
}

.qf-shell .east, .qf-shell .west, .qf-shell .south {
  position: absolute;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.qf-shell .east { right: 10px; top: 50%; transform: translateY(-50%); }
.qf-shell .west { left: 10px; top: 50%; transform: translateY(-50%); }
.qf-shell .south { bottom: 10px; left: 50%; transform: translateX(-50%); }

.qf-shell .needle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
  transition: transform 0.4s ease;
}

.qf-shell .needle::before {
  content: "";
  width: 6px;
  height: 98px;
  border-radius: 999px;
  background: linear-gradient(to top, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(56,189,248,0.45);
  transform: translateY(-44px);
}

.qf-shell .needle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 16px rgba(255,255,255,0.35);
}

.qf-shell .footer-note {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.qf-shell .manual-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .qf-shell .grid,
  .qf-shell .manual-grid {
    grid-template-columns: 1fr;
  }

  .qf-shell .compass {
    width: 220px;
    height: 220px;
  }

  .qf-shell h1 {
    font-size: 1.7rem;
  }

  .qf-shell .big-number {
    font-size: 2.5rem;
  }
}
